wnn7egg-install.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #!/bin/sh -e
  2. # /usr/lib/emacsen-common/packages/install/wnn7egg
  3. # [ This particular script hasn't been tested, so be careful. ]
  4. ### based on Debian wnn7egg_1.02-7.diff.gz
  5. set -e
  6. FLAVOR=$1
  7. PACKAGE="wnn7egg"
  8. if [ "X${FLAVOR}" = "X" ]; then
  9. echo Need argument to determin FLAVOR of emacs;
  10. exit 1
  11. fi
  12. if [ "X${PACKAGE}" = "X" ]; then
  13. echo Internal error: need package name;
  14. exit 1;
  15. fi
  16. ELDIR=/usr/share/emacs/site-lisp/${PACKAGE}
  17. ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
  18. STARTDIR=/etc/${FLAVOR}/site-start.d
  19. STARTFILE="${PACKAGE}-init.el";
  20. SITELISP=/usr/share/${FLAVOR}/site-lisp
  21. EL_ONLY="eggrc-wnn7 eggrc-wnn7_for-wnn8 wnn7egg-edep.el its-v309 vine-default-wnn7egg.el"
  22. FILES="wnn7egg-cnv.el wnn7egg-leim.el wnn7egg-jsymbol.el wnn7egg-lib.el wnn7egg.el wnn7egg-com.el wnn7egg-rpc.el busyu.el"
  23. FLAGS="--no-site-file -q -batch -l path.el -l ./wnn7egg-lib.el -f batch-byte-compile"
  24. case "${FLAVOR}" in
  25. *)
  26. echo -n "install/${PACKAGE}: Byte-compiling for ${FLAVOR} ..."
  27. rm -rf ${ELCDIR}
  28. install -m 755 -d ${ELCDIR}
  29. # Byte compile
  30. (
  31. cd ${ELDIR}
  32. cp -r ${FILES} ${EL_ONLY} ${ELCDIR}
  33. cd ${ELCDIR}
  34. # Setup for Wnn8
  35. if [ -f /usr/lib/wnn8/ja_JP/wnnenvrc ] \
  36. && [ -x /usr/sbin/jserver ]; then
  37. cp -f eggrc-wnn7_for-wnn8 eggrc-wnn7
  38. echo "Note: already setup for Wnn8" \
  39. > eggrc-wnn7_for-wnn8
  40. fi
  41. echo '(setq load-path (cons "." load-path) byte-compile-warnings nil)'> path.el
  42. ${FLAVOR} ${FLAGS} ${FILES} > CompilationLog 2>&1
  43. rm -f ${FILES} path.el
  44. )
  45. gzip -9 ${ELCDIR}/CompilationLog
  46. if [ ! -d ${STARTDIR} ]; then
  47. install -m 755 -d ${STARTDIR}
  48. fi
  49. ln -sf ${ELDIR}/${STARTFILE} ${STARTDIR}/50${STARTFILE};
  50. echo " done."
  51. ;;
  52. esac
  53. exit 0;