#!/bin/sh

. config/options

$SCRIPTS/install alsa-lib

PKG_DIR=`find $PACKAGES -type d -name $1`

#mkdir -p $INSTALL/usr/bin
#cp $PKG_BUILD/amixer/amixer $INSTALL/usr/bin

mkdir -p $INSTALL/usr/sbin
cp $PKG_BUILD/alsactl/alsactl $INSTALL/usr/sbin
mkdir -p $INSTALL/usr/share/alsa/init
cp $PKG_BUILD/alsactl/init/* $INSTALL/usr/share/alsa/init
rm -rf $INSTALL/usr/share/alsa/init/Makefile*

mkdir -p $INSTALL/etc/udev/rules.d
cp $PKG_DIR/config/rules.d/* $INSTALL/etc/udev/rules.d

mkdir -p $INSTALL/etc
cp $PKG_DIR/config/asound.state $INSTALL/etc

if [ "$DEVTOOLS" = yes ]; then
#  cp $PKG_BUILD/alsaconf/alsaconf $INSTALL/usr/bin
#  chmod +x $INSTALL/usr/bin/alsaconf

#  cp $PKG_BUILD/alsamixer/alsamixer $INSTALL/usr/bin

  cp $PKG_BUILD/aplay/aplay $INSTALL/usr/bin
  ln -sf /usr/bin/aplay $INSTALL/usr/bin/arecord

  cp $PKG_BUILD/iecset/iecset $INSTALL/usr/bin

#  cp $PKG_BUILD/speaker-test/speaker-test $INSTALL/usr/bin
#  mkdir -p $INSTALL/usr/share/alsa/speaker-test
#  cp $PKG_BUILD/speaker-test/samples/*.csv $INSTALL/usr/share/alsa/speaker-test
#  mkdir -p $INSTALL/usr/share/sounds/alsa
#  cp $PKG_BUILD/speaker-test/samples/*.wav $INSTALL/usr/share/sounds/alsa
fi

exit 0
