#!/bin/sh

. config/options $1

mkdir -p $INSTALL/usr/bin
  cp $PKG_BUILD/source3/bin/smbtree $INSTALL/usr/bin
  cp $PKG_BUILD/source3/bin/mount.cifs $INSTALL/usr/bin
  cp $PKG_BUILD/source3/bin/umount.cifs $INSTALL/usr/bin

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

if [ "$SAMBA_SERVER" = yes ]; then
  mkdir -p $INSTALL/usr/bin
    cp $PKG_BUILD/source3/bin/smbd $INSTALL/usr/bin
    cp $PKG_BUILD/source3/bin/nmbd $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/network
    cp $PKG_DIR/scripts/* $INSTALL/etc/init.d/network
fi
