migemo-install.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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="migemo"
  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. COMPILE="-batch -q -f batch-byte-compile"
  22. SOURCES="migemo.el"
  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. # Byte compile
  42. cd ${ELDIR}
  43. rm -rf ${ELCDIR}
  44. install -m 755 -d ${ELCDIR}
  45. cp ${SOURCES} ${ELCDIR}
  46. FILES="${SOURCES}"
  47. cd ${ELCDIR}
  48. ${FLAVOR} ${FLAGS} ${FILES} > ${ELCDIR}/CompilationLog 2>&1
  49. rm -f ${SOURCES}
  50. gzip -9 ${ELCDIR}/CompilationLog
  51. install -p -m644 ${ELDIR}/vine-default-${PACKAGE}.el ${ELCDIR}
  52. install -p -m644 ${ELDIR}/${STARTFILE} ${STARTDIR}/90${STARTFILE}
  53. echo " done."
  54. ;;
  55. esac
  56. exit 0;