home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / lib / emacsen-common / packages / install / dictionaries-common
Encoding:
Text File  |  2006-07-12  |  1.7 KB  |  73 lines

  1. #!/bin/sh
  2. #
  3. #     $Id: emacsen-install,v 1.9 2006/02/27 20:59:03 agmartin Exp $    
  4. #
  5. # emacsen install script for the Debian GNU/Linux
  6. # dictionaries-common package
  7. #
  8. # Written by Rafael Laboissiere <rafael@debian.org> and 
  9. # Agustin Martin <agmartin@debian.org>
  10. #
  11. # Some things taken from Dirk Eddelbuettel script for the octave package.
  12. # lpath.el trick is stolen from Davide Salvetti's auctex package
  13. # --------------------------------------------------------------
  14.  
  15. set -e
  16.  
  17. # Canadian spelling ;-)
  18. flavour=$1 
  19.  
  20. package=dictionaries-common
  21. files="debian-ispell.el ispell.el flyspell.el"
  22. source=/usr/share/emacs/site-lisp/${package}
  23. destination=/usr/share/${flavour}/site-lisp/${package}
  24.  
  25. case "$flavour" in
  26.     emacs)
  27.     # Dummy emacs flavour. Do nothing and exit
  28.     exit 0
  29.     ;;
  30.     xemacs*)
  31.     flags="-no-site-file"
  32.     ;;
  33.     emacs19|emacs-snapshot*)
  34.     # Do not byte-compile anything for emacs19 or emacs-snapshot
  35.     echo "install/${package}: Skipping byte-compilation for $flavour"
  36.     exit 0
  37.     ;;
  38.     emacs*)
  39.     flags="--no-site-file"
  40.     ;;
  41.     *)
  42.     echo install/${package}: Ignoring emacsen flavour [${flavour}]
  43.     exit 0
  44.     ;;
  45. esac
  46.  
  47. flags="${flags} -q -batch -l path.el -f batch-byte-compile"
  48.  
  49. echo install/${package}: Byte-compiling for emacsen flavour ${flavour}
  50.  
  51. # Copy the temp .el files into the destination directory
  52.  
  53. install -m 0755 -d ${destination}
  54.  
  55. for i in $files; do 
  56.     cp $source/$i $destination
  57. done
  58.  
  59. # Make sure current dir is in the load path
  60.  
  61. cat << EOF > ${destination}/path.el
  62. (setq load-path (cons "." load-path) byte-compile-warnings nil)
  63. EOF
  64.  
  65. ( # Go to the .elc dir, byte compile files and remove temp .el files from the .elc dir
  66.     cd ${destination}
  67.     ${flavour} ${flags} ${files}
  68.     rm ${files} path.el
  69. )
  70.  
  71. exit 0;
  72.  
  73.