%define version 1.3.7 Name: devfsd Summary: devfs daemon for device name compatibility Version: %{version} Release: 1 Copyright: GPL, Copyright Richard Gooch (rgooch@atnf.csiro.au) Packager: William Stearns Group: System Environment/Daemons Source: ftp://ftp.atnf.csiro.au/pub/people/rgooch/linux/daemons/devfsd-v%{version}.tar.gz #Source1: devfsd.init URL: http://www.atnf.csiro.au/~rgooch/linux/ BuildRoot: /tmp/devfsd-broot %description The devfsd programme is a daemon, run by the system boot scripts which can provide for intelligent management of device entries in the Device Filesystem (devfs). %changelog * Wed May 18 2000 William Stearns - Update source to 1.3.7. * Wed Mar 01 2000 William Stearns - removed init script; by then it's too late. Stick devfsd in /etc/rc.d/rc.sysinit * Sat Feb 19 2000 William Stearns - First spec file. Includes buildroot support, Changelog, and init script. %prep %setup -n devfsd %build make %install if [ "$RPM_BUILD_ROOT" = "/tmp/devfsd-broot" ]; then rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT/etc #install -d $RPM_BUILD_ROOT/etc/rc.d/init.d install -d $RPM_BUILD_ROOT/sbin install -d $RPM_BUILD_ROOT/usr/man/man8 make SBINDIR=$RPM_BUILD_ROOT/sbin CONFIG_FILE=$RPM_BUILD_ROOT/etc/devfsd.conf install cp -p devfsd.8 $RPM_BUILD_ROOT/usr/man/man8 #cp -p $RPM_SOURCE_DIR/devfsd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/devfsd else echo Invalid Build root exit 1 fi %clean if [ "$RPM_BUILD_ROOT" = "/tmp/devfsd-broot" ]; then rm -rf $RPM_BUILD_ROOT else echo Invalid Build root exit 1 fi %post if [ "$1" = "1" ]; then #This package is being installed for the first time if [ -f /etc/rc.d/rc.sysinit ]; then if [ `cat /etc/rc.d/rc.sysinit | grep devfsd | wc -l` -eq 0 ]; then #If no references to devfs yet #Add the following lines just after #!/bin/sh or #!/bin/bash. cat /etc/rc.d/rc.sysinit | sed -e 's@\(#!/bin/.*sh\)@\1\ if [ -c /dev/.devfsd ]; then #devfsdinstall\ if ! ps axf | grep [d]evfsd >/dev/null ; then #devfsdinstall\ #devfs not running yet #devfsdinstall\ /sbin/devfsd /dev #devfsdinstall\ fi #devfsdinstall\ fi #devfsdinstall\ @' >/etc/rc.d/rc.sysinit.tmp cat /etc/rc.d/rc.sysinit.tmp >/etc/rc.d/rc.sysinit rm -f /etc/rc.d/rc.sysinit.tmp fi else echo You don\'t have an /etc/rc.d/rc.sysinit - you will need to add echo 'if [ -c /dev/.devfsd ]; then' echo ' if ! ps axf | grep [d]evfsd >/dev/null ; then' echo ' /sbin/devfsd /dev' echo ' fi' echo 'fi' echo to your initialization scripts, before any filesystem checking is done. fi fi %postun if [ "$1" = "0" ]; then #Final removal, not upgrade. if [ -f /etc/rc.d/rc.sysinit ]; then if [ `cat /etc/rc.d/rc.sysinit | grep devfsdinstall | wc -l` -gt 0 ]; then cat /etc/rc.d/rc.sysinit | grep -v devfsdinstall >/etc/rc.d/rc.sysinit.tmp cat /etc/rc.d/rc.sysinit.tmp >/etc/rc.d/rc.sysinit rm -f /etc/rc.d/rc.sysinit.tmp fi fi fi %files %attr(644,root,root) %config /etc/devfsd.conf #%attr(755,root,root) /etc/rc.d/init.d/devfsd %attr(755,root,root) /sbin/devfsd %attr(644,root,root) /usr/man/man8/devfsd.8