Make things in contrib directory installable.
[muse-el.git] / debian / emacsen-install
bloba43297f5b068299e5fa9e2334b64391d1563274c
1 #! /bin/sh -e
2 # /usr/lib/emacsen-common/packages/install/muse
4 # Written by Jim Van Zandt <jrv@vanzandt.mv.com>, borrowing heavily
5 # from the install scripts for gettext by Santiago Vila
6 # <sanvila@ctv.es> and octave by Dirk Eddelbuettel <edd@debian.org>.
8 FLAVOR=$1
9 PACKAGE=muse-el
11 if [ ${FLAVOR} = emacs ]; then exit 0; fi
13 echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR}
15 FLAVORTEST=`echo $FLAVOR | cut -c-6`
16 if [ ${FLAVORTEST} = xemacs ] ; then
17 SITEFLAG="-no-site-file"
18 else
19 SITEFLAG="--no-site-file"
21 FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile"
22 ELPREFIX=/usr/share/emacs/site-lisp/${PACKAGE}
24 for i in ${PACKAGE} ${PACKAGE}/contrib; do
26 ELDIR=/usr/share/emacs/site-lisp/$i
27 ELCDIR=/usr/share/${FLAVOR}/site-lisp/$i
29 install -m 755 -d ${ELCDIR}
30 cd ${ELDIR}
31 FILES=`ls -1 *.el | grep -v autoloads`
32 rm -f ${ELCDIR}/*.el
33 cp ${FILES} ${ELCDIR}
34 cd ${ELCDIR}
36 cat << EOF > path.el
37 (setq load-path (cons "${ELPREFIX}" (cons "${ELPREFIX}/contrib" load-path))
38 byte-compile-warnings nil)
39 EOF
40 ${FLAVOR} ${FLAGS} ${FILES} 2>&1 | gzip -9qf > CompilationLog.gz
41 rm -f *.el path.el
42 ( cd ${ELDIR}
43 for f in *.el; do
44 ln -sf ${ELDIR}/${f} ${ELCDIR}/${f}
45 done
47 done
49 exit 0