]> Creatis software - creaToolsTools.git/blob - Install/scripts/All.sh
Allow aware user to choose the start point in All.sh
[creaToolsTools.git] / Install / scripts / All.sh
1 #!/bin/sh
2
3 if [ $# = 0 ]
4 then
5 echo "Use it as :"
6 echo "sh All.sh <nameOfTheGenerationDirectory> <BooleanForDocGeneration> <userNameForCVS> <installPrefix> <buildType>"
7 echo "with 'installPrefix' : /usr/local or <directory where you want to generate>/creatools_install"
8 echo " "
9 echo "ex : sh All.sh /tmp/gendir OFF jpr /tmp/gendir/creatools_install Debug"
10 exit 0
11 fi
12
13 echo $#
14 echo "----------"
15 echo $0
16 echo $1
17 echo $2
18 echo $3
19 echo $4
20 echo $5
21 echo "----------"
22
23 if [ $# != 5 ]
24 then 
25 echo "sh All.sh <nameOfTheGenerationDirectory> <BooleanForDocGeneration> <userNameForCVS> <installPrefix> <buildType>"
26 echo "with 'installPrefix' : /usr/local or <directory where you want to generate>/creatools_install"
27 echo " "
28 echo "ex : sh All.sh /tmp/gendir OFF jpr /tmp/gendir/creatools_install Debug"
29 exit 0
30 fi
31
32 # @echo off
33
34 #allow user to choose the generation dir
35 #allow user to choose to generate the doc or not
36
37 generationdir=$1
38 cvsUserName=$3
39 installPrefix=$4
40 buildType=$5
41
42 scriptDir=$PWD
43 echo scriptDir
44 echo $scriptDir
45
46 mkdir $generationdir
47 mkdir $generationdir/creatools_source
48 mkdir $generationdir/creatools_bin
49
50  creasource=crea
51  bbtksource=bbtk
52  creamaracassource=creaMaracasVisu
53  creaenvironmentsource=creaEnvironment
54  creabrukersource=creaBruker
55  creaimagesource=creaImageIO
56  creacontourssource=creaContours
57  crearigidregistrationssource=creaRigidRegistration
58  bbtkgeditorsource=bbtkGEditor
59  creatoolssource=creaTools
60  
61 cd $generationdir
62
63 # start_point : used at debug time : start point of the script
64 start_point=2
65
66 # --------------------------------
67 #         start_point = 0 : remove all
68 #---------------------------------
69 if [ $start_point -le 0 ]
70 then
71 # the following stupid test is used at debug time; Please don't remove!
72 #if [ true = false ]
73 if [ true = true ]
74 then
75   sudo rm -rf creatools_bin/creaBin
76   sudo rm -rf creatools_bin/bbtkBin
77   sudo rm -rf creatools_bin/creaMaracasVisuBin
78   sudo rm -rf creatools_bin/creaEnvironmentBin
79   sudo rm -rf creatools_bin/creaBrukerBin
80   sudo rm -rf creatools_bin/creaImageIOBin
81   sudo rm -rf creatools_bin/creaContoursBin
82   sudo rm -rf creatools_bin/creaRigidRegistrationBin
83   sudo rm -rf creatools_bin/bbtkGEditorBin
84   sudo rm -rf creatools_bin/creaToolsBin
85
86   sudo rm -rf creatools_install/lib/creatools
87   sudo rm -rf creatools_install/lib64/creatools
88   sudo rm -rf creatools_install/bin/bb*
89   sudo rm -rf creatools_install/bin/crea*
90   sudo rm -rf creatools_install/include/bb*
91   sudo rm -rf creatools_install/include/crea*
92   sudo rm -rf creatools_install/share/bb*
93   sudo rm -rf creatools_install/share/crea*
94
95 #this is for the old versions EED
96   sudo rm -rf creatools_install/lib/crea*
97   sudo rm -rf creatools_install/lib/libbb*
98   sudo rm -rf creatools_install/lib/libcrea*
99   sudo rm -rf creatools_install/lib64/crea*
100   sudo rm -rf creatools_install/lib64/libbb*
101   sudo rm -rf creatools_install/lib64/libcrea*
102 fi
103 fi
104
105 # ----------------------------------
106 #         start_point =  1 : checkout all
107 #-----------------------------------
108 if [ $start_point -le 1 ]
109 then
110 #if [ true = false ]
111 if [ true = true ]
112 then
113   sh $scriptDir/cvscheckout.sh $creasource                   $generationdir $cvsUserName
114   sh $scriptDir/cvscheckout.sh $bbtksource                   $generationdir $cvsUserName
115   sh $scriptDir/cvscheckout.sh $creamaracassource            $generationdir $cvsUserName
116   sh $scriptDir/cvscheckout.sh $creaenvironmentsource        $generationdir $cvsUserName
117   sh $scriptDir/cvscheckout.sh $creabrukersource             $generationdir $cvsUserName
118   sh $scriptDir/cvscheckout.sh $creaimagesource              $generationdir $cvsUserName
119   sh $scriptDir/cvscheckout.sh $creacontourssource           $generationdir $cvsUserName
120   sh $scriptDir/cvscheckout.sh $crearigidregistrationssource $generationdir $cvsUserName
121   sh $scriptDir/cvscheckout.sh $bbtkgeditorsource            $generationdir $cvsUserName
122   sh $scriptDir/cvscheckout.sh $creatoolssource              $generationdir $cvsUserName
123 fi
124 fi
125
126 cd $scriptDir
127
128
129 # -------------------------
130 #        start_point =  2 : CREA
131 #-------------------------
132 if [ $start_point -le 2 ]
133 then
134 # CREA
135 # the following stupid test is used at debug time; Please don't remove!
136 #if [ true = false ]
137 if [ true = true ]
138 then
139  sh cmakemod.sh         $creasource $generationdir $installPrefix $buildType 
140  sh creaVariables.sh    $creasource $generationdir $docgeneration
141  sh compilemod.sh       $buildType   $creasource $generationdir  
142  sh ctestmod.sh         $creasource $generationdir
143 fi
144 fi
145  creadll=$generationdir/creatools_bin/creaBin
146  LD_LIBRARY_PATH=$creadll:LD_LIBRARY_$PATH
147  
148
149
150 # -------------------------
151 #        start_point =  3 : BBTK
152 #-------------------------
153 if [ $start_point -le 3 ]
154 then
155 # the following stupid test is used at debug time; Please don't remove!
156 #if [ true = false ]
157 if [ true = true ]
158 then
159 # BBTK
160  sh cmakemod.sh         $bbtksource $generationdir $installPrefix $buildType 
161  sh bbtkVariables.sh    $bbtksource $generationdir $docgeneration
162  sh compilemod.sh       $buildType $bbtksource $generationdir 
163  sh ctestmod.sh         $bbtksource $generationdir
164 fi
165 fi
166  bbtkdll=$generationdir/creatools_bin/bbtkBin
167  LD_LIBRARY_PATH=$bbtkdll:$LD_LIBRARY_PATH
168
169
170 # -------------------------
171 #        start_point =  4 : creaMaracasVisu
172 #-------------------------
173 if [ $start_point -le 4 ]
174 then
175 # the following stupid test is used at debug time; Please don't remove!
176 #if [ true = false ]
177 if [ true = true ]
178 then
179 # creaMaracasVisu
180  sh cmakemod.sh                 $creamaracassource $generationdir $installPrefix $buildType 
181  sh creaMaracasVariables.sh     $creamaracassource $generationdir $docgeneration
182  sh compilemod.sh               $buildType $creamaracassource $generationdir 
183  sh ctestmod.sh                 $creamaracassource $generationdir
184 fi
185 fi
186  creamaracasdll=$generationdir/creatools_bin/creamaracasBin
187  LD_LIBRARY_PATH=$creamaracasdll:$LD_LIBRARY_PATH
188
189
190 # -------------------------
191 #        start_point =  5 : creaEnvironment
192 #-------------------------
193 if [ $start_point -le 5 ]
194 then
195 # the following stupid test is used at debug time; Please don't remove!
196 #if [ true = false ]
197 if [ true = true ]
198 then
199 # creaEnvironment
200  sh cmakemod.sh                 $creaenvironmentsource $generationdir $installPrefix $buildType 
201  sh creaenvironmentVariables.sh $creaenvironmentsource $generationdir $docgeneration
202  sh compilemod.sh $buildType    $creaenvironmentsource $generationdir
203  sh ctestmod.sh                 $creaenvironmentsource $generationdir
204 fi
205 fi
206  creaenvironmentdll=$generationdir/creatools_bin/creaenvironmentBin
207  LD_LIBRARY_PATH=$creaenvironmentdll:$LD_LIBRARY_PATH
208
209
210 # -------------------------
211 #        start_point =  6 : creaBruker
212 #-------------------------
213 if [ $start_point -le 6 ]
214 then
215 # the following stupid test is used at debug time; Please don't remove!
216 #if [ true = false ]
217 if [ true = true ]
218 then
219 # creaBruker
220  sh cmakemod.sh                 $creabrukersource $generationdir $installPrefix $buildType 
221  sh creaBrukerVariables.sh      $creabrukersource $generationdir $docgeneration
222  sh compilemod.sh $buildType    $creabrukersource  $generationdir
223  echo generationdir 
224  sh ctestmod.sh                 $creabrukersource $generationdir
225 fi
226 fi
227  creabrukerdll=$generationdir/creatools_bin/creabrukerBin
228  LD_LIBRARY_PATH=$creabrukerdll:$LD_LIBRARY_PATH
229
230
231 # -------------------------
232 #        start_point =  7 : creaImageIO
233 #-------------------------
234 if [ $start_point -le 7 ]
235 then
236  # the following stupid test is used at debug time; Please don't remove!
237 #if [ true = false ]
238 if [ true = true ]
239 then
240 # creaImageIO
241  sh cmakemod.sh                 $creaimagesource $generationdir $installPrefix $buildType 
242  sh creaImageIOVariables.sh     $creaimagesource $generationdir $docgeneration
243  sh compilemod.sh               $buildType $creaimagesource $generationdir
244  sh ctestmod.sh                 $creaimagesource $generationdir
245 fi
246 fi
247  creaimagedll=$generationdir/creatools_bin/creaimageBin
248  LD_LIBRARY_PATH=$creaimagedll:$LD_LIBRARY_PATH
249
250
251 # -------------------------
252 #        start_point =  8 : creaContour
253 #-------------------------
254 if [ $start_point -le 8 ]
255 then
256 # the following stupid test is used at debug time; Please don't remove!
257 #if [ true = false ]
258 if [ true = true ]
259 then
260 # creaContours
261  sh cmakemod.sh                 $creacontourssource $generationdir $installPrefix $buildType 
262  sh creaContoursVariables.sh    $creacontourssource $generationdir $docgeneration
263  sh compilemod.sh               $buildType $creacontourssource $generationdir
264  sh ctestmod.sh                 $creacontourssource $generationdir
265 fi
266 fi
267 # creacontourdll=$generationdir/creatools_bin/creacontoursBin
268 # LD_LIBRARY_PATH=$creacontoursdll:$LD_LIBRARY_PATH
269
270
271 # -------------------------
272 #        start_point =  9 : creaRigidRegistration
273 #-------------------------
274 if [ $start_point -le 9 ]
275 then
276 # the following stupid test is used at debug time; Please don't remove!
277 #if [ true = false ]
278 if [ true = true ]
279 then
280  sh cmakemod.sh                         $crearigidregistrationssource $generationdir $installPrefix $buildType 
281  sh creaRigidRegistrationVariables.sh   $crearigidregistrationssource $generationdir $docgeneration
282  sh compilemod.sh                       $buildType $crearigidregistrationssource $generationdir
283  sh ctestmod.sh                         $crearigidregistrationssource $generationdir
284 fi
285 fi
286 # crearigidregistrationdll=$generationdir/creatools_bin/crearigidregistrationBin
287 # LD_LIBRARY_PATH=$crearigidregistrationdll:$LD_LIBRARY_PATH
288
289
290 # -------------------------
291 #        start_point =  10 : bbtkGEditor
292 #-------------------------
293 if [ $start_point -le 10 ]
294 then
295 # the following stupid test is used at debug time; Please don't remove!
296 #if [ true = false ]
297 if [ true = true ]
298 then
299 # bbtkGEditor
300  sh cmakemod.sh                 $bbtkgeditorsource $generationdir $installPrefix $buildType 
301  sh bbtkGEditorVariables.sh     $bbtkgeditorsource $generationdir $docgeneration
302  sh compilemod.sh               $buildType $bbtkgeditorsource $generationdir
303  sh ctestmod.sh                 $bbtkgeditorsource $generationdir
304 fi
305 fi
306 # bbtkgeditordll=$generationdir/creatools_bin/bbtkgeditorBin
307 # LD_LIBRARY_PATH=$bbtkgeditordll:$LD_LIBRARY_PATH
308
309
310 # -------------------------
311 #        start_point =  11 : creaTools
312 #-------------------------
313 if [ $start_point -le 11 ]
314 then
315 # the following stupid test is used at debug time; Please don't remove!
316 #if [ true = false ]
317 if [ true = true ]
318 then
319 # creaTools
320  sh cmakemod.sh                    $creatoolssource $generationdir $installPrefix $buildType 
321  sh creaToolsVariables.sh          $creatoolssource $generationdir $docgeneration
322  sh compilemod.sh                  $buildType $creatoolssource $generationdir
323 fi
324 fi
325
326
327 # sh ctestmod.sh $creatoolsbinary $generationdir
328 #  creatoolsdll=$generationdir/creatools_bin/creatoolsBin
329 #  LD_LIBRARY_PATH=$creatoolssdll:$LD_LIBRARY_PATH
330
331
332 CREATOOLS_INSTALL_DIR=$installPrefix
333 sudo rm        $CREATOOLS_INSTALL_DIR/share/creatools_base_library_config.sh
334 sudo touch     $CREATOOLS_INSTALL_DIR/share/creatools_base_library_config.sh
335 sudo chmod 666 $CREATOOLS_INSTALL_DIR/share/creatools_base_library_config.sh
336
337 #######################################
338
339 sudo touch     $installPrefix/share/creatools_base_library_config.sh
340 sudo chmod 666 $installPrefix/share/creatools_base_library_config.sh
341
342
343 sudo echo export PATH='$'PATH:$installPrefix/bin                                  >> $installPrefix/share/creatools_base_library_config.sh
344 sudo echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib/creatools >> $installPrefix/share/creatools_base_library_config.sh
345 sudo echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib64/creatools >> $installPrefix/share/creatools_base_library_config.sh
346
347 #  modify .bashrc
348 # - remove line 'sh $installPrefix/creatools_install/share/creatools_base_party_libraries_config.sh' if any (with accurate value for ???)
349 sed -i -e '/.*creatools_base_library_config.*/ d' ~/.bashrc
350
351 # - add line 'sh $installPrefix/creatools_install/share/creatools_base_libraries_config.sh' (with accurate value for ???)
352 echo source $installPrefix/share/creatools_base_library_config.sh >> ~/.bashrc 
353
354
355 # shutdown /s
356 # exit /b