#!/bin/sh
SPDBV_BASE=/usr/local/SPDBV
ARCH=`uname -s`
if [ $ARCH = IRIX64 ]; then
	ARCH=IRIX
elif [ $ARCH = FreeBSD ]; then
    ARCH=Linux
fi
SPDBV_TEMP=$HOME/SPDBV/temp
SPDBV_DOWNLOAD=$HOME/SPDBV/download
SPDBV_RELEASE=spdbv
SPDBV_MINIMIZE_AMBER=
SPDBV_MINIMIZE_CHARMM=
SPDBV_MINIMIZE_GROMOS=
SPDBV_MINIMIZE_PATH=$HOME/SPDBV/EMIN
SPDBV_POV=$SPDBV_BASE/bin/ppov10
SPDBV_POV_PATH=$HOME/SPDBV/PPOV
SPDBV_WWW=netscape
SPDBV_USRSTUFF=$HOME/SPDBV/usrstuff
export SPDBV_RELEASE
export SPDBV_BASE
export SPDBV_TEMP
export SPDBV_DOWNLOAD
export SPDBV_MINIMIZE_AMBER
export SPDBV_MINIMIZE_CHARMM
export SPDBV_MINIMIZE_GROMOS
export SPDBV_MINIMIZE_PATH
export SPDBV_POV
export SPDBV_POV_PATH
export SPDBV_WWW
export SPDBV_USRSTUFF

if [ ! -d $HOME/SPDBV/usrstuff ]; then
   echo "Files needed for proper function of SPDBV are being installed in your home directory under $HOME/SPDBV/usrstuff"
   OLDDIR=`pwd`
   cd $HOME
   gunzip -c $SPDBV_BASE/user.tar.gz | tar xf -
   cd $OLDDIR
fi

# on IRIX this fixes some strange behaviour where it writes white on white!
# but should not be set on newer installations (6.5 with recent patches)
#export SPDBV_FORCE_CMAP=''

#start the SPDBV
$SPDBV_BASE/bin/$SPDBV_RELEASE.$ARCH $*
#done.
