#!/bin/sh

set -e

FLAVOR=$1
elc_dir=/usr/share/${FLAVOR}/site-lisp/skribe

echo remove/skribe-el: Handling removal of emacsen flavor ${FLAVOR}

if [ ${FLAVOR} != emacs ]
then
   echo emacsen-common: purging byte-compiled files for ${FLAVOR}
   rm -f ${elc_dir}/*.elc
   [ -d ${elc_dir} -a `ls -la ${elc_dir}|wc -l` -gt 3 ] && rmdir ${elc_dir}
fi

exit 0;
