#!/bin/sh
#
# Setup:  Performs final customzations(i.e. machine localizations) and installs
#
# Author:	George MacDonald
#
# SYNOPSIS: 
#      Setup [-d] [-r installRoot] [-p packagingPrefix] 
#
# Note: If DESTDIR is set it is used as installRoot, command line arg will
#       override it though.



PREFIX=
INSTALL_ROOT=
DESKTOP_ONLY=
USE_PREFIX=
IGNORE_ROOT_TEST=

if [ ! -z "$DESTDIR" ]
then
	INSTALL_ROOT="-r $DESTDIR"
	USE_PREFIX=" -n "
	IGNORE_ROOT_TEST=" -i "
fi

while [ "$#" -gt "0" ]
do
        case $1 in

            -d ) DESKTOP_ONLY="-d" ; shift ;;

            -r ) INSTALL_ROOT="-r $2" ; shift ; shift  ;;

            -p ) PREFIX="-p $2" ; shift ; shift ;;

             * ) break ;;
        esac
done


# Uses Install.defaults and Install.params to determine how to customize and
# where to put things. Values in Install.params override those in 
# Install.defaults and should be used to customize the install

echo "Performing program setup and installation - Please be patient"

. ./Install.defaults
. ./Install.params


ARGS="$INSTALL_ROOT $DESKTOP_ONLY $USE_PREFIX $IGNORE_ROOT_TEST"

./scripts/generic/installTreeps $ARGS

