Debian Codegraph @

debian/systemtap-common.emacsen-install

raw
1 #!/bin/sh
2 # /usr/lib/emacsen-common/packages/install/systemtap-common
3 set -e
4 PACKAGE=systemtap-common
5
6 FLAVOR=$1
7
8 byte_compile_options="-batch -f batch-byte-compile"
9 el_files="systemtap-init.el systemtap-mode.el"
10 el_dir=/usr/share/emacs/site-lisp/${PACKAGE}/
11 elc_dir=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}/
12
13 case "${FLAVOR}" in
14 emacs)
15 ;;
16 emacs23|emacs24|emacs-snapshot)
17 echo install/${PACKAGE}: Handling install of emacsen flavor ${FLAVOR}
18 [ -d ${elc_dir} ] || mkdir ${elc_dir}
19
20 # Symlink the .el files (emacsen policy 6E)
21 for i in ${el_files}; do
22 ln -fs ../../../emacs/site-lisp/${PACKAGE}/${i} ${elc_dir}/${i}
23 done
24
25 # Byte compile them
26 cd ${elc_dir}
27 LOG=`mktemp -t elc.XXXXXXXXXXXX`
28 if ! ${FLAVOR} ${byte_compile_options} ${el_files} > ${LOG} 2>&1; then
29 echo Byte-compilation failed:
30 cat ${LOG}
31 rm ${LOG}
32 exit 1
33 fi
34 rm ${LOG}
35 ;;
36 *)
37 echo install/${PACKAGE}: Ignoring unsupported flavor ${FLAVOR}
38 ;;
39 esac
40
41 exit 0;
42