#!/bin/sh 
# %Z%$RCSfile$ version $Revision: #6 $ created $Date: 2001/08/30 $
# %Z%%Q%
# This function sets options to be added to the
# $SHOME/splus/lib/install/DEFAULTS.sh file. CONFIGURE looks to see if
# the options are set to decide whether they are to be installed.

. ./splus/lib/install/DEFAULTS.sh

case $# in
1)	TYPE=$1 ;;
*)	echo "Usage: $0 [ less | less_man | lic_man1 | lic_man5 | splus_man | sun_tools ]"
	exit 1 ;;
esac

# Make sure the argument is acceptable
case $TYPE in
less)
	cat << EOF

The less program is a file pager that helps you look at UNIX ascii files.
Similar to the more pager, it allows you to reverse the direction of
paging.

EOF
echo-n "Where would you like to install less? "
	read DEST

	# If the directory exists, put a good message in the options file
	if [ -d "$DEST" ]
	then
		echo "Adding to the $OPTIONS_FILE file..."		
		echo LESS_DIR=$DEST >> $OPTIONS_FILE
	else
		echo ""
		echo "*** ERROR: cannot find directory: $DEST ***"
		echo ""
	fi
	;;
less_man)
    echo
    echo-n "Where should the less UNIX manual pages be installed? "
	read DEST

	# If the directory exists, put destination variable in the options file
	if [ -d "$DEST" ]
	then
		echo "Adding to the $OPTIONS_FILE file..."		
		echo LESS_MAN_DIR=$DEST >> $OPTIONS_FILE
	else
		echo ""
		echo "*** ERROR: cannot find directory: $DEST ***"
		echo ""
	fi
	;;
lic_man1)
    echo
    echo-n "Where should the Elan License Manager command manual pages be installed? "
	read DEST
	if [ -d "$DEST" ]
	then
		echo "Adding to the $OPTIONS_FILE file..."		
		echo LIC_MAN1_DIR=$DEST >> $OPTIONS_FILE
	else
		echo ""
		echo "*** ERROR: cannot find directory: $DEST ***"
		echo ""
	fi 
	;;
lic_man5)
    echo
    echo-n "Where should the Elan License Manager file format manual pages be installed? "
	read DEST
	if [ -d "$DEST" ]
	then
		echo "Adding to the $OPTIONS_FILE file..."		
		echo LIC_MAN5_DIR=$DEST >> $OPTIONS_FILE
	else
		echo ""
		echo "*** ERROR: cannot find directory: $DEST ***"
		echo ""
	fi 
	;;
splus_man)
    echo
    echo-n "Where should the S-PLUS UNIX manual pages be installed? "
	read DEST
	if [ -d "$DEST" ]
	then
		echo "Adding to the $OPTIONS_FILE file..."		
		echo SPLUS_MAN_DIR=$DEST >> $OPTIONS_FILE
	else
		echo ""
		echo "*** ERROR: cannot find directory: $DEST ***"
		echo ""
	fi 
	;;
sun_tools)
	DEST=/usr/lib/defaults
	echo "Adding to the $OPTIONS_FILE file..."
	echo SUN_TOOLS_DIR=$DEST >> $OPTIONS_FILE
	;;
*)	echo "Usage: $0 [ less | less_man | splus_man | suntools ]"
	exit 1 
esac
exit 0
