diff --git a/python-urllib3.changes b/python-urllib3.changes index 68c7bc5..602d121 100644 --- a/python-urllib3.changes +++ b/python-urllib3.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Sep 14 02:58:42 UTC 2019 - John Vandenberg + +- Use have/skip_python2/3 macros to allow building only one flavour + ------------------------------------------------------------------- Mon Jul 22 07:54:44 UTC 2019 - Tomáš Chvátal diff --git a/python-urllib3.spec b/python-urllib3.spec index 7563710..276c03b 100644 --- a/python-urllib3.spec +++ b/python-urllib3.spec @@ -42,16 +42,20 @@ Patch0: urllib3-ssl-default-context.patch # PATCH-FIX-UPSTREAM python-urllib3-recent-date.patch gh#shazow/urllib3#1303, boo#1074247 dimstar@opensuse.org -- Fix test suite, use correct date Patch1: python-urllib3-recent-date.patch # for SSL module on older distros +%if 0%{?suse_version} < 1500 BuildRequires: %{oldpython} +%endif BuildRequires: %{python_module PySocks} BuildRequires: %{python_module psutil} BuildRequires: %{python_module rfc3986} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six} BuildRequires: fdupes -BuildRequires: python-backports.ssl_match_hostname BuildRequires: python-rpm-macros +%if 0%{?have_python2} && ! 0%{?skip_python2} +BuildRequires: python-backports.ssl_match_hostname BuildRequires: python2-ipaddress +%endif #!BuildIgnore: python-requests Requires: ca-certificates-mozilla Requires: python-cryptography @@ -121,6 +125,7 @@ $python -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/urlli $python -O -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/urllib3/ } +%if 0%{?have_python2} && ! 0%{?skip_python2} # Unbundle the Python 2 build rm -rf %{buildroot}/%{python2_sitelib}/urllib3/packages/six.py* rm -rf %{buildroot}/%{python2_sitelib}/urllib3/packages/ssl_match_hostname/ @@ -134,6 +139,9 @@ ln -s %{python2_sitelib}/backports/ssl_match_hostname \ %{buildroot}/%{python2_sitelib}/urllib3/packages/ssl_match_hostname ln -s %{python2_sitelib}/rfc3986/ \ %{buildroot}/%{python2_sitelib}/urllib3/packages/rfc3986 +%endif + +%if 0%{?have_python3} && ! 0%{?skip_python3} # Unbundle the Python 3 build rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/six.py* rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/six* @@ -149,11 +157,12 @@ ln -s %{python3_sitelib}/__pycache__/six.cpython-%{python3_version_nodots}.pyc \ %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/ ln -s %{python3_sitelib}/rfc3986/ \ %{buildroot}/%{python3_sitelib}/urllib3/packages/rfc3986 +%endif %python_expand %fdupes %{buildroot}%{$python_sitelib} %endif -%if ! %{with test} +%if ! %{with test} && "%{python_flavor}" == "python2" %pre -n python2-urllib3 SITELIB=%{python2_sitelib} CONFLICTED="${SITELIB}/urllib3/packages/ssl_match_hostname"