#!/bin/bash -e # # $Id$ # # /usr/lib/emacsen-common/packages/install/debian-el # Written by Jim Van Zandt , borrowing heavily # from the install scripts for gettext by Santiago Vila # and octave by Dirk Eddelbuettel . FLAVOR=$1 PACKAGE=gw-hacks-el STAMPFILE=gw-hacks.elc if [ ${FLAVOR} = emacs ]; then exit 0; fi # Install-info-altdir does not actually exist. # Maybe somebody will write it. if test -x /usr/sbin/install-info-altdir; then echo install/${PACKAGE}: install Info links for ${FLAVOR} install-info-altdir --quiet --section "" "" --dirname=${FLAVOR} /usr/info/${PACKAGE}.info.gz fi LOG=`tempfile -pelc_ -s.log -m644` ELDIR=/usr/share/emacs/site-lisp/${PACKAGE} ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} if test -e "${ELCDIR}/${STAMPFILE}"; then echo "${PACKAGE} files already compiled in ${ELCDIR}." rm -f ${LOG} exit fi echo install/${PACKAGE}: Handling ${FLAVOR}, logged in ${LOG} APPEND_LOAD_PATH= if [ -z "$FLAGS" ] ; then FLAGS="-q -no-site-file --no-site-file -batch -l path.el -f batch-byte-compile" fi install -m 755 -d ${ELCDIR} cd ${ELDIR} # Now to compute the list of files to install... FILES=$(ls -1 *.el) # Here we have all of them FILES=$(for i in $FILES ; do echo $i ; done | sort -u) # And now for my last trick... The list is now uniquified! cd ${ELCDIR} for i in $FILES; do ln -fs ${ELDIR}/$i done cat << EOF > path.el (setq load-path (cons "." load-path) byte-compile-warnings nil) EOF if test "${APPEND_LOAD_PATH}" != "" then cat << EOF >> path.el (setq load-path (append ${APPEND_LOAD_PATH} load-path)) EOF fi echo ${FLAVOR} ${FLAGS} ${FILES} >> ${LOG} "${FLAVOR}" ${FLAGS} ${FILES} >> ${LOG} 2>&1 egrep -s -e "While compiling|\*\*" ${LOG} || /bin/true echo install/${PACKAGE}: Deleting ${LOG} rm -f path.el ${LOG} exit 0