migemo-install.sh 1.5 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="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. FLAGS="${SITEFLAG} -q -batch -f batch-byte-compile"
  21. SOURCES="migemo.el"
  22. case "${FLAVOR}" in
  23. emacs|emacs19)
  24. ;;
  25. *)
  26. echo -n "install/${PACKAGE}: Byte-compiling for ${FLAVOR} ..."
  27. # if [ "${FLAVOR}" = "mule2" ]; then
  28. # if [ ! -d /usr/share/emacs/site-lisp/clime ]; then
  29. # echo " exited."
  30. # echo "W: Please install \`clime' package for mule2." ;
  31. # exit 0;
  32. # fi
  33. # else
  34. # if [ ! -d /usr/share/emacs/site-lisp/flim ]; then
  35. # echo " exited."
  36. # echo "W: Please install \`flim' package for ${FLAVOR}." ;
  37. # exit 0;
  38. # fi
  39. # fi
  40. # Byte compile
  41. cd ${ELDIR}
  42. rm -rf ${ELCDIR}
  43. install -m 755 -d ${ELCDIR}
  44. cp ${SOURCES} ${ELCDIR}
  45. FILES="${SOURCES}"
  46. cd ${ELCDIR}
  47. ${FLAVOR} ${FLAGS} ${FILES} > ${ELCDIR}/CompilationLog 2>&1
  48. rm -f ${SOURCES}
  49. gzip -9 ${ELCDIR}/CompilationLog
  50. install -p -m644 ${ELDIR}/vine-default-${PACKAGE}.el ${ELCDIR}
  51. ln -sf ${ELDIR}/${STARTFILE} ${STARTDIR}/90${STARTFILE}
  52. echo " done."
  53. ;;
  54. esac
  55. exit 0;