]>
Commit | Line | Data |
---|---|---|
93e083b6 MB |
1 | # |
2 | # Conditional build: | |
99eedfd5 | 3 | %bcond_without tests # unit tests |
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 | 8 | Summary: Python library to retrieve information about network interfaces |
99eedfd5 | 9 | Summary(pl.UTF-8): Biblioteka Pythona do pobierania informacji o interfejsach sieciowych |
93e083b6 | 10 | Name: python-%{module} |
70fddb3f AM |
11 | Version: 0.11.0 |
12 | Release: 1 | |
93e083b6 MB |
13 | License: MIT |
14 | Group: Development/Languages/Python | |
99eedfd5 JB |
15 | #Source0Download: https://pypi.org/simple/netifaces/ |
16 | Source0: https://files.pythonhosted.org/packages/source/n/netifaces/%{module}-%{version}.tar.gz | |
70fddb3f AM |
17 | # Source0-md5: 3146dcb3297dd018ae5eb9a52b440419 |
18 | URL: https://pypi.org/project/netifaces/ | |
f6b47641 | 19 | %if %{with python2} |
5c01a06e | 20 | BuildRequires: python-devel >= 1:2.7 |
99eedfd5 | 21 | BuildRequires: python-setuptools |
f6b47641 JR |
22 | %endif |
23 | %if %{with python3} | |
5c01a06e | 24 | BuildRequires: python3-devel >= 1:3.4 |
f6b47641 JR |
25 | BuildRequires: python3-setuptools |
26 | %endif | |
99eedfd5 | 27 | BuildRequires: rpmbuild(macros) >= 1.714 |
93e083b6 | 28 | BuildRequires: rpm-pythonprov |
99eedfd5 | 29 | Requires: python-modules >= 1:2.7 |
93e083b6 MB |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
31 | ||
32 | %description | |
33 | This package provides a cross platform API for getting address | |
34 | information from network interfaces. | |
35 | ||
99eedfd5 JB |
36 | %description -l pl.UTF-8 |
37 | Ten pakiet zapewnia wieloplatformowe API do pobierania informacji o | |
38 | adresach z interfejsów sieciowych. | |
39 | ||
f6b47641 JR |
40 | %package -n python3-%{module} |
41 | Summary: Python library to retrieve information about network interfaces | |
99eedfd5 | 42 | Summary(pl.UTF-8): Biblioteka Pythona do pobierania informacji o interfejsach sieciowych |
f6b47641 | 43 | Group: Libraries/Python |
99eedfd5 | 44 | Requires: python3-modules >= 1:3.4 |
f6b47641 JR |
45 | |
46 | %description -n python3-%{module} | |
47 | This package provides a cross platform API for getting address | |
48 | information from network interfaces. | |
49 | ||
99eedfd5 JB |
50 | %description -n python3-%{module} -l pl.UTF-8 |
51 | Ten pakiet zapewnia wieloplatformowe API do pobierania informacji o | |
52 | adresach z interfejsów sieciowych. | |
53 | ||
93e083b6 MB |
54 | %prep |
55 | %setup -q -n %{module}-%{version} | |
56 | ||
57 | %build | |
f6b47641 | 58 | %if %{with python2} |
826162f9 | 59 | %py_build |
99eedfd5 | 60 | |
93e083b6 | 61 | %{?with_tests:%{__python} setup.py test} |
f6b47641 JR |
62 | %endif |
63 | ||
64 | %if %{with python3} | |
65 | %py3_build | |
99eedfd5 | 66 | |
f6b47641 JR |
67 | %{?with_tests:%{__python3} setup.py test} |
68 | %endif | |
93e083b6 MB |
69 | |
70 | %install | |
71 | rm -rf $RPM_BUILD_ROOT | |
f6b47641 JR |
72 | |
73 | %if %{with python2} | |
826162f9 | 74 | %py_install |
93e083b6 | 75 | |
f6b47641 JR |
76 | %py_postclean |
77 | %endif | |
78 | ||
79 | %if %{with python3} | |
80 | %py3_install | |
81 | %endif | |
82 | ||
93e083b6 MB |
83 | %clean |
84 | rm -rf $RPM_BUILD_ROOT | |
85 | ||
f6b47641 | 86 | %if %{with python2} |
93e083b6 MB |
87 | %files |
88 | %defattr(644,root,root,755) | |
99eedfd5 | 89 | %doc LICENSE README.rst |
93e083b6 | 90 | %attr(755,root,root) %{py_sitedir}/netifaces.so |
99eedfd5 | 91 | %{py_sitedir}/netifaces-%{version}-py*.egg-info |
f6b47641 JR |
92 | %endif |
93 | ||
94 | %if %{with python3} | |
95 | %files -n python3-%{module} | |
96 | %defattr(644,root,root,755) | |
99eedfd5 JB |
97 | %doc LICENSE README.rst |
98 | %attr(755,root,root) %{py3_sitedir}/netifaces.cpython-*.so | |
99 | %{py3_sitedir}/netifaces-%{version}-py*.egg-info | |
f6b47641 | 100 | %endif |