home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / elisp / games / meta-server / install < prev    next >
Encoding:
Text File  |  1993-01-22  |  3.0 KB  |  91 lines

  1. #!/usr/local/bin/tcsh
  2. if ($#argv == 1) then
  3.    test -d $1
  4.    if ($status) then    # destination directory doesn't exist, create it
  5.       mkdir $1
  6.       echo "Created directory " $1 "..."
  7.    else
  8.       echo "Directory " $1 " already exists, installing there..."
  9.    endif
  10.  
  11.    test -f meta-server.elc
  12.    if (! $status) then  # already compiled
  13.       echo "You already compiled the code..."
  14.    else
  15.       echo "Compiling the code..."
  16.       emacs -nw -batch -f batch-byte-compile meta-server.el > /dev/null
  17.       test -f meta-server.elc
  18.       if ($status) then
  19.          echo "Something is wrong with the compiling... aborting."
  20.          exit 1
  21.       endif
  22.    endif
  23.    cp meta-server.el meta-server.elc $1
  24.    if (! $status) then
  25.       echo "Successfully copied the lisp files to "$1"."
  26.    else
  27.       echo "There was an error copying to " $1 "."
  28.       exit 1
  29.    endif
  30.  
  31.    echo "Do you want me to add "$1" to your load-path"
  32.    echo -n "in your .emacs automatically? (y/n)"
  33.    set answer = $<
  34.    if ($answer == "y" || $answer == "Y") then
  35.       test -f ~/.emacs
  36.       if (! $status) then   # .emacs already exists
  37.          echo '(setq load-path (append (list "'$1'") load-path))' >> ~/.emacs
  38.       else
  39.      echo '(setq load-path (append (list "'$1'") load-path))' > ~/.emacs
  40.       endif   
  41.       echo "Check the line (setq load-path ...) to make sure it is correct."
  42.    endif
  43.  
  44.    echo "Adding auto-loading and keybinding to the end of your .emacs"
  45.    test -f ~/.emacs
  46.    if (! $status) then    # .emacs exists
  47.       echo "(autoload 'metaserver-refresh "'"meta-server" "Netrek info" t)' >> ~/.emacs
  48.       echo '(global-set-key "\C-c\C-n"'"'metaserver-refresh)" >> ~/.emacs
  49.    else 
  50.       echo "(autoload 'metaserver-refresh "'"meta-server" "Netrek info" t)' > ~/.emacs
  51.       echo '(global-set-key "\C-c\C-n"'"'metaserver-refresh)" >> ~/.emacs
  52.    endif
  53.  
  54.    echo -n "Do you want the background package installed also?"
  55.    set answer = $<
  56.    if ($answer == "y" || $answer == "Y") then
  57.       test -f background.el
  58.       if (! $status) then
  59.      cp background.el $1
  60.       else
  61.          echo "Could not find background.el in the current directory!"
  62.      exit 1
  63.       endif
  64.       test -f ~/.emacs
  65.       if (! $status) then
  66.      echo "(autoload 'background"' "background" "Background processes." t)' >> ~/.emacs
  67.      echo "(setq metaserver-use-background t)" >> ~/.emacs
  68.       else
  69.      echo "(autoload 'background"' "background" "Background processes." t)' > ~/.emacs
  70.      echo "(setq metaserver-use-background t)" >> ~/.emacs
  71.       endif
  72.  
  73.       echo -n "Do you have the ck_players program installed anywhere? "
  74.       set answer = $<
  75.       if ($answer == "y" || $answer == "Y") then
  76.      echo "Please enter the path to the ck_players program.  Enter just"
  77.      echo "the name of the binary if it is somewhere in your PATH."
  78.      echo -n "Ck_players program: "
  79.      set answer = $<
  80.      echo "(setq metaserver-auto-fallback t)" >> ~/.emacs
  81.      echo "(setq metaserver-ck-players-program" '"'$answer'")' >> ~/.emacs
  82.       endif
  83.       
  84.    endif
  85.  
  86.    echo "Installation complete..."         
  87.  
  88. else
  89.    echo "usage: " $0 " <destination-directory>"
  90. endif
  91.