install -d ${INSTALL_ROOT}/sys     &&
UDEV_CFG=${INSTALL_ROOT}/etc/udev  &&
DEV_DDIR=/etc/dev.d                &&
mkdir  -p  ${UDEV_CFG}/rules.d     &&

for file in $SCRIPT_DIRECTORY/udev.{conf,missing} ; do
	install_config_file $file ${UDEV_CFG}/$(basename $file)
done  &&

for file in $SCRIPT_DIRECTORY/rules/* ; do
	install_config_file $file ${UDEV_CFG}/rules.d/$(basename $file)
done  &&

# install some of the suse rules
for file in etc/udev/suse/40-alsa.rules ; do
        install_config_file $file ${UDEV_CFG}/rules.d/$(basename $file)
done  &&

# udevstart and udevsend are nolonger installed by default. we still need them
install udevsend udevstart  ${INSTALL_ROOT}/sbin &&

make prefix=${INSTALL_ROOT}/ exec_prefix=${INSTALL_ROOT}/ V=true ${OPTS} install   &&
make EXTRAS="extras/run_directory extras/cdrom_id extras/firmware" \
  prefix=${INSTALL_ROOT}/ exec_prefix=${INSTALL_ROOT}/ \
  V=true ${OPTS} install &&
if [[ "$UDEV_EXTRAS" == 'y' ]]; then
  make EXTRAS="extras/ata_id extras/dasd_id extras/edd_id extras/floppy extras/scsi_id extras/usb_id extras/volume_id" prefix=${INSTALL_ROOT}/ exec_prefix=${INSTALL_ROOT}/ ${OPTS} V=true install   &&
  install  extras/path_id  ${INSTALL_ROOT}/sbin  &&

  if [[ "$UDEV_PERSIST" == 'y' ]];then
    for file in etc/udev/persistent-disk.rules ; do
	    install_config_file $file ${UDEV_CFG}/rules.d/60-$(basename $file)
    done
  fi 

fi  &&

if [[ "$UDEV_STATIC" == 'y' ]]; then
  pushd __static__ &&
  # we are not supposed to use `make install'
  for __FILE in $UDEV_STATIC_TARGET; do
    install -D $__FILE $INSTALL_ROOT/usr/sbin/$__FILE.static
  done &&
  popd
fi
