]> Creatis software - creaToolsTools.git/blob - Linux/scripts/ThirdParty-install.sh
#2493 creaToolsTools Feature New Normal - Prepare and Install binary CreaTools...
[creaToolsTools.git] / Linux / scripts / ThirdParty-install.sh
1 # ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
4 #                        pour la Santé)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 #
7 #  This software is governed by the CeCILL-B license under French law and 
8 #  abiding by the rules of distribution of free software. You can  use, 
9 #  modify and/ or redistribute the software under the terms of the CeCILL-B 
10 #  license as circulated by CEA, CNRS and INRIA at the following URL 
11 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
12 #  or in the file LICENSE.txt.
13 #
14 #  As a counterpart to the access to the source code and  rights to copy,
15 #  modify and redistribute granted by the license, users are provided only
16 #  with a limited warranty  and the software's author,  the holder of the
17 #  economic rights,  and the successive licensors  have only  limited
18 #  liability. 
19 #
20 #  The fact that you are presently reading this means that you have had
21 #  knowledge of the CeCILL-B license and that you accept its terms.
22 # ------------------------------------------------------------------------  
23
24
25 #!/bin/bash
26
27  if [ ! -f $PWD/scripts/CreaTools-configure.sh ]
28  then 
29    echo
30    echo "..ERROR.."
31    echo "==================================================="
32    echo "REMEMBER !"
33    echo ""
34    echo "YOU NEED TO RUN 'Configure' (0) First !"
35    echo "==================================================="
36    echo
37    echo
38    exit 0
39 fi
40 echo $loginGroupName
41
42 source $PWD/scripts/CreaTools-configure.sh
43
44    echo "------"
45    echo $PWD/scripts/CreaTools-configure.sh
46    echo --generationdir--
47    echo $generationdir
48    echo --corenumber--
49    echo $corenumber
50    echo --docgeneration--
51    echo $docgeneration
52    echo --installPrefix--
53    echo $installPrefix
54    echo --installPrefixThird--
55    echo $installPrefixThird
56    echo --buildType--
57    echo $buildType
58    echo --gdcmVersion--
59    echo $gdcmVersion
60    echo "--ETC_BASHRC--"
61    echo $ETC_BASHRC  
62 #   echo --sourcesFrom--
63 #   echo $sourcesFrom
64 #   echo --scriptDir--
65 #   echo $scriptDir
66 #   echo --start_point--
67 #   echo $start_point
68    echo "------"
69
70 scriptDir=$PWD
71 sourcesDir=$generationdir/thirdparty_sources
72 binDir=$generationdir/thirdparty_bin
73
74 if [ ! -e $generationdir ]
75 then
76    mkdir -p $generationdir
77    chown -R $loginUserName  $generationdir
78    chgrp -R $loginGroupName $generationdir
79 fi
80
81 if [ ! -e $sourcesDir ]
82 then
83    mkdir -p $sourcesDir
84    #was : (pb on MacOS?)
85    #chown -R $loginUserName:$loginGroupName $sourcesDir
86    chown -R $loginUserName  $sourcesDir
87    chgrp -R $loginGroupName $sourcesDir
88 fi
89
90 if [ ! -e $binDir ]
91 then
92    mkdir -p $binDir
93    chown -R $loginUserName  $binDir
94    chgrp -R $loginGroupName $binDir
95 fi
96
97
98 # Third Party base stuff is now installed by ThirdParty-install-Base-Stuff.sh   JPR
99
100
101 # the following stupid test is used at debug time; Please don't remove!
102 #if [ true = false ]
103 if [ true = true ]
104 then
105   rm -rf $sourcesDir/tth*
106
107   cd $sourcesDir
108
109   if [ $OperatingSystem = "MacOS" ]
110   then
111     # curl -O http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/VTK-5.6.1.patchCreatis.tar.gz
112     # curl -O http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/gdcm_05_Mai_2011.tar.gz
113     # curl -O http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/InsightToolkit-3.20.0.tar.gz
114     curl -O http://www.creatis.insa-lyon.fr/software/public/creatools/crea_Developer_Tools/All_Versions/tth/tth_linux/tth
115     # MacOS, clever enough to understand it *has* to uncompress, doesn't understand tar -z :-(
116     # tar -xvf VTK-5.6.1.patchCreatis.tar.gz
117     # tar -xvf gdcm_05_Mai_2011.tar.gz
118     # tar -xvf InsightToolkit-3.20.0.tar.gz
119   else
120     # wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/VTK-5.6.1.patchCreatis.tar.gz
121     # wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/gdcm_05_Mai_2011.tar.gz
122     # wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/InsightToolkit-3.20.0.tar.gz
123     wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_Developer_Tools/All_Versions/tth/tth_linux/tth
124   
125     # tar -xvzf VTK-5.6.1.patchCreatis.tar.gz
126     #tar -xvzf gdcm_05_Mai_2011.tar.gz
127     #tar -xvzf InsightToolkit-3.20.0.tar.gz
128   fi
129
130 fi
131
132
133 if [ $buildType = "Debug" ]
134 then
135    debug="ON"
136 else
137    debug="OFF"
138 fi
139
140 #if [ true = false ]
141 if [ true = true ]
142 then
143   cd $sourcesDir
144  # pourquoi ne copie-t-on plus? JPR
145  mkdir -p $installPrefixThird/bin
146  cp tth $installPrefixThird/bin
147 fi