source: Sophya/trunk/SophyaLib/Mgr/install_from_tar.csh@ 4059

Last change on this file since 4059 was 2744, checked in by cmv, 20 years ago

pour memoire cmv 20/05/05

  • Property svn:executable set to *
File size: 2.0 KB
Line 
1#!/bin/csh
2set version = V1.1
3
4if($#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)
8endif
9set dir = $1
10if( ! -e $dir ) then
11 echo Directory $dir does not exist
12 exit(-1)
13endif
14touch $dir/toto
15if( $status != 0 ) then
16 echo Writing impossible in $dir
17 exit(-1)
18endif
19rm -rf $dir/toto $dir/env.csh $dir/$version
20
21################################
22#### Creation du fichier env.csh
23################################
24cat >! $dir/env.csh <<EOF
25#!/bin/csh
26# Definition d'environnement SOPHYA sous Linux
27# R. Ansari 03/2001
28#
29set sversion = pro
30set ostype = Linux
31setenv SOPHYACXX g++
32if (\$#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
40endif
41
42echo ' env.csh : setting environment variables for SOPHYA '
43
44setenv SOPHYABASEREP $dir/$version
45setenv EXTLIBDIR $dir/ExtLibs
46
47if( \$?LD_LIBRARY_PATH ) then
48 setenv LD_LIBRARY_PATH .:\${LD_LIBRARY_PATH}:\${SOPHYABASEREP}/\${ostype}-\${SOPHYACXX}/ShLibs
49else
50 setenv LD_LIBRARY_PATH .:\${SOPHYABASEREP}/\${ostype}-\${SOPHYACXX}/ShLibs
51endif
52
53set path = (\$path \$SOPHYABASEREP/\${ostype}-\${SOPHYACXX}/Exec)
54
55echo 'SOPHYACXX= ' \$SOPHYACXX
56echo 'SOPHYABASEREP= ' \$SOPHYABASEREP
57echo 'EXTLIBDIR= ' \$EXTLIBDIR
58echo 'LD_LIBRARY_PATH= ' \$LD_LIBRARY_PATH
59echo 'PATH= ' \$path
60
61exit 0
62
63EOF
64chmod +x $dir/env.csh
65
66#############################
67#### extract des fichiers tar
68#############################
69foreach 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
77end
78
79#############################
80#### Creation du lien sur pro
81#############################
82pushd $dir > /dev/null
83ln -s -f ./$version ./pro
84popd > /dev/null
85
86exit 0
Note: See TracBrowser for help on using the repository browser.