#!/bin/sh

set -e

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

case ${FLAVOR} in
    xemacs*)
        echo "Sorry, artist doesn't work with XEmacs"
	exit 0
        ;;
esac

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/artist: byte-compiling for ${FLAVOR}

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