]> TLD Linux GIT Repositories - packages/udev.git/commitdiff
- udev based on Gentoo eudev, for now just packaged, not tested
authorMarcin Krol <hawk@tld-linux.org>
Sat, 31 Jan 2015 10:27:28 +0000 (10:27 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Sat, 31 Jan 2015 10:27:28 +0000 (10:27 +0000)
fbdev.blacklist [new file with mode: 0644]
start_udev [new file with mode: 0755]
udev-alsa.rules [new file with mode: 0644]
udev-libexecdir.patch [new file with mode: 0644]
udev-links.conf [new file with mode: 0644]
udev-net.helper [new file with mode: 0644]
udev-ploop-rules.patch [new file with mode: 0644]
udev.blacklist [new file with mode: 0644]
udev.rules [new file with mode: 0644]
udev.spec [new file with mode: 0644]

diff --git a/fbdev.blacklist b/fbdev.blacklist
new file mode 100644 (file)
index 0000000..4ab194e
--- /dev/null
@@ -0,0 +1,34 @@
+# This file blacklists the framebuffer drivers.
+
+blacklist arkfb
+blacklist aty128fb
+blacklist atyfb
+blacklist cirrusfb
+blacklist cyber2000fb
+blacklist gx1fb
+blacklist gxfb
+blacklist hgafb
+blacklist i2c-matroxfb
+blacklist i810fb
+blacklist intelfb
+blacklist kyrofb
+blacklist lxfb
+blacklist matroxfb_base
+blacklist mb862xxfb
+blacklist mgag200
+blacklist neofb
+blacklist nvidiafb
+blacklist pm2fb
+blacklist pm3fb
+blacklist radeonfb
+blacklist rivafb
+blacklist s3fb
+blacklist savagefb
+blacklist sisfb
+blacklist sstfb
+blacklist tdfxfb
+blacklist tridentfb
+blacklist vga16fb
+blacklist viafb
+blacklist virgefb
+blacklist vt8623fb
diff --git a/start_udev b/start_udev
new file mode 100755 (executable)
index 0000000..e80278e
--- /dev/null
@@ -0,0 +1,193 @@
+#!/bin/sh
+#
+# start_udev
+#
+# script to initialize /dev by using udev.
+#
+# Copyright (C) 2004 Greg Kroah-Hartman <greg@kroah.com>
+#
+# Released under the GPL v2 only.
+#
+# This needs to be run at the earliest possible point in the boot
+# process.
+#
+# Based on the udev init.d script
+#
+# Thanks go out to the Gentoo developers for proving
+# that this is possible to do.
+#
+# Yes, it's very verbose, feel free to turn off all of the echo calls,
+# they were there to make me feel better that everything was working
+# properly during development...
+
+# default value, if no config present.
+udev_root="/dev"
+sysfs_dir="/sys"
+udevd_timeout=8
+
+# don't use udev if sysfs is not mounted.
+[ -d $sysfs_dir/class ] || exit 1
+[ -r /proc/mounts ] || exit 1
+[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
+
+. /etc/rc.d/init.d/functions
+
+prog=udev
+bin=/sbin/udev
+udevd=/lib/udev/udevd
+# trim traling slash, code expects it not to be there
+udev_root=${udev_root%/}
+
+create_static_nodes() {
+       /sbin/kmod static-nodes --format=tmpfiles | \
+       while read type file mode uid gid age dev ; do
+               case $type in
+                       d|D)
+                               if ! test -d $file; then
+                                       mkdir -p --mode=$mode $file
+                               fi
+                               ;;
+                       *)
+                               oldIFS=$IFS
+                               IFS=":"
+                               set -- $dev
+                               maj=$1
+                               min=$2
+                               IFS=$oldIFS
+                               if ! test -e $file; then
+                                       mknod --mode=$mode $file $type $maj $min
+                               fi
+                               ;;
+               esac
+               [ $uid = "-" ] || chown $uid $file
+               [ $gid = "-" ] || chgrp $gid $file
+       done
+}
+
+make_extra_nodes() {
+       grep '^[^#]' /etc/udev/links.conf | \
+       while read type name arg1; do
+               [ "$type" -a "$name" -a ! -e "$udev_root/$name" -a ! -L "/dev/$name" ] ||continue
+               case "$type" in
+                       L)
+                               if ! test -h $udev_root/$name; then
+                                       ln -s $arg1 $udev_root/$name
+                               fi
+                               ;;
+                       D)
+                               if ! test -d $udev_root/$name; then
+                                       mkdir -p $udev_root/$name
+                               fi
+                               ;;
+                       M)
+                               if ! test -e /dev/$name; then
+                                       mknod -m 600 /dev/$name $arg1
+                               fi
+                               ;;
+                       *)
+                               echo "links.conf: unparseable line ($type $name $arg1)"
+                               ;;
+               esac
+       done
+       [ -d /lib/udev/devices ] && cp -a /lib/udev/devices/* /dev/ >/dev/null 2>&1 || :
+       [ -d /lib64/udev/devices ] && cp -a /lib64/udev/devices/* /dev/ >/dev/null 2>&1 || :
+}
+
+kill_udevd() {
+       if [ -x /sbin/pidof ]; then
+               pid=$(/sbin/pidof -x udevd)
+               [ -n "$pid" ] && kill $pid
+       fi
+}
+
+set_hotplug_handler() {
+       echo "" > /proc/sys/kernel/hotplug
+}
+
+# find subdirs mounted under $udev_root
+get_dev_mounts() {
+       awk -vudev_root="$udev_root/" '
+       BEGIN {
+         len = length(udev_root);
+       }
+
+       substr($2, 1, len) == udev_root {
+         print substr($2, len + 1)
+       }' /proc/mounts
+}
+
+show "Starting udev"; busy
+
+export ACTION=add
+prog=udev
+ret=0
+
+# mount the devtmpfs on $udev_root, if not already done
+awk "\$2 == \"$udev_root\" && \$3 == \"devtmpfs\" { exit 1 }" /proc/mounts && {
+       submounts=$(get_dev_mounts)
+
+       if [ "$submounts" ]; then
+               # mount to temporary location to be able to move submounts
+               # this needs writable TMPDIR:-/tmp, so it won't work in early boot
+               # but fix is simple: use initramfs instead of romfs
+               devdir=$(mktemp -d ${TMPDIR:-/tmp}/tmpXXXXXX)
+       else
+               devdir=$udev_root
+       fi
+       mount -n -o mode=0755 -t devtmpfs devtmpfs "$devdir"
+       ret=$(( $ret + $? ))
+
+       # relocate submounts
+       for dir in $submounts; do
+               mount -n --move $udev_root/$dir $devdir/$dir
+               ret=$(( $ret + $? ))
+       done
+
+       if [ "$submounts" ]; then
+               mount -n --move $devdir $udev_root
+               rmdir $devdir
+       fi
+}
+
+kill_udevd > "$udev_root/null" 2>&1
+
+# Create required static device nodes for the current kernel
+create_static_nodes
+
+# Start udevd daemon
+$udevd --daemon; rc=$?
+test $rc -eq 0 && ok || fail
+ret=$(( $ret + $rc ))
+
+# Making extra nodes
+show "Setup extra nodes"; busy
+make_extra_nodes; rc=$?
+test $rc -eq 0 && ok || fail
+ret=$(( $ret + $rc ))
+
+if [ -f /sys/class/tty/console/uevent ]; then
+       # Setting default hotplug handler
+       set_hotplug_handler
+       ret=$(( $ret + $? ))
+
+       # retrigger all events
+       show "Retrigger subsystems events"; busy
+       /sbin/udevadm trigger --type=subsystems --action=add; rc=$?
+       test $rc -eq 0 && ok || fail
+       ret=$(( $ret + $rc ))
+
+       show "Retrigger devices events"; busy
+       /sbin/udevadm trigger --type=devices --action=add; rc=$?
+       test $rc -eq 0 && ok || fail
+       ret=$(( $ret + $rc ))
+
+       # wait for the events to finish
+       show "udevadm settle"; busy
+       /sbin/udevadm settle; rc=$?
+       test $rc -eq 0 && ok || fail
+       ret=$(( $ret + $rc ))
+else
+       echo "Kernel too old for this udev version"
+fi
+
+exit $ret
diff --git a/udev-alsa.rules b/udev-alsa.rules
new file mode 100644 (file)
index 0000000..1f7d492
--- /dev/null
@@ -0,0 +1 @@
+SUBSYSTEM=="sound", KERNEL=="controlC?", RUN+="/sbin/alsactl -F restore %n"
diff --git a/udev-libexecdir.patch b/udev-libexecdir.patch
new file mode 100644 (file)
index 0000000..d0a29b6
--- /dev/null
@@ -0,0 +1,50 @@
+diff -ur eudev-2.1.1.orig/configure.ac eudev-2.1.1/configure.ac
+--- eudev-2.1.1.orig/configure.ac      2014-10-29 20:19:58.000000000 +0000
++++ eudev-2.1.1/configure.ac   2015-01-30 13:20:36.433000000 +0000
+@@ -128,6 +128,15 @@
+         [with_rootlibexecdir=${with_rootlibdir}/udev]
+ )
++AC_ARG_WITH(
++        [udevlibexecdir],
++        [AS_HELP_STRING(
++                [--with-udevlibexecdir=DIR],
++                [udev directory for libexecs necessary for boot])],
++        [],
++        [with_udevlibexecdir=/lib/udev]
++)
++
+ AC_ARG_ENABLE(
+         [split-usr],
+         [AS_HELP_STRING(
+@@ -149,15 +158,15 @@
+ AC_SUBST([rootprefix], [$with_rootprefix])
+ AC_SUBST([rootlibdir], [$with_rootlibdir])
+ AC_SUBST([rootlibexecdir], [${with_rootlibexecdir}])
+-AC_SUBST([udevlibexecdir], [${rootlibexecdir}])
++AC_SUBST([udevlibexecdir], [${with_udevlibexecdir}])
+ # sysconfdir paths
+ AC_SUBST([udevconfdir],[${sysconfdir}/udev])
+ AC_SUBST([udevconffile],[${udevconfdir}/udev.conf])
+-AC_SUBST([udevhwdbdir],[${udevconfdir}/hwdb.d])
+ AC_SUBST([udevhwdbbin],[${udevconfdir}/hwdb.bin])
+ # udevlibexecdir paths
++AC_SUBST([udevhwdbdir],[${udevlibexecdir}/hwdb.d])
+ AC_SUBST([udevkeymapdir],[${udevlibexecdir}/keymaps])
+ AC_SUBST([udevkeymapforceredir],[${udevkeymapdir}/force-release])
+ AC_SUBST([udevrulesdir],[${udevlibexecdir}/rules.d])
+@@ -389,10 +398,10 @@
+         datarootdir:             ${datarootdir}
+         udevconfdir:             ${udevconfdir}
++        udevlibexecdir:          ${udevlibexecdir}
+         udevconffile:            ${udevconffile}
+-        udevhwdbdir:             ${udevhwdbdir}
+         udevhwdbbin:             ${udevhwdbbin}
+-        udevlibexecdir:          ${udevlibexecdir}
++        udevhwdbdir:             ${udevhwdbdir}
+         udevkeymapdir:           ${udevkeymapdir}
+         udevkeymapforceredir:    ${udevkeymapforceredir}
+         udevrulesdir:            ${udevrulesdir}
diff --git a/udev-links.conf b/udev-links.conf
new file mode 100644 (file)
index 0000000..caa6fbe
--- /dev/null
@@ -0,0 +1,41 @@
+# List device nodes that need to be created by udev:
+
+# Standard nodes:
+L fd           /proc/self/fd
+L stdin                /proc/self/fd/0
+L stdout       /proc/self/fd/1
+L stderr       /proc/self/fd/2
+L core         /proc/kcore
+
+# These are needed for fs to be mounted:
+D cgroup
+D cpuset
+D pts
+D shm
+
+# These are needed because their drivers cannot be autoprobed in any way:
+M fd0          b 2 0
+M fd1          b 2 1
+M ppp          c 108 0
+M loop0        b 7 0
+D net
+M net/tun      c 10 200
+M raw1394      c 171 0
+M sg0          c 21 0
+M sg1          c 21 1
+M sr0          b 11 0
+M sr1          b 11 1
+M st0          c 9 0
+M st1          c 9 1
+M parport0     c 99 0
+D cpu
+D cpu/0
+M cpu/0/cpuid c 203 0
+M cpu/0/microcode c 10 184
+M cpu/0/msr c 202 0
+M lp0       c   6 0
+M rawctl    c 162 0
+
+# sometimes, nvidia driver is slow to create these devices and X failed to start:
+M nvidia0      c 195 0
+M nvidiactl    c 195 255
diff --git a/udev-net.helper b/udev-net.helper
new file mode 100644 (file)
index 0000000..b9199fb
--- /dev/null
@@ -0,0 +1,102 @@
+#!/bin/sh
+#
+# Kernel NET hotplug params include:
+#      
+#      ACTION=%s [register or unregister]
+#      INTERFACE=%s
+
+. /etc/sysconfig/network-scripts/functions.network
+
+mesg() {
+    /usr/bin/logger -t $(basename $0)"[$$]" "$@"
+}
+
+debug_mesg() {
+    :
+}
+
+# returns true if device is either wireless, usbnet or is named eth* and supports ethtool
+ethernet_check() {
+    [ -d /sys/class/net/$1/wireless/ ] && return 0
+    [[ "$1" == bnep* ]] && return 0
+    # eagle-usb/firewire create a fake ethX interface
+    if [ -x /usr/sbin/ethtool ] && ! /usr/sbin/ethtool $1 > /dev/null 2>&1;
+       then return 1;
+    fi
+    return 0;
+}
+
+if [ "$INTERFACE" = "" ]; then
+    mesg Bad NET invocation: \$INTERFACE is not set
+    exit 1
+fi
+
+export IN_HOTPLUG=1
+
+case $ACTION in
+add|register)
+    case $INTERFACE in
+       # interfaces that are registered after being "up" (?)
+       ppp*|ippp*|isdn*|plip*|lo*|irda*|dummy*|ipsec*|tun*|tap*)
+           debug_mesg assuming $INTERFACE is already up
+           exit 0
+           ;;
+       # interfaces that are registered then brought up
+       *)
+           # NOTE:  network configuration relies on administered state,
+           # we can't do much here without distro-specific knowledge
+           # such as whether/how to invoke DHCP, set up bridging, etc.
+           # conform to network service (AUTOMATIC_IFCFG)
+
+           [ -r /etc/sysconfig/network ] && . /etc/sysconfig/network
+
+           # don't do anything for non ethernet devices
+           ethernet_check $INTERFACE || exit 0;
+
+           # automatically create an interface file
+           CFG=/etc/sysconfig/interfaces/ifcfg-$INTERFACE
+           if [ "$AUTOMATIC_IFCFG" != no -a ! -r $CFG ]; then
+               debug_mesg creating config file for $INTERFACE
+               cat > $CFG <<EOF
+DEVICE=$INTERFACE
+BOOTPROTO=dhcp
+ONBOOT=no
+EOF
+           fi
+
+           if [ ! -f /var/lock/subsys/network ] || [ ! -r $CFG ]; then
+               # Don't do anything if the network is stopped or interface isn't configured
+               exit 0
+           fi
+
+           if [ -x /sbin/ifup ]; then
+               debug_mesg invoke ifup $INTERFACE
+               exec /sbin/ifup $INTERFACE hotplug
+           fi
+           ;;
+    esac
+    mesg $1 $ACTION event not handled
+    ;;
+
+remove|unregister)
+    case $INTERFACE in
+       # interfaces that are unregistered after being "down" (?)
+       ppp*|ippp*|isdn*|plip*|lo*|irda*|dummy*|ipsec*|tun*|tap*)
+           debug_mesg assuming $INTERFACE is already down
+           exit 0
+           ;;
+       *)
+           if [ -x /sbin/ifdown ]; then
+               debug_mesg invoke ifdown $INTERFACE
+               exec /sbin/ifdown $INTERFACE hotplug
+           fi
+           ;;
+    esac
+    mesg $1 $ACTION event not handled
+    ;;
+
+*)
+    debug_mesg NET $ACTION event for $INTERFACE not supported
+    exit 1 ;;
+
+esac
diff --git a/udev-ploop-rules.patch b/udev-ploop-rules.patch
new file mode 100644 (file)
index 0000000..3b7c480
--- /dev/null
@@ -0,0 +1,12 @@
+diff -ru udev-182.orig/rules/60-persistent-storage.rules udev-182/rules/60-persistent-storage.rules
+--- udev-182.orig/rules/60-persistent-storage.rules    2012-02-23 16:26:16.000000000 +0100
++++ udev-182/rules/60-persistent-storage.rules 2012-05-24 11:23:01.000000000 +0200
+@@ -16,6 +16,8 @@
+ # skip rules for inappropriate block devices
+ KERNEL=="fd*|mtd*|nbd*|gnbd*|btibm*|dm-*|md*", GOTO="persistent_storage_end"
++KERNEL=="ploop*", GOTO="persistent_storage_end"
++
+ # ignore partitions that span the entire disk
+ TEST=="whole_disk", GOTO="persistent_storage_end"
diff --git a/udev.blacklist b/udev.blacklist
new file mode 100644 (file)
index 0000000..ebdf3c3
--- /dev/null
@@ -0,0 +1,6 @@
+# This directive blacklists all devices which are members of the display class.
+# It has the main effect of stopping the udev/modprobe from loading the
+# fb drivers.
+
+# vendor, device, subsystem_vendor, subsystem_device, class, class, class
+install pci:v*d*sv*sd*bc03sc*i* /bin/true
diff --git a/udev.rules b/udev.rules
new file mode 100644 (file)
index 0000000..d55bf9f
--- /dev/null
@@ -0,0 +1,71 @@
+#
+# PLD Linux Distribution udev rules
+#
+
+KERNEL=="tty[A-Z]*|pppox*|ircomm*|noz*", GROUP="dialout"
+KERNEL=="mwave",                GROUP="dialout"
+KERNEL=="hvc*|hvsi*",           GROUP="dialout"
+KERNEL=="iseries/vtty*",       GROUP="dialout"
+KERNEL=="rfcomm[0-9]*",                GROUP="dialout", MODE="0664"
+
+# graphics/video
+SUBSYSTEM=="video4linux",      GROUP="video"
+SUBSYSTEM=="graphics",         GROUP="video"
+KERNEL=="3dfx*",               GROUP="video"
+KERNEL=="card*",               GROUP="video"
+KERNEL=="nvidia*|nvidiactl*",  GROUP="video"
+KERNEL=="pmu",                 GROUP="video"
+KERNEL=="vttuner*",            GROUP="video"
+KERNEL=="vtx*|vbi*",           GROUP="video"
+KERNEL=="winradio*",           GROUP="video"
+
+# fb devices
+KERNEL=="fb[0-9]*",            GROUP="video"
+
+# alsa devices
+SUBSYSTEM=="sound",            GROUP="audio"
+KERNEL=="controlC[0-9]*",      GROUP="audio"
+KERNEL=="hw[CD0-9]*",          GROUP="audio"
+KERNEL=="midiC[D0-9]*",                GROUP="audio"
+KERNEL=="pcm[CD0-9cp]*",       GROUP="audio"
+KERNEL=="seq",                 GROUP="audio"
+KERNEL=="timer",               GROUP="audio"
+
+KERNEL=="adsp",                        GROUP="audio"
+KERNEL=="adsp[0-9]*",          GROUP="audio"
+KERNEL=="audio",               GROUP="audio"
+KERNEL=="audio[0-9]*",         GROUP="audio"
+KERNEL=="dsp",                 GROUP="audio"
+KERNEL=="dsp[0-9]*",           GROUP="audio"
+KERNEL=="mixer",               GROUP="audio"
+KERNEL=="mixer[0-9]*",         GROUP="audio"
+KERNEL=="sequencer",           GROUP="audio"
+KERNEL=="sequencer[0-9]*",     GROUP="audio"
+
+# input devices
+KERNEL=="js*",                 MODE="0664", GROUP="sys"
+
+# misc devices
+KERNEL=="fuse",                        MODE="0660", GROUP="fuse"
+
+# graphics
+KERNEL=="agpgart",             MODE="0660", GROUP="video"
+
+# netlink devices
+KERNEL=="arpd",                        SYMLINK="netlink/%k"
+KERNEL=="dnrtmsg",             SYMLINK="netlink/%k"
+KERNEL=="fwmonitor",           SYMLINK="netlink/%k"
+KERNEL=="ip6_fw",              SYMLINK="netlink/%k"
+KERNEL=="nflog",               SYMLINK="netlink/%k"
+KERNEL=="route6",              SYMLINK="netlink/%k"
+KERNEL=="route",               SYMLINK="netlink/%k"
+KERNEL=="skip",                        SYMLINK="netlink/%k"
+KERNEL=="tap*",                        SYMLINK="netlink/%k"
+KERNEL=="tcpdiag",             SYMLINK="netlink/%k"
+KERNEL=="usersock",            SYMLINK="netlink/%k"
+KERNEL=="xfrm",                        SYMLINK="netlink/%k"
+
+# IEEE1394 (firewire) devices
+KERNEL=="dv1394*",             GROUP="video"
+KERNEL=="raw1394",             GROUP="video"
+KERNEL=="video1394*",          GROUP="video"
diff --git a/udev.spec b/udev.spec
new file mode 100644 (file)
index 0000000..7376189
--- /dev/null
+++ b/udev.spec
@@ -0,0 +1,410 @@
+# TODO:
+#   - systemd have more rules, check them and add if possible
+#   - get rules patches from systemd (if any)
+#
+# Conditional build:
+%bcond_without selinux         # without SELinux support
+
+Summary:       Device manager for the Linux 2.6 kernel series
+Summary(pl.UTF-8):     Zarządca urządzeń dla Linuksa 2.6
+Name:          udev
+Version:       2.1.1
+Release:       0.1
+Epoch:         2
+License:       GPL v2+ (udev), LGPL v2.1+ (the rest)
+Group:         Base
+Source0:       http://dev.gentoo.org/~blueness/eudev/eudev-%{version}.tar.gz
+# Source0-md5: dd945ce34314b4544e9036153d3a97e9
+# rules
+Source101:     udev-alsa.rules
+Source102:     udev.rules
+Source103:     udev-links.conf
+# scripts / helpers
+Source110:     udev-net.helper
+Source111:     start_udev
+# misc
+Source120:     udev.blacklist
+Source121:     fbdev.blacklist
+Patch0:                udev-ploop-rules.patch
+Patch1:                udev-libexecdir.patch
+URL:           http://www.gentoo.org/proj/en/eudev/
+BuildRequires: attr-devel
+BuildRequires: autoconf >= 2.64
+BuildRequires: automake >= 1:1.11
+BuildRequires: binutils >= 3:2.22.52.0.1-2
+BuildRequires: dbus-devel >= 1.3.2
+BuildRequires: docbook-style-xsl
+BuildRequires: glib2-devel >= 1:2.22.0
+BuildRequires: glibc-misc
+BuildRequires: gobject-introspection-devel >= 1.31.1
+BuildRequires: gperf
+BuildRequires: gtk-doc >= 1.18
+BuildRequires: kmod-devel >= 14
+BuildRequires: libblkid-devel >= 2.20
+%{?with_selinux:BuildRequires: libselinux-devel >= 2.1.9}
+BuildRequires: libtool >= 2:2.2
+BuildRequires: libxslt-progs
+BuildRequires: m4
+BuildRequires: pkgconfig >= 0.9.0
+BuildRequires: python-modules
+BuildRequires: rpmbuild(macros) >= 1.628
+BuildRequires: sed >= 4.0
+BuildRequires: usbutils >= 0.82
+BuildRequires: xz-devel
+BuildRequires: zlib-devel
+Requires:      udev-core = %{epoch}:%{version}-%{release}
+Provides:      dev = 3.5.0
+Obsoletes:     dev
+Obsoletes:     hotplug
+Obsoletes:     hotplug-input
+Obsoletes:     hotplug-net
+Obsoletes:     hotplug-pci
+Obsoletes:     udev-dev
+Obsoletes:     udev-extras < 20090628
+Obsoletes:     udev-tools
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%define                _bindir         /bin
+%define                _sbindir        /sbin
+%define                _libexecdir     %{_prefix}/lib
+
+%description
+udev is the device manager for the Linux 2.6 kernel series. Its
+primary function is managing device nodes in /dev. It is the successor
+of devfs and hotplug.
+
+%description -l pl.UTF-8
+udev jest zarządcą urządzeń dla Linuksa 2.6. Jego główną funkcją jest
+zarządzanie węzłami urządzeń w katalogu /dev. Jest następcą devfs i
+hotpluga.
+
+%package core
+Summary:       A userspace implementation of devfs - core part of udev
+Summary(pl.UTF-8):     Implementacja devfs w przestrzeni użytkownika - główna część udev
+Group:         Base
+Requires:      coreutils
+Requires:      filesystem >= 3.0-45
+Requires:      kmod >= 14
+Requires:      libblkid >= 2.20
+%{?with_selinux:Requires:      libselinux >= 2.1.9}
+Requires:      setup >= 2.6.1-1
+Requires:      udev-libs = %{epoch}:%{version}-%{release}
+Requires:      uname(release) >= 2.6.32
+#Suggests:     uname(release) >= 3.0
+Obsoletes:     udev-compat
+Obsoletes:     udev-initrd < %{epoch}:%{version}-%{release}}
+Conflicts:     geninitrd < 12639
+Conflicts:     rc-scripts < 0.4.5.3-1
+Conflicts:     systemd-units < 1:183
+Conflicts:     udev < 1:118-1
+
+%description core
+A userspace implementation of devfs - core part of udev.
+
+%description core -l pl.UTF-8
+Implementacja devfs w przestrzeni użytkownika - główna część udev.
+
+%package libs
+Summary:       Shared library to access udev device information
+Summary(pl.UTF-8):     Biblioteka współdzielona do dostępu do informacji o urządzeniach udev
+Group:         Libraries
+
+%description libs
+Shared libudev library to access udev device information.
+
+%description libs -l pl.UTF-8
+Biblioteka współdzielona libudev służąca do dostępu do informacji o
+urządzeniach udev.
+
+%package devel
+Summary:       Header file for libudev library
+Summary(pl.UTF-8):     Plik nagłówkowy biblioteki libudev
+Group:         Development/Libraries
+Requires:      udev-libs = %{epoch}:%{version}-%{release}
+Obsoletes:     udev-static
+
+%description devel
+Header file for libudev library.
+
+%description devel -l pl.UTF-8
+Plik nagłówkowy biblioteki libudev.
+
+%package apidocs
+Summary:       libudev API documentation
+Summary(pl.UTF-8):     Dokumentacja API libudev
+Group:         Documentation
+Requires:      gtk-doc-common
+
+%description apidocs
+libudev API documentation.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API libudev.
+
+%package glib
+Summary:       Shared libgudev library - GObject bindings for libudev
+Summary(pl.UTF-8):     Biblioteka współdzielona libgudev - wiązania GObject do libudev
+Group:         Libraries
+Requires:      glib2 >= 1:2.22.0
+Requires:      udev-libs = %{epoch}:%{version}-%{release}
+
+%description glib
+Shared libgudev library - GObject bindings for libudev.
+
+%description glib -l pl.UTF-8
+Biblioteka współdzielona libgudev - wiązania GObject do libudev.
+
+%package glib-devel
+Summary:       Header file for libgudev library
+Summary(pl.UTF-8):     Plik nagłówkowy biblioteki libgudev
+Group:         Development/Libraries
+Requires:      glib2-devel >= 1:2.22.0
+Requires:      udev-devel = %{epoch}:%{version}-%{release}
+Requires:      udev-glib = %{epoch}:%{version}-%{release}
+Obsoletes:     udev-glib-static
+
+%description glib-devel
+Header file for libgudev library.
+
+%description glib-devel -l pl.UTF-8
+Plik nagłówkowy biblioteki libgudev.
+
+%package glib-apidocs
+Summary:       libgudev API documentation
+Summary(pl.UTF-8):     Dokumentacja API libgudev
+Group:         Documentation
+Requires:      gtk-doc-common
+
+%description glib-apidocs
+libgudev API documentation.
+
+%description glib-apidocs -l pl.UTF-8
+Dokumentacja API libgudev.
+
+%prep
+%setup -q -n eudev-%{version}
+%patch0 -p1
+%patch1 -p1
+
+%build
+%{__gtkdocize}
+%{__libtoolize}
+%{__aclocal} -I m4
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+%configure \
+        --libexecdir=/lib \
+        --bindir=%{_sbindir} \
+        %{?debug:--enable-debug} \
+        %{__enable_disable selinux} \
+        --disable-silent-rules \
+        --enable-introspection \
+        --enable-blkid \
+        --enable-gudev \
+        --enable-gtk-doc \
+        --enable-keymap \
+        --enable-libkmod \
+        --enable-manpages \
+        --enable-modules \
+        --enable-rule-generator \
+        --enable-shared \
+        --enable-static \
+        --with-html-dir=%{_gtkdocdir} \
+        --with-rootprefix="" \
+        --with-rootlibdir=/%{_lib} \
+        --with-udevlibexecdir=/lib/udev
+
+%{__make} -j1
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT/var/lib/%{name}/coredump \
+       $RPM_BUILD_ROOT{%{_sysconfdir}/{udev/hwdb,modprobe}.d,%{_bindir},%{_sbindir},/usr/lib}
+
+%{__make} install \
+       DESTDIR=$RPM_BUILD_ROOT
+
+# compatibility symlinks to udevd binary
+%{__ln} -s %{_sbindir}/udevd $RPM_BUILD_ROOT/lib/udev/udevd
+
+# compat symlinks for "/ merged into /usr" programs
+%{__ln} -s %{_sbindir}/udevadm $RPM_BUILD_ROOT/bin/
+%{__ln} -s /lib/udev $RPM_BUILD_ROOT/usr/lib/
+
+# install custom udev rules from pld package
+%{__cp} -a %{SOURCE101} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/40-alsa-restore.rules
+%{__cp} -a %{SOURCE102} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/70-udev-pld.rules
+
+# install udev configs
+%{__cp} -a %{SOURCE103} $RPM_BUILD_ROOT%{_sysconfdir}/udev/links.conf
+
+# install udev executables (scripts, helpers, etc.)
+install -p %{SOURCE110} $RPM_BUILD_ROOT/lib/udev/net_helper
+install -p %{SOURCE111} $RPM_BUILD_ROOT%{_sbindir}/start_udev
+
+# install misc udev stuff
+%{__cp} -a %{SOURCE120} $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/udev_blacklist.conf
+%{__cp} -a %{SOURCE121} $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/fbdev-blacklist.conf
+
+:>$RPM_BUILD_ROOT%{_sysconfdir}/udev/hwdb.bin
+
+install -d $RPM_BUILD_ROOT/var/log
+:> $RPM_BUILD_ROOT/var/log/btmp
+:> $RPM_BUILD_ROOT/var/log/wtmp
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%triggerpostun core -- dev
+if [ "$2" = 0 ]; then
+       # need to kill and restart udevd as after obsoleting dev package the
+       # /dev tree will remain empty. umask is needed as otherwise udev will
+       # create devices with strange permissions (udev bug probably)
+       umask 000
+       /sbin/start_udev || exit 0
+fi
+
+%triggerpostun core -- udev < 108
+%{__sed} -i -e 's#IMPORT{program}="/sbin/#IMPORT{program}="#g' /etc/udev/rules.d/*.rules
+%if "%{_lib}" != "lib"
+%{__sed} -i -e 's#/%{_lib}/udev/#/lib/udev/#g' /etc/udev/rules.d/*.rules
+%endif
+
+%triggerpostun core -- udev < 165
+/sbin/udevadm info --convert-db
+
+%post core
+/sbin/udevadm hwdb --update || :
+if [ $1 -gt 1 ]; then
+       if grep -qs devtmpfs /proc/mounts && [ -n "$(pidof udevd)" ]; then
+               /sbin/udevadm control --exit
+               /lib/udev/udevd --daemon
+       fi
+fi
+
+%post  libs -p /sbin/ldconfig
+%postun        libs -p /sbin/ldconfig
+
+%post  glib -p /sbin/ldconfig
+%postun        glib -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%dev(c,1,3) %attr(666,root,root) /dev/null
+%dev(c,5,1) %attr(660,root,console) /dev/console
+%dev(c,1,5) %attr(666,root,root) /dev/zero
+
+%files core
+%defattr(644,root,root,755)
+
+/usr/lib/udev
+
+%attr(755,root,root) /lib/udev/collect
+
+%attr(755,root,root) /lib/udev/net_helper
+
+%attr(755,root,root) /lib/udev/ata_id
+%attr(755,root,root) /lib/udev/cdrom_id
+%attr(755,root,root) /lib/udev/mtd_probe
+%attr(755,root,root) /lib/udev/scsi_id
+%attr(755,root,root) /lib/udev/v4l_id
+
+%attr(755,root,root) /lib/udev/udevd
+
+%attr(755,root,root) /lib/udev/accelerometer
+
+%attr(755,root,root) /lib/udev/write_cd_rules
+%attr(755,root,root) /lib/udev/write_net_rules
+/lib/udev/rule_generator.functions
+
+%dir /lib/udev/hwdb.d
+/lib/udev/hwdb.d/20-OUI.hwdb
+/lib/udev/hwdb.d/20-acpi-vendor.hwdb
+/lib/udev/hwdb.d/20-bluetooth-vendor-product.hwdb
+/lib/udev/hwdb.d/20-pci-classes.hwdb
+/lib/udev/hwdb.d/20-pci-vendor-model.hwdb
+/lib/udev/hwdb.d/20-sdio-classes.hwdb
+/lib/udev/hwdb.d/20-sdio-vendor-model.hwdb
+/lib/udev/hwdb.d/20-usb-classes.hwdb
+/lib/udev/hwdb.d/20-usb-vendor-model.hwdb
+/lib/udev/hwdb.d/60-keyboard.hwdb
+
+%attr(755,root,root) %{_sbindir}/start_udev
+%attr(755,root,root) %{_sbindir}/udevd
+%attr(755,root,root) %{_sbindir}/udevadm
+%attr(755,root,root) /bin/udevadm
+
+%dir %{_sysconfdir}/udev
+%dir %{_sysconfdir}/udev/rules.d
+%dir %{_sysconfdir}/udev/hwdb.d
+%ghost %{_sysconfdir}/udev/hwdb.bin
+
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/modprobe.d/fbdev-blacklist.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/modprobe.d/udev_blacklist.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/udev/links.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/udev/rules.d/40-alsa-restore.rules
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/udev/rules.d/70-udev-pld.rules
+
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/udev/udev.conf
+
+# rules below are NOT supposed to be changed by users
+/lib/udev/rules.d/42-usb-hid-pm.rules
+/lib/udev/rules.d/50-udev-default.rules
+/lib/udev/rules.d/60-cdrom_id.rules
+/lib/udev/rules.d/60-drm.rules
+/lib/udev/rules.d/60-keyboard.rules
+/lib/udev/rules.d/60-persistent-alsa.rules
+/lib/udev/rules.d/60-persistent-input.rules
+/lib/udev/rules.d/60-persistent-serial.rules
+/lib/udev/rules.d/60-persistent-storage-tape.rules
+/lib/udev/rules.d/60-persistent-storage.rules
+/lib/udev/rules.d/60-persistent-v4l.rules
+/lib/udev/rules.d/61-accelerometer.rules
+/lib/udev/rules.d/64-btrfs.rules
+/lib/udev/rules.d/75-cd-aliases-generator.rules
+/lib/udev/rules.d/75-net-description.rules
+/lib/udev/rules.d/75-persistent-net-generator.rules
+/lib/udev/rules.d/75-probe_mtd.rules
+/lib/udev/rules.d/75-tty-description.rules
+/lib/udev/rules.d/78-sound-card.rules
+/lib/udev/rules.d/80-drivers.rules
+/lib/udev/rules.d/95-udev-late.rules
+%{_mandir}/man5/udev.conf.5*
+%{_mandir}/man7/udev.7*
+%{_mandir}/man8/udevadm.8*
+%{_mandir}/man8/udevd.8*
+
+%files libs
+%defattr(644,root,root,755)
+%attr(755,root,root) /%{_lib}/libudev.so.*.*.*
+%attr(755,root,root) %ghost /%{_lib}/libudev.so.1
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libudev.so
+%{_includedir}/libudev.h
+%{_includedir}/udev.h
+%{_pkgconfigdir}/libudev.pc
+%{_npkgconfigdir}/udev.pc
+
+%files apidocs
+%defattr(644,root,root,755)
+%{_gtkdocdir}/libudev
+
+%files glib
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libgudev-1.0.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libgudev-1.0.so.0
+%{_libdir}/girepository-1.0/GUdev-1.0.typelib
+
+%files glib-devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libgudev-1.0.so
+%{_includedir}/gudev-1.0
+%{_pkgconfigdir}/gudev-1.0.pc
+%{_datadir}/gir-1.0/GUdev-1.0.gir
+
+%files glib-apidocs
+%defattr(644,root,root,755)
+%{_gtkdocdir}/gudev