]> Creatis software - creaToolsTools.git/blob - Linux/scripts/ThirdParty-install.sh
redmine feature # 1708
[creaToolsTools.git] / Linux / scripts / ThirdParty-install.sh
1 #!/bin/bash
2
3  if [ ! -f $PWD/scripts/CreaTools-configure.sh ]
4  then 
5    echo
6    echo "..ERROR.."
7    echo "==================================================="
8    echo "REMEMBER !"
9    echo ""
10    echo "YOU NEED TO RUN 'Configure' (0) First !"
11    echo "==================================================="
12    echo
13    echo
14    exit 0
15 fi
16 echo $loginGroupName
17
18 source $PWD/scripts/CreaTools-configure.sh
19
20    echo "------"
21    echo $PWD/scripts/CreaTools-configure.sh
22    echo --generationdir--
23    echo $generationdir
24    echo --corenumber--
25    echo $corenumber
26    echo --docgeneration--
27    echo $docgeneration
28    echo --installPrefix--
29    echo $installPrefix
30    echo --installPrefixThird--
31    echo $installPrefixThird
32    echo --buildType--
33    echo $buildType
34    echo --gdcmVersion--
35    echo $gdcmVersion
36    echo "--ETC_BASHRC--"
37    echo $ETC_BASHRC  
38 #   echo --sourcesFrom--
39 #   echo $sourcesFrom
40 #   echo --scriptDir--
41 #   echo $scriptDir
42 #   echo --start_point--
43 #   echo $start_point
44    echo "------"
45
46 scriptDir=$PWD
47 sourcesDir=$generationdir/thirdparty_sources
48 binDir=$generationdir/thirdparty_bin
49
50 if [ ! -e $generationdir ]
51 then
52    mkdir $generationdir
53    chown $loginUserName  $generationdir
54    chgrp $loginGroupName $generationdir
55 fi
56
57 if [ ! -e $sourcesDir ]
58 then
59    mkdir $sourcesDir
60    #was : (pb on MacOS?)
61    #chown $loginUserName:$loginGroupName $sourcesDir
62    chown $loginUserName  $sourcesDir
63    chgrp $loginGroupName $sourcesDir
64 fi
65
66 if [ ! -e $binDir ]
67 then
68    mkdir $binDir
69    chown $loginUserName  $binDir
70    chgrp $loginGroupName $binDir
71 fi
72
73
74 # Third Party base stuff is now installed by ThirdParty-install-Base-Stuff.sh   JPR
75
76
77 # the following stupid test is used at debug time; Please don't remove!
78 #if [ true = false ]
79 if [ true = true ]
80 then
81   rm -rf $sourcesDir/tth*
82
83   cd $sourcesDir
84
85   if [ $OperatingSystem = "MacOS" ]
86   then
87     # curl -O http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/VTK-5.6.1.patchCreatis.tar.gz
88     # curl -O http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/gdcm_05_Mai_2011.tar.gz
89     # curl -O http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/InsightToolkit-3.20.0.tar.gz
90     curl -O http://www.creatis.insa-lyon.fr/software/public/creatools/crea_Developer_Tools/All_Versions/tth/tth_linux/tth
91     # MacOS, clever enough to understand it *has* to uncompress, doesn't understand tar -z :-(
92     # tar -xvf VTK-5.6.1.patchCreatis.tar.gz
93     # tar -xvf gdcm_05_Mai_2011.tar.gz
94     # tar -xvf InsightToolkit-3.20.0.tar.gz
95   else
96     # wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/VTK-5.6.1.patchCreatis.tar.gz
97     # wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/gdcm_05_Mai_2011.tar.gz
98     # wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/InsightToolkit-3.20.0.tar.gz
99     wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_Developer_Tools/All_Versions/tth/tth_linux/tth
100   
101     # tar -xvzf VTK-5.6.1.patchCreatis.tar.gz
102     #tar -xvzf gdcm_05_Mai_2011.tar.gz
103     #tar -xvzf InsightToolkit-3.20.0.tar.gz
104   fi
105
106 fi
107
108
109 if [ $buildType = "Debug" ]
110 then
111    debug="ON"
112 else
113    debug="OFF"
114 fi
115
116 #if [ true = false ]
117 if [ true = true ]
118 then
119   cd $sourcesDir
120  # pourquoi ne copie-t-on plus? JPR
121  mkdir -p $installPrefixThird/bin
122  cp tth $installPrefixThird/bin
123 fi