]>
Commit | Line | Data |
---|---|---|
2bf65fe5 ER |
1 | # TODO |
2 | # - alias from /etc/modprobe.d/3.4.32.longterm-1/geninitrd.conf does not work for geninitrd | |
5c0bad5f ER |
3 | # - kmod no longer links with library dynamically since kmod-15: |
4 | # kmod binary statically links to libkmod - if distro is only interested in | |
5 | # the kmod tool (for example in an initrd) it can refrain from installing the library | |
2bf65fe5 | 6 | # |
60e11f6d | 7 | # Conditional build: |
016fc6ef | 8 | %bcond_without openssl # OpenSSL support for PKCS7 signatures in modinfo |
983e9111 | 9 | %bcond_without python3 # CPython 3.x module |
335eb04a | 10 | %bcond_without tests # perform "make check" (init_module seems to require root for mkdir) |
5c0bad5f | 11 | |
0cbdbf08 AG |
12 | Summary: Linux kernel module handling |
13 | Summary(pl.UTF-8): Obsługa modułów jądra Linuksa | |
14 | Name: kmod | |
0a22daa7 AM |
15 | Version: 27 |
16 | Release: 1 | |
34910362 | 17 | License: GPL v2+ |
223cf71b | 18 | Group: Applications/System |
34e8b922 | 19 | Source0: https://www.kernel.org/pub/linux/utils/kernel/kmod/%{name}-%{version}.tar.xz |
0a22daa7 | 20 | # Source0-md5: 3973a74786670d3062d89a827e266581 |
ea202d12 AG |
21 | Source1: %{name}-blacklist |
22 | Source2: %{name}-usb | |
185589bc | 23 | Patch0: %{name}-modprobe.d-kver.patch |
601b1eec | 24 | Patch1: %{name}-depmod.d-kver.patch |
142b5af7 | 25 | Patch2: python-3.8.patch |
983e9111 JB |
26 | URL: https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git |
27 | BuildRequires: autoconf >= 2.64 | |
223cf71b | 28 | BuildRequires: automake >= 1:1.11 |
34910362 | 29 | BuildRequires: gtk-doc >= 1.14 |
5e93fa11 | 30 | BuildRequires: kernel-module-build |
223cf71b | 31 | BuildRequires: libtool >= 2:2.0 |
016fc6ef | 32 | %{?with_openssl:BuildRequires: openssl-devel >= 1.1.0} |
a01f33dc | 33 | BuildRequires: pkgconfig |
983e9111 JB |
34 | BuildRequires: python-devel >= 1:2.6 |
35 | %{?with_python3:BuildRequires: python3-devel >= 1:3.3} | |
87d6eac2 | 36 | BuildRequires: rpm-pythonprov |
064bf341 | 37 | BuildRequires: rpmbuild(macros) >= 1.219 |
d7e51de2 JB |
38 | BuildRequires: tar >= 1:1.22 |
39 | BuildRequires: xz | |
0cbdbf08 AG |
40 | BuildRequires: xz-devel >= 1:4.99 |
41 | BuildRequires: zlib-devel | |
983e9111 | 42 | Requires: filesystem >= 4.0-24 |
512a3cb5 AM |
43 | # won't work on older kernels as these do not provide require information in /sys |
44 | Requires: uname(release) >= 2.6.21 | |
198a4cc1 | 45 | Provides: module-init-tools = 4.0 |
1904028e | 46 | Provides: virtual(module-tools) |
198a4cc1 | 47 | Obsoletes: module-init-tools < 4.0 |
0cbdbf08 AG |
48 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
49 | ||
7ff317f4 | 50 | %define _bindir /sbin |
0cbdbf08 AG |
51 | |
52 | %description | |
53 | kmod is a set of tools to handle common tasks with Linux kernel | |
54 | modules like insert, remove, list, check properties, resolve | |
55 | dependencies and aliases. | |
56 | ||
57 | These tools are designed on top of libkmod, a library that is shipped | |
58 | with kmod. See libkmod/README for more details on this library and how | |
59 | to use it. The aim is to be compatible with tools, configurations and | |
60 | indexes from module-init-tools project. | |
61 | ||
62 | %description -l pl.UTF-8 | |
63 | kmod to zestaw narzędzi do wykonywania typowych czynności związanych z | |
64 | modułami jądra - ładowanie, usuwanie, listowanie, sprawdzanie | |
65 | parametrów, rozwiązywanie zależności czy obsługa aliasów. | |
66 | ||
67 | Narzędzia te zostały stworzone przy użyciu libkmod, biblioteki | |
68 | dostarczanej wraz z kmod. Celem jest stworzenie narzędzi | |
69 | kompatybilnych z programami, konfiguracją oraz indeksami z projektu | |
70 | module-init-tools. | |
71 | ||
34910362 JB |
72 | %package libs |
73 | Summary: Linux kernel module handling library | |
74 | Summary(pl.UTF-8): Biblioteka do obsługi modułów jądra Linuksa | |
75 | License: LGPL v2.1+ | |
76 | Group: Libraries | |
77 | Conflicts: kmod < 4-1 | |
78 | ||
79 | %description libs | |
80 | libkmod was created to allow programs to easily insert, remove and | |
81 | list modules, also checking its properties, dependencies and aliases. | |
82 | ||
83 | %description libs -l pl.UTF-8 | |
ea202d12 AG |
84 | Biblioteka libkmod została zaprojektowana, aby pozwolić programom w |
85 | łatwy sposób ładować, usuwać i listować moduły, także sprawdzając ich | |
86 | właściwości, zależności i aliasy. | |
34910362 | 87 | |
0cbdbf08 AG |
88 | %package devel |
89 | Summary: Header files for %{name} library | |
90 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki %{name} | |
34910362 | 91 | License: LGPL v2.1+ |
0cbdbf08 | 92 | Group: Development/Libraries |
34910362 | 93 | Requires: %{name}-libs = %{version}-%{release} |
d9def0be | 94 | Obsoletes: kmod-libs-static |
0cbdbf08 AG |
95 | |
96 | %description devel | |
97 | Header files for %{name} library. | |
98 | ||
99 | %description devel -l pl.UTF-8 | |
100 | Pliki nagłówkowe biblioteki %{name}. | |
101 | ||
34e8b922 JB |
102 | %package -n bash-completion-kmod |
103 | Summary: bash-completion for kmod utilities | |
104 | Summary(pl.UTF-8): Bashowe uzupełnianie nazw dla narzędzi kmod | |
105 | Group: Applications/Shells | |
106 | Requires: bash-completion >= 2.0 | |
907cd13b ER |
107 | %if "%{_rpmversion}" >= "5" |
108 | BuildArch: noarch | |
109 | %endif | |
34e8b922 JB |
110 | |
111 | %description -n bash-completion-kmod | |
112 | bash-completion for kmod utilities. | |
113 | ||
114 | %description -n bash-completion-kmod -l pl.UTF-8 | |
115 | Bashowe uzupełnianie nazw dla narzędzi kmod. | |
116 | ||
87d6eac2 | 117 | %package -n python-kmod |
983e9111 JB |
118 | Summary: Python 2 binding for kmod API |
119 | Summary(pl.UTF-8): Wiązania Pythona 2 do API kmod | |
ff466d50 | 120 | License: LGPL v2.1+ |
87d6eac2 | 121 | Group: Development/Languages/Python |
064bf341 | 122 | Requires: %{name}-libs = %{version}-%{release} |
87d6eac2 AM |
123 | |
124 | %description -n python-kmod | |
983e9111 | 125 | Python 2 binding for kmod API. |
87d6eac2 AM |
126 | |
127 | %description -n python-kmod -l pl.UTF-8 | |
983e9111 JB |
128 | Wiązania Pythona 2 do API kmod. |
129 | ||
130 | %package -n python3-kmod | |
131 | Summary: Python 3 binding for kmod API | |
132 | Summary(pl.UTF-8): Wiązania Pythona 3 do API kmod | |
133 | License: LGPL v2.1+ | |
134 | Group: Development/Languages/Python | |
135 | Requires: %{name}-libs = %{version}-%{release} | |
136 | ||
137 | %description -n python3-kmod | |
138 | Python 3 binding for kmod API. | |
139 | ||
140 | %description -n python3-kmod -l pl.UTF-8 | |
141 | Wiązania Pythona 3 do API kmod. | |
87d6eac2 | 142 | |
0cbdbf08 AG |
143 | %prep |
144 | %setup -q | |
185589bc | 145 | %patch0 -p1 |
601b1eec | 146 | %patch1 -p1 |
142b5af7 | 147 | %patch2 -p1 |
0cbdbf08 AG |
148 | |
149 | %build | |
150 | %{__libtoolize} | |
151 | %{__aclocal} -I m4 | |
152 | %{__autoconf} | |
153 | %{__autoheader} | |
154 | %{__automake} | |
983e9111 JB |
155 | |
156 | install -d build | |
157 | cd build | |
158 | ../%configure \ | |
159 | --disable-silent-rules \ | |
160 | --disable-test-modules \ | |
161 | --enable-python \ | |
016fc6ef | 162 | %{?with_openssl:--with-openssl} \ |
983e9111 JB |
163 | --with-rootlibdir=/%{_lib} \ |
164 | --with-xz \ | |
165 | --with-zlib | |
166 | %{__make} | |
167 | cd .. | |
168 | ||
169 | %if %{with python3} | |
170 | install -d build-py3 | |
171 | cd build-py3 | |
172 | ../%configure \ | |
173 | PYTHON=%{__python3} \ | |
223cf71b | 174 | --disable-silent-rules \ |
e9ab11f9 | 175 | --disable-test-modules \ |
87d6eac2 | 176 | --enable-python \ |
7ff317f4 | 177 | --with-rootlibdir=/%{_lib} \ |
0cbdbf08 AG |
178 | --with-xz \ |
179 | --with-zlib | |
180 | %{__make} | |
983e9111 JB |
181 | cd .. |
182 | %endif | |
0cbdbf08 | 183 | |
983e9111 JB |
184 | %if %{with tests} |
185 | %{__make} -C build check \ | |
186 | KDIR=%{_kernelsrcdir} \ | |
187 | KVER=%{_kernel_ver} | |
188 | %endif | |
bdac6c65 | 189 | |
0cbdbf08 AG |
190 | %install |
191 | rm -rf $RPM_BUILD_ROOT | |
c9f1eb7c | 192 | install -d $RPM_BUILD_ROOT{/etc,/lib}/{depmod.d,modprobe.d} |
983e9111 JB |
193 | |
194 | %if %{with python3} | |
195 | %{__make} -C build-py3 install \ | |
196 | DESTDIR=$RPM_BUILD_ROOT | |
197 | %endif | |
198 | ||
199 | %{__make} -C build install \ | |
0cbdbf08 AG |
200 | DESTDIR=$RPM_BUILD_ROOT |
201 | ||
202 | # install symlinks | |
203 | for prog in lsmod rmmod insmod modinfo modprobe depmod; do | |
7ff317f4 | 204 | ln -s kmod $RPM_BUILD_ROOT%{_bindir}/$prog |
0cbdbf08 AG |
205 | done |
206 | ||
7ff317f4 | 207 | # obsoleted by pkg-config |
223cf71b | 208 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libkmod.la |
354c802b | 209 | |
064bf341 ER |
210 | # not needed in python module |
211 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/kmod/*.la | |
212 | %py_postclean | |
983e9111 JB |
213 | %if %{with python3} |
214 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/kmod/*.la | |
215 | %endif | |
064bf341 | 216 | |
5f253112 AM |
217 | :> $RPM_BUILD_ROOT/etc/modprobe.d/modprobe.conf |
218 | ||
1904028e ER |
219 | cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/modprobe.d/blacklist.conf |
220 | cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/modprobe.d/usb.conf | |
5f253112 | 221 | |
0cbdbf08 AG |
222 | %clean |
223 | rm -rf $RPM_BUILD_ROOT | |
224 | ||
34910362 JB |
225 | %post libs -p /sbin/ldconfig |
226 | %postun libs -p /sbin/ldconfig | |
0cbdbf08 AG |
227 | |
228 | %files | |
229 | %defattr(644,root,root,755) | |
230 | %doc NEWS README TODO | |
ea202d12 AG |
231 | %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/blacklist.conf |
232 | %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/modprobe.conf | |
233 | %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/usb.conf | |
5f253112 | 234 | |
c9f1eb7c JP |
235 | %dir /etc/depmod.d |
236 | %dir /lib/depmod.d | |
983e9111 JB |
237 | %dir /lib/modprobe.d |
238 | ||
7ff317f4 JB |
239 | %attr(755,root,root) %{_bindir}/kmod |
240 | %attr(755,root,root) %{_bindir}/lsmod | |
241 | %attr(755,root,root) %{_bindir}/rmmod | |
242 | %attr(755,root,root) %{_bindir}/insmod | |
243 | %attr(755,root,root) %{_bindir}/modinfo | |
244 | %attr(755,root,root) %{_bindir}/modprobe | |
245 | %attr(755,root,root) %{_bindir}/depmod | |
0cbdbf08 | 246 | |
9d251755 AM |
247 | %{_mandir}/man5/depmod.d.5* |
248 | %{_mandir}/man5/modprobe.d.5* | |
249 | %{_mandir}/man5/modules.dep.5* | |
ea202d12 | 250 | %{_mandir}/man5/modules.dep.bin.5* |
9d251755 AM |
251 | %{_mandir}/man8/depmod.8* |
252 | %{_mandir}/man8/insmod.8* | |
c89b69e1 | 253 | %{_mandir}/man8/kmod.8* |
9d251755 AM |
254 | %{_mandir}/man8/lsmod.8* |
255 | %{_mandir}/man8/modinfo.8* | |
256 | %{_mandir}/man8/modprobe.8* | |
257 | %{_mandir}/man8/rmmod.8* | |
258 | ||
34910362 JB |
259 | %files libs |
260 | %defattr(644,root,root,755) | |
7ff317f4 JB |
261 | %attr(755,root,root) /%{_lib}/libkmod.so.*.*.* |
262 | %attr(755,root,root) %ghost /%{_lib}/libkmod.so.2 | |
34910362 | 263 | |
0cbdbf08 AG |
264 | %files devel |
265 | %defattr(644,root,root,755) | |
0af940e5 | 266 | %doc libkmod/README |
354c802b ER |
267 | %attr(755,root,root) %{_libdir}/libkmod.so |
268 | %{_includedir}/libkmod.h | |
269 | %{_pkgconfigdir}/libkmod.pc | |
34e8b922 JB |
270 | |
271 | %files -n bash-completion-kmod | |
272 | %defattr(644,root,root,755) | |
273 | %{_datadir}/bash-completion/completions/kmod | |
87d6eac2 AM |
274 | |
275 | %files -n python-kmod | |
276 | %defattr(644,root,root,755) | |
277 | %dir %{py_sitedir}/kmod | |
278 | %attr(755,root,root) %{py_sitedir}/kmod/*.so | |
064bf341 | 279 | %{py_sitedir}/kmod/*.py[co] |
983e9111 JB |
280 | |
281 | %if %{with python3} | |
282 | %files -n python3-kmod | |
283 | %defattr(644,root,root,755) | |
284 | %dir %{py3_sitedir}/kmod | |
285 | %attr(755,root,root) %{py3_sitedir}/kmod/*.so | |
286 | %{py3_sitedir}/kmod/*.py | |
287 | %{py3_sitedir}/kmod/__pycache__ | |
288 | %endif |