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

74 lines
1.6 KiB
Text

PKGNAME="texlive-langcjk"
UPDMAP="/usr/share/texmf-config/web2c/updmap.cfg"
SYNCWITHTREES=''
NEWMAPS=`mktemp`
cat <<EOF > $NEWMAPS
Map bkaiu.map
Map bsmiu.map
Map dgj.map
Map dmj.map
Map garuda-c90.map
Map gbsnu.map
Map gkaiu.map
Map mc2j.map
Map mcj.map
Map mr2j.map
Map mrj.map
Map norasi-c90.map
Map umj.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."
}
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."
}
pre_remove() {
for m in `cut -d' ' -f2 $NEWMAPS`; do
sed -i "/\s$m/d" $UPDMAP ;
done
}
post_remove() {
post_install
}