#! /bin/bash -e
# /usr/lib/emacsen-common/packages/install/x-symbol

# This package works with xemacs only

FLAVOR=$1
ELD=/usr/share/xemacs/site-lisp/x-symbol/
ELCD=/usr/share/${FLAVOR}/site-lisp/x-symbol/
FILES="`cd /usr/share/xemacs/site-lisp/x-symbol; echo *.el`"

echo install/x-symbol: Handling install of emacsen flavor ${FLAVOR}

if [ "${FLAVOR}" == xemacs20 -o "${FLAVOR}" == xemacs21 ]; then
#    echo install/x-symbol: install Info links for ${FLAVOR}
#    install-info-altdir --quiet --section "" "" --dirname=${FLAVOR} \
#	/usr/info/x-symbol.info.gz
    echo install/x-symbol: byte-compiling for ${FLAVOR}
    cd $ELD
    umask 022
    rm -f lisp/*.elc || true
    make XEMACS=${FLAVOR} lisp
    install -m 755 -d $ELCD
    mv -f lisp/*.elc $ELCD
    install -m 775 -d /etc/$FLAVOR/site-start.d
    install -m 644 startup.el /etc/$FLAVOR/site-start.d/42x-symbol.el
fi
