]> git.notmuchmail.org Git - notmuch/blob - debian/notmuch-emacs.emacsen-install
lib: optionally silence Xapian deprecation warnings
[notmuch] / debian / notmuch-emacs.emacsen-install
1 #!/bin/sh
2 # /usr/lib/emacsen-common/packages/install/notmuch-emacs
3 set -e
4
5 FLAVOR=$1
6 PACKAGE=notmuch
7
8 case "${FLAVOR}" in
9     emacs)
10         return 0
11         ;;
12     xemacs*|emacs2[12])
13         # patches welcome.
14         echo install/${PACKAGE}: skipping install for unsupported emacsen flavor ${FLAVOR}
15         exit 0
16         ;;
17     *)
18         echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR}
19 esac
20
21
22 elc_dir=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
23 el_dir=/usr/share/emacs/site-lisp/${PACKAGE}
24
25 byte_compile_options="--quick --directory=${el_dir} -batch -f batch-byte-compile"
26
27 echo install/${PACKAGE}: byte-compiling for ${FLAVOR}
28
29 [ -d ${elc_dir} ] || mkdir ${elc_dir}
30
31 # Create symlinks to the .el files (see section 6E in debian-emacs
32 # polcy).  This makes complation easy, and also allows find-function
33 # and find-library to work properly.
34 (cd ${elc_dir} && ln -sf ${el_dir}/*.el .)
35
36 # Byte compile them
37 (cd ${elc_dir}
38  set +e
39  ${FLAVOR} ${byte_compile_options} *.el > Install.log 2>&1
40  if test $? -ne 0
41  then
42    cat Install.log
43    exit 1
44  fi
45  set -e
46  gzip -9f Install.log)
47
48 exit 0;