File udev.spec of Package udev
#
# spec file for package udev
#
# Copyright (c) 2012 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/
#
Name: udev
Url: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html
Version: 182
Release: 0
Summary: A rule-based device node and kernel event manager
License: GPL-2.0+
Group: System/Kernel
PreReq: /bin/pidof /bin/rm /usr/bin/stat %insserv_prereq %fillup_prereq /usr/sbin/groupadd /usr/bin/getent /sbin/mkinitrd
Conflicts: systemd < 39
Conflicts: aaa_base < 11.5
Conflicts: filesystem < 11.5
Conflicts: mkinitrd < 2.7.0
Conflicts: util-linux < 2.16
Conflicts: ConsoleKit < 0.4.1
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: glib2-devel
BuildRequires: gobject-introspection-devel
BuildRequires: gperf
BuildRequires: libacl-devel
BuildRequires: libblkid-devel >= 2.20
BuildRequires: libkmod-devel > 5
BuildRequires: libselinux-devel
BuildRequires: libsepol-devel
BuildRequires: libtool
BuildRequires: libusb-devel
BuildRequires: pciutils-ids
BuildRequires: pkg-config
BuildRequires: usbutils
Source0: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2
Source1: udev-rpmlintrc
Source2: baselibs.conf
Source60: boot.udev
# PATCH-FIX-OPENSUSE move-udevd-and-udevadm-back-to-sbin.patch
Patch0: move-udevd-and-udevadm-back-to-sbin.patch
# PATCH-FIX-OPENSUSE 0001-Reinstate-TIMEOUT-handling.patch
Patch1: 0001-Reinstate-TIMEOUT-handling.patch
# PATCH-FIX-UPSTREAM 0002-udev-limit-minimum-worker-count-to-16.patch
Patch2: 0002-udev-limit-minimum-worker-count-to-16.patch
# PATCH-FIX-UPSTREAM 0003-keymaps-keyboard-force-release-fix-shebang.patch
Patch3: 0003-keymaps-keyboard-force-release-fix-shebang.patch
# PATCH-FIX-UPSTREAM 0004-rules-Limit-USB-autosuspend-on-USB-HID-devices.patch
Patch4: 0004-rules-Limit-USB-autosuspend-on-USB-HID-devices.patch
# PATCH-FIX-UPSTREAM 0005-keymap-support-for-Lenovo-IdeaPad-Z570-keyboard.patch
Patch5: 0005-keymap-support-for-Lenovo-IdeaPad-Z570-keyboard.patch
# PATCH-FIX-UPSTREAM 0006-keymap-Add-Mio-N890.patch
Patch6: 0006-keymap-Add-Mio-N890.patch
# PATCH-FIX-UPSTREAM 0007-udev-path_id-add-cciss-support.patch
Patch7: 0007-udev-path_id-add-cciss-support.patch
# PATCH-FIX-UPSTREAM 0008-udev-path_id-skip-PCI-only-parents-for-block-devices.patch
Patch8: 0008-udev-path_id-skip-PCI-only-parents-for-block-devices.patch
# PATCH-FIX-UPSTREAM 0009-keymap-Add-HP-Compaq-Presario-CQ.patch
Patch9: 0009-keymap-Add-HP-Compaq-Presario-CQ.patch
# PATCH-FIX-UPSTREAM 0010-keymap-Add-Dell-XPS-force-release-quirk.patch
Patch10: 0010-keymap-Add-Dell-XPS-force-release-quirk.patch
# PATCH-FIX-UPSTREAM 0011-keymap-Add-support-for-Lenovo-v480-touchpad-toggle-h.patch
Patch11: 0011-keymap-Add-support-for-Lenovo-v480-touchpad-toggle-h.patch
# PATCH-FIX-UPSTREAM 0012-keymap-Add-Samsung-90X3A.patch
Patch12: 0012-keymap-Add-Samsung-90X3A.patch
# PATCH-FIX-OPENSUSE 0013-re-enable-by_path-links-for-ata-devices.patch
Patch13: 0013-re-enable-by_path-links-for-ata-devices.patch
# PATCH-FIX-OPENSUSE 0014-rules-create-by-id-scsi-links-for-ATA-devices.patch
Patch14: 0014-rules-create-by-id-scsi-links-for-ATA-devices.patch
# PATCH-FIX-OPENSUSE 0015-udev-secure-getenv.patch
Patch15: 0015-udev-secure-getenv.patch
# PATCH-FIX-UPSTREAM 0016-udev-ata_id-fixup-all-8-not-only-6-bytes-of-the-fw_revision.patch
Patch16: 0016-udev-ata_id-fixup-all-8-not-only-6-bytes-of-the-fw_revision.patch
# PATCH-FIX-UPSTREAM 0017-udev-add-some-O_CLOEXEC.patch
Patch17: 0017-udev-add-some-O_CLOEXEC.patch
# PATCH-FIX-UPSTREAM 0018-udev-static-nodes-fix-default-permissions-if-no-rule.patch
Patch18: 0018-udev-static-nodes-fix-default-permissions-if-no-rule.patch
# PATCH-FIX-UPSTREAM 0019-udev-path_id-export-path-for-platform-block-devices.patch
Patch19: 0019-udev-path_id-export-path-for-platform-block-devices.patch
# PATCH-FIX-UPSTREAM 0020-rules-fix-typo-in-42-usb-hid-pm.rules.patch
Patch20: 0020-rules-fix-typo-in-42-usb-hid-pm.rules.patch
# PATCH-FIX-UPSTREAM 0021-keymap-Add-Dell-Latitude-force-release-quirk.patch
Patch21: 0021-keymap-Add-Dell-Latitude-force-release-quirk.patch
# PATCH-FIX-UPSTREAM 0022-keymap-Broaden-ThinkPad-X2.-tablet-match-to-also-app.patch
Patch22: 0022-keymap-Broaden-ThinkPad-X2.-tablet-match-to-also-app.patch
# PATCH-FIX-OPENSUSE 0023-udev-fix-rules-timestamp-race.patch
Patch23: 0023-udev-fix-rules-timestamp-race.patch
# PATCH-FIX-UPSTREAM 0024-libudev-queue.c-simplified-open_queue_file.patch (drop this, needs way more work)
# Patch24: 0024-libudev-queue.c-simplified-open_queue_file.patch
# PATCH-FIX-UPSTREAM 0025-keyboard-force-release-Apply-to-all-Fujitso-AMILO-mo.patch
Patch25: 0025-keyboard-force-release-Apply-to-all-Fujitso-AMILO-mo.patch
# PATCH-FIX-OPENSUSE 0026-udev-netlink-null-rules.patch
Patch26: 0026-udev-netlink-null-rules.patch
# PATCH-FIX-OPENSUSE 0027-udev-fix-sg-autoload-regression.patch
Patch27: 0027-udev-fix-sg-autoload-regression.patch
# PATCH-FIX-UPSTREAM 0028-udev-re-initialize-builtins-in-the-daemon-process-no.patch
Patch28: 0028-udev-re-initialize-builtins-in-the-daemon-process-no.patch
# Upstream First - Policy:
# Never add any patches to this package without the upstream commit id
# in the patch. Any patches added here without a very good reason to make
# an exception will be silently removed with the next version update.
%description
Udev creates and removes device nodes in /dev for devices discovered or
removed from the system. It receives 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.
%package -n libudev0
Summary: Dynamic library to access udev device information
License: LGPL-2.1+
Group: System/Libraries
Requires: udev = %{version}-%{release}
%description -n libudev0
This package contains the dynamic library libudev, which provides
access to udev device information
%package -n libudev-devel
Summary: Development files for libudev
License: LGPL-2.1+
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.
%package -n libgudev-1_0-0
Summary: GObject library, to access udev device information
License: LGPL-2.1+
Group: System/Libraries
Requires: libudev0 = %{version}-%{release}
%description -n libgudev-1_0-0
This package contains the GObject library libgudev, which provides
access to udev device information.
%package -n typelib-1_0-GUdev-1_0
Summary: GObject library, to access udev device information -- Introspection bindings
License: LGPL-2.1+
Group: System/Libraries
%description -n typelib-1_0-GUdev-1_0
This package provides the GObject Introspection bindings for libgudev, which
provides access to udev device information.
%package -n libgudev-1_0-devel
Summary: Devel package for libgudev
License: LGPL-2.1+
Group: Development/Libraries/Other
Requires: glib2-devel
Requires: libgudev-1_0-0 = %{version}-%{release}
Requires: libudev-devel = %{version}-%{release}
Requires: typelib-1_0-GUdev-1_0 = %{version}-%{release}
%description -n libgudev-1_0-devel
This is the devel package for the GObject library libgudev, which
provides GObject access to udev device information.
%prep
%setup -q
# patching
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%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
%build
autoreconf -vfi
# prevent man pages from re-building (xmlto)
find . -name "*.[1-8]" -exec touch '{}' \;
export V=1
%configure \
--sysconfdir=%{_sysconfdir} \
--sbindir=/sbin \
--with-rootlibdir=/%{_lib} \
--libexecdir=/lib \
--docdir=%{_docdir}/udev \
--with-selinux \
--with-systemdsystemunitdir=/lib/systemd/system \
--enable-floppy \
--enable-rule_generator \
CFLAGS="$RPM_OPT_FLAGS"
make %{?_smp_mflags}
%install
make DESTDIR=$RPM_BUILD_ROOT install
rm -f $RPM_BUILD_ROOT/%{_libdir}/libudev.la
rm -f $RPM_BUILD_ROOT/%{_libdir}/libgudev-1.0.la
mkdir -p $RPM_BUILD_ROOT%{_bindir}
ln -sf ../../sbin/udevadm $RPM_BUILD_ROOT%{_bindir}/udevadm
ln -sf ../../sbin/udevd $RPM_BUILD_ROOT/lib/udev/udevd
mkdir -p $RPM_BUILD_ROOT/lib/firmware
mkdir -p $RPM_BUILD_ROOT/%{_prefix}/lib
ln -sf ../../lib/firmware $RPM_BUILD_ROOT/%{_prefix}/lib/firmware
cp -ax README NEWS $RPM_BUILD_ROOT%{_docdir}/udev
install -m755 -D %{S:60} $RPM_BUILD_ROOT/etc/init.d/boot.udev
%pre
/usr/bin/getent group tape > /dev/null 2>&1 || /usr/sbin/groupadd -r tape 2> /dev/null
# stop 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
/bin/systemctl stop udev-control.socket udev-kernel.service >/dev/null 2>&1 || :
/sbin/udevadm control --exit >/dev/null 2>&1 || :
fi
fi
%post
%{fillup_and_insserv -Y boot.udev}
# 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
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
# 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
/bin/systemctl start udev.service >/dev/null 2>&1 || :
/sbin/udevd --daemon >/dev/null 2>&1 || :
fi
fi
[ -x /sbin/mkinitrd_setup ] && /sbin/mkinitrd_setup
if [ -e /var/lib/no_initrd_recreation_by_suspend ]; then
echo "Skipping recreation of existing initial ramdisks, due"
echo "to presence of /var/lib/no_initrd_recreation_by_suspend"
elif [ -x /sbin/mkinitrd ]; then
/sbin/mkinitrd
fi
%postun
%insserv_cleanup
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
[ -x /sbin/mkinitrd_setup ] && /sbin/mkinitrd_setup
if [ -e /var/lib/no_initrd_recreation_by_suspend ]; then
echo "Skipping recreation of existing initial ramdisks, due"
echo "to presence of /var/lib/no_initrd_recreation_by_suspend"
elif [ -x /sbin/mkinitrd ]; then
/sbin/mkinitrd
fi
%post -n libudev0 -p /sbin/ldconfig
%postun -n libudev0 -p /sbin/ldconfig
%post -n libgudev-1_0-0 -p /sbin/ldconfig
%postun -n libgudev-1_0-0 -p /sbin/ldconfig
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
/sbin/udevd
/sbin/udevadm
%dir %{_bindir}
%{_bindir}/udevadm
%dir /usr/lib/firmware/
%dir /lib/udev/
/lib/udev/*
%dir /lib/udev/keymaps
/lib/udev/keymaps/*
/lib/udev/keyboard-force-release.sh
%dir /lib/udev/rules.d/
/lib/udev/rules.d/*.rules
%{_sysconfdir}/init.d/boot.udev
%dir %{_sysconfdir}/udev/
%dir %{_sysconfdir}/udev/rules.d/
%config(noreplace) %{_sysconfdir}/udev/udev.conf
%{_mandir}/man?/*.[0-9]*
%doc %{_docdir}/udev
%dir /lib/udev/devices/
%dir /lib/systemd/system
/lib/systemd/system/udev*.service
/lib/systemd/system/udev*.socket
%dir /lib/systemd/system/basic.target.wants
/lib/systemd/system/basic.target.wants/udev*.service
%dir /lib/systemd/system/sockets.target.wants
/lib/systemd/system/sockets.target.wants/udev*.socket
%files -n libudev0
%defattr(-,root,root)
/%{_lib}/libudev.so.*
%files -n libudev-devel
%defattr(-,root,root)
%{_includedir}/libudev.h
%{_libdir}/libudev.so
%{_datadir}/pkgconfig/udev.pc
%{_libdir}/pkgconfig/libudev.pc
%dir %{_datadir}/gtk-doc
%dir %{_datadir}/gtk-doc/html
%dir %{_datadir}/gtk-doc/html/libudev
%{_datadir}/gtk-doc/html/libudev/*
%files -n libgudev-1_0-0
%defattr(-,root,root)
/%{_lib}/libgudev-1.0.so.*
%files -n typelib-1_0-GUdev-1_0
%defattr(-,root,root)
%{_libdir}/girepository-1.0/GUdev-1.0.typelib
%files -n libgudev-1_0-devel
%defattr(-,root,root)
%dir %{_includedir}/gudev-1.0
%dir %{_includedir}/gudev-1.0/gudev
%{_includedir}/gudev-1.0/gudev/*.h
%{_libdir}/libgudev-1.0.so
%{_libdir}/pkgconfig/gudev-1.0.pc
%dir %{_datadir}/gtk-doc
%dir %{_datadir}/gtk-doc/html
%dir %{_datadir}/gtk-doc/html/gudev
%{_datadir}/gtk-doc/html/gudev/*
%{_datadir}/gir-1.0/GUdev-1.0.gir
%changelog