#!/bin/sh
set -e

FLAVOR=$1
PACKAGE="mu-cite"

if [ -z "${FLAVOR}" ]; then
  echo Need argument to determin FLAVOR of emacsen
  exit 1
fi
if [ -z "${PACKAGE}" ]; then
  echo Internal error: need package name
  exit 1
fi

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

echo "remove/$PACKAGE: purging byte-compiled files for $FLAVOR"
rm -rf "$ELCDIR"
if [ -L "/etc/$FLAVOR/site-start.d/51$PACKAGE.el" ]; then
    rm -f "/etc/$FLAVOR/site-start.d/51$PACKAGE.el"
fi
exit 0
