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 65 66 67 68 69 70 71
|
#!/bin/sh
#
# emacsen install script for the Debian GNU/Linux
# gforth package
#
# Written by Rafael Laboissiere <rafael@debian.org> and
# Agustin Martin <agmartin@debian.org>
#
# Some things taken from Dirk Eddelbuettel script for the octave package.
# lpath.el trick is stolen from Davide Salvetti's auctex package
# --------------------------------------------------------------
set -e
# Canadian spelling ;-)
flavour=$1
package=gforth
files="gforth.el"
source=/usr/share/emacs/site-lisp/${package}
destination=/usr/share/${flavour}/site-lisp/${package}
case "$flavour" in
emacs)
# Dummy emacs flavour. Do nothing and exit
exit 0
;;
xemacs*)
flags="-no-site-file"
;;
emacs19)
# Do not byte-compile anything for emacs19
echo "install/${package}: Skipping byte-compilation for $flavour"
exit 0
;;
emacs*)
flags="--no-site-file"
;;
*)
echo install/${package}: Ignoring emacsen flavour [${flavour}]
exit 0
;;
esac
if [ -e "${destination}/done" ]; then
echo "install/${package}: Already byte-compiled for ${flavour}. Skipping ..."
else
echo install/${package}: Byte-compiling for emacsen flavour ${flavour}
# Make sure destination directory is available
install -m 0755 -d ${destination}
# Make sure current dir is in the load path
cat << EOF > ${destination}/path.el
(setq load-path (cons "." load-path) byte-compile-warnings nil)
EOF
flags="${flags} -q -batch -l path.el -f batch-byte-compile"
( # Go to the .elc dir, set sources symlinks, byte compile files and remove temp .el files from the .elc dir
cd ${destination}
for i in $files; do
ln -sf $source/$i
done
${flavour} ${flags} ${files}
rm path.el
touch done
)
fi
exit 0;
|