File: install

package info (click to toggle)
debview 1.7-4
  • links: PTS
  • area: main
  • in suites: potato
  • size: 100 kB
  • ctags: 28
  • sloc: lisp: 333; sh: 82; makefile: 40
file content (30 lines) | stat: -rwxr-xr-x 853 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
#!/bin/sh
# /usr/lib/emacsen-common/packages/install/debview
set -e

FLAVOR=$1
echo install/debview: Handling install of emacsen flavor ${FLAVOR}

byte_compile_options="-batch -f batch-byte-compile"
el_file=deb-view.el
el_dir=/usr/share/emacs/site-lisp/debview
elc_dir=/usr/share/${FLAVOR}/site-lisp/debview

if [ ${FLAVOR} != emacs ]; then
    echo install/debview: byte-compiling for ${FLAVOR}
	    
    # Copy the temp .el file
    mkdir -p ${elc_dir}
    cp ${el_dir}/${el_file} ${elc_dir}

    # Byte compile them
    LOG=`tempfile`
    ${FLAVOR} ${byte_compile_options} ${elc_dir}/${el_file} >$LOG 2>&1
    mv $LOG ${elc_dir}/install.log
    echo "Compilation log for ${FLAVOR} saved to ${elc_dir}/install.log"

    # remove the redundant .el files
    # presumes that any .el files in the <flavor> dir are trash.
    rm ${elc_dir}/*.el
fi
exit 0