Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 30th, 2012  |  syntax: None  |  size: 1.20 KB  |  hits: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/sh
  2. set -e
  3. SRC_FILE="haml-mode.el"
  4. # Right now only emacs23 is supported. If the future brings support
  5. # for other emacsen, we can keep this same logic - just update this
  6. # regex
  7. SUPPORTED_EMACSEN="^emacs23$"
  8. FLAVOR="$1"
  9.  
  10. if echo $FLAVOR | egrep -vq $SUPPORTED_EMACSEN; then
  11.   echo "Skipping byte-compilation for ${FLAVOR}: Not supported"
  12.   exit 0
  13. fi
  14.  
  15. echo "install/haml-elisp: Handling install of emacsen flavor ${FLAVOR}"
  16.  
  17. if [ "${FLAVOR}" != "emacs" ]; then
  18.   echo "install/haml-elisp: byte-compiling for ${FLAVOR}"
  19.   cd /usr/share/emacs/site-lisp/haml-elisp
  20.   mkdir -p /usr/share/${FLAVOR}/site-lisp/haml-elisp
  21.   cp $SRC_FILE /usr/share/${FLAVOR}/site-lisp/haml-elisp
  22.   cd /usr/share/${FLAVOR}/site-lisp/haml-elisp
  23.   cat <<EOF > path.el
  24. (setq load-path (cons "." load-path) byte-compile-warnings nil)
  25. EOF
  26.   FLAVORTEST=`echo $FLAVOR | cut -c-6`
  27.   if [ ${FLAVORTEST} = xemacs ] ; then
  28.     SITEFLAG="-no-site-file"
  29.   else
  30.     SITEFLAG="--no-site-file"
  31.   fi
  32.   ${FLAVOR} -q ${SITEFLAG} -batch -l path.el -f batch-byte-compile $SRC_FILE
  33.   rm path.el $SRC_FILE
  34. fi
  35.  
  36. if [ $FLAVOR == "emacs23" ]; then
  37.   ln -s /usr/share/${FLAVOR}/site-lisp/haml-elisp/$SRC_FILE \
  38.       /usr/share/emacs/site-lisp/haml-elisp/$SRC_FILE
  39. fi
  40.  
  41. exit 0;