#! /bin/sh -e
# /usr/lib/emacsen-common/packages/install/aplus-fsf-el

# Written by Neil Roeth <neil@debian.org>, borrowing heavily
# from the install scripts for dpkg-dev-el by Jim Van Zandt
# <jrv@vanzandt.mv.com>.

FLAVOR=$1
PACKAGE=aplus-fsf-el

if [ "${FLAVOR}" != "xemacs21" ]; then exit 0; fi

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

FLAGS="-no-site-file -q -batch -l path.el -f batch-byte-compile"

ELDIR=/usr/share/emacs/site-lisp/${PACKAGE}
ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
[ -d $ELCDIR ] || mkdir -p $ELCDIR

install -m 755 -d ${ELDIR}
install -m 755 -d ${ELCDIR}

cd ${ELDIR}
FILES=`echo *.el`
cp ${FILES} ${ELCDIR}
cd ${ELCDIR}

cat << EOF > path.el
(setq load-path (cons "." load-path) byte-compile-warnings nil)
EOF
${FLAVOR} ${FLAGS} ${FILES}
rm -f ${FILES} path.el

exit 0
