navi2ch-install.sh 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #! /bin/sh -e
  2. # /usr/lib/emacsen-common/packages/install/navi2ch
  3. # [ This particular script hasn't been tested, so be careful. ]
  4. set -e
  5. FLAVOR=$1
  6. PACKAGE="navi2ch"
  7. VERSION="2.0.0"
  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. STAMP=${ELCDIR}/compile-stamp
  22. compile() {
  23. echo -n "install/${PACKAGE}: Byte-compiling for ${FLAVOR} ..."
  24. if [ -e ${STAMP} ]; then
  25. if [ "${VERSION}" = "`cat ${STAMP}`" ]; then
  26. echo " exited. (already compiled)"
  27. exit
  28. fi
  29. fi
  30. rm -rf ${ELCDIR}
  31. install -m 755 -d ${ELCDIR}
  32. cd ${ELDIR}
  33. #rm -f config.*
  34. ./configure --with-lispdir=${ELCDIR} > ${ELCDIR}/CompilationLog 2>&1
  35. ## Unrecognized options: --with-xemacs, --with-emacs in ./configure
  36. make clean >> ${ELCDIR}/CompilationLog 2>&1
  37. make EMACS=${FLAVOR} >> ${ELCDIR}/CompilationLog 2>&1
  38. #make EMACS=${FLAVOR} -C contrib >> ${ELCDIR}/CompilationLog 2>&1
  39. make INSTALLPATH=${ELCDIR} install >> ${ELCDIR}/CompilationLog 2>&1
  40. #make INSTALLPATH=${ELCDIR} install -C contrib >> ${ELCDIR}/CompilationLog 2>&1
  41. make clean >> ${ELCDIR}/CompilationLog 2>&1
  42. #rm -f config.*
  43. rm ${ELCDIR}/*.el
  44. #if [ -e /usr/share/info/navi2ch.info.gz ]; then
  45. # rm -f /usr/share/info/navi2ch.info*.gz
  46. #fi
  47. gzip -9 ${ELCDIR}/CompilationLog
  48. #gzip -9 /usr/share/info/navi2ch.info
  49. echo ${VERSION} > ${STAMP}
  50. install -p -m644 ${ELDIR}/vine-default-${PACKAGE}.el ${ELCDIR}
  51. ln -f -s ${ELDIR}/${STARTFILE} ${STARTDIR}/90${STARTFILE};
  52. echo " done."
  53. }
  54. case "${FLAVOR}" in
  55. emacs-20*)
  56. echo "Not Support"
  57. ;;
  58. emacs-21*)
  59. compile
  60. ;;
  61. emacs-22*)
  62. compile
  63. ;;
  64. xemacs-*)
  65. compile
  66. ;;
  67. emacs-23*)
  68. compile
  69. ;;
  70. *)
  71. ;;
  72. esac
  73. exit 0;