]>
Commit | Line | Data |
---|---|---|
f11e3208 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_with python3 # CPython 3.x module (enable when useful - now scripts use python2 shebang) | |
5 | ||
6 | Summary: Python 2 bindings to Ethernet settings | |
7 | Summary(pl.UTF-8): Wiązania Pythona 2 do ustawień sieci Ethernet | |
8 | Name: python-ethtool | |
9 | Version: 0.11 | |
b0e123ba | 10 | Release: 3 |
f11e3208 JB |
11 | License: GPL v2 |
12 | Group: Libraries/Python | |
13 | Source0: https://fedorahosted.org/releases/p/y/python-ethtool/%{name}-%{version}.tar.bz2 | |
14 | # Source0-md5: b505501d928debf69664b72fafa9d0c3 | |
15 | URL: https://fedorahosted.org/python-ethtool/ | |
16 | BuildRequires: asciidoc | |
17 | BuildRequires: libnl-devel >= 3.2 | |
18 | BuildRequires: python-devel >= 2 | |
19 | BuildRequires: python-modules >= 2 | |
20 | BuildRequires: rpm-pythonprov | |
0e2033e3 | 21 | BuildRequires: rpmbuild(macros) >= 1.710 |
f11e3208 JB |
22 | %if %{with python3} |
23 | BuildRequires: python3-devel >= 1:3.2 | |
24 | BuildRequires: python3-modules >= 1:3.2 | |
25 | %endif | |
26 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
27 | ||
28 | %description | |
29 | Python 2 bindings for the ethtool kernel interface, that allows | |
30 | querying and changing of Ethernet card settings, such as speed, port, | |
31 | auto-negotiation, and PCI locations. | |
32 | ||
33 | %description -l pl.UTF-8 | |
34 | Wiązania Pythona 2 do interfejsu ethtool w jądrze, pozwalającego na | |
35 | odczyt i zmianę ustawień kart sieciowych Ethenet, takich jak szybkość, | |
36 | port, autonegocjacja oraz lokalizacja PCI. | |
37 | ||
38 | %package -n python3-ethtool | |
39 | Summary: Python 3 bindings to Ethernet settings | |
40 | Summary(pl.UTF-8): Wiązania Pythona 3 do ustawień sieci Ethernet | |
41 | Group: Libraries/Python | |
42 | ||
43 | %description -n python3-ethtool | |
44 | Python 3 bindings for the ethtool kernel interface, that allows | |
45 | querying and changing of Ethernet card settings, such as speed, port, | |
46 | auto-negotiation, and PCI locations. | |
47 | ||
48 | %description -n python3-ethtool -l pl.UTF-8 | |
49 | Wiązania Pythona 3 do interfejsu ethtool w jądrze, pozwalającego na | |
50 | odczyt i zmianę ustawień kart sieciowych Ethenet, takich jak szybkość, | |
51 | port, autonegocjacja oraz lokalizacja PCI. | |
52 | ||
53 | %prep | |
54 | %setup -q | |
55 | ||
56 | %build | |
57 | %if %{with python2} | |
7330c416 | 58 | %py_build |
f11e3208 JB |
59 | %endif |
60 | ||
61 | %if %{with python3} | |
7330c416 | 62 | %py3_build |
f11e3208 JB |
63 | %endif |
64 | ||
65 | a2x -d manpage -f manpage man/pethtool.8.asciidoc | |
66 | a2x -d manpage -f manpage man/pifconfig.8.asciidoc | |
67 | ||
68 | %install | |
69 | rm -rf $RPM_BUILD_ROOT | |
70 | install -d $RPM_BUILD_ROOT%{_sbindir} | |
71 | ||
72 | %if %{with python2} | |
7330c416 | 73 | %py_install |
f11e3208 JB |
74 | |
75 | cp -p pethtool.py $RPM_BUILD_ROOT%{_sbindir}/pethtool | |
76 | cp -p pifconfig.py $RPM_BUILD_ROOT%{_sbindir}/pifconfig | |
77 | %endif | |
78 | ||
79 | %if %{with python3} | |
7330c416 | 80 | %py3_install |
f11e3208 JB |
81 | %endif |
82 | ||
83 | %clean | |
84 | rm -rf $RPM_BUILD_ROOT | |
85 | ||
86 | %if %{with python2} | |
87 | %files | |
88 | %defattr(644,root,root,755) | |
89 | %attr(755,root,root) %{_sbindir}/pethtool | |
90 | %attr(755,root,root) %{_sbindir}/pifconfig | |
91 | %attr(755,root,root) %{py_sitedir}/ethtool.so | |
92 | %if "%{py_ver}" > "2.4" | |
93 | %{py_sitedir}/ethtool-%{version}-py*.egg-info | |
94 | %endif | |
95 | %endif | |
96 | ||
97 | %if %{with python3} | |
98 | %files -n python3-ethtool | |
99 | %defattr(644,root,root,755) | |
100 | %attr(755,root,root) %{py3_sitedir}/ethtool.cpython-*.so | |
101 | %{py3_sitedir}/ethtool-%{version}-py*.egg-info | |
102 | %endif |