#ident	"@(#)atm13:pkg/postinstall	1.2"
#	Copyright (c) 1990, 1991 UNIX System Laboratories, Inc.
#	Copyright (c) 1988 AT&T
#	  All Rights Reserved

#	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF
#	UNIX System Laboratories, Inc.
#	The copyright notice above does not evidence any
#	actual or intended publication of such source code.


#
#	USL Adobe Base 13 Type 1 Fonts
#


#
# make sure we're on V.4
#
if [ `uname -r`  -lt "4.0" ]
then
	echo "This package can only be installed on Release 4.0 or later systems"
	exit 1
fi

# This code generates XLFD names for Type 1 fonts in the
# ATM Basic Fonts Package (atm13)

if [ -r /usr/X/defaults/Xwinfont ]; then
   derivedOption=`grep derived-instance /usr/X/defaults/Xwinfont |
		     sed -n 1p`
   if [ `echo $derivedOption | wc -l` -eq 1 ]; then
      derivedValues=`echo $derivedOption | cut -f2 -d=`
      fi
   fi

if [ "$derivedValues" ]; then
   : # it has been set from value in file
else
   derivedValues=10,12,14
   fi

# After fonts are installed:
cd /usr/X/lib/fonts
DERIVED_INSTANCE_PS=$derivedValues \
   LD_LIBRARY_PATH=/usr/X/lib /usr/X/bin/mkfontscale type1 mitType1 &&
   /usr/X/bin/mkfontdir   type1 mitType1



#
# let them know that the ATM/13 package is installed
#

installf $PKGINST /usr/options/$PKG.name
echo $NAME > /usr/options/$PKG.name
installf -f $PKGINST

#
# Now clean up
#
rm -rf /tmp/pkg > /dev/null 2>&1
exit ${errflag}
