| 1 |
#! /bin/sh -e |
| 2 |
# /usr/lib/emacsen-common/packages/install/bbdb3 |
| 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=bbdb3 |
| 10 |
|
| 11 |
if [ ${FLAVOR} = emacs ]; then exit 0; fi |
| 12 |
|
| 13 |
# Liberally blacklist unsupported emacsen: |
| 14 |
if [ ${FLAVOR} = xemacs19 ]; then exit 0; fi |
| 15 |
if [ ${FLAVOR} = xemacs20 ]; then exit 0; fi |
| 16 |
if [ ${FLAVOR} = xemacs21 ]; then exit 0; fi |
| 17 |
if [ ${FLAVOR} = emacs19 ]; then exit 0; fi |
| 18 |
if [ ${FLAVOR} = emacs20 ]; then exit 0; fi |
| 19 |
if [ ${FLAVOR} = emacs21 ]; then exit 0; fi |
| 20 |
if [ ${FLAVOR} = emacs22 ]; then exit 0; fi |
| 21 |
if [ ${FLAVOR} = emacs23 ]; then exit 0; fi |
| 22 |
|
| 23 |
echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR} |
| 24 |
|
| 25 |
#FLAVORTEST=$(echo $FLAVOR | cut -c-6) |
| 26 |
#if [ ${FLAVORTEST} = xemacs ] ; then |
| 27 |
# SITEFLAG="-no-site-file" |
| 28 |
#else |
| 29 |
# SITEFLAG="--no-site-file" |
| 30 |
#fi |
| 31 |
FLAGS="${SITEFLAG} --no-init-file --batch --load path.el --funcall batch-byte-compile" |
| 32 |
|
| 33 |
ELDIR=/usr/share/emacs/site-lisp/${PACKAGE} |
| 34 |
ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} |
| 35 |
ELRELDIR=../../../emacs/site-lisp/${PACKAGE} |
| 36 |
|
| 37 |
# Install-info-altdir does not actually exist. |
| 38 |
# Maybe somebody will write it. |
| 39 |
if test -x /usr/sbin/install-info-altdir; then |
| 40 |
echo install/${PACKAGE}: install Info links for ${FLAVOR} |
| 41 |
install-info-altdir --quiet --section "" "" --dirname=${FLAVOR} /usr/share/info/${PACKAGE}.info.gz |
| 42 |
fi |
| 43 |
|
| 44 |
install -m 755 -d ${ELCDIR} |
| 45 |
cd ${ELDIR} |
| 46 |
FILES=$(echo *.el) |
| 47 |
cd ${ELCDIR} |
| 48 |
ln -sf ${ELRELDIR}/*.el . |
| 49 |
|
| 50 |
# do not compile bbdb-pkg.el |
| 51 |
FILES="$(echo "$FILES" | sed 's:bbdb-pkg[.]el::')" |
| 52 |
|
| 53 |
# do not compile bbdb-site.el |
| 54 |
FILES="$(echo "$FILES" | sed 's:bbdb-site[.]el::')" |
| 55 |
|
| 56 |
# Check if vm is installed for this flavour. |
| 57 |
# If not, do not install or compile bbdb-vm. |
| 58 |
if test \! -d ../vm; then |
| 59 |
echo "vm seems uninstalled in $FLAVOR, skipping bbdb-vm" |
| 60 |
rm bbdb-vm.el || echo failure to remove bbdb-vm.el |
| 61 |
FILES="$(echo "$FILES" | sed 's:bbdb-vm[.]el::')" |
| 62 |
fi |
| 63 |
|
| 64 |
# Check if mu4e is installed for this flavour. |
| 65 |
# If not, do not install or compile bbdb-mu4e. |
| 66 |
if test \! -d ../mu4e; then |
| 67 |
echo "mu4e seems uninstalled in $FLAVOR, skipping bbdb-mu4e" |
| 68 |
rm bbdb-mu4e.el || echo failure to remove bbdb-mu4e.el |
| 69 |
FILES="$(echo "$FILES" | sed 's:bbdb-mu4e[.]el::')" |
| 70 |
fi |
| 71 |
|
| 72 |
cat << EOF > path.el |
| 73 |
(debian-pkg-add-load-path-item ".") |
| 74 |
(setq byte-compile-warnings nil) |
| 75 |
EOF |
| 76 |
echo invoking: ${FLAVOR} ${FLAGS} ${FILES} |
| 77 |
${FLAVOR} ${FLAGS} ${FILES} |
| 78 |
rm -f path.el |
| 79 |
|
| 80 |
exit 0 |