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