/[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 229352 - (show annotations) (download)
Fri Apr 6 19:03:42 2012 UTC (2 years, 7 months ago) by colin
File size: 4416 byte(s)
Obsolete module-init-tools
1 %define major 2
2 %define libname %mklibname %{name} %{major}
3 %define develname %mklibname %{name} -d
4
5 # (cg) Should be same version and rel + 1 as module-init-tools.
6 %define tools_ver 3.16
7 %define tools_rel 17
8
9 %bcond_without dietlibc
10 %bcond_without tools
11
12 Summary: Kernel modules management tools
13 Name: kmod
14 Version: 7
15 Release: %mkrel 2
16 Source0: http://packages.profusion.mobi/kmod/%{name}-%{version}.tar.xz
17 %if %{with tools}
18 Source1: modprobe.default
19 Source2: modprobe.preload
20 Source3: blacklist-mga.conf
21 Source4: ipw-no-associate.conf
22 # From Fedora module-init-tools package
23 Source5: blacklist-compat.conf
24 %endif
25 # fix more headers:
26 Patch1: kmod-3-fix-diet-size_t.diff
27
28 License: GPLv2+
29 Group: System/Kernel and hardware
30 #Url1: http://www.politreco.com/2011/12/announce-kmod-1/
31 Url: http://git.profusion.mobi/cgit.cgi/kmod.git/
32 BuildRequires: zlib-devel
33 BuildRequires: lzma-devel
34 %if %{with dietlibc}
35 BuildRequires: dietlibc-devel
36 %endif
37 %if %{with tools}
38 Provides: module-init-tools = %{tools_ver}-%{tools_rel}
39 Obsoletes: module-init-tools < %{tools_ver}-%{tools_rel}
40 %endif
41
42 %description
43 Simple tools for managing kernel modules.
44
45 %package -n %{libname}
46 Summary: Kernel modules management library
47 Group: System/Libraries
48 License: LGPLv2+
49
50 %description -n %{libname}
51 Dynamic libraries for %{name}.
52
53 The goal of the libkmod library is to offer to other programs the
54 needed flexibility and fine grained control over insertion, removal,
55 configuration and listing of kernel modules. Using the library, with
56 simple pieces of code it's possible to interact with kernel modules
57 and then there's no need to rely on other tools for that. This is a
58 thing lacking on Linux for a while and it's one of the items in the
59 Plumber's Wish List for Linux. Quoting it:
60
61 provide a proper libmodprobe.so from module-init-tools:
62 Early boot tools, installers, driver install disks want to access
63 information about available modules to optimize boot up handling.
64
65 %package -n %{develname}
66 Summary: Development files for %{name}
67 Group: Development/C
68 Requires: %{libname} = %{version}-%{release}
69 Provides: %{name}-devel = %{version}-%{release}
70 License: LGPLv2+
71
72 %description -n %{develname}
73 Development files and headers for %{name}.
74
75
76
77 %prep
78 %setup -q
79 %apply_patches
80
81 %build
82 %if %{with dietlibc}
83 mkdir diet
84 pushd diet
85 CC="diet gcc" ../configure --with-zlib --with-xz --enable-static --disable-shared --disable-tools
86 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"
87 popd
88 %endif
89
90 %configure --with-zlib --with-xz
91 %make
92
93 %install
94 rm -rf %{buildroot}
95 %makeinstall_std
96 rm -f %{buildroot}/%_libdir/libkmod.la
97
98 %if %{with tools}
99 mkdir -p %{buildroot}%{_sbindir} %{buildroot}/sbin
100 for tool in modprobe modinfo insmod rmmod depmod lsmod; do
101 # (cg) It seems the links in /usr/sbin confuse a dracut initrd build this way
102 # due to various udev rules hardcoding a /sbin/modprobe path...
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}
120 install -m644 ./diet/libkmod/.libs/libkmod.a -D %{buildroot}%{_prefix}/lib/dietlibc/lib-%{_arch}/libkmod.a
121 %endif
122
123 %check
124 #make test
125
126 %clean
127 rm -rf %{buildroot}
128
129 %files
130 %doc NEWS
131 %_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/*/*
141 %endif
142
143 %files -n %{libname}
144 %_libdir/libkmod.so.%major
145 %_libdir/libkmod.so.%major.*
146
147 %files -n %{develname}
148 %_libdir/pkgconfig/libkmod.pc
149 %_includedir/libkmod.h
150 %_libdir/*.so
151 %if %{with dietlibc}
152 %{_prefix}/lib/dietlibc/lib-%{_arch}/libkmod.a
153 %endif

  ViewVC Help
Powered by ViewVC 1.1.15