]> git.pld-linux.org Git - packages/python-netifaces.git/blob - python-netifaces.spec
e222870b0e8ad8a2130ed914df4a16e3d11dd03d
[packages/python-netifaces.git] / python-netifaces.spec
1 #
2 # Conditional build:
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
6
7 %define         module  netifaces
8 Summary:        Python library to retrieve information about network interfaces
9 Name:           python-%{module}
10 Version:        0.10.5
11 Release:        6
12 License:        MIT
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
18 %if %{with python2}
19 BuildRequires:  python-devel
20 BuildRequires:  python-distribute
21 %endif
22 %if %{with python3}
23 BuildRequires:  python3-modules
24 BuildRequires:  python3-setuptools
25 %endif
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
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
43 %prep
44 %setup -q -n %{module}-%{version}
45
46 %build
47 %if %{with python2}
48 %py_build
49 %{?with_tests:%{__python} setup.py test}
50 %endif
51
52 %if %{with python3}
53 %py3_build
54 %{?with_tests:%{__python3} setup.py test}
55 %endif
56
57 %install
58 rm -rf $RPM_BUILD_ROOT
59
60 %if %{with python2}
61 %py_install
62
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
76 %clean
77 rm -rf $RPM_BUILD_ROOT
78
79 %if %{with python2}
80 %files
81 %defattr(644,root,root,755)
82 %doc README.rst
83 %attr(755,root,root) %{py_sitedir}/netifaces.so
84 %if "%{py_ver}" > "2.4"
85 %{py_sitedir}/netifaces-*.egg-info
86 %endif
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
This page took 0.095232 seconds and 2 git commands to generate.