#! /bin/ksh
#***********************************************************************
# E.S.O. - VLT project
#
# "@(#) $Id: install_script,v 1.18 2005/09/23 13:42:42 mpasquat Exp $"
#
# who       when        what
# --------  --------    ----------------------------------------------
# MPA       22 Sep 2005 created 
#************************************************************************
#   NAME 
#   install_script
#
#   SYNOPSIS
#   install_script $doxygen_Version $graphviz_Version
#
#   DESCRIPTION
#   This script 
#   on linux: performs a binary installation of the doxygen/graphviz tools
#   and maybe SUN: installs the doxygen/graphviz tools
#
#   FILES
#
#   ENVIRONMENT
#
#   RETURN VALUES
#
#   CAUTIONS
#
#   EXAMPLES
#
#   SEE ALSO
#
#   BUGS
#
#------------------------------------------------------------------------
#

OS=`uname -s`
OS_REV=`uname -r`
DOX_VER=$1
GVIZ_VER=$2

case $OS in
Linux) 
    TAG=linux.i386
    ;;
SunOS)
    TAG=sol56.sun4
    ;;
*)      
    echo "Unsupported Operative System. Script aborted"
    exit 1
    ;;
esac

if [ "$INTLIST" != "" ] && [ "X$INTROOT" = "X" ]
then
    INTROOT=`echo $INTLIST | awk -F: '{print $1}'`
fi

if [ "$INTROOT" != "" ] 
then 
   INSTALL_DIR=$INTROOT
elif [ "$ACSROOT" != "" ] 
then 
   INSTALL_DIR=$ACSROOT
elif [ "$VLTROOT" != "" ] 
then 
   INSTALL_DIR=$VLTROOT
else 
   echo "no installation directories (INTROOT, ACSROOT, VLTROOT) have been found"
   echo "please define one and start again" 
   exit 1
fi

BASE=`pwd`

case $OS in
Linux)

    # Graphviz Installation
    echo ". . . graphviz $GVIZ_VER installation"
    cd graphviz-$GVIZ_VER
    make install
    make clean
    cd ..

    # Doxygen Installation
    echo ". . . doxygen $DOX_VER installation"
    cd doxygen-$DOX_VER
    make install
    cd .. 
    ;;

SunOS)
    
    # Graphviz Installation
    echo ". . . graphviz $GVIZ_VER installation"
    cd graphviz-$GVIZ_VER
    make install
    make clean
    cd ..

    # Doxygen Installation
    echo ". . . doxygen $DOX_VER installation"
    cd doxygen-$DOX_VER
    make install
    cd .. 
    ;;

esac

doxygen -g $INSTALL_DIR/config/doxygen.conf

echo "installation done"
echo "configuration file created in $INSTALL_DIR/config/doxygen.conf"




