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