#!/bin/sh # postinst script for thailatex # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package SOURCE_TEXMF=/usr/share/texmf-texlive TARGET_TEXMF=/usr/share/texmf BABELSTY_LOC=tex/generic/babel/babel.sty SOURCE_BABELSTY="${SOURCE_TEXMF}/${BABELSTY_LOC}" TARGET_BABELSTY="${TARGET_TEXMF}/${BABELSTY_LOC}" patch_babel_sty() { echo -n "Customizing babel.sty..." if [ ! -f ${SOURCE_BABELSTY} ]; then printf "failed: system babel.sty does not exists.\n" printf "Warning: you will not be able to use [thai] option directly in \\documentclass.\n" return fi if [ -f ${TARGET_BABELSTY} ]; then sed -i.dpkg-old '/thai.ldf/d' ${TARGET_BABELSTY} else cp ${SOURCE_BABELSTY} ${TARGET_BABELSTY} fi sed -i '/swedish/i\ \\DeclareOption{thai}{\\input{thai.ldf}}' ${TARGET_BABELSTY} echo "done." } case "$1" in configure) patch_babel_sty ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0