| [2744] | 1 | #!/bin/csh | 
|---|
|  | 2 | set version = V1.1 | 
|---|
|  | 3 |  | 
|---|
|  | 4 | if($#argv <= 0)  then | 
|---|
|  | 5 | echo "Give the directory where Sophya should be installed" | 
|---|
|  | 6 | echo "usage: install_from_tar.csh directory_name" | 
|---|
|  | 7 | exit(-1) | 
|---|
|  | 8 | endif | 
|---|
|  | 9 | set dir = $1 | 
|---|
|  | 10 | if( ! -e $dir ) then | 
|---|
|  | 11 | echo Directory $dir does not exist | 
|---|
|  | 12 | exit(-1) | 
|---|
|  | 13 | endif | 
|---|
|  | 14 | touch $dir/toto | 
|---|
|  | 15 | if( $status != 0 ) then | 
|---|
|  | 16 | echo Writing impossible in $dir | 
|---|
|  | 17 | exit(-1) | 
|---|
|  | 18 | endif | 
|---|
|  | 19 | rm -rf $dir/toto $dir/env.csh $dir/$version | 
|---|
|  | 20 |  | 
|---|
|  | 21 | ################################ | 
|---|
|  | 22 | #### Creation du fichier env.csh | 
|---|
|  | 23 | ################################ | 
|---|
|  | 24 | cat >! $dir/env.csh <<EOF | 
|---|
|  | 25 | #!/bin/csh | 
|---|
|  | 26 | #  Definition d'environnement SOPHYA sous Linux | 
|---|
|  | 27 | #                           R. Ansari   03/2001 | 
|---|
|  | 28 | # | 
|---|
|  | 29 | set sversion = pro | 
|---|
|  | 30 | set ostype = Linux | 
|---|
|  | 31 | setenv SOPHYACXX g++ | 
|---|
|  | 32 | if (\$#argv > 0)  then | 
|---|
|  | 33 | if (\$1 == '-h') then | 
|---|
|  | 34 | echo 'Usage: source env.csh [pro/new/old]' | 
|---|
|  | 35 | echo '  Defines the environment for using SOPHYA ' | 
|---|
|  | 36 | echo '  First optional argument defines the library version (pro/new/... Default=pro)' | 
|---|
|  | 37 | exit -1 | 
|---|
|  | 38 | endif | 
|---|
|  | 39 | set sversion = \$1 | 
|---|
|  | 40 | endif | 
|---|
|  | 41 |  | 
|---|
|  | 42 | echo ' env.csh : setting environment variables for SOPHYA ' | 
|---|
|  | 43 |  | 
|---|
|  | 44 | setenv SOPHYABASEREP $dir/$version | 
|---|
|  | 45 | setenv EXTLIBDIR  $dir/ExtLibs | 
|---|
|  | 46 |  | 
|---|
|  | 47 | if( \$?LD_LIBRARY_PATH ) then | 
|---|
|  | 48 | setenv LD_LIBRARY_PATH .:\${LD_LIBRARY_PATH}:\${SOPHYABASEREP}/\${ostype}-\${SOPHYACXX}/ShLibs | 
|---|
|  | 49 | else | 
|---|
|  | 50 | setenv LD_LIBRARY_PATH .:\${SOPHYABASEREP}/\${ostype}-\${SOPHYACXX}/ShLibs | 
|---|
|  | 51 | endif | 
|---|
|  | 52 |  | 
|---|
|  | 53 | set path = (\$path \$SOPHYABASEREP/\${ostype}-\${SOPHYACXX}/Exec) | 
|---|
|  | 54 |  | 
|---|
|  | 55 | echo 'SOPHYACXX=    ' \$SOPHYACXX | 
|---|
|  | 56 | echo 'SOPHYABASEREP= ' \$SOPHYABASEREP | 
|---|
|  | 57 | echo 'EXTLIBDIR=  ' \$EXTLIBDIR | 
|---|
|  | 58 | echo 'LD_LIBRARY_PATH= ' \$LD_LIBRARY_PATH | 
|---|
|  | 59 | echo 'PATH= ' \$path | 
|---|
|  | 60 |  | 
|---|
|  | 61 | exit 0 | 
|---|
|  | 62 |  | 
|---|
|  | 63 | EOF | 
|---|
|  | 64 | chmod +x $dir/env.csh | 
|---|
|  | 65 |  | 
|---|
|  | 66 | ############################# | 
|---|
|  | 67 | #### extract des fichiers tar | 
|---|
|  | 68 | ############################# | 
|---|
|  | 69 | foreach f ( sophya_src.tar.gz sophya_linux.tar.gz sophya_extlibs_linux.tar.gz) | 
|---|
|  | 70 | if( -e $f ) then | 
|---|
|  | 71 | cp $f $dir/. | 
|---|
|  | 72 | pushd $dir > /dev/null | 
|---|
|  | 73 | tar -xzvf $f | 
|---|
|  | 74 | rm -f $f | 
|---|
|  | 75 | popd > /dev/null | 
|---|
|  | 76 | endif | 
|---|
|  | 77 | end | 
|---|
|  | 78 |  | 
|---|
|  | 79 | ############################# | 
|---|
|  | 80 | #### Creation du lien sur pro | 
|---|
|  | 81 | ############################# | 
|---|
|  | 82 | pushd $dir > /dev/null | 
|---|
|  | 83 | ln -s -f ./$version ./pro | 
|---|
|  | 84 | popd > /dev/null | 
|---|
|  | 85 |  | 
|---|
|  | 86 | exit 0 | 
|---|