- 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 <gareth.armstrong@hp.com>
This commit is contained in:
John Eckersberg 2009-07-22 19:32:38 +00:00
parent a473eab567
commit 3ee98bb237

View File

@ -1,68 +1,100 @@
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
#====================================================================#
Name: python-netaddr Name: python-netaddr
Version: 0.6.3 Version: 0.6.3
Release: 1%{?dist} Release: 2%{?dist}
Summary: Network address manipulation, done Pythonically Summary: Network address manipulation, done Pythonically
Group: Development/Libraries Group: Development/Libraries
License: BSD License: BSD
URL: http://code.google.com/p/netaddr/ URL: http://code.google.com/p/netaddr/
Source0: http://netaddr.googlecode.com/files/netaddr-%{version}.tar.gz Source0: http://netaddr.googlecode.com/files/netaddr-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildArch: noarch BuildArch: noarch
BuildRequires: python-devel, python-setuptools, dos2unix BuildRequires: python-devel >= 2.4
%description %description
netaddr is a network address manipulation library written in pure Python. netaddr is a Python library for the representation and manipulation of
various common network address formats and notations.
It supports the Pythonic manipulation of several common network address It takes the hassle out of fiddling with innumerable variations of
notations and standards, including :- network addresses, presenting a consistent, extensible, easy-to-use
and above all Pythonic API.
With it you can represent, validate, convert, categorize, iterate,
generate, slice (and dice) :-
* IP version 4
* IP version 6
* CIDR (Classless Inter-Domain Routing) both IPv4 and IPv6
* MAC (Media Access Control) and IEEE EUI-48 and EUI-64
* Support for arbitrary IP address ranges with CIDR interoperability
* User friendly alternative IPv4 range syntax using netaddr's
glob-style Wildcard addresses
For examples see the project wiki :-
http://code.google.com/p/netaddr/wiki/NetAddrExamples
API documentation (auto-generated with epydoc) :-
http://packages.python.org/netaddr/
- IP version 4
- IP version 6
- CIDR (Classless Inter-Domain Routing)
- IEEE EUI-48 and EUI-64
- MAC (Media Access Control)
%prep %prep
%setup -q -n netaddr-%{version} %setup -q -n netaddr-%{version}
chmod 644 tests/* chmod 644 tests/*
# 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/'
%build %build
%{__python} setup.py build %{__python} setup.py build
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf %{buildroot}
mkdir -p $RPM_BUILD_ROOT/%{_bindir} %{__python} setup.py install -O1 --skip-build --root %{buildroot}
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
dos2unix $RPM_BUILD_ROOT%{python_sitelib}/netaddr/core.py
dos2unix $RPM_BUILD_ROOT%{python_sitelib}/netaddr/ip/__init__.py %check
python tests/ut_netaddr.py
%clean %clean
rm -rf $RPM_BUILD_ROOT rm -rf %{buildroot}
%files %files
%defattr(0644,root,root,0755) %defattr(-,root,root,-)
%doc GLOSSARY INSTALL LICENSE PKG-INFO README docs/api/ tests %doc AUTHORS CHANGELOG COPYRIGHT GLOSSARY INSTALL LICENSE PKG-INFO
%doc README docs/api/ tests
%{python_sitelib}/* %{python_sitelib}/*
#These libraries have shebangs thus should be +x
%attr(0755,root,root) %{python_sitelib}/netaddr/core.py
%attr(0755,root,root) %{python_sitelib}/netaddr/eui/__init__.py
%attr(0755,root,root) %{python_sitelib}/netaddr/strategy.py
%attr(0755,root,root) %{python_sitelib}/netaddr/address.py
%attr(0755,root,root) %{python_sitelib}/netaddr/ip/__init__.py
%attr(0755,root,root) %{python_sitelib}/netaddr/__init__.py
%attr(0755,root,root) %{python_sitelib}/netaddr/fallback.py
%attr(0755,root,root) %{python_sitelib}/netaddr/util.py
%changelog %changelog
* Wed Jul 22 2009 John Eckersberg <jeckersb@redhat.com> - 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 <gareth.armstrong@hp.com>
* Tue Jun 23 2009 John Eckersberg <jeckersb@redhat.com> - 0.6.3-1 * Tue Jun 23 2009 John Eckersberg <jeckersb@redhat.com> - 0.6.3-1
- New upstream bugfix release - New upstream bugfix release