2 # - alias from /etc/modprobe.d/3.4.32.longterm-1/geninitrd.conf does not work for geninitrd
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
8 %bcond_without openssl # OpenSSL support for PKCS7 signatures in modinfo
9 %bcond_without python2 # CPython 2.x module
10 %bcond_without python3 # CPython 3.x module
11 %bcond_without tests # perform "make check" (init_module seems to require root for mkdir)
13 Summary: Linux kernel module handling
14 Summary(pl.UTF-8): Obsługa modułów jądra Linuksa
19 Group: Applications/System
20 Source0: https://www.kernel.org/pub/linux/utils/kernel/kmod/%{name}-%{version}.tar.xz
21 # Source0-md5: 3973a74786670d3062d89a827e266581
22 Source1: %{name}-blacklist
24 Patch0: %{name}-modprobe.d-kver.patch
25 Patch1: %{name}-depmod.d-kver.patch
26 URL: https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git
27 BuildRequires: autoconf >= 2.64
28 BuildRequires: automake >= 1:1.11
29 BuildRequires: gtk-doc >= 1.14
31 BuildRequires: kernel-module-build
33 BuildRequires: libtool >= 2:2.0
34 %{?with_openssl:BuildRequires: openssl-devel >= 1.1.0}
35 BuildRequires: pkgconfig
36 %{?with_python2:BuildRequires: python-devel >= 1:2.6}
37 %{?with_python3:BuildRequires: python3-devel >= 1:3.3}
38 %if %{with python2} || %{with python3}
39 BuildRequires: rpm-pythonprov
41 BuildRequires: rpmbuild(macros) >= 1.219
42 BuildRequires: tar >= 1:1.22
44 BuildRequires: xz-devel >= 1:4.99
45 BuildRequires: zlib-devel
46 Requires: filesystem >= 4.0-24
47 # won't work on older kernels as these do not provide require information in /sys
48 Requires: uname(release) >= 2.6.21
49 Provides: module-init-tools = 4.0
50 Provides: virtual(module-tools)
51 Obsoletes: module-init-tools < 4.0
52 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57 kmod is a set of tools to handle common tasks with Linux kernel
58 modules like insert, remove, list, check properties, resolve
59 dependencies and aliases.
61 These tools are designed on top of libkmod, a library that is shipped
62 with kmod. See libkmod/README for more details on this library and how
63 to use it. The aim is to be compatible with tools, configurations and
64 indexes from module-init-tools project.
66 %description -l pl.UTF-8
67 kmod to zestaw narzędzi do wykonywania typowych czynności związanych z
68 modułami jądra - ładowanie, usuwanie, listowanie, sprawdzanie
69 parametrów, rozwiązywanie zależności czy obsługa aliasów.
71 Narzędzia te zostały stworzone przy użyciu libkmod, biblioteki
72 dostarczanej wraz z kmod. Celem jest stworzenie narzędzi
73 kompatybilnych z programami, konfiguracją oraz indeksami z projektu
77 Summary: Linux kernel module handling library
78 Summary(pl.UTF-8): Biblioteka do obsługi modułów jądra Linuksa
84 libkmod was created to allow programs to easily insert, remove and
85 list modules, also checking its properties, dependencies and aliases.
87 %description libs -l pl.UTF-8
88 Biblioteka libkmod została zaprojektowana, aby pozwolić programom w
89 łatwy sposób ładować, usuwać i listować moduły, także sprawdzając ich
90 właściwości, zależności i aliasy.
93 Summary: Header files for %{name} library
94 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki %{name}
96 Group: Development/Libraries
97 Requires: %{name}-libs = %{version}-%{release}
98 Obsoletes: kmod-libs-static
101 Header files for %{name} library.
103 %description devel -l pl.UTF-8
104 Pliki nagłówkowe biblioteki %{name}.
106 %package -n bash-completion-kmod
107 Summary: bash-completion for kmod utilities
108 Summary(pl.UTF-8): Bashowe uzupełnianie nazw dla narzędzi kmod
109 Group: Applications/Shells
110 Requires: bash-completion >= 2.0
111 %if "%{_rpmversion}" >= "5"
115 %description -n bash-completion-kmod
116 bash-completion for kmod utilities.
118 %description -n bash-completion-kmod -l pl.UTF-8
119 Bashowe uzupełnianie nazw dla narzędzi kmod.
121 %package -n python-kmod
122 Summary: Python 2 binding for kmod API
123 Summary(pl.UTF-8): Wiązania Pythona 2 do API kmod
125 Group: Development/Languages/Python
126 Requires: %{name}-libs = %{version}-%{release}
128 %description -n python-kmod
129 Python 2 binding for kmod API.
131 %description -n python-kmod -l pl.UTF-8
132 Wiązania Pythona 2 do API kmod.
134 %package -n python3-kmod
135 Summary: Python 3 binding for kmod API
136 Summary(pl.UTF-8): Wiązania Pythona 3 do API kmod
138 Group: Development/Languages/Python
139 Requires: %{name}-libs = %{version}-%{release}
141 %description -n python3-kmod
142 Python 3 binding for kmod API.
144 %description -n python3-kmod -l pl.UTF-8
145 Wiązania Pythona 3 do API kmod.
162 --disable-silent-rules \
163 --disable-test-modules \
164 %{?with_python2:--enable-python} \
165 %{?with_openssl:--with-openssl} \
166 --with-rootlibdir=/%{_lib} \
176 PYTHON=%{__python3} \
177 --disable-silent-rules \
178 --disable-test-modules \
180 --with-rootlibdir=/%{_lib} \
188 %{__make} -C build check \
189 KDIR=%{_kernelsrcdir} \
194 rm -rf $RPM_BUILD_ROOT
195 install -d $RPM_BUILD_ROOT{/etc,/lib}/{depmod.d,modprobe.d}
198 %{__make} -C build-py3 install \
199 DESTDIR=$RPM_BUILD_ROOT
202 %{__make} -C build install \
203 DESTDIR=$RPM_BUILD_ROOT
206 for prog in lsmod rmmod insmod modinfo modprobe depmod; do
207 ln -s kmod $RPM_BUILD_ROOT%{_bindir}/$prog
210 # obsoleted by pkg-config
211 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libkmod.la
214 # not needed in python module
215 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/kmod/*.la
219 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/kmod/*.la
222 :> $RPM_BUILD_ROOT/etc/modprobe.d/modprobe.conf
224 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/modprobe.d/blacklist.conf
225 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/modprobe.d/usb.conf
228 rm -rf $RPM_BUILD_ROOT
230 %post libs -p /sbin/ldconfig
231 %postun libs -p /sbin/ldconfig
234 %defattr(644,root,root,755)
235 %doc NEWS README TODO
236 %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/blacklist.conf
237 %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/modprobe.conf
238 %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/usb.conf
244 %attr(755,root,root) %{_bindir}/kmod
245 %attr(755,root,root) %{_bindir}/lsmod
246 %attr(755,root,root) %{_bindir}/rmmod
247 %attr(755,root,root) %{_bindir}/insmod
248 %attr(755,root,root) %{_bindir}/modinfo
249 %attr(755,root,root) %{_bindir}/modprobe
250 %attr(755,root,root) %{_bindir}/depmod
252 %{_mandir}/man5/depmod.d.5*
253 %{_mandir}/man5/modprobe.d.5*
254 %{_mandir}/man5/modules.dep.5*
255 %{_mandir}/man5/modules.dep.bin.5*
256 %{_mandir}/man8/depmod.8*
257 %{_mandir}/man8/insmod.8*
258 %{_mandir}/man8/kmod.8*
259 %{_mandir}/man8/lsmod.8*
260 %{_mandir}/man8/modinfo.8*
261 %{_mandir}/man8/modprobe.8*
262 %{_mandir}/man8/rmmod.8*
265 %defattr(644,root,root,755)
266 %attr(755,root,root) /%{_lib}/libkmod.so.*.*.*
267 %attr(755,root,root) %ghost /%{_lib}/libkmod.so.2
270 %defattr(644,root,root,755)
272 %attr(755,root,root) %{_libdir}/libkmod.so
273 %{_includedir}/libkmod.h
274 %{_pkgconfigdir}/libkmod.pc
276 %files -n bash-completion-kmod
277 %defattr(644,root,root,755)
278 %{_datadir}/bash-completion/completions/kmod
281 %files -n python-kmod
282 %defattr(644,root,root,755)
283 %dir %{py_sitedir}/kmod
284 %attr(755,root,root) %{py_sitedir}/kmod/*.so
285 %{py_sitedir}/kmod/*.py[co]
289 %files -n python3-kmod
290 %defattr(644,root,root,755)
291 %dir %{py3_sitedir}/kmod
292 %attr(755,root,root) %{py3_sitedir}/kmod/*.so
293 %{py3_sitedir}/kmod/*.py
294 %{py3_sitedir}/kmod/__pycache__