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