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