]>
Commit | Line | Data |
---|---|---|
93e083b6 MB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
f6b47641 JR |
4 | %bcond_without python2 # CPython 2.x module |
5 | %bcond_without python3 # CPython 3.x module | |
93e083b6 | 6 | |
f6b47641 | 7 | %define module netifaces |
93e083b6 MB |
8 | Summary: Python library to retrieve information about network interfaces |
9 | Name: python-%{module} | |
f6b47641 | 10 | Version: 0.10.5 |
222a476a | 11 | Release: 7 |
93e083b6 MB |
12 | License: MIT |
13 | Group: Development/Languages/Python | |
f6b47641 JR |
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/ | |
6cc600a9 | 17 | BuildRequires: rpmbuild(macros) >= 1.710 |
f6b47641 | 18 | %if %{with python2} |
93e083b6 MB |
19 | BuildRequires: python-devel |
20 | BuildRequires: python-distribute | |
f6b47641 JR |
21 | %endif |
22 | %if %{with python3} | |
23 | BuildRequires: python3-modules | |
24 | BuildRequires: python3-setuptools | |
25 | %endif | |
93e083b6 MB |
26 | BuildRequires: rpm-pythonprov |
27 | Requires: python-modules | |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
29 | ||
30 | %description | |
31 | This package provides a cross platform API for getting address | |
32 | information from network interfaces. | |
33 | ||
f6b47641 JR |
34 | %package -n python3-%{module} |
35 | Summary: Python library to retrieve information about network interfaces | |
36 | Group: Libraries/Python | |
37 | Requires: python3-modules | |
38 | ||
39 | %description -n python3-%{module} | |
40 | This package provides a cross platform API for getting address | |
41 | information from network interfaces. | |
42 | ||
93e083b6 MB |
43 | %prep |
44 | %setup -q -n %{module}-%{version} | |
45 | ||
46 | %build | |
f6b47641 | 47 | %if %{with python2} |
826162f9 | 48 | %py_build |
93e083b6 | 49 | %{?with_tests:%{__python} setup.py test} |
f6b47641 JR |
50 | %endif |
51 | ||
52 | %if %{with python3} | |
53 | %py3_build | |
54 | %{?with_tests:%{__python3} setup.py test} | |
55 | %endif | |
93e083b6 MB |
56 | |
57 | %install | |
58 | rm -rf $RPM_BUILD_ROOT | |
f6b47641 JR |
59 | |
60 | %if %{with python2} | |
826162f9 | 61 | %py_install |
93e083b6 | 62 | |
f6b47641 JR |
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} | |
68 | ||
69 | %py_postclean | |
70 | %endif | |
71 | ||
72 | %if %{with python3} | |
73 | %py3_install | |
74 | %endif | |
75 | ||
93e083b6 MB |
76 | %clean |
77 | rm -rf $RPM_BUILD_ROOT | |
78 | ||
f6b47641 | 79 | %if %{with python2} |
93e083b6 MB |
80 | %files |
81 | %defattr(644,root,root,755) | |
f6b47641 | 82 | %doc README.rst |
93e083b6 MB |
83 | %attr(755,root,root) %{py_sitedir}/netifaces.so |
84 | %if "%{py_ver}" > "2.4" | |
85 | %{py_sitedir}/netifaces-*.egg-info | |
86 | %endif | |
f6b47641 JR |
87 | %endif |
88 | ||
89 | %if %{with python3} | |
90 | %files -n python3-%{module} | |
91 | %defattr(644,root,root,755) | |
92 | %doc README.rst | |
93 | %{py3_sitedir}/netifaces*.so | |
94 | %{py3_sitedir}/%{module}-%{version}-py*.egg-info | |
95 | %endif |