#!/bin/sh

# 
# This script is executed after the patch has been installed
#
#
#################################################################################
# Exit codes for installation scripts 
#################################################################################

e_ok=0	       # script completed successfully.
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
               # To be added to one of the single-digit exit code above
e_rebootnow=20 # User must reboot right after installation of current package
               # To be added to one of the single-digit exit code above

LS="/bin/ls"
RM="/bin/rm"
MV="/bin/mv"
LN="/bin/ln"
AWK="/bin/awk"
NAWK="/bin/nawk"
SED="/bin/sed"
CUT="/bin/cut"
ECHO="/bin/echo"
GREP="/bin/grep"
CHOWN="/bin/chown"
TAIL="/bin/tail"
PKGPARAM="/bin/pkgparam"
PKGCHK="/usr/sbin/pkgchk"
REMOVEF="/usr/sbin/removef"

#Name of the Calendar package
PKG="SUNWics5"

#Calendar Base directory
BASEDIR=`$PKGPARAM -R $ROOTDIR $PKG BASEDIR`

#Calendar Root directory
if [ "$ROOTDIR" = "/" -o "$ROOTDIR" = "" ]; then
  PKG_INSTALL_ROOT=""
else
  PKG_INSTALL_ROOT="$ROOTDIR"
fi

#Moves the not-supposed-to-be-here deletes file away
filename="deletes"
src="$PKG_INSTALL_ROOT/var/sadm/pkg/$PKG/install/$filename"
dst="$PKG_INTALL_ROOT$BASEDIR/$PKG/cal/config-template/$filename"
if [ -f $src ]; then
  # moves the deletes file to config-template directory
  $MV $src $dst
fi

exit $e_ok;
