#!/bin/sh
#
# postinst script for the Debian GNU/Linux musixtex package
#
#   by Anthony Fok <foka@debian.org>
#   Adjustments 2003, Roland Stigge <stigge@antcom.de>
#   Adjustments 2006, Norbert Preinig <preining@logic.at>
#   Initial release:  Mon, 14 Jul 1997 02:00:00 -0600
#     Last modified:  Tue,  2 May 2006 11:28:43 +0200

set -e

NAME=musixtex

#
# Since the version specified in the following, the musix fonts didn't change
# and therefore don't need to be deleted and regenerated when upgrading from
# there on
#
LASTFONTCHANGE=1:0.102-1

std_TEXMFMAIN=/usr/share/texmf
std_VARTEXFONTS=/var/cache/fonts

TEXMFMAIN=`kpsewhich -expand-var '$TEXMFMAIN'`
: ${TEXMFMAIN:=$std_TEXMFMAIN}

VARTEXFONTS=`kpsewhich -expand-var '$VARTEXFONTS'`
: ${VARTEXFONTS:=$std_VARTEXFONTS}

WEB2C=$TEXMFMAIN/web2c

case "$1" in
  configure)
    rm -f $WEB2C/$NAME.fmt $WEB2C/$NAME.log
    
    if dpkg --compare-versions "$2" lt "$LASTFONTCHANGE"; then
      rm -rf $VARTEXFONTS/pk/*/$font_supplier/$font_typeface
    fi
    
    ;;

  abort-upgrade|abort-remove|abort-deconfigure)
    ;;

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

#DEBHELPER#
