3 %bcond_without tests # do not perform "make test"
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
7 %define module netifaces
8 Summary: Python library to retrieve information about network interfaces
13 Group: Development/Languages/Python
14 Source0: https://files.pythonhosted.org/packages/source/n/%{module}/%{module}-%{version}.tar.gz
15 # Source0-md5: 5b4d1f1310ed279e6df27ef3a9b71519
16 URL: https://alastairs-place.net/projects/netifaces/
17 BuildRequires: rpmbuild(macros) >= 1.710
19 BuildRequires: python-devel
20 BuildRequires: python-distribute
23 BuildRequires: python3-modules
24 BuildRequires: python3-setuptools
26 BuildRequires: rpm-pythonprov
27 Requires: python-modules
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 This package provides a cross platform API for getting address
32 information from network interfaces.
34 %package -n python3-%{module}
35 Summary: Python library to retrieve information about network interfaces
36 Group: Libraries/Python
37 Requires: python3-modules
39 %description -n python3-%{module}
40 This package provides a cross platform API for getting address
41 information from network interfaces.
44 %setup -q -n %{module}-%{version}
49 %{?with_tests:%{__python} setup.py test}
54 %{?with_tests:%{__python3} setup.py test}
58 rm -rf $RPM_BUILD_ROOT
63 # when files are installed in other way that standard 'setup.py
64 # they need to be (re-)compiled
65 # change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
66 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
67 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
77 rm -rf $RPM_BUILD_ROOT
81 %defattr(644,root,root,755)
83 %attr(755,root,root) %{py_sitedir}/netifaces.so
84 %if "%{py_ver}" > "2.4"
85 %{py_sitedir}/netifaces-*.egg-info
90 %files -n python3-%{module}
91 %defattr(644,root,root,755)
93 %{py3_sitedir}/netifaces*.so
94 %{py3_sitedir}/%{module}-%{version}-py*.egg-info