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