#!/bin/sh

# Original Author: Manoj Srivastava <srivasta@tiamat.datasync.com>

set -e

FLAVOUR=$1
PACKAGE="gnus"

if [ "X$FLAVOUR" = "X" ]; then
    echo Need argument to determine FLAVOUR of emacs;
    exit 1
fi

ELDIR=/usr/share/emacs/site-lisp/$PACKAGE
ELCDIR=/usr/share/$FLAVOUR/site-lisp/$PACKAGE/

case $FLAVOUR in
    emacs19 | emacs20 | emacs)
	echo "remove/$PACKAGE: Ignoring emacsen flavor $FLAVOUR."       
        ;;
    emacs22 | emacs21 | xemacs21 | emacs-snapshot)
        echo -n "remove/$PACKAGE: Removing for $FLAVOUR..."
	if [ -d $ELCDIR ]; then
	    rm -fr $ELCDIR
	fi
        echo " done."   
        ;;
    *)
        echo "remove/$PACKAGE: Ignoring emacsen flavor $FLAVOUR."       
        ;;
esac
