summaryrefslogtreecommitdiff
path: root/packaging/kmod.spec
blob: cd358d3e629d1780bdf19b1edd94ff5f8e8c30b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
Name:           kmod
Version:        12
Release:        0
License:        LGPL-2.1+ and GPL-2.0+
Summary:        Utilities to load modules into the kernel
Url:            http://www.politreco.com/2011/12/announce-kmod-2/
Group:          Base/Libraries

Source:         %{name}-%{version}.tar.xz
Source1001: 	kmod.manifest
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
License:        GPL-2.0+
Summary:        Compat symlinks for kernel module utilities
Group:          Base/Libraries
Requires:       kmod
Requires(pre):	filesystem
Provides:       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 libkmod
License:        LGPL-2.1+
Summary:        Library to interact with Linux kernel modules
Group:          Base/Libraries

%description -n libkmod
libkmod was created to allow programs to easily insert, remove and
list modules, also checking its properties, dependencies and aliases.

%package -n libkmod-devel
License:        LGPL-2.1+
Summary:        Development files for libkmod
Group:          Development/Libraries
Requires:       libkmod = %{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 libkmod.

%prep
%setup -q
cp %{SOURCE1001} .

%build
autoreconf -fi
# The extra --includedir gives us the possibility to detect dependent
# packages which fail to properly use pkgconfig.
%configure \
   --with-xz \
   --disable-manpages \
   --with-zlib \
   --includedir=%{_includedir}/%{name}-%{version} \
   --with-rootlibdir=%{_libdir} \
   --bindir=%{_bindir}
make %{?_smp_mflags}

%check
make check

%install
%make_install

# kmod-compat
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;


%post -n libkmod -p /sbin/ldconfig

%postun -n libkmod -p /sbin/ldconfig

%docs_package

%files
%manifest %{name}.manifest
%defattr(-,root,root)
%license COPYING
%{_bindir}/kmod

%files -n libkmod
%manifest %{name}.manifest
%defattr(-,root,root)
%{_libdir}/libkmod.so.2*

%files -n libkmod-devel
%manifest %{name}.manifest
%defattr(-,root,root)
%{_includedir}/*
%{_libdir}/pkgconfig/libkmod.pc
%{_libdir}/libkmod.so

%files compat
%manifest %{name}.manifest
%defattr(-,root,root)
%{_bindir}/lsmod
%{_sbindir}/depmod
%{_sbindir}/insmod
%{_sbindir}/lsmod
%{_sbindir}/modinfo
%{_sbindir}/modprobe
%{_sbindir}/rmmod

%changelog