]> Creatis software - creaToolsTools.git/blob - Linux/scripts/CreaTools-load.sh
#3118 creaToolsTools Feature New Normal - branch changestoITK3and4
[creaToolsTools.git] / Linux / scripts / CreaTools-load.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 # Set all local variables
28
29  if [ -f $PWD/scripts/CreaTools-configure.sh ]
30  then 
31    source $PWD/scripts/CreaTools-configure.sh
32    source $PWD/scripts/CreaTools-names.sh
33
34    echo "------"
35    echo $PWD/scripts/CreaTools-configure.sh
36    echo --generationdir--
37    echo $generationdir
38    echo --docgeneration--
39    echo $docgeneration
40    echo --installPrefix--
41    echo $installPrefix
42    echo --buildType--
43    echo $buildType
44    echo --gdcmVersion--
45    echo $gdcmVersion
46    echo "--ETC_BASHRC--"
47    echo $ETC_BASHRC
48    echo --sourcesFrom--
49    echo $sourcesFrom
50    echo --scriptDir--
51    echo $scriptDir
52    echo --start_point--
53    echo $start_point
54    echo "------"
55
56 else
57    echo
58    echo "..ERROR.."
59    echo "==================================================="
60    echo "REMEMBER !"
61    echo ""
62    echo "YOU NEED TO RUN 'Configure' (0) First !"
63    echo "==================================================="
64    echo
65    echo
66    exit 0
67
68 fi
69
70 if [ ! -e $generationdir ]
71 then
72    mkdir -p $generationdir
73    mkdir -p $generationdir/creatools_source
74    mkdir -p $generationdir/creatools_bin
75    mkdir -p $generationdir/creatools_install   
76 fi
77
78 cd $generationdir
79
80 # --------------------------------
81 #         start_point = 0 : remove everything that was created before
82 #---------------------------------
83 if [ $start_point -le 0 ]
84 then
85 # the following stupid test is used at debug time; Please don't remove!
86 #if [ true = false ]
87 if [ true = true ]
88 then
89   rm -rf creatools_source
90   rm -rf creatools_bin
91   rm -rf creatools_install
92   mkdir -p $generationdir/creatools_source
93 fi
94 fi
95
96 # ----------------------------------
97 #         start_point =  1 : Load all sources
98 #-----------------------------------
99
100
101 if [ $start_point -le 1 ]
102 then
103    if [ true = true ]
104    #if [ true = false ]
105    then
106 #
107       if [ $sourcesFrom = GIT ] || [ $sourcesFrom = GIT-READ-ONLY ];
108       then
109                         ssh-add
110          bash $scriptDir/gitclone.sh $creasource                   $generationdir       $sourcesFrom
111          bash $scriptDir/gitclone.sh $bbtksource                   $generationdir       $sourcesFrom
112          bash $scriptDir/gitclone.sh $creavtksource                    $generationdir   $sourcesFrom 
113          bash $scriptDir/gitclone.sh $creamaracassource            $generationdir       $sourcesFrom 
114          bash $scriptDir/gitclone.sh $creaenvironmentsource        $generationdir       $sourcesFrom 
115          bash $scriptDir/gitclone.sh $creabrukersource             $generationdir       $sourcesFrom 
116          bash $scriptDir/gitclone.sh $creaimagesource              $generationdir       $sourcesFrom 
117          bash $scriptDir/gitclone.sh $creacontourssource           $generationdir       $sourcesFrom 
118          bash $scriptDir/gitclone.sh $crearigidregistrationssource $generationdir       $sourcesFrom 
119          bash $scriptDir/gitclone.sh $bbtkgeditorsource            $generationdir       $sourcesFrom 
120          bash $scriptDir/gitclone.sh $creatoolssource              $generationdir       $sourcesFrom
121          bash $scriptDir/gitclone.sh $creaminitoolssource          $generationdir       $sourcesFrom
122          bash $scriptDir/gitclone.sh $creatoolstoolssource         $generationdir       $sourcesFrom
123  #       bash $scriptDir/cvscheckout.sh $libidosource-ESRF         $generationdir   $cvsUserName
124  #             mv $libidosource-ESRF $libidosource               
125
126  cd $generationdir/creatools_source/$creasource
127                  git checkout changestoITK3and4
128  cd $generationdir/creatools_source/$bbtksource
129                  git checkout changestoITK3and4
130  cd $generationdir/creatools_source/$creabrukersource
131                  git checkout changestoITK3and4
132  cd $generationdir/creatools_source/$creaimagesource
133                  git checkout changestoITK3and4
134
135
136       fi
137
138       if [ $sourcesFrom = HTML ]
139       then
140          cd $generationdir/creatools_source
141          wwwtargz=http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/nightly/
142          wget $wwwtargz/crea.tgz
143          wget $wwwtargz/bbtk.tgz
144          wget $wwwtargz/creaVtk.tgz
145          wget $wwwtargz/creaMaracasVisu.tgz
146          wget $wwwtargz/creaEnvironment.tgz
147          wget $wwwtargz/creaBruker.tgz
148          wget $wwwtargz/creaImageIO.tgz
149          wget $wwwtargz/creaContours.tgz
150          wget $wwwtargz/creaRigidRegistration.tgz
151          wget $wwwtargz/bbtkGEditor.tgz
152          wget $wwwtargz/creaTools.tgz
153          wget $wwwtargz/creaMiniTools.tgz
154          
155  if [ $OperatingSystem = "MacOS" ]
156  then                            
157          curl $wwwtargz/crea.tgz
158          curl $wwwtargz/bbtk.tgz
159          curl $wwwtargz/creaVtk.tgz
160          curl $wwwtargz/creaMaracasVisu.tgz
161          curl $wwwtargz/creaEnvironment.tgz
162          curl $wwwtargz/creaBruker.tgz
163          curl $wwwtargz/creaImageIO.tgz
164          curl $wwwtargz/creaContours.tgz
165          curl $wwwtargz/creaRigidRegistration.tgz
166          curl $wwwtargz/bbtkGEditor.tgz
167          curl $wwwtargz/creaTools.tgz
168          curl $wwwtargz/creaMiniTools.tgz
169  else    
170          tar xvzf crea.tgz
171          tar xvzf bbtk.tgz
172          tar xvzf creaVtk.tgz
173          tar xvzf creaMaracasVisu.tgz
174          tar xvzf creaEnvironment.tgz            
175          tar xvzf creaBruker.tgz
176          tar xvzf creaImageIO.tgz
177          tar xvzf creaContours.tgz
178          tar xvzf creaRigidRegistration.tgz
179          tar xvzf bbtkGEditor.tgz
180          tar xvzf creaTools.tgz
181          tar xvzf creaMiniTools.tgz
182 fi
183          rm -f *.tgz
184       fi
185    fi
186 fi