#!/bin/sh

base_dir=`dirname "$0"`
if [ $base_dir = "." ]
then
	base_dir=`pwd`
fi
(grep BASEDIR /var/db/calinst/CalderaSofts | grep -v '\$' | cut -d' ' -f 2) > /tmp/.ginstall 2>/dev/null
inst_dir=`cat /tmp/.ginstall`
rm -f /tmp/.ginstall 2>/dev/null
__CAS_DATA=$inst_dir/lib
export __CAS_DATA

case  `uname`  in	
	Linux)
		LD_LIBRARY_PATH=/tmp:$base_dir/LIB/LINUX
		export LD_LIBRARY_PATH
		MACHINE=LINUX
		export MACHINE
		;;
	default)
		echo Unknown system
		exit -1
	;;
esac

return_stat=-1

if [ -f $inst_dir/bin/ginstall ]
	then
	$inst_dir/bin/ginstall -b $base_dir $*
	return_stat=$?
else
	echo ginstall can not be found
fi



exit $return_stat
