#!/bin/sh

. config/options

[ "$AVAHI_DAEMON" = yes ] && $SCRIPTS/install avahi

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

mkdir -p $INSTALL/usr/lib
  cp -P $PKG_BUILD/source3/bin/libsmbclient.so* $INSTALL/usr/lib

if [ "$SAMBA_SERVER" = yes ]; then
  mkdir -p $INSTALL/usr/bin
    cp $PKG_BUILD/source3/bin/smbd $INSTALL/usr/bin

  mkdir -p $INSTALL/etc/samba
    cp $PKG_DIR/config/smb.conf $INSTALL/etc/samba

  mkdir -p $INSTALL/usr/config
    cp $PKG_DIR/config/samba.conf.sample $INSTALL/usr/config

  mkdir -p $INSTALL/etc/init.d
    cp $PKG_DIR/scripts/* $INSTALL/etc/init.d

fi
