#!/bin/sh -e
# /usr/lib/emacsen-common/packages/remove/maxima

FLAVOR=$1
PACKAGE=maxima
ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}/

if test -x /usr/sbin/install-info-altdir; then
    echo remove/${PACKAGE}: removing Info links for ${FLAVOR}
    install-info-altdir --quiet --remove --dirname=${FLAVOR} /usr/info/maxima.info.gz
fi

if [ -d ${ELCDIR} ]; then
    echo remove/${PACKAGE}: purging byte-compiled files for ${FLAVOR}
    if [ ${FLAVOR} = emacs ]; then
	rm -f /usr/share/${FLAVOR}/site-lisp/${PACKAGE}/*.elc
    else
	rm -rf /usr/share/${FLAVOR}/site-lisp/${PACKAGE}
    fi
fi
