#!/sbin/sh

########
# Product:  GraphicsSBaseDK
# Fileset:  STAR-PRG
# postinstall
# Release Services 08/01/2000
#
# $Source: ./release/SD/GraphicsSBase/STAR-PRG/configure
#
########
#
# (c) Copyright Hewlett-Packard Company 2000
#
########

	set -a       					# export all vars
	exitval=0					# anticipate success

	UTILS="/usr/lbin/sw/control_utils"
	if [[ ! -f $UTILS ]]
	then
		echo "ERROR:    Cannot find UTILS"
		exit 1
	fi
	. $UTILS

################################################################################
#set -x # For debugging purposes.  _Never_ ship uncommented!!


	SW_INSTALL_DIR="/"

	##
	## Test to see if either SW_ROOT_DIRECTORY or SW_LOCATION is
	## set to something other than /.  If so, set up SW_INSTALL_DIR
	## so it will not have spurious /'s in the path name.
	##
	
	if [ $SW_ROOT_DIRECTORY != / -o $SW_LOCATION != / ]
	then
		if [ $SW_ROOT_DIRECTORY != / ]
		then
			if [ $SW_LOCATION != / ]
			then
				SW_INSTALL_DIR="${SW_ROOT_DIRECTORY}${SW_LOCATION}"
			else
				SW_INSTALL_DIR="${SW_ROOT_DIRECTORY}"
			fi
		else
			if [ $SW_LOCATION != / ]
			then
				SW_INSTALL_DIR="${SW_LOCATION}"
			fi
		fi
	fi

##set -x

# Adjust permissions on two directories that this product 'owns', but
# are frequently created by another product with incorrect permissions.

if [ -d ${SW_ROOT_DIRECTORY}/opt/graphics/common/doc ]
then
    chmog 0555 bin bin  ${SW_ROOT_DIRECTORY}/opt/graphics/common/doc
fi

if [ -d ${SW_ROOT_DIRECTORY}/opt/graphics/common/doc/GAG ]
then
    chmog 0555 bin bin ${SW_ROOT_DIRECTORY}/opt/graphics/common/doc/GAG
fi

#
# Check to see if GraphicsSBaseDK filesets FAFM-PRG and  FAFM-MAN are on the system.
#
IT_IS=`uname -r`

       if [[ $IT_IS = B.11.11 ]]
         then
         FILESET_LIST="GraphicsSBaseDK.FAFM-PRG GraphicsSBaseDK.FAFM-MAN"
         for FILESET in $FILESET_LIST
           do
             swlist -l fileset $FILESET  > /dev/null 2>&1
             if [[ $? -eq 0 ]]
               then
                   swremove $FILESET
             fi
           done
       fi

	exit $exitval
################################################################################
