rpm -q enstore > /dev/null
if [ $? -eq 0 ]; then 
	ENSTORE_DIR=`rpm -ql enstore | head -1`
else
	echo "Enstore is not installed"
	exit 1
fi

PYTHON_DIR=$ENSTORE_DIR/Python
FTT_DIR=$ENSTORE_DIR/FTT
ENSTORE_HOME=/home/enstore
ENSTORE_OUT=/var/log/enstore

export ENSTORE_DIR
export PYTHON_DIR
export FTT_DIR
export ENSTORE_HOME
export ENSTORE_OUT
SWIG_DIR=$ENSTORE_DIR/SWIG
export SWIG_DIR
export SWIG_LIB=$SWIG_DIR/swig_lib
PATH=$SWIG_DIR:$PATH

PATH=$ENSTORE_DIR/sbin:$ENSTORE_DIR/bin:$ENSTORE_DIR/tools:$PATH
rpm -q pnfs > /dev/null
if [ $? -eq 0 ]; then
        p_d=`rpm -ql pnfs | grep bin | head -1`
        PNFS_DIR=`dirname $p_d`
        PATH=$PATH:$PNFS_DIR/tools
        export PNFS_DIR
fi

#CVSROOT=hppccvs@cdcvs.fnal.gov:/cvs/hppc; export CVSROOT
#unset CVS_RSH 2>//dev/null;

PYTHONINC=`ls -d $PYTHON_DIR/include/python*`; export PYTHONINC
PYTHONLIB=`ls -d $PYTHON_DIR/lib/python*`;export PYTHONLIB
PATH=$PYTHON_DIR/bin:$PATH
PYTHONPATH=$ENSTORE_DIR:$ENSTORE_DIR/src:$ENSTORE_DIR/modules:$ENSTORE_DIR/HTMLgen:$ENSTORE_DIR/PyGreSQL; export PYTHONPATH
PYTHONUNBUFFERED="x"; export PYTHONUNBUFFERED

# if using ssh for enstore node communications for discribution, upgade, and maintenance 
# uncomment the following lines
#export ENSSH=/usr/bin/ssh
#export ENSCP=/usr/bin/scp


GADFLY_GRAMMAR=$ENSTORE_DIR/gadfly; export GADFLY_GRAMMAR

$ENSTORE_DIR/external_distr/update_sym_links.sh -c

export ENSTORE_CONFIG_HOST=d0ensrv2.fnal.gov
export ENSTORE_CONFIG_PORT=7500
export ENSTORE_CONFIG_FILE=/home/enstore/enstore/etc/sam.conf
export ENSTORE_MAIL=enstore-auto@fnal.gov
export FARMLETS_DIR=/usr/local/etc/farmlets
