#!/bin/sh

. config/options

$SCRIPTS/install expat
$SCRIPTS/install glib
$SCRIPTS/install udev
$SCRIPTS/install dbus
$SCRIPTS/install dbus-glib
$SCRIPTS/install gettext-dummy

mkdir -p $INSTALL/usr/sbin
  cp $PKG_BUILD/hald/hald $INSTALL/usr/sbin/

mkdir -p $INSTALL/usr/bin
  cp $PKG_BUILD/tools/.libs/lshal $INSTALL/usr/bin
  cp $PKG_BUILD/tools/.libs/hal-device $INSTALL/usr/bin
  cp $PKG_BUILD/tools/.libs/hal-disable-polling $INSTALL/usr/bin
  cp $PKG_BUILD/tools/.libs/hal-find-by-capability $INSTALL/usr/bin
  cp $PKG_BUILD/tools/.libs/hal-find-by-property $INSTALL/usr/bin
  cp $PKG_BUILD/tools/.libs/hal-get-property $INSTALL/usr/bin
  cp $PKG_BUILD/tools/.libs/hal-is-caller-locked-out $INSTALL/usr/bin
  cp $PKG_BUILD/tools/.libs/hal-lock $INSTALL/usr/bin
  cp $PKG_BUILD/tools/.libs/hal-set-property $INSTALL/usr/bin

mkdir -p $INSTALL/usr/libexec
  cp $PKG_BUILD/tools/.libs/hal-storage-mount $INSTALL/usr/libexec
  cp $PKG_BUILD/tools/.libs/hal-storage-eject $INSTALL/usr/libexec
  cp $PKG_BUILD/tools/.libs/hal-storage-closetray $INSTALL/usr/libexec
  cp $PKG_BUILD/tools/.libs/hal-storage-cleanup-mountpoint $INSTALL/usr/libexec
  cp $PKG_BUILD/tools/.libs/hal-storage-cleanup-all-mountpoints $INSTALL/usr/libexec
  cp $PKG_BUILD/hald/linux/addons/.libs/hald-addon-* $INSTALL/usr/libexec
  cp $PKG_BUILD/hald/linux/probing/.libs/hald-probe-* $INSTALL/usr/libexec
  cp $PKG_BUILD/hald/hald-generate-fdi-cache $INSTALL/usr/libexec
  cp $PKG_BUILD/hald-runner/hald-runner $INSTALL/usr/libexec

mkdir -p $INSTALL/usr/lib/hal/scripts
  cp $PKG_BUILD/tools/hal-functions $INSTALL/usr/lib/hal/scripts
  cp $PKG_BUILD/tools/hal-dockstation-undock $INSTALL/usr/lib/hal/scripts

mkdir -p $INSTALL/usr/lib
  cp -PR $PKG_BUILD/libhal/.libs/libhal.so* $INSTALL/usr/lib
  cp -PR $PKG_BUILD/libhal-storage/.libs/libhal-storage.so* $INSTALL/usr/lib

mkdir -p $INSTALL/etc/udev/rules.d
  cp $PKG_BUILD/tools/linux/90-hal.rules $INSTALL/etc/udev/rules.d

mkdir -p $INSTALL/etc/dbus-1/system.d
  cp $PKG_BUILD/hal.conf $INSTALL/etc/dbus-1/system.d

mkdir -p $INSTALL/etc/hal/fdi/preprobe
mkdir -p $INSTALL/etc/hal/fdi/information
mkdir -p $INSTALL/etc/hal/fdi/policy
mkdir -p $INSTALL/usr/share/hal/fdi/preprobe
mkdir -p $INSTALL/usr/share/hal/fdi/information/10freedesktop

mkdir -p $INSTALL/usr/share/hal/fdi/policy/10osvendor
cp \
  $PKG_BUILD/fdi/policy/10osvendor/10-input-policy.fdi \
  $PKG_BUILD/fdi/policy/10osvendor/10-keymap.fdi \
  $PKG_BUILD/fdi/policy/10osvendor/10-usbcsr-mice.fdi \
  $PKG_BUILD/fdi/policy/10osvendor/20-acl-management.fdi \
  $PKG_BUILD/fdi/policy/10osvendor/20-storage-methods.fdi \
  $INSTALL/usr/share/hal/fdi/policy/10osvendor
