html-helper-mode-install.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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="html-helper-mode"
  7. if [ "X${FLAVOR}" = "X" ]; then
  8. echo Need argument to determin FLAVOR of emacs;
  9. exit 1
  10. fi
  11. if [ "X${PACKAGE}" = "X" ]; then
  12. echo Internal error: need package name;
  13. exit 1;
  14. fi
  15. ELDIR=/usr/share/emacs/site-lisp/${PACKAGE}
  16. ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
  17. STARTDIR=/etc/${FLAVOR}/site-start.d
  18. STARTFILE="${PACKAGE}-init.el";
  19. SITELISP=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
  20. #EFLAGS="-batch -q"
  21. EFLAGS="-batch -l HHM-MK"
  22. COMPILE="-batch -q -f batch-byte-compile"
  23. case "${FLAVOR}" in
  24. emacs|emacs19)
  25. ;;
  26. *)
  27. echo -n "install/${PACKAGE}: Byte-compiling for ${FLAVOR} ..."
  28. # if [ "${FLAVOR}" = "mule2" ]; then
  29. # if [ ! -d /usr/share/emacs/site-lisp/clime ]; then
  30. # echo " exited."
  31. # echo "W: Please install \`clime' package for mule2." ;
  32. # exit 0;
  33. # fi
  34. # else
  35. # if [ ! -d /usr/share/emacs/site-lisp/flim ]; then
  36. # echo " exited."
  37. # echo "W: Please install \`flim' package for ${FLAVOR}." ;
  38. # exit 0;
  39. # fi
  40. # fi
  41. rm -rf ${ELCDIR}
  42. install -m 755 -d ${ELCDIR}
  43. # Byte compile
  44. (cd ${ELDIR}
  45. ${FLAVOR} ${EFLAGS} > ${ELCDIR}/CompilationLog 2>&1
  46. install -m0644 *.elc /usr/share/${FLAVOR}/site-lisp/${PACKAGE} \
  47. > ${ELCDIR}/CompilationLog 2>&1
  48. rm -f *.elc > ${ELCDIR}/CompilationLog 2>&1
  49. rm -f ${ELCDIR}/*.el
  50. )
  51. gzip -9 ${ELCDIR}/CompilationLog
  52. ln -sf ${ELDIR}/${STARTFILE} ${STARTDIR}/75${STARTFILE};
  53. echo " done."
  54. ;;
  55. esac
  56. exit 0;