make_normal                              &&
make install                             &&

cd ..  &&

mkdir  -p  $INSTALL_ROOT/usr/share/samba/codepages    &&
mkdir  -p  $INSTALL_ROOT/var/{spool,cache,log}/samba  &&

mkdir  -m  700  -p  $INSTALL_ROOT/etc/samba/private  &&
if  [[  !  -f  $INSTALL_ROOT/etc/samba/private/smbpasswd  ]];  then
  touch       $INSTALL_ROOT/etc/samba/private/smbpasswd  &&
  chmod  600  $INSTALL_ROOT/etc/samba/private/smbpasswd
fi

#
# Install libwinbind if it exists
#
#if  [[  -f  source4/nsswitch/libnss_winbind.so  ]]
#then
#  echo  "Installing nsswitch/libnss_winbind.so to $INSTALL_ROOT/lib"  &&
#  install  -m  644  source4/nsswitch/libnss_winbind.so                \
#                    $INSTALL_ROOT/lib                                 &&
#  echo  "Symlinking libnss_winbind.so.2 to libnss_winbind.so"         &&
#  pushd  $INSTALL_ROOT/lib                                            &&
#  ln  -sf  libnss_winbind.so                                          \
#           libnss_winbind.so.2                                        &&
#  popd
#fi  &&

#if  [[  -f  source4/nsswitch/libnss_wins.so  ]]
#then
#  echo  "Installing nsswitch/libnss_wins.so to $INSTALL_ROOT/lib"  &&
#  install  -m  644  source4/nsswitch/libnss_wins.so                \
#                    $INSTALL_ROOT/lib                              &&
#  echo  "Symlinking libnss_wins.so.2 to libnss_wins.so"            &&
#  pushd  $INSTALL_ROOT/lib                                         &&
#  ln  -sf  libnss_wins.so                                          \
#           libnss_wins.so.2                                        &&
#  popd
#fi  &&

# Setup the symlink for CUPS:
#if  spell_ok  cups;  then
#  if  !  [  -e  ${INSTALL_ROOT}/usr/lib/cups/backend/smb  ];  then
#    ln  -s  ${INSTALL_ROOT}/usr/bin/smbspool  ${INSTALL_ROOT}/usr/lib/cups/backend/smb
#  fi
#fi

if [[ -h $INSTALL_ROOT/usr/include/samba ]];  then
  rm -f $INSTALL_ROOT/usr/include/samba
fi

ln -sf /usr/include/samba-4.0/samba $INSTALL_ROOT/usr/include/samba
