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