[3602] | 1 | #! /bin/sh -e |
---|
| 2 | # /usr/lib/emacsen-common/packages/install/foo |
---|
| 3 | # [ This particular script hasn't been tested, so be careful. ] |
---|
| 4 | |
---|
| 5 | set -e |
---|
| 6 | |
---|
| 7 | FLAVOR=$1 |
---|
| 8 | PACKAGE="flim" |
---|
| 9 | VERSION=1.14.8 |
---|
| 10 | |
---|
| 11 | if [ "X${FLAVOR}" = "X" ]; then |
---|
| 12 | echo Need argument to determin FLAVOR of emacs; |
---|
| 13 | exit 1 |
---|
| 14 | fi |
---|
| 15 | |
---|
| 16 | if [ "X${PACKAGE}" = "X" ]; then |
---|
| 17 | echo Internal error: need package name; |
---|
| 18 | exit 1; |
---|
| 19 | fi |
---|
| 20 | |
---|
| 21 | ELDIR=/usr/share/emacs/site-lisp/${PACKAGE} |
---|
| 22 | ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} |
---|
| 23 | |
---|
| 24 | STARTDIR=/etc/${FLAVOR}/site-start.d |
---|
| 25 | STARTFILE="${PACKAGE}-init.el"; |
---|
| 26 | |
---|
| 27 | SITELISP=/usr/share/${FLAVOR}/site-lisp |
---|
| 28 | |
---|
| 29 | EFLAGS="-batch -q -l FLIM-MK" |
---|
| 30 | COMPILE="-batch -q -f batch-byte-compile" |
---|
| 31 | |
---|
| 32 | STAMP=${ELCDIR}/compile-stamp |
---|
| 33 | |
---|
| 34 | case "${FLAVOR}" in |
---|
| 35 | |
---|
| 36 | emacs) |
---|
| 37 | ;; |
---|
| 38 | |
---|
| 39 | *) |
---|
| 40 | |
---|
| 41 | echo -n "install/${PACKAGE}: Byte-compiling for ${FLAVOR} ..." |
---|
| 42 | |
---|
| 43 | if [ "${FLAVOR}" = "emacs19" ]; then |
---|
| 44 | if [ ! -f /usr/share/emacs/site-lisp/custom-init.el ]; then |
---|
| 45 | echo -n " exited. " |
---|
| 46 | echo "W: Please install custom package for emacs19." ; |
---|
| 47 | exit 0; |
---|
| 48 | fi |
---|
| 49 | fi |
---|
| 50 | |
---|
| 51 | if [ "${FLAVOR}" = "mule2" ]; then |
---|
| 52 | if [ ! -f /usr/share/emacs/site-lisp/custom-mule-init.el ]; then |
---|
| 53 | echo -n " exited. " |
---|
| 54 | echo "W: Please install custom-mule package for mule2." ; |
---|
| 55 | exit 0; |
---|
| 56 | fi |
---|
| 57 | fi |
---|
| 58 | |
---|
| 59 | if [ -e ${STAMP} ]; then |
---|
| 60 | if [ "${VERSION}" = "`cat ${STAMP}`" ]; then |
---|
| 61 | echo " exited. (already compiled)" |
---|
| 62 | exit |
---|
| 63 | fi |
---|
| 64 | fi |
---|
| 65 | |
---|
| 66 | rm -rf ${ELCDIR} |
---|
| 67 | install -m 755 -d ${ELCDIR} |
---|
| 68 | |
---|
| 69 | # Copy the temp .el files |
---|
| 70 | # cp ${ELDIR}/* ${ELCDIR}/ |
---|
| 71 | |
---|
| 72 | # Byte compile them |
---|
| 73 | (cd ${ELDIR} |
---|
| 74 | make EMACS=${FLAVOR} LISPDIR=${SITELISP} install \ |
---|
| 75 | > ${ELCDIR}/CompilationLog 2>&1 |
---|
| 76 | ) |
---|
| 77 | |
---|
| 78 | # remove mel-b-ccl.el* for xemacs |
---|
| 79 | # (see http://lists.airs.net/wl/archive/200101/msg00077.html) |
---|
| 80 | case "${FLAVOR}" in |
---|
| 81 | xemacs-21.1*) |
---|
| 82 | rm -f ${ELCDIR}/mel-b-ccl.el* |
---|
| 83 | ;; |
---|
| 84 | *) |
---|
| 85 | ;; |
---|
| 86 | esac |
---|
| 87 | |
---|
| 88 | gzip -9 ${ELCDIR}/CompilationLog |
---|
| 89 | echo ${VERSION} > ${STAMP} |
---|
| 90 | |
---|
| 91 | if [ -e ${ELCDIR}/${STARTFILE}c ]; then |
---|
| 92 | mv ${ELCDIR}/${STARTFILE}c ${STARTDIR}/50${STARTFILE}c; |
---|
| 93 | else |
---|
| 94 | ln -f -s ${ELDIR}/${STARTFILE} ${STARTDIR}/50${STARTFILE}; |
---|
| 95 | fi |
---|
| 96 | echo " done." |
---|
| 97 | ;; |
---|
| 98 | |
---|
| 99 | esac |
---|
| 100 | |
---|
| 101 | exit 0; |
---|