#!/ibin/sh

CCS_SCRIPT=/opt/K/SCO/Mozilla/1.2.1Ab/cntl/ccs

[ -f $CCS_SCRIPT ] && {
    grep 29-Mar-2004 $CCS_SCRIPT > /dev/null || {
        cat > $CCS_SCRIPT <<EOF
#!/ibin/sh
#******************************************************************************
#       Mozilla component ccs script - updated version 29-Mar-2004
#       input:
#           \$1 is the name of the step
#           \$2 is the keyword list (e.g., INSTALL, UPGRADE, REMOVE)
#           \$3 is the package list
#=============================================================================

# Read arguments into variables
scriptname="\$0"
step="\$1"
keywords="\$2"
pkglist="\$3"

# Source in the standard functions library, ccsSetup.sh
. /ibin/ccsSetup.sh

# Set global variables indicating whether this is an upgrade or removal.
sso_upgrade=
for word in \$keywords
do
    case "\$word" in 
        UPGRADE) sso_upgrade=TRUE
                 ;;
    esac
done

PATH="/ibin:/bin:/usr/bin"
export PATH

# Check \$IQM_FILE to determine how custom was invoked and the installation
# type. If IQM_FILE exists, source it in
customMode=LAYERED
[ "\$IQM_FILE" ] && {
		# Invoking custom from the IQM.  IQM output will be stored
		# in \$IQM_FILE.
		customMode="IQM"
		. \$IQM_FILE
}

#=========================================================================
#  doPostexport
#=========================================================================
doPostexport()
{
        # using docview?
        if [ -x /usr/bin/doctool ]; then
	    /usr/bin/doctool --add \\
                NetworkDoc/Internet/Mozilla/MozillaDoc.desktop > /dev/null 2>&1
	    /usr/bin/doctool --add \\
		NetworkDoc/Internet/Mozilla/.directory > /dev/null 2>&1
        fi

        return \$?
}
 
#====================================================================== INT ===
#  doPreunexport --
#------------------------------------------------------------------------------
doPreunexport() {
        # on 5.0.7 and later, we use docview instead of scohelp.  test
        # whether 'doctool' exists to determine whether it needs to be run.
        if [ -x /usr/bin/doctool ]; then
	    /usr/bin/doctool --remove \\
                NetworkDoc/Internet/Mozilla/MozillaDoc.desktop > /dev/null 2>&1
	    /usr/bin/doctool --remove \\
		NetworkDoc/Internet/Mozilla/.directory > /dev/null 2>&1
	fi

        return \$?
}


#====================================================================== INT ===
#  main --
#
#------------------------------------------------------------------------------

case "\$step" in
        POST_EXPORT)	doPostexport
                        ;;      
        PRE_UNEXPORT)	doPreunexport
                        ;;      
esac

exit 0
EOF
    }
}

exit 0
