#!/bin/sh
#ident "@(#)preinstall	1.1 99/03/31 SMI"

# We want to preserve the SMC.jar file that's already there so that it
# doesn't get overwritten by the SEAS 3.0 installer wizard.  This should be
# put back by the postinstall script.

if [ -f $BASEDIR/$PRODUCTDIR/beans/SMC.jar ]; then
	cp -p $BASEDIR/$PRODUCTDIR/beans/SMC.jar /var/tmp/SMC_upgrade_backup.jar
fi

# Any version of this package that had smcappadm in it should have that
# file removed first.

OLDBASEDIR=`pkgparam SUNWmc BASEDIR`
OLDPRODUCTDIR=`pkgparam SUNWmc PRODUCTDIR`
if pkgchk -lp $OLDBASEDIR/$OLDPRODUCTDIR/lib/smcappadm | egrep "\<$PKGINST\>"; then
	removef    $PKGINST $OLDBASEDIR/$OLDPRODUCTDIR/lib/smcappadm
	removef -f $PKGINST
fi
