1 |
%define url ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug |
2 |
%define tarname %{name}-%{version} |
3 |
%define kernel_dir /usr/src/linux |
4 |
%define use_dietlibc 0 |
5 |
%define bootstrap 0 |
6 |
|
7 |
%define main_major 0 |
8 |
%define gudev_api 1.0 |
9 |
%define gudev_major 0 |
10 |
|
11 |
%define libname %mklibname %{name} %{main_major} |
12 |
%define gudev_libname %mklibname gudev %{gudev_api} %{main_major} |
13 |
%define gudev_libname_devel %mklibname gudev %{gudev_api} -d |
14 |
|
15 |
%define lib_udev_dir /lib/%{name} |
16 |
%define system_rules_dir %{lib_udev_dir}/rules.d |
17 |
%define user_rules_dir %{_sysconfdir}/%{name}/rules.d |
18 |
|
19 |
%{?_without_dietlibc: %{expand: %%global use_dietlibc 0}} |
20 |
%{?_with_dietlibc: %{expand: %%global use_dietlibc 1}} |
21 |
|
22 |
%{?_with_bootstrap: %{expand: %%global bootstrap 1}} |
23 |
%{?_without_bootstrap: %{expand: %%global bootstrap 0}} |
24 |
|
25 |
%define git_url git://git.kernel.org/pub/scm/linux/hotplug/udev.git |
26 |
|
27 |
Name: udev |
28 |
Version: 164 |
29 |
Release: %mkrel 4 |
30 |
License: GPLv2 |
31 |
Summary: A userspace implementation of devfs |
32 |
Group: System/Configuration/Hardware |
33 |
URL: %{url} |
34 |
Source0: %{url}/%{tarname}.tar.bz2 |
35 |
Source1: %{url}/%{tarname}.tar.bz2.sign |
36 |
Source2: 50-udev-mandriva.rules |
37 |
Source3: 69-printeracl.rules |
38 |
Source5: udev.sysconfig |
39 |
|
40 |
# from Fedora (keep unmodified) |
41 |
Source6: udev-post.init |
42 |
Source7: start_udev |
43 |
|
44 |
Source34: udev_import_usermap |
45 |
# from hotplug-2004_09_23 |
46 |
Source40: hotplug-usb.distmap |
47 |
Source41: hotplug-usb.handmap |
48 |
# (blino) net rules and helpers |
49 |
Source60: 76-net.rules |
50 |
Source62: udev_net_create_ifcfg |
51 |
Source63: udev_net_action |
52 |
Source64: udev_net.sysconfig |
53 |
# (hk) udev rules for zte 3g modems with drakx-net |
54 |
Source66: 61-mobile-zte-drakx-net.rules |
55 |
|
56 |
# from upstream git |
57 |
|
58 |
# from Mageia |
59 |
# disable coldplug for storage and device pci |
60 |
Patch20: udev-152-coldplug.patch |
61 |
# patches from Mandriva on Fedora's start_udev |
62 |
Patch73: udev-137-speedboot.patch |
63 |
# (bor) TODO to be removed when last STARTUP rule is fixed |
64 |
Patch78: udev-161-env_STARTUP.patch |
65 |
# (bor) use action "add" instead of "change" when retrying failed events |
66 |
Patch79: udev-161-use-add-for-retry.patch |
67 |
# (bor) udev-post should start after D-Bus |
68 |
Patch80: udev-162-udev-post_needs_dbus.patch |
69 |
|
70 |
Requires: coreutils |
71 |
Requires: setup >= 2.7.16 |
72 |
Requires: util-linux-ng >= 2.15 |
73 |
%if %use_dietlibc |
74 |
BuildRequires: dietlibc |
75 |
%endif |
76 |
BuildRequires: glibc-static-devel |
77 |
BuildRequires: libblkid-devel |
78 |
%if !%{bootstrap} |
79 |
BuildRequires: libacl-devel |
80 |
BuildRequires: glib2-devel |
81 |
BuildRequires: libusb-devel |
82 |
BuildRequires: gperf |
83 |
BuildRequires: gobject-introspection-devel >= 0.6.2 |
84 |
BuildRequires: libtool |
85 |
BuildRequires: gtk-doc |
86 |
BuildRequires: usbutils |
87 |
BuildRequires: ldetect-lst >= 0.1.283 |
88 |
Requires: ldetect-lst >= 0.1.283 |
89 |
%endif |
90 |
BuildRoot: %{_tmppath}/%{name}-%{version}-build |
91 |
Obsoletes: speedtouch eagle-usb |
92 |
Obsoletes: %{name}-tools < 125 |
93 |
Provides: %{name}-tools = %{version}-%{release} |
94 |
|
95 |
%description |
96 |
Udev is an implementation of devfs/devfsd in userspace using sysfs and |
97 |
/sbin/hotplug. It requires a 2.6 kernel to run properly. |
98 |
|
99 |
Like devfs, udev dynamically creates and removes device nodes from /dev/. |
100 |
It responds to /sbin/hotplug device events. |
101 |
|
102 |
%package doc |
103 |
Summary: Udev documentation |
104 |
Group: Books/Computer books |
105 |
%description doc |
106 |
This package contains documentation of udev. |
107 |
|
108 |
%package -n %{libname} |
109 |
Group: System/Libraries |
110 |
Summary: Library for %{name} |
111 |
License: LGPLv2+ |
112 |
%description -n %{libname} |
113 |
Library for %{name}. |
114 |
|
115 |
%package -n %{libname}-devel |
116 |
Group: Development/C |
117 |
Summary: Devel library for %{name} |
118 |
License: LGPLv2+ |
119 |
Provides: %{name}-devel = %{version}-%{release} |
120 |
Provides: lib%{name}-devel = %{version}-%{release} |
121 |
Requires: %{libname} = %{version} |
122 |
%description -n %{libname}-devel |
123 |
Devel library for %{udev}. |
124 |
|
125 |
%package -n %{gudev_libname} |
126 |
Summary: Libraries for adding libudev support to applications that use glib |
127 |
Group: System/Libraries |
128 |
License: LGPLv2+ |
129 |
Requires: %{libname} >= 142 |
130 |
Provides: libgudev = %{version}-%{release} |
131 |
|
132 |
%description -n %{gudev_libname} |
133 |
This package contains the libraries that make it easier to use libudev |
134 |
functionality from applications that use glib. |
135 |
|
136 |
%package -n %{gudev_libname_devel} |
137 |
Summary: Header files for adding libudev support to applications that use glib |
138 |
Group: Development/C |
139 |
License: LGPLv2+ |
140 |
Requires: %{libname}-devel >= 142 |
141 |
Requires: %{gudev_libname} = %{version}-%{release} |
142 |
Provides: libgudev-devel = %{version}-%{release} |
143 |
|
144 |
%description -n %{gudev_libname_devel} |
145 |
This package contains the header and pkg-config files for developing |
146 |
glib-based applications using libudev functionality. |
147 |
|
148 |
%prep |
149 |
%setup -q |
150 |
%patch20 -p1 -b .coldplug |
151 |
cp -a %{SOURCE7} . |
152 |
cp -a %{SOURCE6} . |
153 |
%patch73 -p1 -b .speedboot |
154 |
%patch78 -p1 -b .STARTUP |
155 |
%patch79 -p1 -b .action_add |
156 |
%patch80 -p1 -b .messagebus |
157 |
|
158 |
%build |
159 |
%serverbuild |
160 |
%configure2_5x \ |
161 |
--prefix=%{_prefix} \ |
162 |
--sysconfdir=%{_sysconfdir} \ |
163 |
--sbindir="/sbin" \ |
164 |
--libexecdir="%{lib_udev_dir}" \ |
165 |
--with-rootlibdir=/%{_lib} \ |
166 |
%if %{bootstrap} |
167 |
--disable-extras --disable-introspection |
168 |
%else |
169 |
--enable-extras --enable-introspection |
170 |
%endif |
171 |
|
172 |
%make |
173 |
|
174 |
%install |
175 |
rm -rf %{buildroot} |
176 |
%makeinstall_std |
177 |
|
178 |
%if %use_dietlibc |
179 |
install -d %{buildroot}%{_prefix}/lib/dietlibc/lib-%{_arch} |
180 |
%endif |
181 |
|
182 |
install -m 755 start_udev %{buildroot}/sbin/ |
183 |
|
184 |
install -m 644 %SOURCE2 %{buildroot}%{system_rules_dir}/ |
185 |
install -m 644 %SOURCE3 %{buildroot}%{system_rules_dir}/ |
186 |
|
187 |
install -d %{buildroot}%{_sysconfdir}/sysconfig |
188 |
install -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/sysconfig/udev |
189 |
|
190 |
# net rules |
191 |
install -m 0644 %SOURCE60 %{buildroot}%{system_rules_dir}/ |
192 |
install -m 0755 %SOURCE62 %{buildroot}%{lib_udev_dir}/net_create_ifcfg |
193 |
install -m 0755 %SOURCE63 %{buildroot}%{lib_udev_dir}/net_action |
194 |
install -m 0644 %SOURCE64 %{buildroot}/etc/sysconfig/udev_net |
195 |
|
196 |
mkdir -p %{buildroot}%{_sbindir} |
197 |
install -m 0755 %SOURCE34 %{buildroot}%{_sbindir} |
198 |
mkdir -p %{buildroot}%{_sysconfdir}/%{name}/agents.d/usb |
199 |
|
200 |
touch $RPM_BUILD_ROOT%{_sysconfdir}/scsi_id.config |
201 |
|
202 |
%{buildroot}%{_sbindir}/udev_import_usermap --no-driver-agent usb %{SOURCE40} %{SOURCE41} > %{buildroot}%{system_rules_dir}/70-hotplug_map.rules |
203 |
|
204 |
mkdir -p %{buildroot}%{_initrddir} |
205 |
install -m 0755 udev-post.init %{buildroot}%{_initrddir}/udev-post |
206 |
|
207 |
# (blino) usb_id are used by drakx |
208 |
ln -s ..%{lib_udev_dir}/usb_id %{buildroot}/sbin/ |
209 |
|
210 |
# udev rules for zte 3g modems and drakx-net |
211 |
install -m 0644 %SOURCE66 %{buildroot}%{system_rules_dir}/ |
212 |
|
213 |
mkdir -p %{buildroot}/lib/firmware |
214 |
|
215 |
rm -rf $RPM_BUILD_ROOT%{_docdir}/udev |
216 |
rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la |
217 |
|
218 |
# default /dev content, from Fedora RPM |
219 |
mkdir -p %{buildroot}%{lib_udev_dir}/devices/{net,hugepages,pts,shm} |
220 |
|
221 |
# From previous Mandriva /etc/udev/devices.d |
222 |
mkdir -p %{buildroot}%{lib_udev_dir}/devices/cpu/0 |
223 |
|
224 |
%clean |
225 |
rm -rf %{buildroot} |
226 |
|
227 |
%post |
228 |
%_post_service udev-post |
229 |
|
230 |
%preun |
231 |
%_preun_service udev-post |
232 |
|
233 |
%triggerun -- udev <= 164-1mnb2 |
234 |
# migrate from create_static_dev_nodes |
235 |
for i in /etc/udev/devices.d/*.nodes; do |
236 |
[ -e "$i" ] && /sbin/create_static_dev_nodes /lib/udev/devices "$i" || : |
237 |
done |
238 |
|
239 |
%files |
240 |
%defattr(0644,root,root,0755) |
241 |
%attr(0755,root,root) /sbin/udevadm |
242 |
%attr(0755,root,root) /sbin/udevd |
243 |
%attr(0755,root,root) /sbin/start_udev |
244 |
%attr(0755,root,root) %{_sbindir}/udev_import_usermap |
245 |
%attr(0755,root,root) %{_initrddir}/udev-post |
246 |
%dir %{_sysconfdir}/%{name}/agents.d |
247 |
%dir %{_sysconfdir}/%{name}/agents.d/usb |
248 |
%config(noreplace) %{_sysconfdir}/sysconfig/udev |
249 |
%config(noreplace) %{_sysconfdir}/sysconfig/udev_net |
250 |
%config(noreplace) %{_sysconfdir}/%{name}/*.conf |
251 |
%ghost %config(noreplace,missingok) %attr(0644,root,root) %{_sysconfdir}/scsi_id.config |
252 |
%dir %{system_rules_dir} |
253 |
%{system_rules_dir}/* |
254 |
%dir %{_sysconfdir}/%{name} |
255 |
%dir %{user_rules_dir} |
256 |
%{_mandir}/man7/* |
257 |
%{_mandir}/man8/* |
258 |
%dir /lib/firmware |
259 |
%dir %{lib_udev_dir} |
260 |
%attr(0755,root,root) %{lib_udev_dir}/ata_id |
261 |
%attr(0755,root,root) %{lib_udev_dir}/cdrom_id |
262 |
%attr(0755,root,root) %{lib_udev_dir}/edd_id |
263 |
%attr(0755,root,root) %{lib_udev_dir}/input_id |
264 |
%attr(0755,root,root) %{lib_udev_dir}/path_id |
265 |
%attr(0755,root,root) %{lib_udev_dir}/scsi_id |
266 |
%attr(0755,root,root) %{lib_udev_dir}/usb_id |
267 |
%attr(0755,root,root) %{lib_udev_dir}/collect |
268 |
%attr(0755,root,root) %{lib_udev_dir}/create_floppy_devices |
269 |
%attr(0755,root,root) %{lib_udev_dir}/firmware |
270 |
%attr(0755,root,root) %{lib_udev_dir}/fstab_import |
271 |
%attr(0755,root,root) %{lib_udev_dir}/rule_generator.functions |
272 |
%attr(0755,root,root) %{lib_udev_dir}/write_cd_rules |
273 |
%attr(0755,root,root) %{lib_udev_dir}/write_net_rules |
274 |
%attr(0755,root,root) %{lib_udev_dir}/net_create_ifcfg |
275 |
%attr(0755,root,root) %{lib_udev_dir}/net_action |
276 |
%attr(0755,root,root) %{lib_udev_dir}/v4l_id |
277 |
%attr(0755,root,root) %{lib_udev_dir}/mtd_probe |
278 |
%attr(0755,root,root) /sbin/usb_id |
279 |
# Default static nodes to copy to /dev on udevd start |
280 |
%dir %{lib_udev_dir}/devices |
281 |
# From Fedora RPM |
282 |
%attr(0755,root,root) %dir %{lib_udev_dir}/devices/net |
283 |
%attr(0755,root,root) %dir %{lib_udev_dir}/devices/hugepages |
284 |
%attr(0755,root,root) %dir %{lib_udev_dir}/devices/pts |
285 |
%attr(0755,root,root) %dir %{lib_udev_dir}/devices/shm |
286 |
%attr(666,root,root) %dev(c,10,200) %{lib_udev_dir}/devices/net/tun |
287 |
%attr(600,root,root) %dev(c,108,0) %{lib_udev_dir}/devices/ppp |
288 |
%attr(666,root,root) %dev(c,10,229) %{lib_udev_dir}/devices/fuse |
289 |
%attr(660,root,lp) %dev(c,6,0) %{lib_udev_dir}/devices/lp0 |
290 |
%attr(660,root,lp) %dev(c,6,1) %{lib_udev_dir}/devices/lp1 |
291 |
%attr(660,root,lp) %dev(c,6,2) %{lib_udev_dir}/devices/lp2 |
292 |
%attr(660,root,lp) %dev(c,6,3) %{lib_udev_dir}/devices/lp3 |
293 |
%attr(640,root,disk) %dev(b,7,0) %{lib_udev_dir}/devices/loop0 |
294 |
%attr(640,root,disk) %dev(b,7,1) %{lib_udev_dir}/devices/loop1 |
295 |
%attr(640,root,disk) %dev(b,7,2) %{lib_udev_dir}/devices/loop2 |
296 |
%attr(640,root,disk) %dev(b,7,3) %{lib_udev_dir}/devices/loop3 |
297 |
%attr(640,root,disk) %dev(b,7,4) %{lib_udev_dir}/devices/loop4 |
298 |
%attr(640,root,disk) %dev(b,7,5) %{lib_udev_dir}/devices/loop5 |
299 |
%attr(640,root,disk) %dev(b,7,6) %{lib_udev_dir}/devices/loop6 |
300 |
%attr(640,root,disk) %dev(b,7,7) %{lib_udev_dir}/devices/loop7 |
301 |
|
302 |
# From previous Mandriva /etc/udev/devices.d and patches |
303 |
%attr(0666,root,root) %dev(c,1,3) %{lib_udev_dir}/devices/null |
304 |
%attr(0600,root,root) %dev(b,2,0) %{lib_udev_dir}/devices/fd0 |
305 |
%attr(0600,root,root) %dev(b,2,1) %{lib_udev_dir}/devices/fd1 |
306 |
%attr(0600,root,root) %dev(c,21,0) %{lib_udev_dir}/devices/sg0 |
307 |
%attr(0600,root,root) %dev(c,21,1) %{lib_udev_dir}/devices/sg1 |
308 |
%attr(0600,root,root) %dev(c,9,0) %{lib_udev_dir}/devices/st0 |
309 |
%attr(0600,root,root) %dev(c,9,1) %{lib_udev_dir}/devices/st1 |
310 |
%attr(0600,root,root) %dev(c,99,0) %{lib_udev_dir}/devices/parport0 |
311 |
%dir %{lib_udev_dir}/devices/cpu |
312 |
%dir %{lib_udev_dir}/devices/cpu/0 |
313 |
%attr(0600,root,root) %dev(c,203,0) %{lib_udev_dir}/devices/cpu/0/cpuid |
314 |
%attr(0600,root,root) %dev(c,10,184) %{lib_udev_dir}/devices/cpu/0/microcode |
315 |
%attr(0600,root,root) %dev(c,202,0) %{lib_udev_dir}/devices/cpu/0/msr |
316 |
%attr(0600,root,root) %dev(c,162,0) %{lib_udev_dir}/devices/rawctl |
317 |
%attr(0600,root,root) %dev(c,195,0) %{lib_udev_dir}/devices/nvidia0 |
318 |
%attr(0600,root,root) %dev(c,195,255) %{lib_udev_dir}/devices/nvidiactl |
319 |
%if !%{bootstrap} |
320 |
%attr(0755,root,root) %{lib_udev_dir}/hid2hci |
321 |
%attr(0755,root,root) %{lib_udev_dir}/pci-db |
322 |
%attr(0755,root,root) %{lib_udev_dir}/usb-db |
323 |
%attr(0755,root,root) %{lib_udev_dir}/keymap |
324 |
%attr(0755,root,root) %{lib_udev_dir}/udev-acl |
325 |
%attr(0755,root,root) %{lib_udev_dir}/findkeyboards |
326 |
%attr(0755,root,root) %{lib_udev_dir}/keyboard-force-release.sh |
327 |
%attr(0755,root,root) %{lib_udev_dir}/mobile-action-modeswitch |
328 |
%dir %attr(0755,root,root) %{lib_udev_dir}/keymaps |
329 |
%attr(0755,root,root) %{lib_udev_dir}/keymaps/* |
330 |
%attr(0644,root,root) %{_prefix}/lib/ConsoleKit/run-seat.d/udev-acl.ck |
331 |
%endif |
332 |
|
333 |
%files doc |
334 |
%defattr(0644,root,root,0755) |
335 |
%doc COPYING README TODO ChangeLog NEWS extras/keymap/README.keymap.txt |
336 |
|
337 |
%files -n %{libname} |
338 |
%defattr(0644,root,root,0755) |
339 |
/%{_lib}/lib%{name}.so.%{main_major}* |
340 |
|
341 |
%files -n %{libname}-devel |
342 |
%defattr(0644,root,root,0755) |
343 |
%doc %{_datadir}/gtk-doc/html/libudev |
344 |
%{_libdir}/lib%{name}.* |
345 |
%if %use_dietlibc |
346 |
%{_prefix}/lib/dietlibc/lib-%{_arch}/lib%{name}.a |
347 |
%endif |
348 |
%{_libdir}/pkgconfig/lib%{name}.pc |
349 |
%{_datadir}/pkgconfig/udev.pc |
350 |
%{_includedir}/lib%{name}.h |
351 |
|
352 |
%if !%{bootstrap} |
353 |
%files -n %{gudev_libname} |
354 |
%defattr(0644,root,root,0755) |
355 |
/%{_lib}/libgudev-%{gudev_api}.so.%{gudev_major}* |
356 |
%{_libdir}/girepository-1.0/GUdev-%{gudev_api}.typelib |
357 |
|
358 |
%files -n %{gudev_libname_devel} |
359 |
%defattr(0644,root,root,0755) |
360 |
%doc %{_datadir}/gtk-doc/html/gudev |
361 |
%{_libdir}/libgudev-%{gudev_api}.so |
362 |
%{_includedir}/gudev-%{gudev_api} |
363 |
%{_datadir}/gir-1.0/GUdev-%{gudev_api}.gir |
364 |
%{_libdir}/pkgconfig/gudev-%{gudev_api}.pc |
365 |
%endif |
366 |
|
367 |
|