#!/bin/sh

# Emacs remove: /usr/lib/emacsen-common/packages/remove/aumix-mode

# Copyright 2005, 2007, 2008, 2009, 2014 Kevin Ryde
# Copyright 1998, 2009 Robert Browning
#
# This file is part of aumix-mode.  It was derived from the example code in
# /usr/share/doc/emacsen-common/debian-emacs-policy.gz of emacsen-common
# version 1.4.16.  That code is by Rob Browning and covered by the GPL, as
# described in /usr/share/doc/emacsen-common/copyright.
#
#
# aumix-mode is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3, or (at your option) any later
# version.
#
# aumix-mode is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

set -e

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

echo remove/aumix-mode: Handling removal of emacsen flavor ${FLAVOR}

if [ ${FLAVOR} != emacs ]
then
  echo aumix-mode: purging byte-compiled files for ${FLAVOR}

  # -f to ignore if the directory is somehow already gone
  rm -f $elc_dir/*.el $elc_dir/*.elc
  # || true to quietly ignore if the directory is somehow not empty
  rmdir $elc_dir || true
fi
exit 0
