[1004] | 1 | #! /bin/sh -e |
---|
| 2 | # /usr/lib/emacsen-common/packages/install/navi2ch |
---|
| 3 | # [ This particular script hasn't been tested, so be careful. ] |
---|
| 4 | |
---|
| 5 | set -e |
---|
| 6 | |
---|
| 7 | FLAVOR=$1 |
---|
| 8 | PACKAGE="navi2ch" |
---|
| 9 | VERSION="2.0.0" |
---|
| 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 | STAMP=${ELCDIR}/compile-stamp |
---|
| 30 | |
---|
| 31 | compile() { |
---|
| 32 | |
---|
| 33 | echo -n "install/${PACKAGE}: Byte-compiling for ${FLAVOR} ..." |
---|
| 34 | |
---|
| 35 | if [ -e ${STAMP} ]; then |
---|
| 36 | if [ "${VERSION}" = "`cat ${STAMP}`" ]; then |
---|
| 37 | echo " exited. (already compiled)" |
---|
| 38 | exit |
---|
| 39 | fi |
---|
| 40 | fi |
---|
| 41 | |
---|
| 42 | rm -rf ${ELCDIR} |
---|
| 43 | install -m 755 -d ${ELCDIR} |
---|
| 44 | |
---|
| 45 | cd ${ELDIR} |
---|
| 46 | #rm -f config.* |
---|
| 47 | ./configure --with-lispdir=${ELCDIR} > ${ELCDIR}/CompilationLog 2>&1 |
---|
| 48 | ## Unrecognized options: --with-xemacs, --with-emacs in ./configure |
---|
| 49 | make clean >> ${ELCDIR}/CompilationLog 2>&1 |
---|
| 50 | make EMACS=${FLAVOR} >> ${ELCDIR}/CompilationLog 2>&1 |
---|
| 51 | #make EMACS=${FLAVOR} -C contrib >> ${ELCDIR}/CompilationLog 2>&1 |
---|
| 52 | make INSTALLPATH=${ELCDIR} install >> ${ELCDIR}/CompilationLog 2>&1 |
---|
| 53 | #make INSTALLPATH=${ELCDIR} install -C contrib >> ${ELCDIR}/CompilationLog 2>&1 |
---|
| 54 | make clean >> ${ELCDIR}/CompilationLog 2>&1 |
---|
| 55 | #rm -f config.* |
---|
| 56 | rm ${ELCDIR}/*.el |
---|
| 57 | |
---|
| 58 | #if [ -e /usr/share/info/navi2ch.info.gz ]; then |
---|
| 59 | # rm -f /usr/share/info/navi2ch.info*.gz |
---|
| 60 | #fi |
---|
| 61 | |
---|
| 62 | gzip -9 ${ELCDIR}/CompilationLog |
---|
| 63 | #gzip -9 /usr/share/info/navi2ch.info |
---|
| 64 | echo ${VERSION} > ${STAMP} |
---|
| 65 | |
---|
| 66 | install -p -m644 ${ELDIR}/vine-default-${PACKAGE}.el ${ELCDIR} |
---|
| 67 | ln -f -s ${ELDIR}/${STARTFILE} ${STARTDIR}/90${STARTFILE}; |
---|
| 68 | echo " done." |
---|
| 69 | } |
---|
| 70 | |
---|
| 71 | case "${FLAVOR}" in |
---|
| 72 | |
---|
| 73 | emacs-20*) |
---|
| 74 | echo "Not Support" |
---|
| 75 | ;; |
---|
| 76 | |
---|
| 77 | emacs-21*) |
---|
| 78 | compile |
---|
| 79 | ;; |
---|
| 80 | |
---|
| 81 | emacs-22*) |
---|
| 82 | compile |
---|
| 83 | ;; |
---|
| 84 | |
---|
| 85 | xemacs-*) |
---|
| 86 | compile |
---|
| 87 | ;; |
---|
| 88 | |
---|
| 89 | emacs-23*) |
---|
| 90 | compile |
---|
| 91 | ;; |
---|
| 92 | |
---|
[2319] | 93 | emacs-24*) |
---|
| 94 | compile |
---|
| 95 | ;; |
---|
| 96 | |
---|
[1004] | 97 | *) |
---|
| 98 | ;; |
---|
| 99 | esac |
---|
| 100 | |
---|
| 101 | exit 0; |
---|