
# Copyright 2002 Sun Microsystems, Inc. All Rights Reserved.
#
# @(#)postremove	1.14 10/07/02


# postremove script for Netscape package.
 
#
# Return pid of named process in variable "pid"
#
# Exit codes for installation scripts
 
export BASEDIR

nsdir=$BASEDIR/dt/appconfig
 
e_ok=0
e_fatal=1      # stop installation on this exit
e_warning=2    # Installation will go on.
e_int=3        # Interrupted. Stop installation
e_reboot=10    # User must reboot after installation of all selected packages
e_rebootnow=20 # User must reboot right after installation of current package
               # To be added to one of the single-digit exit codes above
 
#
# Trap interrupt
#
trap `exit $e_int` 15
#
 
# test to see if BASEDIR of the CDE & Netscape are the same
if [ "$PKG_INSTALL_ROOT" != "" ]; then
        BASEDIR_CDE=`pkginfo -R ${PKG_INSTALL_ROOT} -l SUNWdtbas | grep BASEDIR | sed 's/BASEDIR: *//' | sed 's/ *//'`
else
        BASEDIR_CDE=`pkginfo -l SUNWdtbas | grep BASEDIR | sed 's/BASEDIR: *//' | sed 's/ *//'`
fi

#echo "++++++ postremove+++++++++" > /tmp/swtest/script2.out
#echo "PKG_INSTALL_ROOT=$PKG_INSTALL_ROOT" >> /tmp/swtest/script2.out
#echo "BASEDIR=$BASEDIR" >> /tmp/swtest/script2.out
#echo "BASEDIR_CDE=$BASEDIR_CDE" >> /tmp/swtest/script2.out
#echo "nsdir=$nsdir" >> /tmp/swtest/script2.out

# do the following only if the package is installed
if [ "$PKG_INSTALL_ROOT" != "" ]; then
	pkginfo -R ${PKG_INSTALL_ROOT} -q $PKGINST
else
	pkginfo -q $PKGINST
fi
if [ $? -eq 0 ]
then
	if [ -h $nsdir/SUNWns/plugins/libjavaplugin_oji.so ]; then
		rm -f $nsdir/SUNWns/plugins/libjavaplugin_oji.so
	fi
	if [ -h $nsdir/SUNWns/java ]; then
		rm -f $nsdir/SUNWns/java
	fi
	if [ -h ${PKG_INSTALL_ROOT}$BASEDIR_CDE/dt/bin/sun_netscape ]; then
		rm -f ${PKG_INSTALL_ROOT}$BASEDIR_CDE/dt/bin/sun_netscape
	fi
fi


#
exit $e_ok
 

