File udev.spec of Package udev
#
# spec file for package udev (Version 128)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: udev
Url: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html
Version: 128
Release: 13.<RELEASE3>
License: GPL v2 or later
Group: System/Kernel
Summary: A Rule-Based Device Node and Kernel Event Manager
PreReq: /bin/pidof /bin/rm /usr/bin/stat %insserv_prereq %fillup_prereq
Requires: libvolume_id1 >= 127
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: libselinux-devel
Source0: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2
Source60: boot.udev
Source61: boot.udev_retry
Source62: pnp-aliases
Patch10: udev-ieee1394-rules.patch
Patch11: volume_id-include-config.h.patch
Patch12: volume_id-hpfs.patch
Patch13: udev-net-rule-gen-fix.patch
Patch14: volume_id-larger-swap-probe.patch
Patch15: udev-escape-symlink-spaces.patch
Patch16: udev-no-scsi-timeout.patch
Patch17: udev-always-add-and-change-match.patch
Patch18: volume_id-fix-logging.patch
Patch19: udev-mdadm-3-names.patch
Patch20: udev-delete-uevent_seqnum.patch
Patch21: udev-path_id-fc.patch
Patch22: udev-s390-tape.patch
Patch23: udev-cciss.rules
Patch24: udev-path_id-sas.patch
Patch25: udev-cd-rule-gen-escape.patch
Patch26: udev-device-mapper-rules-no-paths-check
Patch27: udev-netlink-check.patch
Patch28: udev-device-mapper-rules-ignore-dm-uevent
Patch29: udev-add-scsi-timeout-to-80-drivers-rule
Patch30: udev-trigger-use-qsort
%description
udev's main task is to create and remove device nodes in /dev when a
device is discovered or removed from the system. udevd receives all
hotplug events via kernel netlink messages and dispatches them
according to rules in /lib/udev/rules.d/. Matching rules may name a
device node, create additional symlinks to the node, call tools to
initialize a device, or load needed kernel modules.
Authors:
--------
Greg Kroah-Hartman <greg@kroah.com>
Kay Sievers <Kay.Sievers@vrfy.org>
%package -n libudev-devel
License: GPL v2 only; GPL v2 or later
Summary: Development files for libudev
Group: Development/Libraries/Other
Requires: libudev0 = %{version}-%{release}
%description -n libudev-devel
This package contains the development files for the library libudev, a
dynamic library, which provides access to udev device information.
Authors:
--------
Kay Sievers <Kay.Sievers@vrfy.org>
%package -n libudev0
License: GPL v2 or later
Summary: Dynamic library to access udev device information
Requires: udev >= 120
Group: System/Libraries
%description -n libudev0
This package contains the dynamic library libudev, which provides
access to udev device information, and an interface to search devices
in sysfs.
Authors:
--------
Kay Sievers <Kay.Sievers@vrfy.org>
%package -n libvolume_id-devel
License: GPL v2 or later
Summary: Devel package for libvolume_id
Group: Development/Libraries/Other
Requires: libvolume_id1 = %{version}-%{release}
%description -n libvolume_id-devel
This is the devel package for the library libvolume_id, a dynamic
library, which contains functions to get volume ids.
Authors:
--------
Kay Sievers <Kay.Sievers@vrfy.org>
%package -n libvolume_id1
License: GPL v2 or later
Summary: Dynamic library, which contains functions to get volume ids
Group: System/Libraries
%description -n libvolume_id1
Dynamic library, to guess the type of a filesystem by searching for
known signatures, and extracting metadata like filesystem labels and
uuids.
Authors:
--------
Kay Sievers <Kay.Sievers@vrfy.org>
%prep
%setup -q
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch29 -p1
%patch30 -p1
%build
# prevent man pages from re-building (xmlto)
find . -name "*.[78]" -exec touch '{}' \;
./configure \
--prefix=/usr \
--exec-prefix= \
--sysconfdir=/etc \
--with-libdir-name=%{_lib} \
--with-selinux \
CFLAGS="$RPM_OPT_FLAGS"
make %{?jobs:-j %jobs}
%install
make DESTDIR=$RPM_BUILD_ROOT install
mkdir -p $RPM_BUILD_ROOT/usr/bin
ln -s ../../sbin/udevadm $RPM_BUILD_ROOT/usr/bin/udevinfo
ln -s udevadm $RPM_BUILD_ROOT/sbin/udevsettle
cp rules/packages/64-device-mapper.rules $RPM_BUILD_ROOT/lib/udev/rules.d/
cp rules/packages/64-md-raid.rules $RPM_BUILD_ROOT/lib/udev/rules.d/
cp rules/packages/40-zaptel.rules $RPM_BUILD_ROOT/lib/udev/rules.d/
%ifarch ppc ppc64
cp rules/packages/40-ppc.rules $RPM_BUILD_ROOT/lib/udev/rules.d/
%endif
%ifarch ia64
cp rules/packages/40-ia64.rules $RPM_BUILD_ROOT/lib/udev/rules.d/
%endif
%ifarch s390 s390x
cp rules/packages/40-s390.rules $RPM_BUILD_ROOT/lib/udev/rules.d/
%endif
# SUSE rules may overwrite any other rules
cp rules/suse/*.rules $RPM_BUILD_ROOT/lib/udev/rules.d/
install -m755 -D %{S:60} $RPM_BUILD_ROOT/etc/init.d/boot.udev
install -m755 -D %{S:61} $RPM_BUILD_ROOT/etc/init.d/boot.udev_retry
install -m644 -D %{S:62} $RPM_BUILD_ROOT/etc/modprobe.d/pnp-aliases
# install initial /dev + static devices (nodes are in the files section below)
mkdir -p $RPM_BUILD_ROOT/lib/udev/devices
mkdir -p $RPM_BUILD_ROOT/lib/udev/devices/pts
mkdir -p $RPM_BUILD_ROOT/lib/udev/devices/shm
mkdir -p $RPM_BUILD_ROOT/lib/udev/devices/net
ln -sn /proc/self/fd/ $RPM_BUILD_ROOT/lib/udev/devices/fd
ln -sn /proc/self/fd/0 $RPM_BUILD_ROOT/lib/udev/devices/stdin
ln -sn /proc/self/fd/1 $RPM_BUILD_ROOT/lib/udev/devices/stdout
ln -sn /proc/self/fd/2 $RPM_BUILD_ROOT/lib/udev/devices/stderr
ln -sn /proc/kcore $RPM_BUILD_ROOT/lib/udev/devices/core
%pre
# kill daemon if we are not in a chroot
if test -f /proc/1/exe -a -d /proc/1/root; then
if test "$(stat -Lc '%%D-%%i' /)" = "$(stat -Lc '%%D-%%i' /proc/1/root)"; then
if test -x /sbin/udevd; then
kill $(pidof udevd) >/dev/null 2>&1 || :
fi
fi
fi
%post
%{fillup_and_insserv -Y boot.udev}
%{fillup_and_insserv -Y boot.udev_retry}
# add KERNEL name match to existing persistent net rules
sed -ri '/KERNEL/ ! { s/NAME="(eth|wlan|ath)([0-9]+)"/KERNEL=="\1*", NAME="\1\2"/}' \
/etc/udev/rules.d/70-persistent-net.rules >/dev/null 2>&1 || :
# cleanup old stuff
rm -f /etc/sysconfig/udev
rm -f /etc/udev/rules.d/20-cdrom.rules
rm -f /etc/udev/rules.d/55-cdrom.rules
rm -f /etc/udev/rules.d/65-cdrom.rules
# start daemon if we are not in a chroot
if test -f /proc/1/exe -a -d /proc/1/root; then
if test "$(stat -Lc '%%D-%%i' /)" = "$(stat -Lc '%%D-%%i' /proc/1/root)"; then
if test -x /sbin/udevd; then
/sbin/udevd --daemon >/dev/null 2>&1 || :
fi
fi
fi
%postun
%insserv_cleanup
%post -n libudev0 -p /sbin/ldconfig
%postun -n libudev0 -p /sbin/ldconfig
%post -n libvolume_id1 -p /sbin/ldconfig
%postun -n libvolume_id1 -p /sbin/ldconfig
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
/sbin/udevd
/sbin/udevadm
/sbin/udevsettle
/usr/bin/udevinfo
%dir /lib/udev/
/lib/udev/ata_id
/lib/udev/cdrom_id
/lib/udev/edd_id
/lib/udev/path_id
/lib/udev/usb_id
/lib/udev/vol_id
/lib/udev/scsi_id
/lib/udev/fstab_import
/lib/udev/create_floppy_devices
/lib/udev/firmware.sh
/lib/udev/collect
/lib/udev/write_cd_rules
/lib/udev/write_net_rules
/lib/udev/rule_generator.functions
%dir /lib/udev/rules.d/
/lib/udev/rules.d/*.rules
%{_sysconfdir}/init.d/boot.udev
%{_sysconfdir}/init.d/boot.udev_retry
%dir %{_sysconfdir}/udev/
%dir %{_sysconfdir}/udev/rules.d/
%config(noreplace) %{_sysconfdir}/udev/udev.conf
%config(noreplace) %{_sysconfdir}/scsi_id.config
%dir %{_sysconfdir}/modprobe.d/
%{_sysconfdir}/modprobe.d/pnp-aliases
%{_mandir}/man?/*.[0-9]*
%doc docs/writing_udev_rules
# static devices, copied to /dev at every bootup
%dir /lib/udev/devices/
%dir /lib/udev/devices/net/
%dir /lib/udev/devices/pts/
%dir /lib/udev/devices/shm/
/lib/udev/devices/fd
/lib/udev/devices/stdin
/lib/udev/devices/stdout
/lib/udev/devices/stderr
/lib/udev/devices/core
%attr(600,root,root) %dev(c,5,1) /lib/udev/devices/console
%attr(660,root,root) %dev(c,1,11) /lib/udev/devices/kmsg
%attr(666,root,root) %dev(c,1,3) /lib/udev/devices/null
%attr(666,root,root) %dev(c,1,5) /lib/udev/devices/zero
%attr(666,root,tty) %dev(c,5,2) /lib/udev/devices/ptmx
%attr(666,root,tty) %dev(c,5,0) /lib/udev/devices/tty
%attr(620,root,tty) %dev(c,4,1) /lib/udev/devices/tty1
%attr(660,root,uucp) %dev(c,4,64) /lib/udev/devices/ttyS0
%attr(660,root,uucp) %dev(c,4,65) /lib/udev/devices/ttyS1
%attr(660,root,uucp) %dev(c,4,66) /lib/udev/devices/ttyS2
%attr(660,root,uucp) %dev(c,4,67) /lib/udev/devices/ttyS3
%attr(660,root,uucp) %dev(c,4,68) /lib/udev/devices/ttyS4
%attr(660,root,uucp) %dev(c,4,69) /lib/udev/devices/ttyS5
%attr(660,root,uucp) %dev(c,4,70) /lib/udev/devices/ttyS6
%attr(660,root,uucp) %dev(c,4,71) /lib/udev/devices/ttyS7
%ifarch ppc ppc64
%attr(660,root,uucp) %dev(c,229,0) /lib/udev/devices/hvc0
%attr(660,root,uucp) %dev(c,229,128) /lib/udev/devices/hvsi0
%attr(660,root,uucp) %dev(c,229,129) /lib/udev/devices/hvsi1
%endif
#
%attr(660,root,root) %dev(c,10,130) /lib/udev/devices/watchdog
%attr(660,root,root) %dev(c,108,0) /lib/udev/devices/ppp
%attr(666,root,root) %dev(c,10,200) /lib/udev/devices/net/tun
%attr(660,root,root) %dev(c,36,0) /lib/udev/devices/route
%attr(660,root,root) %dev(c,10,200) /lib/udev/devices/skip
%attr(660,root,root) %dev(c,10,200) /lib/udev/devices/fwmonitor
%attr(660,root,lp) %dev(c,6,0) /lib/udev/devices/lp0
%files -n libudev-devel
%defattr(-,root,root)
%{_includedir}/libudev.h
%{_libdir}/libudev.so
%{_libdir}/pkgconfig/libudev.pc
%files -n libudev0
%defattr(-,root,root)
/%{_lib}/libudev.so.*
%files -n libvolume_id-devel
%defattr(-,root,root)
%{_includedir}/libvolume_id.h
%{_libdir}/libvolume_id.so
%{_libdir}/pkgconfig/libvolume_id.pc
%files -n libvolume_id1
%defattr(-,root,root)
/%{_lib}/libvolume_id.so.*
%changelog