# # spec file for package kmod # # Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: kmod %define lname libkmod2 Summary: Utilities to load modules into the kernel License: LGPL-2.1+ and GPL-2.0+ Group: System/Kernel Version: 16 Release: 0 Url: http://www.jonmasters.org/blog/2011/12/20/libkmod-replaces-module-init-tools/ #Announce: https://lwn.net/Articles/577962/ #Git-Web: http://git.kernel.org/?p=utils/kernel/kmod/kmod.git;a=summary #Git-Clone: git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/kmod/%name-%version.tar.xz Source2: ftp://ftp.kernel.org/pub/linux/utils/kernel/kmod/%name-%version.tar.sign # Files that would have been added by patches 5 and 7 Source3: test-files.tar.xz Patch1: 0001-Remove-rmmod-w-documentation-and-getopt-entry.patch Patch2: 0002-modprobe-Recognize-allow-unsupported-modules-on-comm.patch Patch3: 0003-libkmod-config-Recognize-allow_unsupported_modules-i.patch Patch4: 0004-testsuite-Check-the-list-of-loaded-modules-after-a-t.patch Patch5: 0005-testsuite-Add-test-for-modprobe-force.patch Patch6: 0006-testsuite-Do-not-provide-finit_module-2-on-older-ker.patch Patch7: 0007-Add-some-tests-for-kernels-without-finit_module-2.patch Patch8: 0008-libkmod-module-Simplify-kmod_module_insert_module.patch Patch9: 0009-libkmod-Implement-filtering-of-unsupported-modules-o.patch Patch10: 0010-modprobe-Implement-allow-unsupported-modules.patch Patch11: 0001-testsuite-Fix-uname-during-glibc-startup.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool %if 0%{?suse_version} >= 1220 BuildRequires: libxslt-tools %else BuildRequires: libxslt %endif BuildRequires: pkgconfig >= 0.21 BuildRequires: xz %if 0%{?sles_version} BuildRequires: xz-devel >= 4.99 BuildRequires: zlib-devel %else BuildRequires: pkgconfig(liblzma) >= 4.99 BuildRequires: pkgconfig(zlib) %endif Requires: suse-module-tools %description kmod is a set of tools to handle common tasks with Linux kernel modules like insert, remove, list, check properties, resolve dependencies and aliases. These tools are designed on top of libkmod, a library that is shipped with kmod. The aim is to be compatible with tools, configurations and indexes from module-init-tools project. %package compat Summary: Compat symlinks for kernel module utilities License: GPL-2.0+ Group: System/Kernel Requires: kmod Obsoletes: module-init-tools < 3.16 Provides: module-init-tools = 3.16 Provides: modutils %description compat kmod is a set of tools to handle common tasks with Linux kernel modules like insert, remove, list, check properties, resolve dependencies and aliases. This package contains traditional name symlinks (lsmod, etc.) %package -n %lname Summary: Library to interact with Linux kernel modules License: LGPL-2.1+ Group: System/Libraries %description -n %lname libkmod was created to allow programs to easily insert, remove and list modules, also checking its properties, dependencies and aliases. %package -n libkmod-devel Summary: Development files for libkmod License: LGPL-2.1+ Group: Development/Libraries/C and C++ Requires: %lname = %{version} %description -n libkmod-devel libkmod was created to allow programs to easily insert, remove and list modules, also checking its properties, dependencies and aliases. This package contains the development headers for the library found in %lname. %prep %{?gpg_verify: xz -dk "%{S:0}"; %gpg_verify %{S:2}} %setup -q -a 3 %patch1 -p1 touch man/rmmod.8 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %patch6 -p1 %patch7 -p1 %patch8 -p1 %patch9 -p1 %patch10 -p1 %patch11 -p1 %build autoreconf -fi # The extra --includedir gives us the possibility to detect dependent # packages which fail to properly use pkgconfig. %configure \ %if 0%{?sles_version} zlib_CFLAGS=" " zlib_LIBS="-lz" \ %endif --with-xz \ --with-zlib \ --includedir="%_includedir/%name-%version" \ --with-rootlibdir="%_libdir" \ --bindir="%_bindir" make %{?_smp_mflags} %install b="%buildroot"; make install DESTDIR="$b"; rm -f "$b/%_libdir"/*.la mkdir -p "$b/%_libexecdir/%name" "$b/%_sbindir" "$b/sbin"; for i in depmod insmod lsmod modinfo modprobe rmmod; do # # kmod-compat and kmod-compat(usrmerge) # ln -s "%_bindir/kmod" "$b/%_sbindir/$i"; ln -s "%_bindir/kmod" "$b/sbin/$i"; # # Make symlinks also available in normal fashion, # so one can actually run it. # ln -s "%_bindir/kmod" "$b/%_libexecdir/%name/$i"; done; mkdir -p "$b/%_bindir" "$b/bin"; for i in lsmod; do ln -s "%_bindir/kmod" "$b/%_bindir/$i"; ln -s "%_bindir/kmod" "$b/bin/$i"; done; # # make mkinitrd happy # (last time checked it does not look into /usr) # mkdir -p "$b"/{bin,sbin,%_lib}; ln -s "%_bindir/kmod" "$b/bin/"; %if "%_libdir" != "/%_lib" ln -s "%_libdir/libkmod.so.2" "$b/%_lib/"; ln -s "%_libdir/libkmod.so.2.2.6" "$b/%_lib/"; %endif %check make check %post -n %lname -p /sbin/ldconfig %postun -n %lname -p /sbin/ldconfig %files %defattr(-,root,root) %_bindir/kmod %_libexecdir/%name /bin/kmod %_datadir/bash-completion/ %files -n %lname %defattr(-,root,root) %_libdir/libkmod.so.2* /%_lib/libkmod.so.2* %files -n libkmod-devel %defattr(-,root,root) %_includedir/* %_libdir/pkgconfig/libkmod.pc %_libdir/libkmod.so %files compat %defattr(-,root,root) %_bindir/lsmod %_sbindir/depmod %_sbindir/insmod %_sbindir/lsmod %_sbindir/modinfo %_sbindir/modprobe %_sbindir/rmmod # UsrMerge /bin/lsmod /sbin/depmod /sbin/insmod /sbin/lsmod /sbin/modinfo /sbin/modprobe /sbin/rmmod # EndUsrMerge %_mandir/man5/depmod.d.5* %_mandir/man5/modprobe.d.5* %_mandir/man5/modules.dep.5* %_mandir/man5/modules.dep.bin.5* %_mandir/man8/depmod.8* %_mandir/man8/insmod.8* %_mandir/man8/lsmod.8* %_mandir/man8/modinfo.8* %_mandir/man8/modprobe.8* %_mandir/man8/rmmod.8* %changelog