#! /bin/sh -e
# /usr/lib/emacsen-common/packages/install/rabbit
# Written by Jim Van Zandt <jrv@debian.org>, borrowing heavily
# from the install scripts for gettext by Santiago Vila
# <sanvila@ctv.es> and octave by Dirk Eddelbuettel <edd@debian.org>.

FLAVOR=$1
PACKAGE=rabbit

case $FLAVOR in
    emacs|*xemacs*|emacs20|emacs19|mule2)
        exit 0
        ;;
esac

ELDIR=/usr/share/emacs/site-lisp/${PACKAGE}
ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
install -m 755 -d ${ELCDIR}
cd ${ELDIR}
FILES=`echo *.el`
cp ${FILES} ${ELCDIR}
cd ${ELCDIR}
cat << EOF > path.el
(setq load-path (cons "." load-path))
(setq byte-compile-warnings nil)
(require 'cl)
(require 'rd-mode)
EOF
FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile"
${FLAVOR} ${FLAGS} ${FILES}
rm -f *.el path.el

exit 0
