#!/bin/sh
# /usr/lib/emacsen-common/packages/remove/x-face-el
set -e

FLAVOR=$1
PACKAGE="x-face-el"

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 -n "remove/${PACKAGE}: Handling removal of emacsen flavor ${FLAVOR} ..."
rm -rf ${ELCDIR}
if [ -L "/etc/$FLAVOR/site-start.d/70$PACKAGE.el" ]; then
    rm -f "/etc/$FLAVOR/site-start.d/70$PACKAGE.el"
fi
echo " done."

exit 0
