#!/bin/sh
# @(#)postinstall 1.10 02/02/27 SMI
# Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
# postinstall script to edit Solaris Docs entry point

if [ "${PKG_INSTALL_ROOT:-/}" = "/" ]; then
	SDOCSBASE="`pkgparam SUNWsdocs BASEDIR`"
	DOCSDIR=${SDOCSBASE}
else
	SDOCSBASE="`pkgparam -R ${PKG_INSTALL_ROOT} SUNWsdocs BASEDIR`"
	DOCSDIR=${PKG_INSTALL_ROOT}${SDOCSBASE}
fi

EDITSUNDOCS=${DOCSDIR}/SUNWsdocs/sun_docs/edit_sundocshtml
SUNDOCSDIR="/var/opt/sun_docs"

$EDITSUNDOCS i

if [ $? -eq 0 ]; then

	# Create link to sundocs.html file
	if [ ! -h ${BASEDIR}/sun_docs/sundocs.html ]; then
		ln -s ${SUNDOCSDIR}/sundocs.html \
			${BASEDIR}/sun_docs/sundocs.html
	fi

	exit 0
else
	exit 2
fi
