#!/bin/sh
# /usr/lib/emacsen-common/packages/install/bhl
set -e

FLAVOR=$1
echo install/bhl: Handling install of emacsen flavor ${FLAVOR}

byte_compile_options="-batch -f batch-byte-compile"
el_dir=/usr/share/emacs/site-lisp/
elc_dir=/usr/share/${FLAVOR}/site-lisp/

if [ ${FLAVOR} != emacs -a ${FLAVOR} != emacs20 ]
then
  echo install/bhl: byte-compiling for ${FLAVOR}

  cp ${el_dir}bhl.el ${elc_dir}

  cd ${elc_dir} && ${FLAVOR} ${byte_compile_options} bhl.el

  rm ${elc_dir}bhl.el
fi

exit 0
