#!/bin/sh

set -e

FLAVOR=$1
echo install/biomode: 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 ]; then
    echo install/biomode: byte-compiling for ${FLAVOR}

    cp ${el_dir}/bio-mode.el ${elc_dir}
    cd ${elc_dir}
    ${FLAVOR} ${byte_compile_options} bio-mode.el
    rm -f ${elc_dir}/bio-mode.el
fi
exit 0
