skk-install.sh 2.9 KB

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