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