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