/[packages]/cauldron/kmod/current/SPECS/kmod.spec
ViewVC logotype

Contents of /cauldron/kmod/current/SPECS/kmod.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 217270 - (show annotations) (download)
Sat Mar 3 14:00:06 2012 UTC (2 years, 6 months ago) by colin
File size: 4350 byte(s)
Fix up links for modprobe and friends (only when built --with tools)
1 %define major 2
2 %define libname %mklibname %{name} %{major}
3 %define develname %mklibname %{name} -d
4 %define tools_ver 3.16
5 %define tools_rel 16
6
7 %bcond_without dietlibc
8 %bcond_with tools
9
10 Summary: Kernel modules management tools
11 Name: kmod
12 Version: 6
13 Release: %mkrel 1
14 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:
24 Patch1: kmod-3-fix-diet-size_t.diff
25
26 License: GPLv2+
27 Group: System/Kernel and hardware
28 #Url1: http://www.politreco.com/2011/12/announce-kmod-1/
29 Url: http://git.profusion.mobi/cgit.cgi/kmod.git/
30 BuildRequires: zlib-devel
31 BuildRequires: lzma-devel
32 %if %{with dietlibc}
33 BuildRequires: dietlibc-devel
34 %endif
35 %if %{with tools}
36 Provides: module-init-tools = %{tools_ver}-%{tools_rel}
37 Obsoletes: module-init-tools < %{tools_ver}-%{tools_rel}
38 %endif
39
40 %description
41 Simple tools for managing kernel modules.
42
43 %package -n %{libname}
44 Summary: Kernel modules management library
45 Group: System/Libraries
46 License: LGPLv2+
47
48 %description -n %{libname}
49 Dynamic libraries for %{name}.
50
51 The goal of the libkmod library is to offer to other programs the
52 needed flexibility and fine grained control over insertion, removal,
53 configuration and listing of kernel modules. Using the library, with
54 simple pieces of code it's possible to interact with kernel modules
55 and then there's no need to rely on other tools for that. This is a
56 thing lacking on Linux for a while and it's one of the items in the
57 Plumber's Wish List for Linux. Quoting it:
58
59 provide a proper libmodprobe.so from module-init-tools:
60 Early boot tools, installers, driver install disks want to access
61 information about available modules to optimize boot up handling.
62
63 %package -n %{develname}
64 Summary: Development files for %{name}
65 Group: Development/C
66 Requires: %{libname} = %{version}-%{release}
67 Provides: %{name}-devel = %{version}-%{release}
68 License: LGPLv2+
69
70 %description -n %{develname}
71 Development files and headers for %{name}.
72
73
74
75 %prep
76 %setup -q
77 %apply_patches
78
79 %build
80 %if %{with dietlibc}
81 mkdir diet
82 pushd diet
83 CC="diet gcc" ../configure --with-zlib --with-xz --enable-static --disable-shared --disable-tools
84 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"
85 popd
86 %endif
87
88 %configure --with-zlib --with-xz
89 %make
90
91 %install
92 rm -rf %{buildroot}
93 %makeinstall_std
94 rm -f %{buildroot}/%_libdir/libkmod.la
95
96 %if %{with tools}
97 mkdir -p %{buildroot}%{_sbindir} %{buildroot}/sbin
98 for tool in modprobe modinfo insmod rmmod depmod lsmod; do
99 # (cg) It seems the links in /usr/sbin confuse a dracut initrd build this way
100 # due to various udev rules hardcoding a /sbin/modprobe path...
101 #ln -sf ../bin/kmod %{buildroot}%{_sbindir}/$tool
102 # (cg) Provide /sbin based binaries for now in case some tools hard code path
103 ln -sf ..%{_bindir}/kmod %{buildroot}/sbin/$tool
104 done
105
106 install -d -m755 %{buildroot}%{_sysconfdir}
107 install -d -m755 %{buildroot}%{_sysconfdir}/depmod.d
108 install -d -m755 %{buildroot}%{_sysconfdir}/modprobe.d/
109 touch %{buildroot}%{_sysconfdir}/modprobe.conf
110 install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/modprobe.d/00_modprobe.conf
111 install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}
112 install -m 644 %{SOURCE3} %{SOURCE4} %{SOURCE5} %{buildroot}%{_sysconfdir}/modprobe.d
113 %else
114 rm -rf %{buildroot}%{_mandir}
115 %endif
116
117 %if %{with dietlibc}
118 install -m644 ./diet/libkmod/.libs/libkmod.a -D %{buildroot}%{_prefix}/lib/dietlibc/lib-%{_arch}/libkmod.a
119 %endif
120
121 %check
122 #make test
123
124 %clean
125 rm -rf %{buildroot}
126
127 %files
128 %doc NEWS
129 %_bindir/%{name}
130 %if %{with tools}
131 %dir /etc/depmod.d/
132 %config(noreplace) %{_sysconfdir}/modprobe.preload
133 %config(noreplace) %{_sysconfdir}/modprobe.conf
134 %dir %{_sysconfdir}/modprobe.d/
135 %config(noreplace) %{_sysconfdir}/modprobe.d/*.conf
136 #%_sbindir/*
137 /sbin/*
138 %_mandir/*/*
139 %endif
140
141 %files -n %{libname}
142 %_libdir/libkmod.so.%major
143 %_libdir/libkmod.so.%major.*
144
145 %files -n %{develname}
146 %_libdir/pkgconfig/libkmod.pc
147 %_includedir/libkmod.h
148 %_libdir/*.so
149 %if %{with dietlibc}
150 %{_prefix}/lib/dietlibc/lib-%{_arch}/libkmod.a
151 %endif
152
153

  ViewVC Help
Powered by ViewVC 1.1.15