/[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 - (hide annotations) (download)
Sat Mar 3 14:00:06 2012 UTC (2 years, 4 months ago) by colin
File size: 4350 byte(s)
Fix up links for modprobe and friends (only when built --with tools)
1 tmb 205901 %define major 2
2 tv 195808 %define libname %mklibname %{name} %{major}
3 tv 195807 %define develname %mklibname %{name} -d
4 colin 215663 %define tools_ver 3.16
5     %define tools_rel 16
6 tv 183406
7 tv 195778 %bcond_without dietlibc
8 colin 215663 %bcond_with tools
9 tv 195778
10 tv 183406 Summary: Kernel modules management tools
11     Name: kmod
12 tmb 217195 Version: 6
13     Release: %mkrel 1
14 tmb 187109 Source0: http://packages.profusion.mobi/kmod/%{name}-%{version}.tar.xz
15 colin 215663 %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 tv 195778 # fix more headers:
24 colin 215663 Patch1: kmod-3-fix-diet-size_t.diff
25    
26 tv 183406 License: GPLv2+
27     Group: System/Kernel and hardware
28 tv 183409 #Url1: http://www.politreco.com/2011/12/announce-kmod-1/
29 tv 183406 Url: http://git.profusion.mobi/cgit.cgi/kmod.git/
30 tv 190165 BuildRequires: zlib-devel
31 tv 192235 BuildRequires: lzma-devel
32 tv 195778 %if %{with dietlibc}
33     BuildRequires: dietlibc-devel
34     %endif
35 colin 215663 %if %{with tools}
36     Provides: module-init-tools = %{tools_ver}-%{tools_rel}
37     Obsoletes: module-init-tools < %{tools_ver}-%{tools_rel}
38     %endif
39 tv 183406
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 tv 183408 License: LGPLv2+
47 tv 183406
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 tv 183408 License: LGPLv2+
69 tv 183406
70     %description -n %{develname}
71     Development files and headers for %{name}.
72    
73    
74    
75     %prep
76     %setup -q
77 tv 195786 %apply_patches
78 tv 183406
79     %build
80 colin 215663 %if %{with dietlibc}
81 tv 195778 mkdir diet
82     pushd diet
83 tv 196476 CC="diet gcc" ../configure --with-zlib --with-xz --enable-static --disable-shared --disable-tools
84 tv 195778 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 colin 215663 popd
86 tv 195778 %endif
87    
88 tv 195771 %configure --with-zlib --with-xz
89 tv 183406 %make
90    
91     %install
92     rm -rf %{buildroot}
93     %makeinstall_std
94 colin 215663 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 colin 217270 # (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 colin 215663 # (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 tv 195778 %if %{with dietlibc}
118     install -m644 ./diet/libkmod/.libs/libkmod.a -D %{buildroot}%{_prefix}/lib/dietlibc/lib-%{_arch}/libkmod.a
119     %endif
120 tv 183406
121 tv 195773 %check
122 tmb 205901 #make test
123 tv 195773
124 tv 183406 %clean
125     rm -rf %{buildroot}
126    
127     %files
128 tv 198465 %doc NEWS
129 colin 215663 %_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 colin 217270 #%_sbindir/*
137 colin 215663 /sbin/*
138 tv 197530 %_mandir/*/*
139 colin 215663 %endif
140 tv 183406
141     %files -n %{libname}
142     %_libdir/libkmod.so.%major
143     %_libdir/libkmod.so.%major.*
144    
145     %files -n %{develname}
146 tmb 187113 %_libdir/pkgconfig/libkmod.pc
147 tv 183406 %_includedir/libkmod.h
148     %_libdir/*.so
149 tv 195778 %if %{with dietlibc}
150     %{_prefix}/lib/dietlibc/lib-%{_arch}/libkmod.a
151     %endif
152 tv 183406
153    

  ViewVC Help
Powered by ViewVC 1.1.15