|
|
|
@ -1,26 +1,20 @@
|
|
|
|
|
%if 0%{?fedora} || 0%{?rhel} > 7
|
|
|
|
|
%global with_python3 1
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if 0%{?rhel} > 7
|
|
|
|
|
%bcond_with python2
|
|
|
|
|
%else
|
|
|
|
|
%bcond_without python2
|
|
|
|
|
%endif
|
|
|
|
|
%bcond docs %{undefined rhel}
|
|
|
|
|
|
|
|
|
|
Name: python-netaddr
|
|
|
|
|
Version: 0.7.19
|
|
|
|
|
Release: 8%{?dist}
|
|
|
|
|
Version: 1.3.0
|
|
|
|
|
Release: 2%{?dist}
|
|
|
|
|
Summary: A pure Python network address representation and manipulation library
|
|
|
|
|
|
|
|
|
|
License: BSD
|
|
|
|
|
URL: http://github.com/drkjam/netaddr
|
|
|
|
|
License: BSD-3-Clause
|
|
|
|
|
URL: https://github.com/drkjam/netaddr
|
|
|
|
|
Source0: https://pypi.python.org/packages/source/n/netaddr/netaddr-%{version}.tar.gz
|
|
|
|
|
# Remove once https://github.com/netaddr/netaddr/pull/345
|
|
|
|
|
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
|
|
Patch0: 0001-fixed-broken-tests-in-issue-149-python-3-regression-.patch
|
|
|
|
|
Patch1: 0001-Do-not-override-executable-path.patch
|
|
|
|
|
%if %{with docs}
|
|
|
|
|
BuildRequires: python3-sphinx
|
|
|
|
|
BuildRequires: python3-furo
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%global desc A network address manipulation library for Python\
|
|
|
|
|
\
|
|
|
|
@ -31,7 +25,8 @@ Layer 3 addresses\
|
|
|
|
|
* IPv4 and IPv6 addresses, subnets, masks, prefixes\
|
|
|
|
|
* iterating, slicing, sorting, summarizing and classifying IP networks\
|
|
|
|
|
* dealing with various ranges formats (CIDR, arbitrary ranges and globs, nmap)\
|
|
|
|
|
* set based operations (unions, intersections etc) over IP addresses and subnets\
|
|
|
|
|
* set based operations (unions, intersections etc) over IP addresses and\
|
|
|
|
|
subnets\
|
|
|
|
|
* parsing a large variety of different formats and notations\
|
|
|
|
|
* looking up IANA IP block information\
|
|
|
|
|
* generating DNS reverse lookups\
|
|
|
|
@ -43,119 +38,194 @@ Layer 2 addresses\
|
|
|
|
|
* looking up IEEE organisational information (OUI, IAB)\
|
|
|
|
|
* generating derived IPv6 addresses
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%global _description\
|
|
|
|
|
%{desc}
|
|
|
|
|
|
|
|
|
|
%description %_description
|
|
|
|
|
|
|
|
|
|
%if %{with python2}
|
|
|
|
|
%package -n python2-netaddr
|
|
|
|
|
Summary: %summary
|
|
|
|
|
%{?python_provide:%python_provide python2-netaddr}
|
|
|
|
|
BuildRequires: python2-devel
|
|
|
|
|
BuildRequires: python2-setuptools
|
|
|
|
|
BuildRequires: python2-sphinx
|
|
|
|
|
BuildRequires: python2-pytest
|
|
|
|
|
|
|
|
|
|
%description -n python2-netaddr %_description
|
|
|
|
|
%endif #{with python2}
|
|
|
|
|
|
|
|
|
|
%if 0%{?with_python3}
|
|
|
|
|
%package -n python3-netaddr
|
|
|
|
|
Summary: A pure Python network address representation and manipulation library
|
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
|
BuildRequires: python3-setuptools
|
|
|
|
|
BuildRequires: python3-sphinx
|
|
|
|
|
|
|
|
|
|
BuildRequires: python3-pytest
|
|
|
|
|
|
|
|
|
|
%description -n python3-netaddr
|
|
|
|
|
%{desc}
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%setup -q -n netaddr-%{version}
|
|
|
|
|
%patch0 -p1
|
|
|
|
|
%patch1 -p1
|
|
|
|
|
|
|
|
|
|
# Make rpmlint happy, get rid of DOS line endings
|
|
|
|
|
sed -i 's/\r//' netaddr/*.py netaddr/ip/*.py netaddr/eui/*.idx
|
|
|
|
|
%autosetup -n netaddr-%{version} -p1
|
|
|
|
|
|
|
|
|
|
# Make rpmlint happy, rip out python shebang lines from most python
|
|
|
|
|
# modules
|
|
|
|
|
find netaddr -name "*.py" | \
|
|
|
|
|
xargs sed -i -e '1 {/^#!\//d}'
|
|
|
|
|
# Fix python executable
|
|
|
|
|
%if %{with python2}
|
|
|
|
|
sed -i -e '1s,/usr/bin/env python,%{__python2} %{?py_shbang_opts},' netaddr/tools/netaddr
|
|
|
|
|
%else
|
|
|
|
|
sed -i -e '1s,/usr/bin/env python,%{__python3} %{?py_shbang_opts},' netaddr/tools/netaddr
|
|
|
|
|
%endif #{with python2}
|
|
|
|
|
|
|
|
|
|
# Make rpmlint happy, fix permissions on documentation files
|
|
|
|
|
chmod 0644 README.md AUTHORS CHANGELOG COPYRIGHT LICENSE PKG-INFO
|
|
|
|
|
chmod 0644 README.rst AUTHORS.rst CHANGELOG.rst COPYRIGHT.rst LICENSE.rst PKG-INFO
|
|
|
|
|
|
|
|
|
|
%generate_buildrequires
|
|
|
|
|
%pyproject_buildrequires
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
%if %{with python2}
|
|
|
|
|
%py2_build
|
|
|
|
|
%endif #{with python2}
|
|
|
|
|
|
|
|
|
|
%if 0%{?with_python3}
|
|
|
|
|
%py3_build
|
|
|
|
|
%endif
|
|
|
|
|
%pyproject_wheel
|
|
|
|
|
|
|
|
|
|
#docs
|
|
|
|
|
%if %{with docs}
|
|
|
|
|
pushd docs
|
|
|
|
|
%if %{with python2}
|
|
|
|
|
PYTHONPATH='../' sphinx-build -b html -d build/doctrees source html
|
|
|
|
|
%endif #{with python2}
|
|
|
|
|
%if 0%{?with_python3}
|
|
|
|
|
PYTHONPATH='../' sphinx-build-%{python3_version} -b html -d build/doctrees source python3/html
|
|
|
|
|
%endif
|
|
|
|
|
rm -f python3/html/.buildinfo
|
|
|
|
|
popd
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%if 0%{?with_python3}
|
|
|
|
|
%py3_install
|
|
|
|
|
mv %{buildroot}%{_bindir}/netaddr %{buildroot}%{_bindir}/netaddr3
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %{with python2}
|
|
|
|
|
%py2_install
|
|
|
|
|
%endif #{with python2}
|
|
|
|
|
|
|
|
|
|
%pyproject_install
|
|
|
|
|
%pyproject_save_files netaddr
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
%if %{with python2}
|
|
|
|
|
py.test-%{python2_version}
|
|
|
|
|
%endif #{with python2}
|
|
|
|
|
%if 0%{?with_python3}
|
|
|
|
|
LANG=en_US.UTF-8 py.test-%{python3_version}
|
|
|
|
|
%endif
|
|
|
|
|
py.test-%{python3_version}
|
|
|
|
|
|
|
|
|
|
%if %{with python2}
|
|
|
|
|
%files -n python2-netaddr
|
|
|
|
|
%license COPYRIGHT LICENSE
|
|
|
|
|
%doc AUTHORS CHANGELOG
|
|
|
|
|
%doc README.md docs/html
|
|
|
|
|
%{python2_sitelib}/*
|
|
|
|
|
%{_bindir}/netaddr
|
|
|
|
|
%endif #{with python2}
|
|
|
|
|
|
|
|
|
|
%if 0%{?with_python3}
|
|
|
|
|
%files -n python3-netaddr
|
|
|
|
|
%license COPYRIGHT
|
|
|
|
|
%doc AUTHORS CHANGELOG
|
|
|
|
|
%doc README.md docs/python3/html
|
|
|
|
|
%{python3_sitelib}/*
|
|
|
|
|
%{_bindir}/netaddr3
|
|
|
|
|
%license COPYRIGHT.rst
|
|
|
|
|
%doc AUTHORS.rst CHANGELOG.rst README.rst
|
|
|
|
|
%if %{with docs}
|
|
|
|
|
%doc docs/python3/html
|
|
|
|
|
%endif
|
|
|
|
|
%{python3_sitelib}/*
|
|
|
|
|
%{_bindir}/netaddr
|
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
|
|
* Mon Jul 09 2018 Petr Viktorin <pviktori@redhat.com> - 0.7.19-8
|
|
|
|
|
- Don't build python2 subpackage on rhel>7
|
|
|
|
|
https://bugzilla.redhat.com/show_bug.cgi?id=1567153
|
|
|
|
|
* Mon Jan 20 2025 Rafael Jeffman <rjeffman@redhat.com> - 1.3.0-2
|
|
|
|
|
- Remove subpackage python-netaddr-shell
|
|
|
|
|
Resolves: RHEL-74187
|
|
|
|
|
|
|
|
|
|
* Thu Jan 16 2025 Rafael Jeffman <rjeffman@redhat.com> - 1.3.0-1
|
|
|
|
|
- New upstream release 1.3.0
|
|
|
|
|
Resolves: RHEL-74187
|
|
|
|
|
|
|
|
|
|
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 0.10.1-6
|
|
|
|
|
- Bump release for October 2024 mass rebuild:
|
|
|
|
|
Resolves: RHEL-64018
|
|
|
|
|
|
|
|
|
|
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 0.10.1-5
|
|
|
|
|
- Bump release for June 2024 mass rebuild
|
|
|
|
|
|
|
|
|
|
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.1-4
|
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
|
|
|
|
|
|
|
|
|
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.1-3
|
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
|
|
|
|
|
|
|
|
|
* Thu Jan 04 2024 Yaakov Selkowitz <yselkowi@redhat.com> - 0.10.1-2
|
|
|
|
|
- Conditionalize docs
|
|
|
|
|
|
|
|
|
|
* Wed Jan 3 2024 John Eckersberg <jeckersb@redhat.com> - 0.10.1-1
|
|
|
|
|
- New upstream release 0.10.1 (rhbz#2256342)
|
|
|
|
|
- Remove patch for Python 3.13 compatibility (merged upstream in 0.10.0)
|
|
|
|
|
- Add new depencency on furo
|
|
|
|
|
- Include missing THANKS file (https://github.com/netaddr/netaddr/pull/345)
|
|
|
|
|
|
|
|
|
|
* Thu Dec 14 2023 John Eckersberg <jeckersb@redhat.com> - 0.9.0-2
|
|
|
|
|
- Add patch for Python 3.13 compatibility (rhbz#2246093)
|
|
|
|
|
|
|
|
|
|
* Tue Sep 19 2023 John Eckersberg <jeckersb@redhat.com> - 0.9.0-1
|
|
|
|
|
- New upstream release 0.9.0 (rhbz#2239532)
|
|
|
|
|
|
|
|
|
|
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-14
|
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
|
|
|
|
|
|
|
|
|
* Wed Jun 14 2023 Python Maint <python-maint@redhat.com> - 0.8.0-13
|
|
|
|
|
- Rebuilt for Python 3.12
|
|
|
|
|
|
|
|
|
|
* Thu Feb 23 2023 Orion Poplawski <orion@nwra.com> - 0.8.0-12
|
|
|
|
|
- Cleanup spec
|
|
|
|
|
- Use SPDX License tag
|
|
|
|
|
|
|
|
|
|
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-11
|
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
|
|
|
|
|
|
|
|
|
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-10
|
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
|
|
|
|
|
|
|
|
|
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 0.8.0-9
|
|
|
|
|
- Rebuilt for Python 3.11
|
|
|
|
|
|
|
|
|
|
* Fri May 13 2022 John Eckersberg <jeckersb@redhat.com> - 0.8.0-8
|
|
|
|
|
- Move netaddr shell into a separate subpackage (rhbz#2076031)
|
|
|
|
|
|
|
|
|
|
* Tue Apr 12 2022 John Eckersberg <jeckersb@redhat.com> - 0.8.0-7
|
|
|
|
|
- Add Recommends on python3-ipython (rhbz#2074313)
|
|
|
|
|
|
|
|
|
|
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-6
|
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
|
|
|
|
|
|
|
|
|
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-5
|
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
|
|
|
|
|
|
|
|
|
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.8.0-4
|
|
|
|
|
- Rebuilt for Python 3.10
|
|
|
|
|
|
|
|
|
|
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-3
|
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
|
|
|
|
|
|
|
|
|
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-2
|
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
|
|
|
|
|
|
|
|
|
* Fri Jul 3 2020 John Eckersberg <jeckersb@redhat.com> - 0.8.0-1
|
|
|
|
|
- New upstream release 0.8.0 (rhbz#1853684)
|
|
|
|
|
|
|
|
|
|
* Fri Jun 19 2020 John Eckersberg <jeckersb@redhat.com> - 0.7.20-1
|
|
|
|
|
- New upstream release 0.7.20 (rhbz#1848782)
|
|
|
|
|
- Minor spec and rpmlint cleanups
|
|
|
|
|
|
|
|
|
|
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.7.19-22
|
|
|
|
|
- Rebuilt for Python 3.9
|
|
|
|
|
|
|
|
|
|
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.19-21
|
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
|
|
|
|
|
|
|
|
|
* Thu Nov 7 2019 John Eckersberg <eck@redhat.com> - 0.7.19-20
|
|
|
|
|
- Remove python2 subpackage from Fedora 32+ (rhbz#1769871)
|
|
|
|
|
|
|
|
|
|
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.7.19-19
|
|
|
|
|
- Rebuilt for Python 3.8.0rc1 (#1748018)
|
|
|
|
|
|
|
|
|
|
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.7.19-18
|
|
|
|
|
- Rebuilt for Python 3.8
|
|
|
|
|
|
|
|
|
|
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.19-17
|
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
|
|
|
|
|
|
|
|
|
* Mon Jul 22 2019 John Eckersberg <eck@redhat.com> - 0.7.19-16
|
|
|
|
|
- Move /usr/bin/netaddr to python3 and remove python2 version
|
|
|
|
|
See https://fedoraproject.org/wiki/Changes/Python_means_Python3
|
|
|
|
|
|
|
|
|
|
* Mon Mar 11 2019 John Eckersberg <eck@redhat.com> - 0.7.19-15
|
|
|
|
|
- Remove BuildRequires on python2-sphinx
|
|
|
|
|
See https://fedoraproject.org/wiki/Changes/Sphinx2
|
|
|
|
|
|
|
|
|
|
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.19-14
|
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
|
|
|
|
|
|
|
|
|
* Wed Nov 28 2018 John Eckersberg <eck@redhat.com> - 0.7.19-13
|
|
|
|
|
- Add python_provide for python3 subpackage per packaging guidelines (RHBZ#1654198)
|
|
|
|
|
|
|
|
|
|
* Sun Nov 18 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.7.19-12
|
|
|
|
|
- Drop explicit locale setting
|
|
|
|
|
See https://fedoraproject.org/wiki/Changes/Remove_glibc-langpacks-all_from_buildroot
|
|
|
|
|
|
|
|
|
|
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.19-11
|
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
|
|
|
|
|
|
|
|
|
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.7.19-10
|
|
|
|
|
- Rebuilt for Python 3.7
|
|
|
|
|
|
|
|
|
|
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.7.19-9
|
|
|
|
|
- Rebuilt for Python 3.7
|
|
|
|
|
|
|
|
|
|
* Thu Feb 22 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.7.19-8
|
|
|
|
|
- Update Python 2 dependency declarations to new packaging standards
|
|
|
|
|
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
|
|
|
|
|
|
|
|
|
|
* Mon Feb 19 2018 John Eckersberg <eck@redhat.com> - 0.7.19-7
|
|
|
|
|
- Fix shebang mangling for python3 (RHBZ#1546800)
|