]> git.pld-linux.org Git - packages/python-ethtool.git/blob - python-ethtool.spec
rebuild with tests and docs
[packages/python-ethtool.git] / python-ethtool.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
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.14
10 Release:        6
11 License:        GPL v2
12 Group:          Libraries/Python
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
16 BuildRequires:  asciidoc
17 BuildRequires:  libnl-devel >= 3.2
18 BuildRequires:  pkgconfig
19 %if %{with python2}
20 BuildRequires:  python-devel >= 2
21 BuildRequires:  python-modules >= 2
22 %endif
23 %if %{with python3}
24 BuildRequires:  python3-devel >= 1:3.2
25 BuildRequires:  python3-modules >= 1:3.2
26 %endif
27 BuildRequires:  rpm-pythonprov
28 BuildRequires:  rpmbuild(macros) >= 1.714
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}
61 %py_build
62 %endif
63
64 %if %{with python3}
65 %py3_build
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
73 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man8}
74
75 %if %{with python2}
76 %py_install
77
78 %{__mv} $RPM_BUILD_ROOT{%{_bindir}/pethtool,%{_sbindir}/pethtool2}
79 %{__mv} $RPM_BUILD_ROOT{%{_bindir}/pifconfig,%{_sbindir}/pifconfig2}
80 %endif
81
82 %if %{with python3}
83 %py3_install
84 %{__mv} $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/pethtool
85 %{__mv} $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/pifconfig
86 %endif
87
88 cp -p man/{pethtool,pifconfig}.8 $RPM_BUILD_ROOT%{_mandir}/man8
89
90 %clean
91 rm -rf $RPM_BUILD_ROOT
92
93 %if %{with python2}
94 %files
95 %defattr(644,root,root,755)
96 %attr(755,root,root) %{_sbindir}/pethtool2
97 %attr(755,root,root) %{_sbindir}/pifconfig2
98 %{py_sitedir}/ethtool-%{version}-py*.egg-info
99 %attr(755,root,root) %{py_sitedir}/ethtool.so
100 %endif
101
102 %if %{with python3}
103 %files -n python3-ethtool
104 %defattr(644,root,root,755)
105 %attr(755,root,root) %{_sbindir}/pethtool
106 %attr(755,root,root) %{_sbindir}/pifconfig
107 %attr(755,root,root) %{py3_sitedir}/ethtool.cpython-*.so
108 %{py3_sitedir}/ethtool-%{version}-py*.egg-info
109 %{_mandir}/man8/pethtool.8*
110 %{_mandir}/man8/pifconfig.8*
111 %endif
This page took 0.109334 seconds and 3 git commands to generate.