1 | #! /bin/sh -e |
---|
2 | # /usr/lib/emacsen-common/packages/install/foo |
---|
3 | # [ This particular script hasn't been tested, so be careful. ] |
---|
4 | |
---|
5 | set -e |
---|
6 | |
---|
7 | FLAVOR=$1 |
---|
8 | PACKAGE="html-helper-mode" |
---|
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 | VDELFILE="vine-default-${PACKAGE}.el" |
---|
26 | |
---|
27 | SITELISP=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} |
---|
28 | |
---|
29 | #EFLAGS="-batch -q" |
---|
30 | EFLAGS="-batch -l HHM-MK" |
---|
31 | COMPILE="-batch -q -f batch-byte-compile" |
---|
32 | |
---|
33 | case "${FLAVOR}" in |
---|
34 | emacs|emacs19) |
---|
35 | ;; |
---|
36 | *) |
---|
37 | |
---|
38 | echo -n "install/${PACKAGE}: Byte-compiling for ${FLAVOR} ..." |
---|
39 | # if [ "${FLAVOR}" = "mule2" ]; then |
---|
40 | # if [ ! -d /usr/share/emacs/site-lisp/clime ]; then |
---|
41 | # echo " exited." |
---|
42 | # echo "W: Please install \`clime' package for mule2." ; |
---|
43 | # exit 0; |
---|
44 | # fi |
---|
45 | # else |
---|
46 | # if [ ! -d /usr/share/emacs/site-lisp/flim ]; then |
---|
47 | # echo " exited." |
---|
48 | # echo "W: Please install \`flim' package for ${FLAVOR}." ; |
---|
49 | # exit 0; |
---|
50 | # fi |
---|
51 | # fi |
---|
52 | |
---|
53 | rm -rf ${ELCDIR} |
---|
54 | install -m 755 -d ${ELCDIR} |
---|
55 | |
---|
56 | # Byte compile |
---|
57 | (cd ${ELDIR} |
---|
58 | ${FLAVOR} ${EFLAGS} > ${ELCDIR}/CompilationLog 2>&1 |
---|
59 | install -m0644 *.elc ${ELCDIR} > ${ELCDIR}/CompilationLog 2>&1 |
---|
60 | rm -f *.elc > ${ELCDIR}/CompilationLog 2>&1 |
---|
61 | rm -f ${ELCDIR}/*.el |
---|
62 | install -m0644 ${VDELFILE} ${ELCDIR} > ${ELCDIR}/CompilationLog 2>&1 |
---|
63 | ) |
---|
64 | |
---|
65 | gzip -9 ${ELCDIR}/CompilationLog |
---|
66 | |
---|
67 | ln -sf ${ELDIR}/${STARTFILE} ${STARTDIR}/75${STARTFILE}; |
---|
68 | echo " done." |
---|
69 | ;; |
---|
70 | esac |
---|
71 | |
---|
72 | exit 0; |
---|