- Remove python2 and "other_python3" support

- Resolves: rhbz#1802998 Make pycryptodomex and ecdsa weak dependencies of python-dns
- Resolves: rhbz#1801247 python-certbot-dns-rfc2136 fails to build with Python 3.9: base64.decodestring() was removed
This commit is contained in:
Paul Wouters 2020-04-15 16:00:03 -04:00
parent 4ca04bca89
commit f75030bc11

View File

@ -14,18 +14,9 @@ manipulation of DNS zones, messages, names, and records. \
# Disable dependency generator until it has test code
%{?python_disable_dependency_generator}
%bcond_without python3
# Drop Python 2 with EL8
%if 0%{?fedora} || (0%{?rhel} && 0%{?rhel} < 8)
%bcond_without python2
%else
%bcond_with python2
%endif
Name: python-%{py_package_name}
Version: 1.16.0
Release: 8%{?dist}
Release: 9%{?dist}
Summary: %{summary}
License: MIT
@ -40,18 +31,13 @@ Source1: typing.py
BuildArch: noarch
Patch0: unicode_label_escapify.patch
Patch1: collections_abc.patch
%if %{with python2}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-pycryptodomex
%endif
Patch2: python-dns-1.16-base64.patch
%if %{with python3}
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-ecdsa
BuildRequires: python%{python3_pkgversion}-pycryptodomex
Recommends: python%{python3_pkgversion}-ecdsa
Recommends: python%{python3_pkgversion}-pycryptodomex
%endif
%if 0%{?with_python3}
@ -70,20 +56,6 @@ BuildRequires: python%{python3_other_pkgversion}-pycryptodomex
%description %{_description}
# Python 2 package
%if %{with python2}
%package -n python2-%{py_package_name}
Summary: %{summary}
%{?python_provide:%python_provide python2-%{py_package_name}}
Requires: python2-pycryptodomex
%description -n python2-%{py_package_name} %{_description}
%endif
# Python 3 package
%if %{with python3}
%package -n python%{python3_pkgversion}-%{py_package_name}
Summary: %{summary}
%{?python_provide:%python_provide python%{python3_pkgversion}-%{py_package_name}}
@ -92,20 +64,6 @@ Requires: python%{python3_pkgversion}-ecdsa
Requires: python%{python3_pkgversion}-pycryptodomex
%description -n python%{python3_pkgversion}-%{py_package_name} %{_description}
%endif
# Python 3 other package
%if 0%{?with_python3_other}
%package -n python%{python3_other_pkgversion}-%{py_package_name}
Summary: %{summary}
%{?python_provide:%python_provide python%{python3_other_pkgversion}-%{py_package_name}}
Requires: python%{python3_other_pkgversion}-ecdsa
Requires: python%{python3_other_pkgversion}-pycryptodomex
%description -n python%{python3_other_pkgversion}-%{py_package_name} %{_description}
%endif
%prep
%autosetup -p1 -n %{pypi_name}-%{version}
@ -115,75 +73,26 @@ find examples -type f | xargs chmod a-x
%build
%if %{with python2}
%py2_build
%endif
%if %{with python3}
%py3_build
%endif
%if 0%{?with_python3_other}
%py3_other_build
%endif
%install
%if 0%{?with_python3_other}
%py3_other_install
%endif
%if %{with python3}
%py3_install
%endif
%if %{with python2}
%py2_install
%endif
%check
%if %{with python2}
cp %{SOURCE1} .
%{__python2} setup.py test
rm typing.py{,?}
%endif
%if %{with python3}
%{__python3} setup.py test
%endif
%if 0%{?with_python3_other}
%{__python3_other} setup.py test
%endif
%if %{with python2}
%files -n python2-%{py_package_name}
%license LICENSE
%doc README.md examples
%{python2_sitelib}/%{py_package_name}
%{python2_sitelib}/%{pypi_name}-*.egg-info
%endif
%if %{with python3}
%files -n python%{python3_pkgversion}-%{py_package_name}
%files
%license LICENSE
%doc README.md examples
%{python3_sitelib}/%{py_package_name}
%{python3_sitelib}/%{pypi_name}-*.egg-info
%endif
%if 0%{?with_python3_other}
%files -n python%{python3_other_pkgversion}-%{py_package_name}
%license LICENSE
%doc README.md examples
%{python3_other_sitelib}/%{py_package_name}
%{python3_other_sitelib}/%{pypi_name}-*.egg-info
%endif
%changelog
* Wed Apr 15 2020 Paul Wouters <pwouters@redhat.com> - 1.16.0-9
- Remove python2 and "other_python3" support
- Resolves: rhbz#1802998 Make pycryptodomex and ecdsa weak dependencies of python-dns
- Resolves: rhbz#1801247 python-certbot-dns-rfc2136 fails to build with Python 3.9: base64.decodestring() was removed
* Mon Feb 03 2020 Miro Hrončok <mhroncok@redhat.com> - 1.16.0-8
- Drop build dependency on python2-typing