flim-install.sh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #! /bin/sh -e
  2. # /usr/lib/emacsen-common/packages/install/foo
  3. # [ This particular script hasn't been tested, so be careful. ]
  4. set -e
  5. FLAVOR=$1
  6. PACKAGE="flim"
  7. VERSION=1.14.8
  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. EFLAGS="-batch -q -l FLIM-MK"
  22. COMPILE="-batch -q -f batch-byte-compile"
  23. STAMP=${ELCDIR}/compile-stamp
  24. case "${FLAVOR}" in
  25. emacs)
  26. ;;
  27. *)
  28. echo -n "install/${PACKAGE}: Byte-compiling for ${FLAVOR} ..."
  29. if [ "${FLAVOR}" = "emacs19" ]; then
  30. if [ ! -f /usr/share/emacs/site-lisp/custom-init.el ]; then
  31. echo -n " exited. "
  32. echo "W: Please install custom package for emacs19." ;
  33. exit 0;
  34. fi
  35. fi
  36. if [ "${FLAVOR}" = "mule2" ]; then
  37. if [ ! -f /usr/share/emacs/site-lisp/custom-mule-init.el ]; then
  38. echo -n " exited. "
  39. echo "W: Please install custom-mule package for mule2." ;
  40. exit 0;
  41. fi
  42. fi
  43. if [ -e ${STAMP} ]; then
  44. if [ "${VERSION}" = "`cat ${STAMP}`" ]; then
  45. echo " exited. (already compiled)"
  46. exit
  47. fi
  48. fi
  49. rm -rf ${ELCDIR}
  50. install -m 755 -d ${ELCDIR}
  51. # Copy the temp .el files
  52. # cp ${ELDIR}/* ${ELCDIR}/
  53. # Byte compile them
  54. (cd ${ELDIR}
  55. make EMACS=${FLAVOR} LISPDIR=${SITELISP} install \
  56. > ${ELCDIR}/CompilationLog 2>&1
  57. )
  58. # remove mel-b-ccl.el* for xemacs
  59. # (see http://lists.airs.net/wl/archive/200101/msg00077.html)
  60. case "${FLAVOR}" in
  61. xemacs-21.1*)
  62. rm -f ${ELCDIR}/mel-b-ccl.el*
  63. ;;
  64. *)
  65. ;;
  66. esac
  67. gzip -9 ${ELCDIR}/CompilationLog
  68. echo ${VERSION} > ${STAMP}
  69. if [ -e ${ELCDIR}/${STARTFILE}c ]; then
  70. mv ${ELCDIR}/${STARTFILE}c ${STARTDIR}/50${STARTFILE}c;
  71. else
  72. ln -f -s ${ELDIR}/${STARTFILE} ${STARTDIR}/50${STARTFILE};
  73. fi
  74. echo " done."
  75. ;;
  76. esac
  77. exit 0;