#!/sbin/sh

########
# Product:  GraphicsPEX5DK
# Fileset:  PEX5-HELP
# postremove
#
# $Source: /src//./release/SD/GraphicsPEX5v2/PEX5-HELP/postinstall,v $
# $Revision: 000.0 $
# $Date: 97/03/27 10:00:32 $
#
########
#
# (c) Copyright Hewlett-Packard Company 1994
#
########

	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!!


	##
	##  Set up local environment variables
	##

	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 up the PEX5_MAN_DIR to "/opt/graphics/PEX5/share/man/man3" 

PEX5_DIR="${SW_INSTALL_DIR}"
PEX5_MAN_DIR="${PEX5_DIR}share/man/man3"

# Remove hardlink files that point to command pex.3g. 
if [ -d $PEX5_MAN_DIR ]
then
   rm -rf $PEX5_MAN_DIR > /dev/null 2>&1
fi

# Remove symbolic links to /opt/graphics/PEX5/help

if [ -d ${PEX5_DIR}help5.1v2 ]
then
   rm ${PEX5_DIR}help5.1v2 > /dev/null 2>&1
fi
if [ -d ${PEX5_DIR}help5.1v3 ]
then
   rm ${PEX5_DIR}help5.1v3 > /dev/null 2>&1
fi

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