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 |
Release: %mkrel 2 |
31 |
License: GPLv2 |
32 |
Summary: A userspace implementation of devfs |
33 |
Group: System/Configuration/Hardware |
34 |
URL: %{url} |
35 |
Source0: %{url}/%{tarname}.tar.bz2 |
36 |
Source1: %{url}/%{tarname}.tar.bz2.sign |
37 |
Source2: 50-udev-mandriva.rules |
38 |
Source3: 69-printeracl.rules |
39 |
Source5: udev.sysconfig |
40 |
|
41 |
# from Fedora (keep unmodified) |
42 |
Source6: udev-post.init |
43 |
Source7: start_udev |
44 |
|
45 |
Source34: udev_import_usermap |
46 |
# from hotplug-2004_09_23 |
47 |
Source40: hotplug-usb.distmap |
48 |
Source41: hotplug-usb.handmap |
49 |
# (blino) net rules and helpers |
50 |
Source60: 76-net.rules |
51 |
Source62: udev_net_create_ifcfg |
52 |
Source63: udev_net_action |
53 |
Source64: udev_net.sysconfig |
54 |
# (hk) udev rules for zte 3g modems with drakx-net |
55 |
Source66: 61-mobile-zte-drakx-net.rules |
56 |
# allow to boot from live cd in virtualbox |
57 |
Patch81: udev-162-VirtualBox-boot-fix.patch |
58 |
# from upstream git |
59 |
Patch0: udev-173-dev-sg-ACL.patch |
60 |
|
61 |
# from Mageia |
62 |
# disable coldplug for storage and device pci |
63 |
Patch20: udev-152-coldplug.patch |
64 |
# patches from Mandriva on Fedora's start_udev |
65 |
Patch73: udev-137-speedboot.patch |
66 |
# (bor) TODO to be removed when last STARTUP rule is fixed |
67 |
Patch78: udev-161-env_STARTUP.patch |
68 |
# (bor) use action "add" instead of "change" when retrying failed events |
69 |
Patch79: udev-161-use-add-for-retry.patch |
70 |
# (bor) udev-post should start after D-Bus |
71 |
Patch80: udev-162-udev-post_needs_dbus.patch |
72 |
|
73 |
Requires: coreutils |
74 |
Requires: setup >= 2.7.16 |
75 |
Requires: util-linux-ng >= 2.15 |
76 |
%if %use_dietlibc |
77 |
BuildRequires: dietlibc |
78 |
%endif |
79 |
BuildRequires: glibc-static-devel |
80 |
BuildRequires: libblkid-devel |
81 |
%if %{_with_systemd} |
82 |
BuildRequires: systemd-units |
83 |
%endif |
84 |
%if !%{bootstrap} |
85 |
BuildRequires: libacl-devel |
86 |
BuildRequires: glib2-devel |
87 |
BuildRequires: libusb-devel |
88 |
BuildRequires: gperf |
89 |
BuildRequires: gobject-introspection-devel >= 0.6.2 |
90 |
BuildRequires: libtool |
91 |
BuildRequires: usbutils |
92 |
BuildRequires: kernel-source |
93 |
BuildRequires: ldetect-lst >= 0.1.283 |
94 |
Requires: ldetect-lst >= 0.1.283 |
95 |
%endif |
96 |
Obsoletes: speedtouch eagle-usb |
97 |
Obsoletes: %{name}-tools < 125 |
98 |
Provides: %{name}-tools = %{version}-%{release} |
99 |
|
100 |
%description |
101 |
Udev is an implementation of devfs/devfsd in userspace using sysfs and |
102 |
/sbin/hotplug. It requires a 2.6 kernel to run properly. |
103 |
|
104 |
Like devfs, udev dynamically creates and removes device nodes from /dev/. |
105 |
It responds to /sbin/hotplug device events. |
106 |
|
107 |
%package doc |
108 |
Summary: Udev documentation |
109 |
Group: Books/Computer books |
110 |
%description doc |
111 |
This package contains documentation of udev. |
112 |
|
113 |
%package -n %{libname} |
114 |
Group: System/Libraries |
115 |
Summary: Library for %{name} |
116 |
License: LGPLv2+ |
117 |
%description -n %{libname} |
118 |
Library for %{name}. |
119 |
|
120 |
%package -n %{libname}-devel |
121 |
Group: Development/C |
122 |
Summary: Devel library for %{name} |
123 |
License: LGPLv2+ |
124 |
Provides: %{name}-devel = %{version}-%{release} |
125 |
Provides: lib%{name}-devel = %{version}-%{release} |
126 |
Requires: %{libname} = %{version} |
127 |
%description -n %{libname}-devel |
128 |
Devel library for udev. |
129 |
|
130 |
%package -n %{gudev_libname} |
131 |
Summary: Libraries for adding libudev support to applications that use glib |
132 |
Group: System/Libraries |
133 |
License: LGPLv2+ |
134 |
Requires: %{libname} >= 142 |
135 |
Provides: libgudev = %{version}-%{release} |
136 |
|
137 |
%description -n %{gudev_libname} |
138 |
This package contains the libraries that make it easier to use libudev |
139 |
functionality from applications that use glib. |
140 |
|
141 |
%package -n %{gudev_libname_devel} |
142 |
Summary: Header files for adding libudev support to applications that use glib |
143 |
Group: Development/C |
144 |
License: LGPLv2+ |
145 |
Requires: %{libname}-devel >= 142 |
146 |
Requires: %{gudev_libname} = %{version}-%{release} |
147 |
Provides: libgudev-devel = %{version}-%{release} |
148 |
|
149 |
%description -n %{gudev_libname_devel} |
150 |
This package contains the header and pkg-config files for developing |
151 |
glib-based applications using libudev functionality. |
152 |
|
153 |
%prep |
154 |
%setup -q |
155 |
%patch20 -p1 -b .coldplug |
156 |
cp -a %{SOURCE7} . |
157 |
cp -a %{SOURCE6} . |
158 |
%patch73 -p1 -b .speedboot |
159 |
%patch78 -p1 -b .STARTUP |
160 |
%patch79 -p1 -b .action_add |
161 |
%patch80 -p1 -b .messagebus |
162 |
%patch81 -p1 -b .virtualbox_boot |
163 |
%patch0 -p1 -b .dev_sg_ACL |
164 |
|
165 |
%build |
166 |
%serverbuild |
167 |
%configure2_5x \ |
168 |
--prefix=%{_prefix} \ |
169 |
--sysconfdir=%{_sysconfdir} \ |
170 |
--sbindir="/sbin" \ |
171 |
--libexecdir="%{lib_udev_dir}" \ |
172 |
--with-rootlibdir=/%{_lib} \ |
173 |
--enable-floppy \ |
174 |
--enable-udev-acl \ |
175 |
%if !%{_with_systemd} |
176 |
--without-systemdsystemunitdir \ |
177 |
%endif |
178 |
%if %{bootstrap} |
179 |
--disable-introspection |
180 |
%else |
181 |
--enable-introspection |
182 |
%endif |
183 |
|
184 |
%make |
185 |
|
186 |
%install |
187 |
rm -rf %{buildroot} |
188 |
%makeinstall_std |
189 |
|
190 |
%if %use_dietlibc |
191 |
install -d %{buildroot}%{_prefix}/lib/dietlibc/lib-%{_arch} |
192 |
%endif |
193 |
|
194 |
install -m 755 start_udev %{buildroot}/sbin/ |
195 |
|
196 |
install -m 644 %SOURCE2 %{buildroot}%{system_rules_dir}/ |
197 |
install -m 644 %SOURCE3 %{buildroot}%{system_rules_dir}/ |
198 |
|
199 |
install -d %{buildroot}%{_sysconfdir}/sysconfig |
200 |
install -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/sysconfig/udev |
201 |
|
202 |
# net rules |
203 |
install -m 0644 %SOURCE60 %{buildroot}%{system_rules_dir}/ |
204 |
install -m 0755 %SOURCE62 %{buildroot}%{lib_udev_dir}/net_create_ifcfg |
205 |
install -m 0755 %SOURCE63 %{buildroot}%{lib_udev_dir}/net_action |
206 |
install -m 0644 %SOURCE64 %{buildroot}/etc/sysconfig/udev_net |
207 |
|
208 |
mkdir -p %{buildroot}%{_sbindir} |
209 |
install -m 0755 %SOURCE34 %{buildroot}%{_sbindir} |
210 |
mkdir -p %{buildroot}%{_sysconfdir}/%{name}/agents.d/usb |
211 |
|
212 |
touch $RPM_BUILD_ROOT%{_sysconfdir}/scsi_id.config |
213 |
|
214 |
%{buildroot}%{_sbindir}/udev_import_usermap --no-driver-agent usb %{SOURCE40} %{SOURCE41} > %{buildroot}%{system_rules_dir}/70-hotplug_map.rules |
215 |
|
216 |
mkdir -p %{buildroot}%{_initrddir} |
217 |
install -m 0755 udev-post.init %{buildroot}%{_initrddir}/udev-post |
218 |
|
219 |
%if %{_with_systemd} |
220 |
# (bor) screen initscript from systemd |
221 |
ln -s udev-settle.service %{buildroot}/lib/systemd/system/udev-post.service |
222 |
%endif |
223 |
|
224 |
# (blino) usb_id are used by drakx |
225 |
ln -s ..%{lib_udev_dir}/usb_id %{buildroot}/sbin/ |
226 |
|
227 |
# udev rules for zte 3g modems and drakx-net |
228 |
install -m 0644 %SOURCE66 %{buildroot}%{system_rules_dir}/ |
229 |
|
230 |
mkdir -p %{buildroot}/lib/firmware |
231 |
|
232 |
rm -rf $RPM_BUILD_ROOT%{_docdir}/udev |
233 |
rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la |
234 |
|
235 |
# default /dev content, from Fedora RPM |
236 |
mkdir -p %{buildroot}%{lib_udev_dir}/devices/{net,hugepages,pts,shm} |
237 |
|
238 |
# From previous Mandriva /etc/udev/devices.d |
239 |
mkdir -p %{buildroot}%{lib_udev_dir}/devices/cpu/0 |
240 |
|
241 |
%clean |
242 |
rm -rf %{buildroot} |
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 |
%attr(0755,root,root) %{lib_udev_dir}/udev-acl |
340 |
%attr(0755,root,root) %{lib_udev_dir}/findkeyboards |
341 |
%attr(0755,root,root) %{lib_udev_dir}/keyboard-force-release.sh |
342 |
%dir %attr(0755,root,root) %{lib_udev_dir}/keymaps |
343 |
%attr(0755,root,root) %{lib_udev_dir}/keymaps/* |
344 |
%attr(0644,root,root) %{_prefix}/lib/ConsoleKit/run-seat.d/udev-acl.ck |
345 |
%endif |
346 |
%if %{_with_systemd} |
347 |
/lib/systemd/system/basic.target.wants/udev-trigger.service |
348 |
/lib/systemd/system/basic.target.wants/udev.service |
349 |
/lib/systemd/system/sockets.target.wants/udev-control.socket |
350 |
/lib/systemd/system/sockets.target.wants/udev-kernel.socket |
351 |
/lib/systemd/system/udev-control.socket |
352 |
/lib/systemd/system/udev-kernel.socket |
353 |
/lib/systemd/system/udev-post.service |
354 |
/lib/systemd/system/udev-settle.service |
355 |
/lib/systemd/system/udev-trigger.service |
356 |
/lib/systemd/system/udev.service |
357 |
%endif |
358 |
|
359 |
%files doc |
360 |
%defattr(0644,root,root,0755) |
361 |
%doc COPYING README TODO ChangeLog NEWS extras/keymap/README.keymap.txt |
362 |
|
363 |
%files -n %{libname} |
364 |
%defattr(0644,root,root,0755) |
365 |
/%{_lib}/lib%{name}.so.%{main_major}* |
366 |
|
367 |
%files -n %{libname}-devel |
368 |
%defattr(0644,root,root,0755) |
369 |
%doc %{_datadir}/gtk-doc/html/libudev |
370 |
%{_libdir}/lib%{name}.* |
371 |
%if %use_dietlibc |
372 |
%{_prefix}/lib/dietlibc/lib-%{_arch}/lib%{name}.a |
373 |
%endif |
374 |
%{_libdir}/pkgconfig/lib%{name}.pc |
375 |
%{_datadir}/pkgconfig/udev.pc |
376 |
%{_includedir}/lib%{name}.h |
377 |
|
378 |
%if !%{bootstrap} |
379 |
%files -n %{gudev_libname} |
380 |
%defattr(0644,root,root,0755) |
381 |
/%{_lib}/libgudev-%{gudev_api}.so.%{gudev_major}* |
382 |
%{_libdir}/girepository-1.0/GUdev-%{gudev_api}.typelib |
383 |
|
384 |
%files -n %{gudev_libname_devel} |
385 |
%defattr(0644,root,root,0755) |
386 |
%doc %{_datadir}/gtk-doc/html/gudev |
387 |
%{_libdir}/libgudev-%{gudev_api}.so |
388 |
%{_includedir}/gudev-%{gudev_api} |
389 |
%{_datadir}/gir-1.0/GUdev-%{gudev_api}.gir |
390 |
%{_libdir}/pkgconfig/gudev-%{gudev_api}.pc |
391 |
%endif |