diff --git a/python-netaddr.spec b/python-netaddr.spec index f239119..bf2d60c 100644 --- a/python-netaddr.spec +++ b/python-netaddr.spec @@ -2,9 +2,13 @@ %global with_python3 1 %endif +%if 0%{?fedora} < 32 +%global with_python2 1 +%endif + Name: python-netaddr Version: 0.7.19 -Release: 19%{?dist} +Release: 20%{?dist} Summary: A pure Python network address representation and manipulation library License: BSD @@ -12,12 +16,14 @@ URL: http://github.com/drkjam/netaddr Source0: https://pypi.python.org/packages/source/n/netaddr/netaddr-%{version}.tar.gz BuildArch: noarch -BuildRequires: python2-devel -BuildRequires: python2-setuptools # sphinx is python3-only f31 onward # https://fedoraproject.org/wiki/Changes/Sphinx2 BuildRequires: python3-sphinx +%if 0%{?with_python2} BuildRequires: python2-pytest +BuildRequires: python2-devel +BuildRequires: python2-setuptools +%endif Patch0: 0001-fixed-broken-tests-in-issue-149-python-3-regression-.patch Patch1: 0001-Do-not-override-executable-path.patch @@ -51,11 +57,13 @@ Layer 2 addresses\ %description %_description +%if 0%{?with_python2} %package -n python2-netaddr Summary: %summary %{?python_provide:%python_provide python2-netaddr} %description -n python2-netaddr %_description +%endif %if 0%{?with_python3} %package -n python3-netaddr @@ -90,7 +98,9 @@ sed -i -e '1s,/usr/bin/env python,%{__python2} %{?py_shbang_opts},' netaddr/tool chmod 0644 README.md AUTHORS CHANGELOG COPYRIGHT LICENSE PKG-INFO %build +%if 0%{?with_python2} %py2_build +%endif %if 0%{?with_python3} %py3_build @@ -106,7 +116,9 @@ popd %install +%if 0%{?with_python2} %py2_install +%endif %if 0%{?with_python3} %py3_install @@ -114,16 +126,20 @@ popd %check +%if 0%{?with_python2} py.test-%{python2_version} +%endif %if 0%{?with_python3} py.test-%{python3_version} %endif +%if 0%{?with_python2} %files -n python2-netaddr %license COPYRIGHT LICENSE %doc AUTHORS CHANGELOG %doc README.md docs/html %{python2_sitelib}/* +%endif %if 0%{?with_python3} %files -n python3-netaddr @@ -135,6 +151,9 @@ py.test-%{python3_version} %endif %changelog +* Thu Nov 7 2019 John Eckersberg - 0.7.19-20 +- Remove python2 subpackage from Fedora 32+ (rhbz#1769871) + * Thu Oct 03 2019 Miro HronĨok - 0.7.19-19 - Rebuilt for Python 3.8.0rc1 (#1748018)