summaryrefslogtreecommitdiff
path: root/kmod.spec
diff options
context:
space:
mode:
Diffstat (limited to 'kmod.spec')
-rw-r--r--kmod.spec98
1 files changed, 98 insertions, 0 deletions
diff --git a/kmod.spec b/kmod.spec
new file mode 100644
index 0000000..a4662c6
--- /dev/null
+++ b/kmod.spec
@@ -0,0 +1,98 @@
+Name: kmod
+Version: 33
+Release: 1
+Summary: Kernel module management
+License: GPL-2.0-or-later
+URL: https://git.kernel.org/?p=utils/kernel/kmod/kmod.git;a=summary
+Source0: https://www.kernel.org/pub/linux/utils/kernel/kmod/%{name}-%{version}.tar.xz
+Source1: weak-modules
+Source2: depmod.conf.dist
+Source3: kmod.changes
+
+BuildRequires: gcc chrpath zlib-devel xz-devel scdoc openssl-devel libtool gtk-doc
+
+Provides: module-init-tools = 4.0-1
+Provides: /sbin/modprobe
+Patch0001: 0001-Module-replace-the-module-with-new-module.patch
+Patch0002: 0002-Module-suspend-the-module-by-rmmod-r-option.patch
+
+%description
+The kmod package provides several commands to manage the kernel modules,
+such as insmod to load and rmmod to unload the modules.
+
+%package libs
+Summary: Libraries to handle kernel module loading and unloading
+License: LGPL-2.1-or-later
+
+%description libs
+The kmod-libs package provides runtime libraries for any application that
+wishes to load or unload Linux kernel modules from the running system.
+
+%package devel
+Summary: Header files for kmod development
+License: LGPL-2.1-or-later
+Requires: %{name} = %{version}-%{release}
+Requires: %{name}-libs = %{version}-%{release}
+
+%description devel
+The kmod-devel package provides header files used for loading or unloading
+kernel modules.
+
+%package_help
+
+%prep
+%autosetup -n %{name}-%{version} -p1
+
+%build
+# Reinitialize libtool to remove Rpath
+autoreconf -vif
+%configure --with-openssl --with-zlib --with-xz
+%make_build
+
+%install
+%make_install
+%delete_la
+pushd $RPM_BUILD_ROOT/%{_mandir}/man5
+ln -s modprobe.d.5 modprobe.conf.5
+popd
+
+mkdir -p $RPM_BUILD_ROOT%{_sbindir}
+for i in $RPM_BUILD_ROOT%{_sbindir}/modprobe $RPM_BUILD_ROOT%{_sbindir}/modinfo $RPM_BUILD_ROOT%{_sbindir}/insmod \
+ $RPM_BUILD_ROOT%{_sbindir}/rmmod $RPM_BUILD_ROOT%{_sbindir}/depmod $RPM_BUILD_ROOT%{_sbindir}/lsmod
+do
+ ln -sf ../bin/kmod $i
+done
+
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d
+mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/modprobe.d
+mkdir -p $RPM_BUILD_ROOT/sbin
+
+install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/weak-modules
+install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf
+
+%files
+%dir %{_sysconfdir}/*.d
+%dir %{_prefix}/lib/modprobe.d
+
+%{_bindir}/kmod
+%{_sbindir}/*
+%{_datadir}/bash-completion/
+%{_sysconfdir}/depmod.d/dist.conf
+
+%files libs
+%license COPYING
+%{_libdir}/libkmod.so.*
+
+%files devel
+%{_includedir}/libkmod.h
+%{_libdir}/pkgconfig/libkmod.pc
+%{_libdir}/libkmod.so
+
+%files help
+%attr(0644,root,root) %{_mandir}/man5/*.5*
+%attr(0644,root,root) %{_mandir}/man8/*.8*
+
+%doc TODO NEWS README.md
+
+%include %{SOURCE3}