1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
#!/bin/sh
#
# emacsen-install for @PVER@-elisp, Gregor Hoffleit <flight@debian.org>
#
# parts borrowed from gnus's emacsen-install,
# by Manoj Srivastava <srivasta@tiamat.datasync.com>
#
# This file is free software under the terms of the GNU
# Public License, version 2 or higher.
set -e
FLAVOR=$1
PACKAGE="@PVER@-elisp"
if [ "X$FLAVOR" = "X" ]; then
echo need argument to determine FLAVOR of emacs
exit 1
fi
if [ "X$PACKAGE" = "X" ]; then
echo internal error: need package name
exit 1
fi
ELDIR=/usr/share/emacs/site-lisp/$PACKAGE
ELCDIR=/usr/share/$FLAVOR/site-lisp/$PACKAGE
STARTFILE=/etc/$FLAVOR/site-start.d/50$PACKAGE.el
BATCHFLAGS="-batch -q -no-site-file"
COMPILE="-f batch-byte-compile [a-z]*.el"
case "$FLAVOR" in
emacs20 | emacs21 | xemacs19 | xemacs20 | xemacs21)
echo -n "install/$PACKAGE: byte-compiling for $FLAVOR..."
if [ -d $ELCDIR ]; then
rm -f $ELCDIR/*.elc $ELCDIR/install.log
rmdir $ELCDIR
fi
if [ ! -d $ELCDIR ]; then
install -m 755 -d $ELCDIR
fi
cd $ELDIR
LOG=`tempfile`
echo "running '$FLAVOR $BATCHFLAGS $PRELOADS $COMPILE' in $ELDIR" >>$LOG
$FLAVOR $BATCHFLAGS $PRELOADS $COMPILE >>$LOG 2>&1
echo install -m 644 *.elc $ELCDIR >> $LOG
install -m 644 *.elc $ELCDIR
mv -f $LOG $ELCDIR/install.log
rm -f *.elc
#if [ ! -f $STARTFILE ]; then
# ln -s $ELDIR/_tdtd-init.el $STARTFILE
#fi
echo "done."
;;
*)
echo "install/$PACKAGE: ignoring emacsen flavor $FLAVOR."
;;
esac
exit 0
|