diff --git a/0001-PEP-479-return-instead-of-raise-StopIteration.patch b/0001-PEP-479-return-instead-of-raise-StopIteration.patch new file mode 100644 index 0000000..2aa13c9 --- /dev/null +++ b/0001-PEP-479-return-instead-of-raise-StopIteration.patch @@ -0,0 +1,26 @@ +From 2599f0e57c0a20bd3f8870dbc2c5479cad502597 Mon Sep 17 00:00:00 2001 +From: Sergey Kozlov +Date: Mon, 11 Dec 2017 17:04:20 +0100 +Subject: [PATCH] PEP 479: 'return' instead of 'raise StopIteration'. + +Fro details please visit https://www.python.org/dev/peps/pep-0479/ +--- + netaddr/ip/__init__.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/netaddr/ip/__init__.py b/netaddr/ip/__init__.py +index 489badf..ecf72d0 100644 +--- a/netaddr/ip/__init__.py ++++ b/netaddr/ip/__init__.py +@@ -1258,7 +1258,7 @@ class IPNetwork(BaseIP, IPListMixin): + + if not self.prefixlen <= prefixlen: + # Don't return anything. +- raise StopIteration ++ return + + # Calculate number of subnets to be returned. + width = self._module.width +-- +2.17.1 + diff --git a/netaddr-0.7.19.tar.gz b/netaddr-0.7.19.tar.gz new file mode 100644 index 0000000..cc31d9d Binary files /dev/null and b/netaddr-0.7.19.tar.gz differ diff --git a/python-netaddr.spec b/python-netaddr.spec new file mode 100644 index 0000000..331a2a4 --- /dev/null +++ b/python-netaddr.spec @@ -0,0 +1,80 @@ +Name: python-netaddr +Version: 0.7.19 +Release: 14 +Summary: A pure Python network address representation and manipulation library + +License: BSD +URL: http://github.com/drkjam/netaddr +Source0: https://pypi.python.org/packages/source/n/netaddr/netaddr-%{version}.tar.gz + +BuildArch: noarch +BuildRequires: python2-devel python2-setuptools python2-sphinx python2-pytest +BuildRequires: python3-devel python3-setuptools python3-sphinx python3-pytest + +Patch0001: 0001-PEP-479-return-instead-of-raise-StopIteration.patch + +%description +A network address manipulation library for Python +Provides support for: +Layer 3 addresses + * dealing with various ranges formats (CIDR, arbitrary ranges and globs, nmap) + * parsing a large variety of different formats and notations +Layer 2 addresses + * generating derived IPv6 addresses + + + +%package -n python2-netaddr +Summary: Netaddr for 2 matching expressions +%{?python_provide:%python_provide python2-netaddr} + +%description -n python2-netaddr +Based on Python2 network address representation and operation library Package + +%package -n python3-netaddr +Summary: A pure Python network address representation and manipulation library +%{?python_provide:%python_provide python3-netaddr} + +%description -n python3-netaddr +Based on Python3 network address representation and operation library Package + + + + +%prep +%autosetup -n netaddr-%{version} -p1 + +sed -i 's/\r//' netaddr/*.py netaddr/ip/*.py netaddr/eui/*.idx +find netaddr -name "*.py" | xargs sed -i -e '1 {/^#!\//d}' +sed -i -e '1s,/usr/bin/env python,%{__python2} %{?py_shbang_opts},' netaddr/tools/netaddr + +%build +%py2_build +%py3_build + +#docs +cd docs +PYTHONPATH='../' sphinx-build -b html -d build/doctrees source html +PYTHONPATH='../' sphinx-build-%{python3_version} -b html -d build/doctrees source python3/html + + +%install +%py3_install +mv %{buildroot}%{_bindir}/netaddr %{buildroot}%{_bindir}/netaddr3 +%py2_install + +%files -n python2-netaddr +%license COPYRIGHT LICENSE +%doc AUTHORS CHANGELOG README.md docs/html +%{python2_sitelib}/* +%{_bindir}/netaddr + +%files -n python3-netaddr +%license COPYRIGHT +%doc AUTHORS CHANGELOG README.md docs/python3/html +%{python3_sitelib}/* +%{_bindir}/netaddr3 + +%changelog +* Fri Feb 14 2020 gulining - 0.7.19-14 +- Package init