python-ipaddr/python-ipaddr.spec
Sascha Peilicke 0b6cacc53e Accepting request 76390 from home:alina_q:NEPI
Hi, I'd like to submit this package here, I found it's a dependency of another project I've been maintaining. devel:languages:python seems to be a good match, prior to submitting it to factory.

OBS-URL: https://build.opensuse.org/request/show/76390
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ipaddr?expand=0&rev=1
2011-07-18 17:46:56 +00:00

59 lines
1.7 KiB
RPMSpec

# norootforbuild
Name: python-ipaddr
Version: 2.1.9
Release: 1
Summary: Python IP address manipulation library
Group: Development/Libraries/Python
License: Apache 2.0
URL: http://code.google.com/p/ipaddr-py/
Source0: http://ipaddr-py.googlecode.com/files/ipaddr-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-build
Requires: python
BuildRequires: python-devel python-setuptools
%if 0%{?suse_version}
BuildRequires: fdupes
%endif
%if (0%{?suse_version} < 1130) && (0%{?suse_version} > 0)
# py_requires is no longer needed since 11.3
%{py_requires}
%endif
Autoreqprov: on
%if %{?suse_version: %{suse_version} > 1110} %{!?suse_version:1}
BuildArchitectures: noarch
%endif
%description
An IPv4/IPv6 manipulation library in Python. This library is used to create/poke/manipulate IPv4 and IPv6 addresses and prefixes.
%prep
%setup -q -n ipaddr-%{version}
%build
%{__python} setup.py build
%install
%if 0%{?suse_version}
%{__python} setup.py install --prefix=%{_prefix} --root=%{buildroot} --compile --optimize=2 --record-rpm=INSTALLED_FILES
%else
%{__python} setup.py install --prefix=%{_prefix} --root=%{buildroot} --compile --optimize=2 --record=INSTALLED_FILES
%endif
%if 0%{?suse_version}
%fdupes %{buildroot}%{py_sitedir}
%endif
%if 0%{?mdkversion} >= 201001
# Mandriva 2010.1 has some issues with byte compiling
# It refuses to, but it still outputs the .py[co] to the INSTALLED_FILES list
grep -v '[.]py[co]$' INSTALLED_FILES > INSTALLED_FILES_MDK
mv -f INSTALLED_FILES_MDK INSTALLED_FILES
%endif
%clean
rm -rf %{buildroot}
%files -f INSTALLED_FILES
%defattr(-,root,root)
%doc README
%changelog