#! /bin/sh

set -e

PACKAGE=nethack-el
ELDIR=/usr/share/emacs/site-lisp/nethack
FLAGS="${SITEFLAGS} -q -batch -f batch-byte-compile"
FLAVOUR=$1
ELCDIR=/usr/share/${FLAVOUR}/site-lisp/nethack

if [ $FLAVOUR = emacs21 ]; then
	echo install/${PACKAGE}: Handling install for emacsen flavor $FLAVOUR
	install -m 755 -d ${ELCDIR}
	cd ${ELDIR} && cp *.el ${ELCDIR}
	cd ${ELCDIR} && \
	${FLAVOUR} ${FLAGS} *.el
	cd ${ELCDIR} && rm -f *.el
fi
