]> git.pld-linux.org Git - packages/python-ethtool.git/blob - python-ethtool.spec
b3395f30523121ebaf5a54d06d301263dc58307b
[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.12
10 Release:        2
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:  8089d72c9dbe0570bc2aa6ecd59e026f
15 Patch0:         %{name}-build.patch
16 URL:            https://fedorahosted.org/python-ethtool/
17 BuildRequires:  asciidoc
18 BuildRequires:  libnl-devel >= 3.2
19 BuildRequires:  pkgconfig
20 %if %{with python2}
21 BuildRequires:  python-devel >= 2
22 BuildRequires:  python-modules >= 2
23 %endif
24 %if %{with python3}
25 BuildRequires:  python3-devel >= 1:3.2
26 BuildRequires:  python3-modules >= 1:3.2
27 %endif
28 BuildRequires:  rpm-pythonprov
29 BuildRequires:  rpmbuild(macros) >= 1.714
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
59 %patch0 -p1
60
61 %build
62 %if %{with python2}
63 %py_build
64 %endif
65
66 %if %{with python3}
67 %py3_build
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
75 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man8}
76
77 %if %{with python2}
78 %py_install
79
80 cp -p pethtool.py $RPM_BUILD_ROOT%{_sbindir}/pethtool
81 cp -p pifconfig.py $RPM_BUILD_ROOT%{_sbindir}/pifconfig
82 cp -p man/{pethtool,pifconfig}.8 $RPM_BUILD_ROOT%{_mandir}/man8
83 %endif
84
85 %if %{with python3}
86 %py3_install
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
101 %{_mandir}/man8/pethtool.8*
102 %{_mandir}/man8/pifconfig.8*
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
This page took 0.042706 seconds and 2 git commands to generate.