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