--- communicator-v47.x86-bsdi-bsd2/ns-install.orig	Thu Sep 16 19:59:00 1999
+++ communicator-v47.x86-bsdi-bsd2/ns-install	Sun Apr  9 17:32:07 2000
@@ -84,22 +84,10 @@ then
 	exit 1
 fi
 #
+# We use OpenBSD's ports environment instead.
 #
-# If MOZILLA_HOME is set, assume that is the place to install.
-# Otherwise, make an educated guess at the "right" default
-# directory.
-#
-if test ! -z "${MOZILLA_HOME}"
-then
-	INSTALL_DIR="${MOZILLA_HOME}"
-else
-	if test -d /opt
-	then
-		INSTALL_DIR="/opt/netscape"
-	else
-		INSTALL_DIR="/usr/local/netscape"
-	fi
-fi
+INSTALL_DIR="${PREFIX}/netscape"
+
 #
 #
 # See if we have to use the lame SYS-V echo command flags.
@@ -137,63 +125,22 @@ do
 	fi
 done
 #
-echo ""
-echo "Please specify the directory path under which the software will be"
-echo "installed.  The default directory is ${INSTALL_DIR}, but you may"
-echo "install anywhere you wish (if you have permission to do so)."
-echo ""
 flag=1
 while test ${flag} -eq 1
 do
-	${ECHO} "Location for ${PRODUCT} software [${INSTALL_DIR}]: ${ENDER}"
-	read TARGET
-	if test -z "${TARGET}"
-	then
-		TARGET="${INSTALL_DIR}"
-	fi
-	if test ! -z "`echo ${TARGET} | grep '~'`"
-	then
-		TARGET=`echo ${TARGET} | sed "s:~:${HOME}:"`
-	fi
-#
+	TARGET="${INSTALL_DIR}"
+
 	flag=0
 	if test ! -d ${TARGET}
 	then
-		echo ""
-		${ECHO} "${TARGET}: No such directory.  Do you wish to create it? (y/n)[y] ${ENDER}"
-		read check
-		if test "${check}" = "n" -o "${check}" = "N"
-		then
-			flag=1
-		else
-			#
-			# The -p flag may cause an error on some HP-UX systems.
-			# Removing the -p will work for 'basename TARGET' as long
-			# as 'dirname TARGET' exists.
-			#
-			mkdir -p ${TARGET}
-			if test $? -ne 0
-			then
-				echo "ERROR: Problem creating ${TARGET}"
-				exit 2
-			fi
-		fi
-	else
-		echo ""
-		echo "Existing '${TARGET}' directory found."
-		echo ""
-		echo "The existing contents may be modified or replaced if you install in"
-		echo "this directory.  If you choose not to install in '${TARGET}',"
-		echo "you will be prompted for a different directory."
-		echo ""
-		${ECHO} "Do you wish to install in '${TARGET}'? (y/n)[y] ${ENDER}"
-		read check
-		if test "${check}" = "n" -o "${check}" = "N"
+		mkdir -p ${TARGET}
+		if test $? -ne 0
 		then
-			flag=1
+		    echo "ERROR: Problem creating ${TARGET}"
+		    exit 2
 		fi
 	fi
-#
+
 	if test ${flag} -eq 0
 	then
 		(echo "Write test." 2>/dev/null > ${TARGET}/${TESTFILE}) 2>/dev/null
@@ -217,13 +164,6 @@ echo ""
 echo ""
 echo "Installing ${PRODUCT} files..."
 #
-#
-# Make a list of the files in this package, so we can check for
-# existing files with the same names and save them.
-#
-FILELIST="`${GZIP} -dc ${PACKAGE} | tar -tvf - | awk '{print $NF}'`"
-#
-#
 # Keep a log of this installation for reference.
 #
 LOGFILE="ns-install.log-$$"
@@ -231,30 +171,6 @@ date > ${LOGFILE}
 echo "Files installed:" >> ${LOGFILE}
 echo "================" >> ${LOGFILE}
 #
-#
-# Check for existing files and move them out of the way.
-#
-if test -d ${TARGET}/java/classes
-then
-	echo " ==> moving existing '${TARGET}/java/classes' to '${TARGET}/java/classes.old'"; \
-	/bin/rm -rf ${TARGET}/java/classes.old
-	mv ${TARGET}/java/classes ${TARGET}/java/classes.old
-fi
-for i in ${FILELIST}
-do
-	echo "${i}" >> ${LOGFILE}
-	if test ! -d ${TARGET}/${i}
-	then
-		(cd ${TARGET}; \
-		 /bin/rm -f ${i}.old; \
-		 if test -f ${i}; then \
-			echo " ==> moving existing '${TARGET}/${i}' to '${TARGET}/${i}.old'"; \
-			mv ${i} ${i}.old; \
-		 fi)
-	fi
-done
-#
-#
 # Actually install the package in TARGET.
 #
 ${GZIP} -dc ${PACKAGE} | (cd ${TARGET}; tar -x${TAR_OPTIONS}f -)
@@ -269,33 +185,28 @@ if test "${PRODUCT}" = "Communicator" -o
 then
 	echo ""
 	echo "Installing ${PRODUCT} Java files..."
+	/bin/rm -rf ${TARGET}/java
 	if test ! -d ${TARGET}/java/classes
 	then
 		(cd ${TARGET}; mkdir -p java/classes)
 	fi
 	for i in *.jar
 	do
-		if test -f ${TARGET}/java/classes/${i}
-		then
-			echo " ==> moving existing '${TARGET}/java/classes/${i}' to '${TARGET}/java/classes/${i}.old'"
-			/bin/rm -f ${TARGET}/java/classes/${i}.old
-			mv ${TARGET}/java/classes/${i} ${TARGET}/java/classes/${i}.old
-		fi
 		tar -cf - ${i} | (cd ${TARGET}/java/classes; tar -xf -)
 		echo "${i}" >> ${LOGFILE}
-		/bin/rm -f ${TARGET}/${i} ./${i}
+		/bin/rm -f ${TARGET}/${i}
 		echo "${i},${BLDVERS},${TARGET}/java/classes" >> ${REG_INFILE}
 	done
-#
+
 	#
 	# Try to properly deal with the font.properties files, to hopefully
 	# avoid users having to set MOZILLA_JAVA_FONT_PROPERTY_PATH, or
 	# just assuming Java font-handling is broken.
 	#
-	if test ! -z "`ls /bin/uname`"
+	if test ! -z "`ls /usr/bin/uname`"
 	then
 		MOVE_FONTS="TRUE"
-		case `/bin/uname` in
+		case `/usr/bin/uname` in
 			AIX)
 				PLATFORM="aix"
 				;;
@@ -317,19 +228,6 @@ then
 			mv ${TARGET}/java/classes/${PLATFORM}/* ${TARGET}/java/classes/.
 		fi
 	fi
-#
-	#
-	# Is this a virgin install?  If so, create the .netscape dir
-	# and put the default bookmark file in it.
-	#
-	if test ! -d ${HOME}/.netscape
-	then
-		# New install, or upgrade from 0.x or 1.x.
-		mkdir ${HOME}/.netscape
-		cp ${TARGET}/bookmark.htm ${HOME}/.netscape/bookmarks.html
-		chmod 644 ${HOME}/.netscape/bookmarks.html
-		echo "${HOME}/.netscape/bookmarks.html" >> ${LOGFILE}
-	fi
 fi
 #
 echo ""
@@ -356,7 +254,6 @@ do
 	esac
 	${GZIP} -dc ${pkg} | (cd ${TARGET}; tar -x${TAR_OPTIONS}f -)
 	echo "${pkg},${BLDVERS},${TARGET}" >> ${REG_INFILE}
-	/bin/rm -f ${pkg}
 done
 #
 #
@@ -374,20 +271,7 @@ fi
 #
 # Install the vreg binary in the TARGET directory.
 #
-if test -f ${TARGET}/vreg
-then
-	/bin/rm -f ${TARGET}/vreg.old
-	mv ${TARGET}/vreg ${TARGET}/vreg.old
-	# Handle the case where TARGET == . (meaning we just moved the file we just installed).
-	if test ! -f ./vreg
-	then
-		mv ${TARGET}/vreg.old ${TARGET}/vreg
-	else
-		mv ./vreg ${TARGET}/vreg
-	fi
-else
-	mv ./vreg ${TARGET}/vreg
-fi
+cp ./vreg ${TARGET}/vreg
 #
 #
 # Register the product so Automatic Software Download can work.
@@ -413,7 +297,6 @@ then
 	awk '{printf("\techo \"%s\" >>/tmp/infile\n", $0)}' ${REG_INFILE}
 	echo "	${TARGET}/vreg ${TARGET}/${VREGISTRY} /tmp/infile"
 	echo ""
-	/bin/rm -f ns-install ${PACKAGE} ${REG_INFILE} core
 	exit 3
 fi
 #
@@ -422,11 +305,6 @@ echo ""
 echo "The Netscape ${PRODUCT} software installation is complete."
 echo ""
 echo ""
-#
-#
-# Get rid of the trash.
-#
-/bin/rm -f ns-install ${PACKAGE} ${REG_INFILE}
 #
 echo ""
 exit 0
