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