#! /bin/sh -e
#
# postinst script for Debian python2 packages.
# Written 1998 by Gregor Hoffleit <flight@debian.org>.
#

PACKAGE=python-4suite
BINAPPS=@BINAPPS@
SHAREAPPS=@SHAREAPPS@

if [ "$1" = "configure" ]; then
    # Remove obsolete alternatives
    if [ -n "$2" ] && dpkg --compare-versions "$2" lt "0.11.1-1"; then
	for i in 4odb_clean 4odb_destroy 4odb_metadig OdlParse 4odb_clear \
	         4odb_dig 4odb_odmsdump addDbDomDocument transformDbDom \
	         4odb_create 4odb_grant 4odb_odmsload initDomDb
	do
            update-alternatives --remove $i /usr/bin/$i.$PACKAGE
	done
    fi

    # update-alternatives on things that collide
    for i in $BINAPPS; do
        update-alternatives --install /usr/bin/$i $i /usr/bin/$i.$PACKAGE 50
#        --slave /usr/share/man/man1/$i.1.gz $i.1.gz /usr/share/man/man1/$i.$PACKAGE.1.gz 
    done
    for i in $SHAREAPPS; do
        update-alternatives --install /usr/share/4Suite/$i $i /usr/share/4Suite/$i.$PACKAGE 50
#        --slave /usr/share/man/man1/$i.1.gz $i.1.gz /usr/share/man/man1/$i.$PACKAGE.1.gz 
    done
fi

#DEBHELPER#
