preview-latex-install.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #! /bin/sh -e
  2. # /usr/lib/emacsen-common/packages/install/preview-latex
  3. # [ This particular script hasn't been tested, so be careful. ]
  4. set -e
  5. FLAVOR=$1
  6. PACKAGE="preview-latex"
  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. ## <merged from auctex-11.85/preview/Makefile>
  21. ELCC="${FLAVOR} -batch -q -no-site-file -no-init-file"
  22. LISP_SOURCES="prv-emacs.el preview.el"
  23. ## </merged from auctex-11.85/preview/Makefile>
  24. case "${FLAVOR}" in
  25. *)
  26. echo -n "install/${PACKAGE}: Byte-compiling for ${FLAVOR} ..."
  27. rm -rf ${ELCDIR}
  28. install -m 755 -d ${ELCDIR}
  29. # Byte compile
  30. (
  31. cd ${ELDIR}
  32. install -p -m 0644 *.el ${ELCDIR}
  33. cp -ra images ${ELCDIR}/
  34. cd ${ELCDIR}
  35. ${ELCC} -f batch-byte-compile \
  36. ${LISP_SOURCES} > CompilationLog 2>&1
  37. rm -f auto.el ${PACKAGE}-init.el
  38. )
  39. gzip -9 ${ELCDIR}/CompilationLog
  40. if [ ! -d ${STARTDIR} ]; then
  41. install -m 755 -d ${STARTDIR}
  42. fi
  43. ln -sf ${ELDIR}/${STARTFILE} ${STARTDIR}/50${STARTFILE};
  44. echo " done."
  45. ;;
  46. esac
  47. exit 0;