#! /bin/sh
### /usr/local/src/ghostscript/make-Fontmap.sh, Wed Oct  4 06:49:23 2000
### Edit by Nelson H. F. Beebe <beebe@math.utah.edu>
### ====================================================================
### Create Fontmap.new to reflect additional fonts available locally.
###
### Usage:
###	./make-fontmap.sh
###
### [21-May-2002] -- Update for new ghostscript directory names
### [04-Oct-2000] -- Original version.
### ====================================================================

SRCDIR=`dirname $0`

cd $SRCDIR

### Old-style gsx.yz directory names:
### HIGHEST_GS_VERSION=`find gs?.?? -prune -type d | \
###			/usr/local/bin/sort | \
###				tail -1`

### New-style ghostscript-x.yz directory names:
HIGHEST_GS_VERSION=`find ghostscript-* -prune -type d | \
			/usr/local/bin/sort | \
				tail -1`

BASEMAP=$SRCDIR/${HIGHEST_GS_VERSION}/lib/Fontmap.GS
OTHERMAPS="$SRCDIR/maps/Fontmap.* \
	/u/sy/beebe/psres/PSres.upr \
	/usr/local/sys/adobe/Acrobat3.02/Distillr/Xtras/PSres.upr \
	/usr/local/sys/adobe/Acrobat3.02/Fonts/PSres.upr"

echo ""
echo "Highest ghostscript version = " ${HIGHEST_GS_VERSION}
awk -f $SRCDIR/make-Fontmap.awk $BASEMAP $OTHERMAPS > Fontmap.new
echo ""
ls -l Fontmap.new
