#!/bin/sh

. config/options

cd $BUILD/$1*

do_install usr/sbin/bluetoothd

pkg_uses $1 alsa && do_install usr/lib/alsa-lib/*.so
do_install usr/lib/libbluetooth.so*

if pkg_uses $1 devtools; then
  do_install usr/sbin/bccmd
  do_install usr/sbin/hciemu
  do_install usr/sbin/hciattach
  do_install usr/sbin/hciconfig

  do_install usr/bin
fi

mkdir -p $INSTALL/etc/bluetooth
cp -P src/main.conf $INSTALL/etc/bluetooth

mkdir -p $INSTALL/etc/dbus-1/system.d
cp -P src/bluetooth.conf $INSTALL/etc/dbus-1/system.d

mkdir -p $INSTALL/etc/udev/rules.d
cp $ROOT/$PACKAGES/$1/config/bluetooth.rules \
  $INSTALL/etc/udev/rules.d/97_bluetooth.rules
