#!/bin/sh

set -e

if [ "$1" = "configure" -o "$1" = "abort-upgrade" ] ; then
    # in case old version of star (that used /usr for its binaries) was installed
    update-alternatives --remove mt /usr/bin/mt-star
    update-alternatives --remove rmt /usr/sbin/rmt-star

    update-alternatives --install /bin/mt mt /bin/mt-star 10 --slave /usr/share/man/man1/mt.1.gz mt.1.gz /usr/share/man/man1/mt-star.1.gz
    update-alternatives --install /usr/sbin/rmt mt /sbin/rmt-star 10 --slave /usr/share/man/man8/rmt.1.gz rmt.1.gz /usr/share/man/man8/rmt-star.1.gz
fi

