#!/sbin/sh 
########
#  Product: Graphics3DCom
#  Fileset: COM-RUN
#  
#  @(#) $Revision: 557.1 $
########
#
# (c) Copyright Hewlett-Packard Company, 1994
#
########

#set -x # For debugging purposes.  _Never_ ship uncommented!!
        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

	##
	## Create the "/var/opt/common" directory for timd if it does
	## not already exist.
	##

	TIMD_VAR_DIR="${SW_ROOT_DIRECTORY}var/opt/common"

	if [ ! -d ${TIMD_VAR_DIR} ]
	then
		mkdir -p ${TIMD_VAR_DIR} > /dev/null 2>&1
		chmod 777 ${TIMD_VAR_DIR} > /dev/null 2>&1
	fi

	##
	## Explicitly set the permissions to 777 on /var/spool/sockets
	## as a fix for the Transition Link defect that sets 555 perms
	## on /var/spool/sockets.
	##

	SOCKET_DIR="${SW_ROOT_DIRECTORY}var/spool/sockets"

	mkdir -p ${SOCKET_DIR} > /dev/null 2>&1
	chmod 777 ${SOCKET_DIR} > /dev/null 2>&1

	##
	## Create the "/var/spool/sockets/common" directory for the timd
	## sockets.
	##

	TIMD_SOCKET_DIR="${SOCKET_DIR}/common"

	mkdir -p ${TIMD_SOCKET_DIR} > /dev/null 2>&1
	chmod 777 ${TIMD_SOCKET_DIR} > /dev/null 2>&1

       ##
       ## Change permission and ownership for directory /opt/graphics/common/lib/pa20_64
       ## The Xserver patch lays directory pa20_64 with permission 755 and owner  root:sys
       ## Change them to 555 and bin:bin.
       ##

       COMMON_PA="/opt/graphics/common/lib/pa20_64"

       chmod 555 $COMMON_PA > /dev/null 2>&1
       chown bin $COMMON_PA > /dev/null 2>&1
       chgrp bin $COMMON_PA > /dev/null 2>&1 
     
       IT_IS=`uname -r`
       
       if [[ $IT_IS = B.11.11 ]]
         then
         IPD_delBundleWrapper B6196AA_APZ B6262AA B6265AA B3939BA B3939A_APZ \
                              B3940BA B3940A_APZ B3941A_APZ B5428AA_APZ 
         ##PRODUCT_LIST="TechPrintSvcDK PowerShade OpenGLDebugger"
         PRODUCT_LIST="PowerShade OpenGLDebugger"
         for PRODUCT in $PRODUCT_LIST
           do
             swlist -l product $PRODUCT  > /dev/null 2>&1
             if [[ $? -eq 0 ]]
               then
                   swremove $PRODUCT
             fi
           done
           ## This is obsolete in 11.x and beyond
           swlist -l fileset Asian-Graphics.FAFMFNT-JPN  > /dev/null 2>&1
           if [[ $? -eq 0 ]]
               then
                   swremove Asian-Graphics.FAFMFNT-JPN
           fi
       fi

################################################################################
