From 62968180e6498d5e3b207080a55f829f2c1e613ed84dd2b6fb34df437134c572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 10 Sep 2020 05:29:33 +0000 Subject: [PATCH] Accepting request 833316 from home:aplanas:branches:devel:languages:python - Generate pyc for ssl_match_hostname too OBS-URL: https://build.opensuse.org/request/show/833316 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-urllib3?expand=0&rev=103 --- python-urllib3.changes | 5 +++++ python-urllib3.spec | 22 +++++++++++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/python-urllib3.changes b/python-urllib3.changes index 4c66823..b1f096a 100644 --- a/python-urllib3.changes +++ b/python-urllib3.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Sep 9 16:49:22 UTC 2020 - Alberto Planas Dominguez + +- Generate pyc for ssl_match_hostname too + ------------------------------------------------------------------- Tue Aug 4 16:09:35 UTC 2020 - Dirk Mueller diff --git a/python-urllib3.spec b/python-urllib3.spec index 26ea977..16561df 100644 --- a/python-urllib3.spec +++ b/python-urllib3.spec @@ -105,23 +105,23 @@ rm -r test/appengine/ %if !%{with test} %python_install +# Unbundle the Python 3 build +rm %{buildroot}/%{python3_sitelib}/urllib3/packages/six.py +rm -r %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname/ + +# Copy ssl_match_hostname.py before compilation, so we can have a pyc too +cp -a %{SOURCE1} %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname.py + %{python_expand \ $python -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/urllib3/ $python -O -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/urllib3/ } -# Unbundle the Python 3 build -rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/six.py* -rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/six* -rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname/ - -mkdir -p %{buildroot}/%{python3_sitelib}/urllib3/packages/ -cp -a %{SOURCE1} %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname.py ln -s %{python3_sitelib}/six.py %{buildroot}/%{python3_sitelib}/urllib3/packages/six.py -ln -s %{python3_sitelib}/__pycache__/six.cpython-%{python3_version_nodots}.opt-1.pyc \ - %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/ -ln -s %{python3_sitelib}/__pycache__/six.cpython-%{python3_version_nodots}.pyc \ - %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/ +ln -sf %{python3_sitelib}/__pycache__/six.cpython-%{python3_version_nodots}.opt-1.pyc \ + %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/ +ln -sf %{python3_sitelib}/__pycache__/six.cpython-%{python3_version_nodots}.pyc \ + %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/ %python_expand %fdupes %{buildroot}%{$python_sitelib} %endif