PKGBUILDs/extra/texlive-core/texlive.install
2009-10-09 21:23:22 -05:00

107 lines
2.4 KiB
Text

PKGNAME="texlive-core"
UPDMAP="/usr/share/texmf-config/web2c/updmap.cfg"
SYNCWITHTREES=''
NEWMAPS=`mktemp`
cat <<EOF > $NEWMAPS
Map euler.map
Map charter.map
Map fpls.map
Map l7x-urwvn.map
Map lm.map
Map marvosym.map
Map pazo.map
Map pxfonts.map
Map qag.map
Map qbk.map
Map qcr.map
Map qcs.map
Map qhv.map
Map qpl.map
Map qtm.map
Map qzc.map
Map tabvar.map
Map txfonts.map
Map utopia.map
Map zpeu.map
MixedMap ccpl.map
MixedMap cm.map
MixedMap cmextra.map
MixedMap cmtext-bsr-interpolated.map
MixedMap csother.map
MixedMap cstext.map
MixedMap cyrillic.map
MixedMap eurosym.map
MixedMap latxfont.map
MixedMap mflogo.map
MixedMap plother.map
MixedMap pltext.map
MixedMap rsfs.map
MixedMap stmaryrd.map
MixedMap symbols.map
MixedMap tipa.map
MixedMap wasy.map
MixedMap yhmath.map
EOF
pre_install() {
cat $NEWMAPS >> $UPDMAP
}
post_install() {
echo ">>> texlive: updating the filename database..."
texconfig-sys rehash
echo ">>> texlive: updating the fontmap files with updmap..."
updmap-sys --quiet --nohash
echo " done."
echo -n "creating all formats..."
fmtutil-sys --all 1>/dev/null
echo " done."
echo " (logs are under /usr/share/texmf-var/web2c/<engine>/<formatname>.log)"
}
pre_upgrade() {
OLDMAPS="/usr/share/texmf-var/arch/installedpkgs/$PKGNAME.maps"
if [ -f $OLDMAPS ] ; then
MAPSDIFF=`mktemp`
TOADD=`mktemp`
diff -B $OLDMAPS $NEWMAPS | sed 's/\s\+/ /g' > $MAPSDIFF
TOREMOVE=`cat $MAPSDIFF | egrep '^<' | cut -d' ' -f3`
cat $MAPSDIFF | egrep '^>' | sed 's/^> //' > $TOADD
if [ "x$TOREMOVE" != "x" ]; then
for map in $TOREMOVE; do
sed -i "/\s$map/d" $UPDMAP
done
fi
if [ -s $TOADD ]; then
cat $TOADD >> $UPDMAP
fi
else
echo "Warning: file $PKGNAME.maps not found"
echo "(ignore the above if updating from TL2008 or from TL2009 in testing)"
SYNCWITHTREES="--syncwithtrees"
fi
}
post_upgrade() {
echo ">>> texlive: updating the filename database..."
texconfig-sys rehash
echo ">>> texlive: updating the fontmap files with updmap..."
updmap-sys --quiet --nohash $SYNCWITHTREES
echo " done."
echo -n "recreating all formats..."
fmtutil-sys --all 1>/dev/null
echo " done."
echo " (logs are under /usr/share/texmf-var/web2c/<engine>/<formatname>.log)"
}
pre_remove() {
for m in `cut -d' ' -f2 $NEWMAPS`; do
sed -i "/\s$m/d" $UPDMAP ;
done
}
post_remove() {
post_install
}