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: 175 |
30 |
Release: %mkrel 1 |
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.asc |
37 |
Source2: 50-udev-mageia.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 |
Requires: acl |
77 |
%if %use_dietlibc |
78 |
BuildRequires: dietlibc |
79 |
%endif |
80 |
BuildRequires: glibc-static-devel |
81 |
BuildRequires: libblkid-devel |
82 |
%if %{_with_systemd} |
83 |
BuildRequires: systemd-units |
84 |
%endif |
85 |
%if !%{bootstrap} |
86 |
BuildRequires: libacl-devel |
87 |
BuildRequires: glib2-devel |
88 |
BuildRequires: libusb-devel |
89 |
BuildRequires: gperf |
90 |
BuildRequires: gobject-introspection-devel >= 0.6.2 |
91 |
BuildRequires: libtool |
92 |
BuildRequires: usbutils |
93 |
BuildRequires: kernel-source |
94 |
BuildRequires: ldetect-lst >= 0.1.283 |
95 |
Requires: ldetect-lst >= 0.1.283 |
96 |
%endif |
97 |
Obsoletes: speedtouch eagle-usb |
98 |
Obsoletes: %{name}-tools < 125 |
99 |
Provides: %{name}-tools = %{version}-%{release} |
100 |
|
101 |
%description |
102 |
Udev is an implementation of devfs/devfsd in userspace using sysfs and |
103 |
/sbin/hotplug. It requires a 2.6 kernel to run properly. |
104 |
|
105 |
Like devfs, udev dynamically creates and removes device nodes from /dev/. |
106 |
It responds to /sbin/hotplug device events. |
107 |
|
108 |
%package doc |
109 |
Summary: Udev documentation |
110 |
Group: Books/Computer books |
111 |
%description doc |
112 |
This package contains documentation of udev. |
113 |
|
114 |
%package -n %{libname} |
115 |
Group: System/Libraries |
116 |
Summary: Library for %{name} |
117 |
License: LGPLv2+ |
118 |
%description -n %{libname} |
119 |
Library for %{name}. |
120 |
|
121 |
%package -n %{libname}-devel |
122 |
Group: Development/C |
123 |
Summary: Devel library for %{name} |
124 |
License: LGPLv2+ |
125 |
Provides: %{name}-devel = %{version}-%{release} |
126 |
Provides: lib%{name}-devel = %{version}-%{release} |
127 |
Requires: %{libname} = %{version} |
128 |
%description -n %{libname}-devel |
129 |
Devel library for udev. |
130 |
|
131 |
%package -n %{gudev_libname} |
132 |
Summary: Libraries for adding libudev support to applications that use glib |
133 |
Group: System/Libraries |
134 |
License: LGPLv2+ |
135 |
Requires: %{libname} >= 142 |
136 |
Provides: libgudev = %{version}-%{release} |
137 |
|
138 |
%description -n %{gudev_libname} |
139 |
This package contains the libraries that make it easier to use libudev |
140 |
functionality from applications that use glib. |
141 |
|
142 |
%package -n %{gudev_libname_devel} |
143 |
Summary: Header files for adding libudev support to applications that use glib |
144 |
Group: Development/C |
145 |
License: LGPLv2+ |
146 |
Requires: %{libname}-devel >= 142 |
147 |
Requires: %{gudev_libname} = %{version}-%{release} |
148 |
Provides: libgudev-devel = %{version}-%{release} |
149 |
|
150 |
%description -n %{gudev_libname_devel} |
151 |
This package contains the header and pkg-config files for developing |
152 |
glib-based applications using libudev functionality. |
153 |
|
154 |
%prep |
155 |
%setup -q |
156 |
%patch20 -p1 -b .coldplug |
157 |
cp -a %{SOURCE7} . |
158 |
cp -a %{SOURCE6} . |
159 |
%patch73 -p1 -b .speedboot |
160 |
%patch78 -p1 -b .STARTUP |
161 |
%patch79 -p1 -b .action_add |
162 |
%patch80 -p1 -b .messagebus |
163 |
%patch81 -p1 -b .virtualbox_boot |
164 |
%patch0 -p1 -b .dev_sg_ACL |
165 |
|
166 |
%build |
167 |
%serverbuild |
168 |
%configure2_5x \ |
169 |
--prefix=%{_prefix} \ |
170 |
--sysconfdir=%{_sysconfdir} \ |
171 |
--sbindir="/sbin" \ |
172 |
--libexecdir="%{lib_udev_dir}" \ |
173 |
--with-rootlibdir=/%{_lib} \ |
174 |
--enable-floppy \ |
175 |
--enable-udev-acl \ |
176 |
%if !%{_with_systemd} |
177 |
--wiithout-systemdsystemunitdir \ |
178 |
%else |
179 |
--with-systemdsystemunitdir="%{_unitdir}" \ |
180 |
%endif |
181 |
%if %{bootstrap} |
182 |
--disable-introspection |
183 |
%else |
184 |
--enable-introspection |
185 |
%endif |
186 |
|
187 |
%make |
188 |
|
189 |
%install |
190 |
%makeinstall_std |
191 |
|
192 |
%if %use_dietlibc |
193 |
install -d %{buildroot}%{_prefix}/lib/dietlibc/lib-%{_arch} |
194 |
%endif |
195 |
|
196 |
install -m 755 start_udev %{buildroot}/sbin/ |
197 |
|
198 |
install -m 644 %SOURCE2 %{buildroot}%{system_rules_dir}/ |
199 |
install -m 644 %SOURCE3 %{buildroot}%{system_rules_dir}/ |
200 |
|
201 |
install -d %{buildroot}%{_sysconfdir}/sysconfig |
202 |
install -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/sysconfig/udev |
203 |
|
204 |
# net rules |
205 |
install -m 0644 %SOURCE60 %{buildroot}%{system_rules_dir}/ |
206 |
install -m 0755 %SOURCE62 %{buildroot}%{lib_udev_dir}/net_create_ifcfg |
207 |
install -m 0755 %SOURCE63 %{buildroot}%{lib_udev_dir}/net_action |
208 |
install -m 0644 %SOURCE64 %{buildroot}/etc/sysconfig/udev_net |
209 |
|
210 |
mkdir -p %{buildroot}%{_sbindir} |
211 |
install -m 0755 %SOURCE34 %{buildroot}%{_sbindir} |
212 |
mkdir -p %{buildroot}%{_sysconfdir}/%{name}/agents.d/usb |
213 |
|
214 |
touch $RPM_BUILD_ROOT%{_sysconfdir}/scsi_id.config |
215 |
|
216 |
%{buildroot}%{_sbindir}/udev_import_usermap --no-driver-agent usb %{SOURCE40} %{SOURCE41} > %{buildroot}%{system_rules_dir}/70-hotplug_map.rules |
217 |
|
218 |
mkdir -p %{buildroot}%{_initrddir} |
219 |
install -m 0755 udev-post.init %{buildroot}%{_initrddir}/udev-post |
220 |
|
221 |
%if %{_with_systemd} |
222 |
# (bor) screen initscript from systemd |
223 |
#ln -s udev-settle.service %{buildroot}/lib/systemd/system/udev-post.service |
224 |
%endif |
225 |
|
226 |
ln -s ..%{lib_udev_dir}/udevd %{buildroot}/sbin/ |
227 |
|
228 |
# udev rules for zte 3g modems and drakx-net |
229 |
install -m 0644 %SOURCE66 %{buildroot}%{system_rules_dir}/ |
230 |
|
231 |
mkdir -p %{buildroot}/lib/firmware |
232 |
|
233 |
rm -rf $RPM_BUILD_ROOT%{_docdir}/udev |
234 |
rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la |
235 |
|
236 |
# default /dev content, from Fedora RPM |
237 |
mkdir -p %{buildroot}%{lib_udev_dir}/devices/{net,hugepages,pts,shm} |
238 |
|
239 |
# From previous Mandriva /etc/udev/devices.d |
240 |
mkdir -p %{buildroot}%{lib_udev_dir}/devices/cpu/0 |
241 |
|
242 |
%post |
243 |
%_post_service udev-post |
244 |
|
245 |
%preun |
246 |
%_preun_service udev-post |
247 |
|
248 |
%triggerun -- udev <= 164-1mnb2 |
249 |
# migrate from create_static_dev_nodes |
250 |
for i in /etc/udev/devices.d/*.nodes; do |
251 |
[ -e "$i" ] && /sbin/create_static_dev_nodes /lib/udev/devices "$i" || : |
252 |
done |
253 |
|
254 |
%files |
255 |
%defattr(0644,root,root,0755) |
256 |
%attr(0755,root,root) %{lib_udev_dir}/udevd |
257 |
%attr(0755,root,root) /sbin/udevadm |
258 |
%attr(0755,root,root) /sbin/udevd |
259 |
%attr(0755,root,root) /sbin/start_udev |
260 |
%attr(0755,root,root) %{_sbindir}/udev_import_usermap |
261 |
%attr(0755,root,root) %{_initrddir}/udev-post |
262 |
%dir %{_sysconfdir}/%{name}/agents.d |
263 |
%dir %{_sysconfdir}/%{name}/agents.d/usb |
264 |
%config(noreplace) %{_sysconfdir}/sysconfig/udev |
265 |
%config(noreplace) %{_sysconfdir}/sysconfig/udev_net |
266 |
%config(noreplace) %{_sysconfdir}/%{name}/*.conf |
267 |
%ghost %config(noreplace,missingok) %attr(0644,root,root) %{_sysconfdir}/scsi_id.config |
268 |
%dir %{system_rules_dir} |
269 |
%{system_rules_dir}/* |
270 |
%dir %{_sysconfdir}/%{name} |
271 |
%dir %{user_rules_dir} |
272 |
%{_mandir}/man7/* |
273 |
%{_mandir}/man8/* |
274 |
%dir /lib/firmware |
275 |
%dir %{lib_udev_dir} |
276 |
%attr(0755,root,root) %{lib_udev_dir}/accelerometer |
277 |
%attr(0755,root,root) %{lib_udev_dir}/ata_id |
278 |
%attr(0755,root,root) %{lib_udev_dir}/cdrom_id |
279 |
%attr(0755,root,root) %{lib_udev_dir}/scsi_id |
280 |
%attr(0755,root,root) %{lib_udev_dir}/collect |
281 |
%attr(0755,root,root) %{lib_udev_dir}/create_floppy_devices |
282 |
%attr(0755,root,root) %{lib_udev_dir}/firmware |
283 |
%attr(0755,root,root) %{lib_udev_dir}/net_create_ifcfg |
284 |
%attr(0755,root,root) %{lib_udev_dir}/net_action |
285 |
%attr(0755,root,root) %{lib_udev_dir}/v4l_id |
286 |
%attr(0755,root,root) %{lib_udev_dir}/mtd_probe |
287 |
# Default static nodes to copy to /dev on udevd start |
288 |
%dir %{lib_udev_dir}/devices |
289 |
# From Fedora RPM |
290 |
%attr(0755,root,root) %dir %{lib_udev_dir}/devices/net |
291 |
%attr(0755,root,root) %dir %{lib_udev_dir}/devices/hugepages |
292 |
%attr(0755,root,root) %dir %{lib_udev_dir}/devices/pts |
293 |
%attr(0755,root,root) %dir %{lib_udev_dir}/devices/shm |
294 |
%attr(666,root,root) %dev(c,10,200) %{lib_udev_dir}/devices/net/tun |
295 |
%attr(600,root,root) %dev(c,108,0) %{lib_udev_dir}/devices/ppp |
296 |
%attr(666,root,root) %dev(c,10,229) %{lib_udev_dir}/devices/fuse |
297 |
%attr(660,root,lp) %dev(c,6,0) %{lib_udev_dir}/devices/lp0 |
298 |
%attr(660,root,lp) %dev(c,6,1) %{lib_udev_dir}/devices/lp1 |
299 |
%attr(660,root,lp) %dev(c,6,2) %{lib_udev_dir}/devices/lp2 |
300 |
%attr(660,root,lp) %dev(c,6,3) %{lib_udev_dir}/devices/lp3 |
301 |
%attr(640,root,disk) %dev(b,7,0) %{lib_udev_dir}/devices/loop0 |
302 |
%attr(640,root,disk) %dev(b,7,1) %{lib_udev_dir}/devices/loop1 |
303 |
%attr(640,root,disk) %dev(b,7,2) %{lib_udev_dir}/devices/loop2 |
304 |
%attr(640,root,disk) %dev(b,7,3) %{lib_udev_dir}/devices/loop3 |
305 |
%attr(640,root,disk) %dev(b,7,4) %{lib_udev_dir}/devices/loop4 |
306 |
%attr(640,root,disk) %dev(b,7,5) %{lib_udev_dir}/devices/loop5 |
307 |
%attr(640,root,disk) %dev(b,7,6) %{lib_udev_dir}/devices/loop6 |
308 |
%attr(640,root,disk) %dev(b,7,7) %{lib_udev_dir}/devices/loop7 |
309 |
|
310 |
# From previous Mandriva /etc/udev/devices.d and patches |
311 |
%attr(0666,root,root) %dev(c,1,3) %{lib_udev_dir}/devices/null |
312 |
%attr(0600,root,root) %dev(b,2,0) %{lib_udev_dir}/devices/fd0 |
313 |
%attr(0600,root,root) %dev(b,2,1) %{lib_udev_dir}/devices/fd1 |
314 |
%attr(0600,root,root) %dev(c,21,0) %{lib_udev_dir}/devices/sg0 |
315 |
%attr(0600,root,root) %dev(c,21,1) %{lib_udev_dir}/devices/sg1 |
316 |
%attr(0600,root,root) %dev(c,9,0) %{lib_udev_dir}/devices/st0 |
317 |
%attr(0600,root,root) %dev(c,9,1) %{lib_udev_dir}/devices/st1 |
318 |
%attr(0600,root,root) %dev(c,99,0) %{lib_udev_dir}/devices/parport0 |
319 |
%dir %{lib_udev_dir}/devices/cpu |
320 |
%dir %{lib_udev_dir}/devices/cpu/0 |
321 |
%attr(0600,root,root) %dev(c,203,0) %{lib_udev_dir}/devices/cpu/0/cpuid |
322 |
%attr(0600,root,root) %dev(c,10,184) %{lib_udev_dir}/devices/cpu/0/microcode |
323 |
%attr(0600,root,root) %dev(c,202,0) %{lib_udev_dir}/devices/cpu/0/msr |
324 |
%attr(0600,root,root) %dev(c,162,0) %{lib_udev_dir}/devices/rawctl |
325 |
%attr(0600,root,root) %dev(c,195,0) %{lib_udev_dir}/devices/nvidia0 |
326 |
%attr(0600,root,root) %dev(c,195,255) %{lib_udev_dir}/devices/nvidiactl |
327 |
%if !%{bootstrap} |
328 |
%attr(0755,root,root) %{lib_udev_dir}/pci-db |
329 |
%attr(0755,root,root) %{lib_udev_dir}/usb-db |
330 |
%attr(0755,root,root) %{lib_udev_dir}/keymap |
331 |
%attr(0755,root,root) %{lib_udev_dir}/udev-acl |
332 |
%attr(0755,root,root) %{lib_udev_dir}/findkeyboards |
333 |
%attr(0755,root,root) %{lib_udev_dir}/keyboard-force-release.sh |
334 |
%dir %attr(0755,root,root) %{lib_udev_dir}/keymaps |
335 |
%attr(0755,root,root) %{lib_udev_dir}/keymaps/* |
336 |
%attr(0644,root,root) %{_prefix}/lib/ConsoleKit/run-seat.d/udev-acl.ck |
337 |
%endif |
338 |
%if %{_with_systemd} |
339 |
/lib/systemd/system/basic.target.wants/udev-trigger.service |
340 |
/lib/systemd/system/basic.target.wants/udev.service |
341 |
/lib/systemd/system/sockets.target.wants/udev-control.socket |
342 |
/lib/systemd/system/sockets.target.wants/udev-kernel.socket |
343 |
/lib/systemd/system/udev-control.socket |
344 |
/lib/systemd/system/udev-kernel.socket |
345 |
/lib/systemd/system/udev-settle.service |
346 |
/lib/systemd/system/udev-trigger.service |
347 |
/lib/systemd/system/udev.service |
348 |
%endif |
349 |
|
350 |
%files doc |
351 |
%defattr(0644,root,root,0755) |
352 |
%doc COPYING README TODO ChangeLog NEWS extras/keymap/README.keymap.txt |
353 |
|
354 |
%files -n %{libname} |
355 |
%defattr(0644,root,root,0755) |
356 |
/%{_lib}/lib%{name}.so.%{main_major}* |
357 |
|
358 |
%files -n %{libname}-devel |
359 |
%defattr(0644,root,root,0755) |
360 |
%doc %{_datadir}/gtk-doc/html/libudev |
361 |
%{_libdir}/lib%{name}.* |
362 |
%if %use_dietlibc |
363 |
%{_prefix}/lib/dietlibc/lib-%{_arch}/lib%{name}.a |
364 |
%endif |
365 |
%{_libdir}/pkgconfig/lib%{name}.pc |
366 |
%{_datadir}/pkgconfig/udev.pc |
367 |
%{_includedir}/lib%{name}.h |
368 |
|
369 |
%if !%{bootstrap} |
370 |
%files -n %{gudev_libname} |
371 |
%defattr(0644,root,root,0755) |
372 |
/%{_lib}/libgudev-%{gudev_api}.so.%{gudev_major}* |
373 |
%{_libdir}/girepository-1.0/GUdev-%{gudev_api}.typelib |
374 |
|
375 |
%files -n %{gudev_libname_devel} |
376 |
%defattr(0644,root,root,0755) |
377 |
%doc %{_datadir}/gtk-doc/html/gudev |
378 |
%{_libdir}/libgudev-%{gudev_api}.so |
379 |
%{_includedir}/gudev-%{gudev_api} |
380 |
%{_datadir}/gir-1.0/GUdev-%{gudev_api}.gir |
381 |
%{_libdir}/pkgconfig/gudev-%{gudev_api}.pc |
382 |
%endif |