| 1 | #! /bin/sh |
| 2 | # /usr/lib/emacsen-common/packages/install/ddskk |
| 3 | set -e |
| 4 | |
| 5 | FLAVOR=$1 |
| 6 | PACKAGE=ddskk |
| 7 | |
| 8 | if [ -z "${FLAVOR}" ]; then exit 1; fi |
| 9 | |
| 10 | case $FLAVOR in |
| 11 | emacs23|emacs22|emacs21|emacs20|emacs19|mule2|*xemacs*) |
| 12 | exit 0 |
| 13 | ;; |
| 14 | esac |
| 15 | |
| 16 | ELCDIR=/usr/share/$FLAVOR/site-lisp/$PACKAGE |
| 17 | ELDIR=/usr/share/$PACKAGE |
| 18 | ELCSTAMP=$ELCDIR/compile-stamp |
| 19 | |
| 20 | if [ -f "$ELCSTAMP" ]; then |
| 21 | if [ -z "`find "$ELDIR/skk.el" -newer "$ELCSTAMP"`" ]; then |
| 22 | echo "install/$PACKAGE: already byte-compiled for $FLAVOR, skipped" |
| 23 | exit 0 |
| 24 | fi |
| 25 | rm -f "$ELCSTAMP" |
| 26 | fi |
| 27 | |
| 28 | echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR} |
| 29 | |
| 30 | FLAGS="-no-site-file -q -batch -l __path.el" |
| 31 | |
| 32 | install -m 755 -d ${ELCDIR} |
| 33 | cd ${ELDIR} |
| 34 | LINKS=`echo SKK-* *.el*` |
| 35 | if [ -d nicola ]; then |
| 36 | LINKS="$LINKS "`echo nicola/NICOLA-* nicola/*.el*` |
| 37 | fi |
| 38 | cd ${ELCDIR} |
| 39 | for f in $LINKS; do |
| 40 | ln -sf "../../../$PACKAGE/$f" . |
| 41 | done |
| 42 | cp -R "$ELDIR/maint" . |
| 43 | |
| 44 | cat << EOF > __path.el |
| 45 | (setq inhibit-automatic-native-compilation t) |
| 46 | (setq native-comp-deferred-compilation nil) |
| 47 | (setq comp-enable-subr-trampolines nil) |
| 48 | (set-language-environment "Japanese") |
| 49 | (prefer-coding-system 'euc-jp) |
| 50 | (prefer-coding-system 'iso-2022-jp) |
| 51 | (setq SKK_SET_JISYO nil) |
| 52 | (setq load-path (cons "/usr/share/${FLAVOR}/site-lisp/apel" load-path)) |
| 53 | (setq load-path (cons "${ELCDIR}" load-path)) |
| 54 | (setq byte-compile-warnings t) |
| 55 | EOF |
| 56 | mv -f skk-setup.el.in skk-setup.el |
| 57 | mv -f leim-list.el.in leim-list.el |
| 58 | rm -f *.elc |
| 59 | set +e |
| 60 | ${FLAVOR} ${FLAGS} -f batch-byte-compile skk-setup.el >CompilationLog 2>&1 |
| 61 | if [ $? -ne 0 ]; then cat CompilationLog; exit 1; fi |
| 62 | ${FLAVOR} ${FLAGS} -l SKK-MK -f SKK-MK-compile >>CompilationLog 2>&1 |
| 63 | if [ $? -ne 0 ]; then cat CompilationLog; exit 1; fi |
| 64 | |
| 65 | ${FLAVOR} ${FLAGS} -l NICOLA-DDSKK-ELS -l NICOLA-DDSKK-MK -f nicola-ddskk-generate-autoloads >>CompilationLog 2>&1 |
| 66 | if [ $? -ne 0 ]; then cat CompilationLog; exit 1; fi |
| 67 | ${FLAVOR} ${FLAGS} -f batch-byte-compile nicola-ddskk-autoloads.el >>CompilationLog 2>&1 |
| 68 | if [ $? -ne 0 ]; then cat CompilationLog; exit 1; fi |
| 69 | ${FLAVOR} ${FLAGS} -l maint/install.el -l NICOLA-DDSKK-MK -f compile-nicola-ddskk NONE NONE NONE >>CompilationLog 2>&1 |
| 70 | if [ $? -ne 0 ]; then cat CompilationLog; exit 1; fi |
| 71 | set -e |
| 72 | |
| 73 | rm -f SKK-* leim-list.el* *.in NICOLA-* __path.el* |
| 74 | rm -f ${ELCDIR}/skk-lookup.elc ${ELCDIR}/skk-jisx0213.elc |
| 75 | rm -f ${ELCDIR}/ptexinfmt.el* ${ELCDIR}/install.el* |
| 76 | rm -rf "$ELCDIR/maint" |
| 77 | gzip -9qf CompilationLog |
| 78 | |
| 79 | if [ -f /usr/share/emacsen-common/debian-startup.el ] && \ |
| 80 | [ ! -f "/etc/$FLAVOR/site-start.d/50$PACKAGE.el" ] && \ |
| 81 | [ -f "/etc/emacs/site-start.d/50$PACKAGE.el" ] && \ |
| 82 | [ -d "/etc/$FLAVOR/site-start.d" ]; then |
| 83 | ln -sf "../../emacs/site-start.d/50$PACKAGE.el" "/etc/$FLAVOR/site-start.d/50$PACKAGE.el" |
| 84 | fi |
| 85 | |
| 86 | touch "$ELCSTAMP" |
| 87 | exit 0 |