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