File udev.spec of Package udev.openSUSE_12.1_Update
#
# spec file for package udev
#
# Copyright (c) 2013 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: 173
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 < 28
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: glib2-devel
BuildRequires: gobject-introspection-devel
BuildRequires: gperf
BuildRequires: libacl-devel
BuildRequires: libselinux-devel
BuildRequires: libsepol-devel
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
Source61: write_dev_root_rule
Source62: udev-root-symlink.systemd
# Patch from upstream to make bluetooth input devices working again.
Patch1: udev.git-617746e09795575c6258dd075ee7f0a44ce61e1e.patch
# PATCH-FIX-UPSTREAM bnc#722858
Patch2: udev.git-7944a13a2b8516d5fa354703789f5988cb4299b6.patch
# PATCH-FIX-UPSTREAM bnc#738604
Patch3: prevent-segfault-in-slow-clocks.patch
# PATCH-FIX-UPSTREAM udevd-add-missing-to-getopt_long-e.patch
Patch4: udevd-add-missing-to-getopt_long-e.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 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}
%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
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%build
# 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/udev \
--docdir=%{_docdir}/udev \
--with-selinux \
--with-systemdsystemunitdir=/lib/systemd/system \
--enable-floppy \
--enable-udev_acl \
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
cp -ax README $RPM_BUILD_ROOT%{_docdir}/udev
%ifarch ppc ppc64
cp rules/arch/40-ppc.rules $RPM_BUILD_ROOT/lib/udev/rules.d/
%endif
%ifarch ia64
cp rules/arch/40-ia64.rules $RPM_BUILD_ROOT/lib/udev/rules.d/
%endif
%ifarch s390 s390x
cp rules/arch/40-s390.rules $RPM_BUILD_ROOT/lib/udev/rules.d/
%endif
install -m755 -D %{S:60} $RPM_BUILD_ROOT/etc/init.d/boot.udev
install -m755 -D %{S:61} $RPM_BUILD_ROOT/lib/udev/write_dev_root_rule
install -m644 -D %{S:62} $RPM_BUILD_ROOT/lib/systemd/system/udev-root-symlink.service
mkdir -p $RPM_BUILD_ROOT/lib/systemd/system/basic.target.wants
ln -sf ../udev-root-symlink.service $RPM_BUILD_ROOT/lib/systemd/system/basic.target.wants
%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
if [ "${YAST_IS_RUNNING}" != "instsys" ]; then
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
[ -x /sbin/mkinitrd_setup ] && /sbin/mkinitrd_setup
/sbin/mkinitrd || :
fi
fi
%postun
%insserv_cleanup
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ "${YAST_IS_RUNNING}" != "instsys" ]; then
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
[ -x /sbin/mkinitrd_setup ] && /sbin/mkinitrd_setup
/sbin/mkinitrd || :
fi
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 /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
%dir %{_prefix}/lib/ConsoleKit
%dir %{_prefix}/lib/ConsoleKit/run-seat.d
%{_prefix}/lib/ConsoleKit/run-seat.d/udev-acl.ck
%{_mandir}/man?/*.[0-9]*
%{_datadir}/pkgconfig/udev.pc
%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
%{_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.*
%{_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