| 1 |
#! /bin/sh -e |
| 2 |
# /usr/lib/emacsen-common/packages/install/mdk |
| 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 |
# Reworked a bit by Peter Pentchev <[email protected]>, borrowing heavily |
| 8 |
# from the emacsen-common example scripts by Rob Browning |
| 9 |
# <[email protected]> and the dictionaries-common install scripts. |
| 10 |
|
| 11 |
set -e |
| 12 |
|
| 13 |
flavor=$1 |
| 14 |
package=mdk |
| 15 |
|
| 16 |
case "$flavor" in |
| 17 |
emacs) |
| 18 |
# Dummy emacs flavor. Do nothing and exit |
| 19 |
exit 0 |
| 20 |
;; |
| 21 |
xemacs*) |
| 22 |
flags="-no-site-file" |
| 23 |
;; |
| 24 |
emacs*) |
| 25 |
flags="--no-site-file" |
| 26 |
;; |
| 27 |
*) |
| 28 |
echo install/$package: Ignoring emacsen flavor [$flavor] |
| 29 |
exit 0 |
| 30 |
;; |
| 31 |
esac |
| 32 |
|
| 33 |
echo "install/$package: Handling install for emacsen flavor $flavor" |
| 34 |
|
| 35 |
flags="$flags -q -batch -l path.el -f batch-byte-compile" |
| 36 |
eldir="/usr/share/emacs/site-lisp/$package" |
| 37 |
elcdir="/usr/share/$flavor/site-lisp/$package" |
| 38 |
|
| 39 |
install -m 755 -d "${elcdir}" |
| 40 |
cd "$elcdir" |
| 41 |
ln -sf "$eldir"/*.el . |
| 42 |
|
| 43 |
cat << EOF > path.el |
| 44 |
(setq load-path (cons "." load-path) byte-compile-warnings nil) |
| 45 |
EOF |
| 46 |
"$flavor" $flags *.el |
| 47 |
rm -f path.el path.elc |