File udev.spec of Package udev.import4648

# spec file for package udev
# Copyright (c) 2011 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

# norootforbuild

Name:           udev
Version:        166
Release:        6.<RELEASE7>
License:        LGPLv2.1+
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 /usr/sbin/groupadd
Conflicts:      aaa_base < 11.2-57
Conflicts:      mkinitrd < 2.5.10-12
Conflicts:      util-linux < 2.16
Conflicts:      ConsoleKit < 0.4.1
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  libselinux-devel libsepol-devel
BuildRequires:  libusb-devel pciutils-ids usbutils
BuildRequires:  gperf libacl-devel pkg-config
BuildRequires:  glib2-devel gobject-introspection-devel
Source1:        udev-rpmlintrc
Source2:        baselibs.conf
Source60:       boot.udev
Source61:       boot.udev_retry

Patch10:        udev-ata_id.patch

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
License:        LGPLv2.1+
Summary:        Dynamic library to access udev device information
Group:          System/Libraries

%description -n libudev0
This package contains the dynamic library libudev, which provides
access to udev device information

%package -n libudev-devel
License:        LGPLv2.1+
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.

%package -n libgudev-1_0-0
License:        LGPLv2.1+
Summary:        GObject library, to access udev device information
Requires:       libudev0 = %{version}-%{release}
Group:          System/Libraries

%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
License:        LGPLv2.1+
Summary:        Devel package for libgudev
Group:          Development/Libraries/Other
Requires:       libgudev-1_0-0 = %{version}-%{release}
Requires:       libudev-devel = %{version}-%{release}
Requires:       glib2-devel

%description -n libgudev-1_0-devel
This is the devel package for the GObject library libgudev, which
provides GObject access to udev device information.

%setup -q
%patch10 -p1

# 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 \
make %{?_smp_mflags}

rm -f $RPM_BUILD_ROOT/%{_libdir}/
rm -f $RPM_BUILD_ROOT/%{_libdir}/
cp -ax README $RPM_BUILD_ROOT%{_docdir}/udev
%ifarch ppc ppc64
cp rules/arch/40-ppc.rules $RPM_BUILD_ROOT/lib/udev/rules.d/
%ifarch ia64
cp rules/arch/40-ia64.rules $RPM_BUILD_ROOT/lib/udev/rules.d/
%ifarch s390 s390x
cp rules/arch/40-s390.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
# don't run/short-cut old sysv init script with different name
ln -s udev-retry.service %{buildroot}/lib/systemd/system/udev_retry.service

/usr/sbin/groupadd -r tape 2> /dev/null || :
# 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 || :

%{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
# convert old database files
/sbin/udevadm info --convert-db >/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
		if test -x /sbin/udevd; then
			/sbin/udevd --daemon >/dev/null 2>&1 || :


%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


%dir /lib/udev/
%dir /lib/udev/keymaps
%dir /lib/udev/rules.d/
%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
%doc %{_docdir}/udev
%dir /lib/udev/devices/
%dir /lib/systemd/system
%dir /lib/systemd/system/

%files -n libudev0

%files -n libudev-devel
%dir %{_datadir}/gtk-doc
%dir %{_datadir}/gtk-doc/html
%dir %{_datadir}/gtk-doc/html/libudev

%files -n libgudev-1_0-0

%files -n libgudev-1_0-devel
%dir %{_includedir}/gudev-1.0
%dir %{_includedir}/gudev-1.0/gudev
%dir %{_datadir}/gtk-doc
%dir %{_datadir}/gtk-doc/html
%dir %{_datadir}/gtk-doc/html/gudev

openSUSE Build Service is sponsored by