1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-08 23:06:56 +00:00
freebsd-ports/print/xdvi/scripts/configure
1997-03-09 22:52:25 +00:00

76 lines
2.2 KiB
Bash

#!/bin/sh
if [ X$PACKAGE_BUILDING = X ]; then
READ=read
else
READ=_read
fi
_read () {
echo
answ=""
}
# paper size, default is not A4
A4=n
prefix=$PREFIX;
if `echo $PREFIX |grep -q X11` ; then
prefix=/usr/local
fi
CACHE=$prefix/share/texmf/fonts
if [ -f $PREFIX/bin/MakeTeXPK ]; then
echo "**WARNING** MakeTeXPK already exists in $PREFIX/bin"
echo "**WARNING** This file will be replaced during install."
echo
fi
if [ ! -f ${WRKSRC}/MakeTeXPK.orig ]; then
mv ${WRKSRC}/MakeTeXPK ${WRKSRC}/MakeTeXPK.orig || exit 1
fi
#find the resolutions
RES=`awk '{if(/test $BDPI/) printf "%s ",$5}' < ${WRKSRC}/MakeTeXPK.orig`
# and the corresponding modes
MODES=`awk -F= '{if(/MODE=[a-zA-Z]/) print $2}' < ${WRKSRC}/MakeTeXPK.orig`
set $MODES
echo "I need to set the mode of our printing/output device for the resolutions"
echo "$RES dpi. (the mode must be in your modes.mf file)"
SUBST=
for i in $RES; do
echo -n "mode for $i dpi [$1]: ";
$READ answ; if [ "$answ" = "" ]; then answ=$1; fi
SUBST="$SUBST -e s/MODE=$1/MODE=$answ/"
if [ $i = 600 -a $answ != imagen ]; then
SUBST="$SUBST -e s/MAG=\"/_MAG=\"/"
fi
shift
done
rm -f $SCRIPTDIR/post-install
echo
echo "Choose a font directory for automatic font generation."
echo "------------------------------------------------------"
echo "The default directory is $CACHE. If you"
echo "don't want to make this directory world writable, then you"
echo "can choose eg. /tmp. Then you will have to periodically move "
echo "the files to $CACHE/pk."
echo -n "font directory [$CACHE]: "
$READ answ; if [ "$answ" != "" ]; then
CACHE=$answ;
else
echo "mkdir -p $CACHE/pk; chmod 1777 $CACHE/pk" > $SCRIPTDIR/post-install
fi
sed -e s:/usr/lib/tex:$prefix/share/texmf: \
-e s:/LocalLibrary/Fonts/TeXFonts:$CACHE: \
-e s:-v:-verbose: \
$SUBST <${WRKSRC}/MakeTeXPK.orig >${WRKSRC}/MakeTeXPK
# Imakefile
chmod +w ${WRKSRC}/Imakefile
echo "OSDEFS=" >> ${WRKSRC}/Imakefile || exit 1;
echo "OPTIONDEFS=-DUSE_PK -DGREY -DPS_GS -DMAKEPK -DBUTTONS" >> ${WRKSRC}/Imakefile
echo "DEFAULT_FONT_PATH=$prefix/share/texmf/fonts/pk:$CACHE/pk:/tmp/pk" >> ${WRKSRC}/Imakefile
echo "DEFAULT_VF_PATH=$prefix/share/texmf/fonts/vf" >> ${WRKSRC}/Imakefile
exit 0;