1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-01 22:05:08 +00:00
freebsd-ports/print/xdvi/scripts/configure
1995-06-13 20:59:35 +00:00

65 lines
2.0 KiB
Bash

#!/bin/sh
# paper size, default is not A4
A4=n
prefix=$PREFIX;
if `echo $PREFIX |grep -q X11` ; then
prefix=/usr/local
fi
CACHE=$prefix/lib/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/lib/texmf: \
-e s:/LocalLibrary/Fonts/TeXFonts:$CACHE: \
$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/lib/texmf/fonts/pk:$CACHE/pk:/tmp/pk" >> ${WRKSRC}/Imakefile
echo "DEFAULT_VF_PATH=$prefix/lib/texmf/fonts/vf" >> ${WRKSRC}/Imakefile
exit 0;