| 1 |
#! /bin/sh -e |
| 2 |
# /usr/lib/emacsen-common/packages/install/auto-install-el |
| 3 |
|
| 4 |
# Written by Jim Van Zandt <[email protected]>, borrowing heavily |
| 5 |
# from the install scripts for gettext by Santiago Vila |
| 6 |
# <[email protected]> and octave by Dirk Eddelbuettel <[email protected]>. |
| 7 |
|
| 8 |
FLAVOR=$1 |
| 9 |
PACKAGE=auto-install |
| 10 |
|
| 11 |
case $FLAVOR in |
| 12 |
emacs|emacs21|emacs20|emacs19|mule2|*xemacs*) |
| 13 |
exit 0 |
| 14 |
;; |
| 15 |
*) |
| 16 |
EMACSEN=$FLAVOR |
| 17 |
;; |
| 18 |
esac |
| 19 |
|
| 20 |
echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR} |
| 21 |
|
| 22 |
FLAGS="-no-site-file -q -batch -l path.el -f batch-byte-compile" |
| 23 |
|
| 24 |
ELDIR=/usr/share/emacs/site-lisp/${PACKAGE} |
| 25 |
ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} |
| 26 |
|
| 27 |
cd "$ELDIR" |
| 28 |
LINKS=`echo *.el` |
| 29 |
|
| 30 |
if [ ! -d "$ELCDIR" ]; then |
| 31 |
mkdir "$ELCDIR" |
| 32 |
chmod 755 "$ELCDIR" |
| 33 |
fi |
| 34 |
|
| 35 |
cd "$ELCDIR" |
| 36 |
|
| 37 |
TOELDIR=../../../emacs/site-lisp/$PACKAGE |
| 38 |
|
| 39 |
rm -f *.el path.el |
| 40 |
|
| 41 |
for f in $LINKS; do |
| 42 |
ln -sf "$TOELDIR/$f" ./ |
| 43 |
done |
| 44 |
|
| 45 |
FILES=`/bin/ls -1 *.el` |
| 46 |
cat << EOF > path.el |
| 47 |
(setq load-path (cons "." load-path)) |
| 48 |
(setq byte-compile-warnings nil) |
| 49 |
EOF |
| 50 |
${FLAVOR} ${FLAGS} ${FILES} |
| 51 |
chmod 644 *.elc |
| 52 |
rm -f path.el |
| 53 |
|
| 54 |
exit 0 |