diff --git a/.python-netaddr.metadata b/.python-netaddr.metadata new file mode 100644 index 0000000..bb2fb2f --- /dev/null +++ b/.python-netaddr.metadata @@ -0,0 +1 @@ +a5ed00d82a9d56344da383fa10dbe13cdeaf50b0 SOURCES/netaddr-0.7.5.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/0001-Fixed-github-Issue-no.-2.-Thanks-keesbos.patch b/SOURCES/0001-Fixed-github-Issue-no.-2.-Thanks-keesbos.patch new file mode 100644 index 0000000..28d4d61 --- /dev/null +++ b/SOURCES/0001-Fixed-github-Issue-no.-2.-Thanks-keesbos.patch @@ -0,0 +1,65 @@ +From 80071f4450261b70b70f537bc2b54d2c97d9f562 Mon Sep 17 00:00:00 2001 +From: "David P. D. Moss" +Date: Thu, 25 Nov 2010 08:53:49 +0000 +Subject: [PATCH] Fixed github Issue no. 2. Thanks keesbos. + +--- + netaddr/ip/__init__.py | 2 ++ + netaddr/tests/2.x/ip/constructor.txt | 11 +++++++++++ + netaddr/tests/3.x/ip/constructor.txt | 11 +++++++++++ + 3 files changed, 24 insertions(+), 0 deletions(-) + +diff --git a/netaddr/ip/__init__.py b/netaddr/ip/__init__.py +index 0179c38..e4a6b7b 100644 +--- a/netaddr/ip/__init__.py ++++ b/netaddr/ip/__init__.py +@@ -779,6 +779,8 @@ def parse_ip_network(module, addr, implicit_prefix=False, flags=0): + # Try a partial IPv4 network address... + expanded_addr = _ipv4.expand_partial_address(val1) + ip = IPAddress(expanded_addr, module.version, flags=INET_PTON) ++ else: ++ raise AddrFormatError('invalid IPNetwork address %s!' % addr) + value = ip._value + + try: +diff --git a/netaddr/tests/2.x/ip/constructor.txt b/netaddr/tests/2.x/ip/constructor.txt +index f67f5e4..5a9e978 100644 +--- a/netaddr/tests/2.x/ip/constructor.txt ++++ b/netaddr/tests/2.x/ip/constructor.txt +@@ -209,3 +209,14 @@ IPNetwork('172.24.0.0/16') + + + }}} ++ ++Negative testing ++ ++{{{ ++ ++>>> IPNetwork('foo') ++Traceback (most recent call last): ++... ++AddrFormatError: invalid IPNetwork foo ++ ++}}} +diff --git a/netaddr/tests/3.x/ip/constructor.txt b/netaddr/tests/3.x/ip/constructor.txt +index 2ec47c0..35a5cd6 100644 +--- a/netaddr/tests/3.x/ip/constructor.txt ++++ b/netaddr/tests/3.x/ip/constructor.txt +@@ -209,3 +209,14 @@ IPNetwork('172.24.0.0/16') + + + }}} ++ ++Negative testing ++ ++{{{ ++ ++>>> IPNetwork('foo') ++Traceback (most recent call last): ++... ++netaddr.core.AddrFormatError: invalid IPNetwork foo ++ ++}}} +-- +1.7.5.2 + diff --git a/SPECS/python-netaddr.spec b/SPECS/python-netaddr.spec new file mode 100644 index 0000000..4829600 --- /dev/null +++ b/SPECS/python-netaddr.spec @@ -0,0 +1,178 @@ +%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} + +#====================================================================# + +Name: python-netaddr +Version: 0.7.5 +Release: 6%{?dist} +Summary: A pure Python network address representation and manipulation library + +Group: Development/Libraries +License: BSD +URL: http://github.com/drkjam/netaddr +Source0: http://github.com/downloads/drkjam/netaddr/netaddr-%{version}.tar.gz +BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) + +BuildArch: noarch +BuildRequires: python-devel >= 2.4 + +Patch0: 0001-Fixed-github-Issue-no.-2.-Thanks-keesbos.patch + + +%description +A pure Python network address representation and manipulation library. + +netaddr provides a Pythonic way of working with :- + +- IPv4 and IPv6 addresses and subnets +- MAC addresses, OUI and IAB identifiers, IEEE EUI-64 identifiers +- arbitrary (non-aligned) IP address ranges and IP address sets +- various non-CIDR IP range formats such as nmap and glob-style formats + +Included are routines for :- + +- generating, sorting and summarizing IP addresses and networks +- performing easy conversions between address notations and formats +- detecting, parsing and formatting network address representations +- performing set-based operations on groups of IP addresses and subnets +- working with arbitrary IP address ranges and formats +- accessing OUI and IAB organisational information published by IEEE +- accessing IP address and block information published by IANA + +For details on the latest updates and changes, see :- + + http://github.com/drkjam/netaddr/blob/rel-0.7.x/CHANGELOG + +API documentation for the latest release is available here :- + + http://packages.python.org/netaddr/ + + +%prep +%setup -q -n netaddr-%{version} +%patch0 -p1 -b .invalid_ip_network + +# Make rpmlint happy, get rid of DOS line endings +%{__sed} -i 's/\r//' netaddr/*.py +%{__sed} -i 's/\r//' netaddr/ip/*.py +%{__sed} -i 's/\r//' netaddr/eui/*.idx + +# Make rpmlint happy, rip out python shebang lines from most python +# modules +find netaddr -name "*.py" | \ + xargs %{__perl} -ni -e 'print unless /usr\/bin\/python|env\s+python/' + +# Make rpmlint happy, fix permissions on documentation files +chmod 0644 README AUTHORS CHANGELOG COPYRIGHT INSTALL LICENSE PKG-INFO + +%build +%{__python} setup.py build + + +%install +rm -rf %{buildroot} +%{__python} setup.py install -O1 --skip-build --root %{buildroot} + + +%check +%{__python} netaddr/tests/__init__.py + +%clean +rm -rf %{buildroot} + + +%files +%defattr(-,root,root,-) +%doc AUTHORS CHANGELOG COPYRIGHT INSTALL LICENSE PKG-INFO +%doc README docs/api/ +%{python_sitelib}/* +%{_bindir}/netaddr + +%changelog +* Thu Feb 14 2013 Fedora Release Engineering - 0.7.5-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Sat Jul 21 2012 Fedora Release Engineering - 0.7.5-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Sat Jan 14 2012 Fedora Release Engineering - 0.7.5-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Mon May 30 2011 Jakub Hrozek - 0.7.5-3 +- Do not traceback on invalid IPNetwork input (upstream issues #2, #6, #5, #8) +- Remove executable bit from documentation files to make rpmlint happy + +* Tue Feb 08 2011 Fedora Release Engineering - 0.7.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Oct 05 2010 John Eckersberg - 0.7.5-1 +- New upstream release 0.7.5 +- Updated summary and description to match upstream README +- Updated URL and source to reflect upstream move to github + +* Thu Jul 22 2010 David Malcolm - 0.7.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild + +* Mon May 17 2010 John Eckersberg - 0.7.4-1 +- New upstream release 0.7.4 + +* Wed Sep 30 2009 John Eckersberg - 0.7.3-1 +- New upstream release 0.7.3 + +* Fri Aug 21 2009 John Eckersberg - 0.7.2-1 +- New upstream release 0.7.2 +- Updated Summary and Description with new values provided by upstream + +* Mon Aug 17 2009 John Eckersberg - 0.7.1-1 +- New upstream release 0.7.1 fixes naming conflict with 'nash' by + renaming the netaddr shell to 'netaddr' + +* Wed Aug 12 2009 John Eckersberg - 0.7-1 +- Upstream release 0.7 + +* Sun Jul 26 2009 Fedora Release Engineering - 0.6.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Jul 22 2009 John Eckersberg - 0.6.3-2 +- Minor tweaks to spec file aligning with latest Fedora packaging guidelines +- Enforce python 2.4 dependency as needed by netaddr >= 0.6.2 +- Drop BR on python-setuptool as it is not imported in setup.py +- Drop BR on dos2unix use sed instead +- Align description with that of delivered PKG-INFO +- Rip out python shebangs +- Add %%check section to enable tests +- Thanks to Gareth Armstrong + +* Tue Jun 23 2009 John Eckersberg - 0.6.3-1 +- New upstream bugfix release + +* Mon Apr 13 2009 John Eckersberg - 0.6.2-1 +- New upstream bugfix release + +* Tue Apr 7 2009 John Eckersberg - 0.6.1-1 +- New upstream bugfix release + +* Thu Feb 26 2009 Fedora Release Engineering - 0.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Wed Feb 18 2009 John Eckersberg - 0.6-2 +- Add BuildDepends on dos2unix to clean up some upstream sources + +* Wed Feb 18 2009 John Eckersberg - 0.6-1 +- New upstream version + +* Sat Nov 29 2008 Ignacio Vazquez-Abrams - 0.5.2-2 +- Rebuild for Python 2.6 + +* Fri Oct 10 2008 John Eckersberg - 0.5.2-1 +- New upstream version, bug fixes for 0.5.1 + +* Tue Sep 23 2008 John Eckersberg - 0.5.1-1 +- New upstream version, bug fixes for 0.5 + +* Sun Sep 21 2008 John Eckersberg - 0.5-1 +- New upstream version + +* Mon Aug 11 2008 John Eckersberg - 0.4-1 +- Initial packaging for Fedora +