#menu# install new software package onto hard disk
#help# 
#help#	Installpkg copies files from removable media onto the hard disk and
#help#	performs additional work as necessary so you can run that software.
#help#	From then on, you will have access to those commands.

INDIR=/usr/lib/installed
RMDIR=${INDIR}/Remove
FILEDIR=${INDIR}/Files
OPTIONS=/usr/options
CONTENTS=${INDIR}/CONTENTS
DIR=$MENUTOP/menu/softwaremgmt
export INDIR RMDIR FILEDIR OPTIONS CONTENTS DIR

cd $DIR
. ./chk_tape				# Check if the tape in 5.3 format
if [ $? != 0 ]
then
	exit 1
fi
if [ $DISTRIBUTOR = "PRIME" ]		# Yes
then
	/usr/bin/installpkg		# Install it in 5.3 way
	if [ $? = 0 ]
	then
		exit 0
	else
		exit 1
	fi
fi
					# MIPS Format
cd ${DIR}
${DIR}/mk_dir
rm -rf ${INDIR}/pkg_info > /dev/null 2>&1        #process the most current one
${DIR}/inst		# A copy of slightly modified/usr/pkg/bin/inst. 
if [ $? != 0 ]
then
	echo "
Can not install the Package "
	exit 1
fi
${DIR}/process_i		#create the display and remove files
if [ $? != 0 ]
then
	exit 1
fi
exit 0
