| 1 | # Description: Userspace device management daemon |
| 2 | # URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html |
| 3 | # Maintainer: CRUX System Team, core-ports at crux dot nu |
| 4 | # Arch Maintainer: CRUX-ARM System Team, devel at crux-arm dot nu |
| 5 | # Depends on: |
| 6 | |
| 7 | name=udev |
| 8 | version=141 |
| 9 | release=1 |
| 10 | source=(ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/$name-$version.tar.bz2 \ |
| 11 | http://crux.nu/files/distfiles/udev-config-20081015.tar.bz2 \ |
| 12 | start_udev) |
| 13 | |
| 14 | build() { |
| 15 | cd udev-$version |
| 16 | |
| 17 | ./configure --build=$CHOST \ |
| 18 | --host=$CTARGET \ |
| 19 | --prefix=/usr \ |
| 20 | --exec-prefix= \ |
| 21 | --sysconfdir=/etc \ |
| 22 | --mandir=/usr/man |
| 23 | |
| 24 | make |
| 25 | make install DESTDIR=$PKG |
| 26 | |
| 27 | # scsi_id + vol_id need to be multi-path |
| 28 | (cd $PKG/sbin; ln -s ../lib/udev/vol_id vol_id) |
| 29 | (cd $PKG/sbin; ln -s ../lib/udev/scsi_id scsi_id) |
| 30 | |
| 31 | mkdir -p $PKG/lib/{firmware,udev/devices/{pts,shm}} |
| 32 | |
| 33 | # Populate nodes |
| 34 | mknod -m 600 $PKG/lib/udev/devices/console c 5 1 |
| 35 | mknod -m 666 $PKG/lib/udev/devices/null c 1 3 |
| 36 | mknod -m 666 $PKG/lib/udev/devices/zero c 1 5 |
| 37 | ln -s /proc/self/fd $PKG/lib/udev/devices/fd |
| 38 | ln -s /proc/self/fd/0 $PKG/lib/udev/devices/stdin |
| 39 | ln -s /proc/self/fd/1 $PKG/lib/udev/devices/stdout |
| 40 | ln -s /proc/self/fd/2 $PKG/lib/udev/devices/stderr |
| 41 | ln -s /proc/kcore $PKG/lib/udev/devices/core |
| 42 | |
| 43 | # Install some upstream rules |
| 44 | cp -a rules/packages/40-alsa.rules $PKG/lib/udev/rules.d/ |
| 45 | |
| 46 | # Add CRUX items + LFS rules |
| 47 | install -m 0755 $SRC/start_udev $PKG/sbin |
| 48 | |
| 49 | pushd $SRC/udev-config-20081015 |
| 50 | make DESTDIR=$PKG RULES_DIR=/lib/udev/rules.d install |
| 51 | popd |
| 52 | |
| 53 | # Comment uucp lines in default rules |
| 54 | sed -i 's|.*uucp.*|#&|g' $PKG/lib/udev/rules.d/50-udev-default.rules |
| 55 | sed -i 's|.*uucp.*|#&|g' $PKG/lib/udev/rules.d/55-lfs.rules |
| 56 | |
| 57 | # Keep udevinfo for legacy support |
| 58 | mkdir -p $PKG/usr/bin |
| 59 | ln -s /sbin/udevadm $PKG/usr/bin/udevinfo |
| 60 | } |