kmod/kmod.spec
Robert Milasan 87a9c849bd * libkmod-util: add missing stdbool.h include
- Don't assert mkdir_p, it fails on 32bit systems.
  add: dont-assert-mkdir_p.patch

OBS-URL: https://build.opensuse.org/package/show/Base:System/kmod?expand=0&rev=31
2012-06-20 13:11:38 +00:00

187 lines
4.8 KiB
RPMSpec

#
# spec file for package kmod
#
# Copyright (c) 2012 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: 9
Release: 0
Url: http://www.politreco.com/2011/12/announce-kmod-2/
#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: %name-%version.tar.xz
Source2: %name-%version.tar.sign
Patch1: kmod-so-version.diff
Patch2: dont-assert-mkdir_p.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
BuildRequires: pkgconfig >= 0.21
BuildRequires: xz
BuildRequires: pkgconfig(liblzma) >= 4.99
BuildRequires: pkgconfig(zlib)
%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
Conflicts: module-init-tools
%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
%setup -q
%patch1 -p1
%patch2 -p1
%build
autoreconf -fi
# The extra --includedir gives us the possibility to detect dependent
# packages which fail to properly use pkgconfig.
%configure \
--with-xz \
--with-zlib \
--includedir=%_includedir/%{name}-%{version} \
--with-rootlibdir=%{_libdir} \
--bindir=%{_bindir}
make %{?_smp_mflags}
%install
%make_install
rm -f %buildroot/%_libdir/*.la
# kmod-compat
#UsrMerge
mkdir -p %buildroot/bin
mkdir -p %buildroot/sbin
mkdir -p %buildroot/%_lib
ln -s %{_bindir}/kmod %buildroot/bin
ln -s %{_bindir}/kmod %buildroot/bin/lsmod
for i in depmod insmod lsmod modinfo modprobe rmmod; do
ln -s %{_bindir}/kmod %buildroot/sbin/$i
done;
ln -s %_libdir/libkmod.so.2 %buildroot/%_lib
ln -s %_libdir/libkmod.so.2.1.0 %buildroot/%_lib
#EndUsrMerge
mkdir -p %buildroot/%{_sbindir}
ln -s %{_bindir}/kmod %buildroot/%{_bindir}/lsmod
for i in depmod insmod lsmod modinfo modprobe rmmod; do
ln -s %{_bindir}/kmod %buildroot/%{_sbindir}/$i
done;
%check
make check
%post -n %lname -p /sbin/ldconfig
%postun -n %lname -p /sbin/ldconfig
%clean
%files
%defattr(-,root,root)
%{_bindir}/kmod
#UsrMerge
/bin/kmod
#EndUsrMerge
%_mandir/man5/modules.dep.bin.5*
%files -n %lname
%defattr(-,root,root)
%_libdir/libkmod.so.2*
#UsrMerge
/%_lib/libkmod.so.2*
#EndUsrMerge
%files -n libkmod-devel
%defattr(-,root,root)
%_includedir/*
%_libdir/pkgconfig/libkmod.pc
%_libdir/libkmod.so
%files compat
%defattr(-,root,root)
#UsrMerge
/bin/lsmod
/sbin/depmod
/sbin/insmod
/sbin/lsmod
/sbin/modinfo
/sbin/modprobe
/sbin/rmmod
#EndUsrMerge
%_bindir/lsmod
%_sbindir/depmod
%_sbindir/insmod
%_sbindir/lsmod
%_sbindir/modinfo
%_sbindir/modprobe
%_sbindir/rmmod
%_mandir/man5/depmod.d.5*
%_mandir/man5/modprobe.d.5*
%_mandir/man5/modules.dep.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