#!/bin/sh

PACKAGE=linuxdoc-tools
CENTRALCAT=/etc/sgml/${PACKAGE}.cat

INFODIR=/usr/share/info

set -e

case $1 in

    configure)

       install-info --quiet --section \
         "Document Preparation" "Document Preparation" \
          --description="Linux Documentation Project SGML tools" \
          ${INFODIR}/linuxdoc-sgml.info.gz

	# remove old sgml catalog
       install-sgmlcatalog --quiet --remove $PACKAGE

	# add new sgml catalog
	update-catalog --quiet --add ${CENTRALCAT} \
	  /usr/share/linuxdoc-tools/linuxdoc-tools.catalog
	# add central catalog to the super catalog
	update-catalog --quiet --add --super ${CENTRALCAT}

       if [ -x /usr/bin/texhash ]; then
           /usr/bin/texhash
       fi

       if which install-docs >/dev/null 2>&1; then
         install-docs -i /usr/share/doc-base/linuxdoc-tools
       fi

    ;;

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

    ;;

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

exit 0

