File: install-sh

package info (click to toggle)
yorick 1.4-14
  • links: PTS
  • area: main
  • in suites: potato
  • size: 5,948 kB
  • ctags: 6,609
  • sloc: ansic: 63,898; yacc: 889; makefile: 605; sh: 65; lisp: 60; fortran: 19
file content (27 lines) | stat: -rwxr-xr-x 1,034 bytes parent folder | download | duplicates (3)
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
#!/bin/sh
# Some versions of make (ULTRIX?) handle if tests inside Makefiles poorly.
# This script is run automatically by make; don't run it by hand.

# install.sh 0 directory   - creates the directory if not present
# install.sh 1 directory   - ditto, but sets permissions to 777 (contrib)
# install.sh 2 site        - copies Yorick/include,doc files to site
# install.sh 3 site        - conditionally destroys site/include,doc
# install.sh 4 dir prog    - conditionally copy prog to dir/yorick

case "$1" in
  "0") shift
       for dir in $*; do
         if test ! -d $dir; then mkdir $dir; fi
       done;;
  "1") if test ! -d $2; then mkdir $2; chmod 777 $2; fi;;
  "2") if test `pwd` != `cd $2;pwd`; then
         cp include/*.i $2/include
         cp include/README $2/include
         cp doc/* $2/doc; fi;;
  "3") if test `pwd` != `cd $2;pwd`; then
         rm -f -r $2/include $2/doc; fi;;
  "4") if test -r $3; then cp $3 $2/yorick; fi;;
  *)   echo "(IMPOSSIBLE ERROR) install.sh script called incorrectly" ;;
esac

exit 0