File: emacsen-install

package info (click to toggle)
emms 5.1-1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster
  • size: 1,412 kB
  • sloc: lisp: 11,179; makefile: 111; cpp: 79; perl: 61; sh: 41; ansic: 40
file content (45 lines) | stat: -rwxr-xr-x 1,141 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#! /bin/sh -e
# /usr/lib/emacsen-common/packages/install/emms

# Written by Jim Van Zandt <jrv@vanzandt.mv.com>, borrowing heavily
# from the install scripts for gettext by Santiago Vila
# <sanvila@ctv.es> and octave by Dirk Eddelbuettel <edd@debian.org>.

FLAVOR=$1
PACKAGE=emms

if [ ${FLAVOR} = xemacs21 ] || \
       [ ${FLAVOR} = emacs21 ] || \
       [ ${FLAVOR} = emacs22 ] || \
       [ ${FLAVOR} = emacs23 ] || \
       [ ${FLAVOR} = emacs24 ]; then
    echo "install/${PACKAGE}: skipping unsupported ${FLAVOR}"
    exit 0
fi

ELDIR=/usr/share/emacs/site-lisp/${PACKAGE}
ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile"

echo "install/${PACKAGE}: byte-compiling for ${FLAVOR}"

install -m 755 -d ${ELCDIR}
cd ${ELCDIR}
# Handle 'emacs' flavor where .elc will be in the same directory as .el
if [ ${ELDIR} != ${ELCDIR} ]; then
    ln -sf ${ELDIR}/* .
fi

cat << EOF > path.el
(setq load-path (cons "." load-path))
EOF

${FLAVOR} ${FLAGS} *.el > install.log 2>&1
if [ $? -ne 0 ]; then
    cat install.log
    exit 1
fi
gzip -9f install.log
rm -f path.el path.elc

exit 0