[2750] | 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 | |
---|
| 5 | set -e |
---|
| 6 | |
---|
| 7 | FLAVOR=$1 |
---|
| 8 | PACKAGE="preview-latex" |
---|
| 9 | |
---|
| 10 | if [ "X${FLAVOR}" = "X" ]; then |
---|
| 11 | echo Need argument to determin FLAVOR of emacs; |
---|
| 12 | exit 1 |
---|
| 13 | fi |
---|
| 14 | |
---|
| 15 | if [ "X${PACKAGE}" = "X" ]; then |
---|
| 16 | echo Internal error: need package name; |
---|
| 17 | exit 1; |
---|
| 18 | fi |
---|
| 19 | |
---|
| 20 | ELDIR=/usr/share/emacs/site-lisp/${PACKAGE} |
---|
| 21 | ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} |
---|
| 22 | |
---|
| 23 | STARTDIR=/etc/${FLAVOR}/site-start.d |
---|
| 24 | STARTFILE="${PACKAGE}-init.el"; |
---|
| 25 | |
---|
| 26 | SITELISP=/usr/share/${FLAVOR}/site-lisp |
---|
| 27 | |
---|
| 28 | ## <merged from auctex-11.85/preview/Makefile> |
---|
| 29 | ELCC="${FLAVOR} -batch -q -no-site-file -no-init-file" |
---|
| 30 | LISP_SOURCES="prv-emacs.el preview.el" |
---|
| 31 | ## </merged from auctex-11.85/preview/Makefile> |
---|
| 32 | |
---|
| 33 | |
---|
| 34 | case "${FLAVOR}" in |
---|
| 35 | |
---|
| 36 | *) |
---|
| 37 | |
---|
| 38 | echo -n "install/${PACKAGE}: Byte-compiling for ${FLAVOR} ..." |
---|
| 39 | |
---|
| 40 | rm -rf ${ELCDIR} |
---|
| 41 | install -m 755 -d ${ELCDIR} |
---|
| 42 | |
---|
| 43 | # Byte compile |
---|
| 44 | ( |
---|
| 45 | cd ${ELDIR} |
---|
| 46 | install -p -m 0644 *.el ${ELCDIR} |
---|
| 47 | cp -ra images ${ELCDIR}/ |
---|
| 48 | cd ${ELCDIR} |
---|
| 49 | |
---|
| 50 | ${ELCC} -f batch-byte-compile \ |
---|
| 51 | ${LISP_SOURCES} > CompilationLog 2>&1 |
---|
| 52 | |
---|
| 53 | rm -f auto.el ${PACKAGE}-init.el |
---|
| 54 | ) |
---|
| 55 | |
---|
| 56 | gzip -9 ${ELCDIR}/CompilationLog |
---|
| 57 | |
---|
| 58 | if [ ! -d ${STARTDIR} ]; then |
---|
| 59 | install -m 755 -d ${STARTDIR} |
---|
| 60 | fi |
---|
| 61 | |
---|
| 62 | ln -sf ${ELDIR}/${STARTFILE} ${STARTDIR}/50${STARTFILE}; |
---|
| 63 | |
---|
| 64 | echo " done." |
---|
| 65 | |
---|
| 66 | ;; |
---|
| 67 | |
---|
| 68 | esac |
---|
| 69 | |
---|
| 70 | exit 0; |
---|