[2750] | 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 | VERSION="0.6" |
---|
| 9 | PACKAGE="IIIMECF" |
---|
| 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 | if [ ! -x "$ELCDIR" ] ; then |
---|
| 25 | mkdir -p "$ELCDIR" |
---|
| 26 | fi |
---|
| 27 | |
---|
| 28 | STARTDIR=/etc/${FLAVOR}/site-start.d |
---|
| 29 | STARTFILE="${PACKAGE}-init.el"; |
---|
| 30 | |
---|
| 31 | SITELISP=/usr/share/${FLAVOR}/site-lisp |
---|
| 32 | |
---|
| 33 | STAMP=${ELCDIR}/compile-stamp |
---|
| 34 | case "${FLAVOR}" in |
---|
| 35 | emacs) |
---|
| 36 | ;; |
---|
| 37 | xemacs-21.1.14) |
---|
| 38 | echo "Not Supported in this." |
---|
| 39 | ;; |
---|
| 40 | |
---|
| 41 | # emacs20|emacs21|xemacs21) |
---|
| 42 | *) |
---|
| 43 | |
---|
| 44 | echo -n "install/${PACKAGE}: Byte-compiling for ${FLAVOR} ..." |
---|
| 45 | |
---|
| 46 | if [ -e ${STAMP} ]; then |
---|
| 47 | if [ "${VERSION}" = "`cat ${STAMP}`" ]; then |
---|
| 48 | echo " exited. (already compiled)" |
---|
| 49 | exit |
---|
| 50 | else |
---|
| 51 | rm -f ${STAMP} |
---|
| 52 | fi |
---|
| 53 | fi |
---|
| 54 | |
---|
| 55 | rm -rf ${ELCDIR} |
---|
| 56 | install -m 755 -d ${ELCDIR} |
---|
| 57 | |
---|
| 58 | # Byte compile them |
---|
| 59 | (cd ${ELDIR} |
---|
| 60 | ${FLAVOR} -q --no-site-file -batch -l iiimcf-comp.el > ${ELCDIR}/CompilationLog 2>&1 |
---|
| 61 | ) |
---|
| 62 | mv ${ELDIR}/lisp/*.elc ${ELCDIR}/ |
---|
| 63 | gzip -9 ${ELCDIR}/CompilationLog |
---|
| 64 | echo ${VERSION} > ${STAMP} |
---|
| 65 | |
---|
| 66 | install -p -m644 ${ELDIR}/vine-default-${PACKAGE}.el ${ELCDIR} |
---|
| 67 | ln -sf ${ELDIR}/${STARTFILE} ${STARTDIR}/40${STARTFILE}; |
---|
| 68 | echo " done." |
---|
| 69 | ;; |
---|
| 70 | *) |
---|
| 71 | ;; |
---|
| 72 | esac |
---|
| 73 | |
---|
| 74 | exit 0; |
---|
| 75 | |
---|