#! /bin/sh -e

FLAVOR=$1
PACKAGE=c-sig

echo install/${PACKAGE}: Handling install of emacsen flavor ${FLAVOR}

ELDIR=/usr/share/emacs/site-lisp/${PACKAGE}/
ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}/

if [ ${FLAVOR} = emacs ]
then
    echo "Ignoring emacsen flavor ${FLAVOR}"
else
    echo install/${PACKAGE}: byte-compiling for ${FLAVOR}

    install -m 755 -d ${ELCDIR}
    
    (
        cd ${ELDIR}
        ${FLAVOR} -batch -no-site-file -f batch-byte-compile c-sig.el
        mv -f *.elc ${ELCDIR}
    )
fi

exit 0
