#!/bin/sh

set -e

FLAVOR=$1
PACKAGE=speechd-el

if [ "${FLAVOR}" != emacs ]; then
  echo "Purging $PACKAGE byte-compiled files for ${FLAVOR}..."
  rm -f /usr/share/${FLAVOR}/site-lisp/$PACKAGE/*.elc
  rm -f /usr/share/${FLAVOR}/site-lisp/$PACKAGE/*.el
  rmdir -p --ignore-fail-on-non-empty /usr/share/${FLAVOR}/site-lisp/$PACKAGE 2>/dev/null || true
  echo "Done."
fi

exit 0
