#!/bin/sh

# mkfontdesc
# 02.01.1995 Roland Meier
# 03.01.1995 modified by Thomas Esser
# 04.07.1995 major changes for teTeX-0.3

progname=`basename $0`

TEXMF=`kpsetool -v '$TEXMF'`
pk=$TEXMF/fonts/pk
FONTDESC=$TEXMF/fonts/fontdesc

if [ ! -d $pk ]; then
	echo "Ooops! font-directory $pk does not exist." >&2
	echo "Need to change value for \$TEXMF?" >&2
	exit
fi

if [ -f $FONTDESC ]; then
	rm -f $FONTDESC.bak
	mv $FONTDESC $FONTDESC.bak
fi

echo "$progname: generating file $FONTDESC ... " >&2

(
    echo "# automatically generated by mkfontdesc"
    echo "# "
    echo "font	pk	*	3	./%f.%mpk"
    find $pk -type d -print | sed 's@^@font	pk	*	3	@;s@$@/%f.%mpk@'
) >$FONTDESC

echo "Done." >&2
