[1697] | 1 | #! /bin/sh -e |
---|
| 2 | # /usr/lib/emacsen-common/packages/install/skk |
---|
| 3 | # [ This particular script hasn't been tested, so be careful. ] |
---|
| 4 | |
---|
| 5 | set -e |
---|
| 6 | |
---|
| 7 | FLAVOR=$1 |
---|
| 8 | PACKAGE="skk" |
---|
[1701] | 9 | VERSION=13.1 |
---|
[1697] | 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 | PACKAGEDIR=/usr/share/${FLAVOR} |
---|
| 29 | EMACSTUTDIR=/usr/share/skk |
---|
| 30 | XEMACSTUTDIR=/usr/share/${FLAVOR}/etc/${PACKAGE} |
---|
| 31 | NICOLAELCDIR=/usr/share/${FLAVOR}/site-lisp/nicola-ddskk |
---|
| 32 | |
---|
| 33 | EFLAGS="-batch -q -l SKK-MK" |
---|
| 34 | COMPILE="-batch -q -f batch-byte-compile" |
---|
| 35 | |
---|
| 36 | STAMP=${ELCDIR}/compile-stamp |
---|
| 37 | |
---|
| 38 | case "${FLAVOR}" in |
---|
| 39 | emacs) |
---|
| 40 | ;; |
---|
| 41 | |
---|
| 42 | *) |
---|
| 43 | |
---|
| 44 | if [ ! -d ${EMACSTUTDIR} ] ; then |
---|
| 45 | echo " exited." |
---|
| 46 | echo "W: Please install \`skkdic' package for ${FLAVOR}." ; |
---|
| 47 | exit 0; |
---|
| 48 | fi |
---|
| 49 | |
---|
| 50 | echo -n "install/${PACKAGE}: Byte-compiling for ${FLAVOR} ..." |
---|
| 51 | |
---|
| 52 | case "${FLAVOR}" in |
---|
| 53 | xemacs-*) |
---|
| 54 | if [ -f /usr/lib/xemacs/mule-packages/lisp/skk/skk.elc ]; then |
---|
| 55 | exit |
---|
| 56 | fi |
---|
| 57 | ;; |
---|
| 58 | |
---|
| 59 | *) |
---|
| 60 | ;; |
---|
| 61 | esac |
---|
| 62 | |
---|
| 63 | if [ -e ${STAMP} ]; then |
---|
| 64 | if [ "${VERSION}" = "`cat ${STAMP}`" ]; then |
---|
| 65 | echo " exited. (already compiled)" |
---|
| 66 | exit |
---|
| 67 | fi |
---|
| 68 | fi |
---|
| 69 | |
---|
| 70 | rm -rf ${ELCDIR} |
---|
| 71 | install -m 755 -d ${ELCDIR} |
---|
| 72 | rm -rf ${NICOLAELCDIR} |
---|
| 73 | install -m 755 -d ${NICOLAELCDIR} |
---|
| 74 | |
---|
| 75 | # Copy the temp .el files |
---|
| 76 | # cp ${ELDIR}/* ${ELCDIR}/ |
---|
| 77 | |
---|
| 78 | # Byte compile them |
---|
| 79 | ( cd ${ELDIR} |
---|
| 80 | |
---|
| 81 | case "${FLAVOR}" in |
---|
| 82 | xemacs-*) |
---|
| 83 | rm -rf ${XEMACSTUTDIR} |
---|
| 84 | make XEMACS=${FLAVOR} package > ${ELCDIR}/CompilationLog 2>&1 |
---|
| 85 | make XEMACS=${FLAVOR} PACKAGE_LISPDIR=${ELCDIR} \ |
---|
| 86 | PACKAGE_DATADIR=${XEMACSTUTDIR} install-package \ |
---|
| 87 | >> ${ELCDIR}/CompilationLog 2>&1 |
---|
| 88 | ( cd nicola |
---|
| 89 | make XEMACS=${FLAVOR} package >> ${ELCDIR}/CompilationLog 2>&1 |
---|
| 90 | make XEMACS=${FLAVOR} PACKAGEDIR=${PACKAGEDIR} install-package \ |
---|
| 91 | >> ${ELCDIR}/CompilationLog 2>&1 |
---|
| 92 | ) |
---|
| 93 | ;; |
---|
| 94 | |
---|
| 95 | *) |
---|
| 96 | rm -f ${EMACSTUTDIR}/*.tut* |
---|
| 97 | make EMACS=${FLAVOR} elc > ${ELCDIR}/CompilationLog 2>&1 |
---|
| 98 | make EMACS=${FLAVOR} SKK_LISPDIR=${ELCDIR} \ |
---|
| 99 | SKK_DATADIR=${EMACSTUTDIR} install-elc \ |
---|
| 100 | >> ${ELCDIR}/CompilationLog 2>&1 |
---|
| 101 | ( cd nicola |
---|
| 102 | make EMACS=${FLAVOR} LISPDIR=${NICOLAELCDIR} install-elc \ |
---|
| 103 | >> ${ELCDIR}/CompilationLog 2>&1 |
---|
| 104 | ) |
---|
| 105 | ;; |
---|
| 106 | esac |
---|
| 107 | |
---|
| 108 | make clean >> ${ELCDIR}/CompilationLog 2>&1 |
---|
| 109 | rm -fv ${NICOLAELCDIR}/*.el >> ${ELCDIR}/CompilationLog 2>&1 |
---|
| 110 | ( cd nicola |
---|
| 111 | make clean >> ${ELCDIR}/CompilationLog 2>&1 |
---|
| 112 | ) |
---|
| 113 | ) |
---|
| 114 | |
---|
| 115 | gzip -9 ${ELCDIR}/CompilationLog |
---|
| 116 | echo ${VERSION} > ${STAMP} |
---|
| 117 | |
---|
| 118 | install -p -m644 ${ELDIR}/vine-default-${PACKAGE}.el ${ELCDIR} |
---|
| 119 | cp -f ${ELDIR}/${STARTFILE} ${STARTDIR}/70${STARTFILE}; |
---|
| 120 | echo " done." |
---|
| 121 | ;; |
---|
| 122 | esac |
---|
| 123 | |
---|
| 124 | exit 0; |
---|