#! /bin/sh
# preinst script for thailatex
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <new-preinst> `install'
#        * <new-preinst> `install' <old-version>
#        * <new-preinst> `upgrade' <old-version>
#        * <old-preinst> `abort-upgrade' <new-version>
#
# For details see /usr/share/doc/packaging-manual/

case "$1" in
    install|upgrade)
        # remove old thai.map in TEXMFSYSCONFIG
        old_md5sum=78e5add055dd03616e5bbfbe54db6947
        current_md5sum=`grep thai.map /var/lib/dpkg/status | cut -f 3 -d ' ' 2>/dev/null || true`
        if [ $old_md5sum = "$current_md5sum" ]; then
            rm -f /etc/texmf/dvips/thai.map 2>/dev/null
        fi
    ;;

    abort-upgrade)
    ;;

    *)
        echo "preinst called with unknown argument \`$1'" >&2
        exit 0
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0


