summaryrefslogtreecommitdiff
path: root/print/xdvi/scripts/configure
blob: 08fcea3324be069f05a79d8355002154d89f10a0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh

# paper size, default is no nor A4
A4=n
#default font cache directory: must be world writable
CACHE=/tmp

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/"
  shift
done

echo "Choose a font cache directory for automatic font generation"
echo -n "(this directory must be world writable) [$CACHE]: "
read answ; if [ "$answ" != "" ]; then CACHE=$answ; fi
  
sed -e s:/usr/lib/tex:/usr/local/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=/usr/local/lib/texmf/fonts/pk:$CACHE/pk"  >> ${WRKSRC}/Imakefile
echo "DEFAULT_VF_PATH=/usr/local/lib/texmf/fonts/vf" >> ${WRKSRC}/Imakefile
exit 0;