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