wl-install.sh 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #!/bin/sh -e
  2. # /usr/lib/emacsen-common/packages/install/wl
  3. # [ This particular script hasn't been tested, so be careful. ]
  4. set -e
  5. FLAVOR=$1
  6. PACKAGE="wl"
  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
  20. PIXMAPDIR=/usr/share/${FLAVOR}/etc/wl
  21. EFLAGS="-batch -q"
  22. COMPILE="-batch -q -f batch-byte-compile"
  23. case "${FLAVOR}" in
  24. emacs|emacs19)
  25. ;;
  26. *)
  27. if [ -e /usr/lib/emacsen-common/packages/install/wemi ]; then
  28. if [ ! -d ${SITELISP}/semi ] ; then
  29. /usr/lib/emacsen-common/packages/install/wemi ${FLAVOR}
  30. fi
  31. fi
  32. echo -n "install/${PACKAGE}: Byte-compiling for ${FLAVOR} ..."
  33. if [ ! -d /usr/share/emacs/site-lisp/semi ]; then
  34. echo " exited."
  35. echo "W: Please install \`semi' package for ${FLAVOR}." ;
  36. exit 0;
  37. fi
  38. rm -rf ${ELCDIR}
  39. install -m 755 -d ${ELCDIR}
  40. # Byte compile
  41. (
  42. cd ${ELDIR}
  43. make EMACS=${FLAVOR} FLAGS="${EFLAGS}" LISPDIR=${SITELISP} \
  44. > ${ELCDIR}/CompilationLog 2>&1
  45. case "${FLAVOR}" in
  46. xemacs-*|emacs-21*)
  47. make EMACS=${FLAVOR} FLAGS="${EFLAGS}" LISPDIR=${SITELISP} \
  48. PIXMAPDIR=${PIXMAPDIR} install \
  49. >> ${ELCDIR}/CompilationLog 2>&1
  50. ;;
  51. *)
  52. make EMACS=${FLAVOR} FLAGS="${EFLAGS}" LISPDIR=${SITELISP} \
  53. PIXMAPDIR=${PIXMAPDIR} \
  54. install >> ${ELCDIR}/CompilationLog 2>&1
  55. ;;
  56. esac
  57. make EMACS=${FLAVOR} FLAGS="${EFLAGS}" LISPDIR=${SITELISP} clean \
  58. >> ${ELCDIR}/CompilationLog 2>&1
  59. rm -f ${ELCDIR}/*.el
  60. #cp ${STARTFILE} ${ELCDIR}
  61. rm -f *.elc elmo/*.elc
  62. rm -f vine-default-${PACKAGE}.elc
  63. install -p -m644 ${ELDIR}/vine-default-${PACKAGE}.el ${ELCDIR}
  64. )
  65. gzip -9 ${ELCDIR}/CompilationLog
  66. ln -sf ${ELDIR}/${STARTFILE} ${STARTDIR}/55${STARTFILE};
  67. echo " done."
  68. ;;
  69. esac
  70. exit 0;