1 |
%define major 2 |
%define major 2 |
2 |
%define libname %mklibname %{name} %{major} |
%define libname %mklibname %{name} %{major} |
3 |
%define develname %mklibname %{name} -d |
%define develname %mklibname %{name} -d |
4 |
|
%define tools_ver 3.16 |
5 |
|
%define tools_rel 16 |
6 |
|
|
7 |
%bcond_without dietlibc |
%bcond_without dietlibc |
8 |
|
%bcond_with tools |
9 |
|
|
10 |
Summary: Kernel modules management tools |
Summary: Kernel modules management tools |
11 |
Name: kmod |
Name: kmod |
12 |
Version: 5 |
Version: 5 |
13 |
Release: %mkrel 2 |
Release: %mkrel 2 |
14 |
Source0: http://packages.profusion.mobi/kmod/%{name}-%{version}.tar.xz |
Source0: http://packages.profusion.mobi/kmod/%{name}-%{version}.tar.xz |
15 |
|
%if %{with tools} |
16 |
|
Source1: modprobe.default |
17 |
|
Source2: modprobe.preload |
18 |
|
Source3: blacklist-mga.conf |
19 |
|
Source4: ipw-no-associate.conf |
20 |
|
# From Fedora module-init-tools package |
21 |
|
Source5: blacklist-compat.conf |
22 |
|
%endif |
23 |
# fix more headers: |
# fix more headers: |
24 |
Patch4: kmod-3-fix-diet-size_t.diff |
Patch1: kmod-3-fix-diet-size_t.diff |
25 |
|
# (cg) Upstream fixes |
26 |
|
Patch0100: 0100-libkmod-module-probe-Fix-ignore-loaded-flag-not-bein.patch |
27 |
|
Patch0101: 0101-libkmod-module-probe-fix-infinite-loop-with-softdeps.patch |
28 |
|
Patch0102: 0102-libkmod-module-don-t-treat-coming-as-in-kernel.patch |
29 |
|
|
30 |
License: GPLv2+ |
License: GPLv2+ |
31 |
Group: System/Kernel and hardware |
Group: System/Kernel and hardware |
32 |
#Url1: http://www.politreco.com/2011/12/announce-kmod-1/ |
#Url1: http://www.politreco.com/2011/12/announce-kmod-1/ |
36 |
%if %{with dietlibc} |
%if %{with dietlibc} |
37 |
BuildRequires: dietlibc-devel |
BuildRequires: dietlibc-devel |
38 |
%endif |
%endif |
39 |
|
%if %{with tools} |
40 |
|
Provides: module-init-tools = %{tools_ver}-%{tools_rel} |
41 |
|
Obsoletes: module-init-tools < %{tools_ver}-%{tools_rel} |
42 |
|
%endif |
43 |
|
|
44 |
%description |
%description |
45 |
Simple tools for managing kernel modules. |
Simple tools for managing kernel modules. |
81 |
%apply_patches |
%apply_patches |
82 |
|
|
83 |
%build |
%build |
84 |
|
%if %{with dietlibc} |
85 |
mkdir diet |
mkdir diet |
86 |
pushd diet |
pushd diet |
|
%if %{with dietlibc} |
|
87 |
CC="diet gcc" ../configure --with-zlib --with-xz --enable-static --disable-shared --disable-tools |
CC="diet gcc" ../configure --with-zlib --with-xz --enable-static --disable-shared --disable-tools |
88 |
make V=1 LD="diet ld" CC="diet cc" CFLAGS="-Os -D_BSD_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_ATFILE_SOURCE -DO_CLOEXEC=0 -g -DUINT16_MAX=65535 -DINT32_MAX=2147483647" |
make V=1 LD="diet ld" CC="diet cc" CFLAGS="-Os -D_BSD_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_ATFILE_SOURCE -DO_CLOEXEC=0 -g -DUINT16_MAX=65535 -DINT32_MAX=2147483647" |
|
%endif |
|
89 |
popd |
popd |
90 |
|
%endif |
91 |
|
|
92 |
%configure --with-zlib --with-xz |
%configure --with-zlib --with-xz |
93 |
%make |
%make |
95 |
%install |
%install |
96 |
rm -rf %{buildroot} |
rm -rf %{buildroot} |
97 |
%makeinstall_std |
%makeinstall_std |
98 |
rm -f %buildroot/%_libdir/libkmod.la |
rm -f %{buildroot}/%_libdir/libkmod.la |
99 |
|
|
100 |
|
%if %{with tools} |
101 |
|
mkdir -p %{buildroot}%{_sbindir} %{buildroot}/sbin |
102 |
|
for tool in modprobe modinfo insmod rmmod depmod lsmod; do |
103 |
|
ln -sf ../bin/kmod %{buildroot}%{_sbindir}/$tool |
104 |
|
# (cg) Provide /sbin based binaries for now in case some tools hard code path |
105 |
|
ln -sf ..%{_bindir}/kmod %{buildroot}/sbin/$tool |
106 |
|
done |
107 |
|
|
108 |
|
install -d -m755 %{buildroot}%{_sysconfdir} |
109 |
|
install -d -m755 %{buildroot}%{_sysconfdir}/depmod.d |
110 |
|
install -d -m755 %{buildroot}%{_sysconfdir}/modprobe.d/ |
111 |
|
touch %{buildroot}%{_sysconfdir}/modprobe.conf |
112 |
|
install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/modprobe.d/00_modprobe.conf |
113 |
|
install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir} |
114 |
|
install -m 644 %{SOURCE3} %{SOURCE4} %{SOURCE5} %{buildroot}%{_sysconfdir}/modprobe.d |
115 |
|
%else |
116 |
|
rm -rf %{buildroot}%{_mandir} |
117 |
|
%endif |
118 |
|
|
119 |
%if %{with dietlibc} |
%if %{with dietlibc} |
120 |
install -m644 ./diet/libkmod/.libs/libkmod.a -D %{buildroot}%{_prefix}/lib/dietlibc/lib-%{_arch}/libkmod.a |
install -m644 ./diet/libkmod/.libs/libkmod.a -D %{buildroot}%{_prefix}/lib/dietlibc/lib-%{_arch}/libkmod.a |
121 |
%endif |
%endif |
128 |
|
|
129 |
%files |
%files |
130 |
%doc NEWS |
%doc NEWS |
131 |
%_bindir/* |
%_bindir/%{name} |
132 |
|
%if %{with tools} |
133 |
|
%dir /etc/depmod.d/ |
134 |
|
%config(noreplace) %{_sysconfdir}/modprobe.preload |
135 |
|
%config(noreplace) %{_sysconfdir}/modprobe.conf |
136 |
|
%dir %{_sysconfdir}/modprobe.d/ |
137 |
|
%config(noreplace) %{_sysconfdir}/modprobe.d/*.conf |
138 |
|
%_sbindir/* |
139 |
|
/sbin/* |
140 |
%_mandir/*/* |
%_mandir/*/* |
141 |
|
%endif |
142 |
|
|
143 |
%files -n %{libname} |
%files -n %{libname} |
144 |
%_libdir/libkmod.so.%major |
%_libdir/libkmod.so.%major |