3 if [ -f scripts/CreaTools-configure.sh ]
5 source scripts/CreaTools-configure.sh
18 echo " Choose what you want to do :"
20 echo " Configure :........................0"
22 if [ $expanded = "YES" ]
24 echo " Get and Compile gdcm :.. ......1.1"
25 echo " Get and Compile itk :.. .......1.2"
26 echo " Get and Compile vtk :.. .......1.3"
28 echo " Install Third Party Libraries :....1 (as root)"
31 if [ $expanded = "YES" ]
33 echo " Get the 'CreaTools' source files :.2.1 (CVS : as user!)"
34 echo " Compile the CreaTools :..........2.2"
35 # Install creatools as user (no longer as root) // JPR 2/5/2011
36 echo " Install the CreaTools :..........2.3"
38 echo " Get and Install the 'CreaTools':...2"
41 if [ $expanded = "NO" ]
43 echo " Use Expanded menu :................5 "
45 echo " Use compact menu :.................5 "
47 echo " Uninstall the CreaTools :..........6 "
48 echo " Help ..............................7 Help about this menu"
49 echo " Show some Environment Variables ...8"
50 echo " Exit :.............................9"
55 echo "Type in your choice :"
62 #ls -l scripts/CreaTools-configure.sh
63 if [ -f scripts/CreaTools-configure.sh ]
65 while [[ "$suitable" != "YES" && \
66 "$suitable" != "yes" && \
67 "$suitable" != "Y" && \
68 "$suitable" != "y" && \
69 "$suitable" != "NO" && \
70 "$suitable" != "no" ]]
72 echo "'Configure' already done : "
73 echo "------------------------"
74 more scripts/CreaTools-configure.sh
75 echo "------------------------"
77 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
78 # if user configured without installing third party library,
79 # Last third party library is still in use! JPR
82 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
86 # Install creatools as user (no longer as root) // JPR 2/5/2011
87 #if [ ! -f /etc/bashrc ]
89 # export ETC_BASHRC="/etc/bash.bashrc"
91 # export ETC_BASHRC="/etc/bashrc"
93 export ETC_BASHRC=$HOME/.bashrc
94 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
96 grep "installPrefixThird=" $ETC_BASHRC
97 echo "VTK_DIR : " $VTK_DIR
98 echo "ITK_DIR : " $ITK_DIR
99 echo "GDCM_DIR : " $GDCM_DIR
100 echo "(Have a look at $ETC_BASHRC=, edit it or run again Install Third Party Libraries if you disagree)"
103 echo "Are these values suitable for you : YES/NO? (default is YES)"
105 if [ "$suitable" = "" ]
114 if [[ "$suitable" = "YES" || "$suitable" = "Y" || "$suitable" = "yes" || "$suitable" = "y" ]]
116 source scripts/CreaTools-configure.sh
119 if [[ "$suitable" = "NO" || "$suitable" = "N" || "$suitable" = "no" || "$suitable" = "n" ]]
120 #if [ "$suitable" = "NO" ]
125 while [ "$confirm" != "YES" ]
128 OperatingSystem="XXX"
129 while [[ "$OperatingSystem" != "Fedora" && \
130 "$OperatingSystem" != "Ubuntu" && \
131 "$OperatingSystem" != "MacOS" ]]
133 echo "Operating System : Fedora/Ubuntu/MacOS (default : Fedora)"
135 if [ "$OperatingSystem" = "" ]
137 OperatingSystem="Fedora"
140 echo "you said : [" $OperatingSystem "]"
145 echo "Name of the Generation Directory (default is /tmp/myGenerationDir)"
147 if [ "$generationdir" = "" ]
149 generationdir="/tmp/myGenerationDir"
151 echo "you said : [" $generationdir "]"
156 installPrefixThird="___"
157 echo "Install Prefix For Third Party Library : '$generationdir/thirdparty_install' / '/usr/local' (default is '$generationdir/thirdparty_install')"
158 read installPrefixThird
159 if [ "$installPrefixThird" = "" ]
161 installPrefixThird="$generationdir/thirdparty_install"
163 echo "you said : [" $installPrefixThird "]"
169 echo "Install Prefix for CreaTools : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
171 if [ "$installPrefix" = "" ]
173 installPrefix="$generationdir/creatools_install"
175 echo "you said : [" $installPrefix "]"
181 while [[ "$docgeneration" != "ON" && "$docgeneration" != "OFF" ]]
183 echo "Boolean For Doc Generation : ON/OFF (default is OFF)"
185 if [ "$docgeneration" = "" ]
189 echo "you said : [" $docgeneration "]"
196 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
198 echo "Where do you want to get source files from : CVS/HTML (default is CVS)"
200 if [ "$sourcesFrom" = "" ]
204 echo "you said : [" $sourcesFrom "]"
211 if [ "$sourcesFrom" = "CVS" ]
213 while [ "$cvsUserName" == "" ]
215 echo "CVS User Name (mandatory!)"
218 echo "you said : [" $cvsUserName "]"
220 cvsUserName="ForgetThisOne"
228 while [ "$loginUserName" == "" ]
230 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
232 echo "Login User Name (mandatory!)"
234 echo "you said : [" $loginUserName "]"
240 while [ "$loginGroupName" == "" ]
242 #echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
243 #echo "Login Group Name (mandatory!)"
244 echo "Login Group Name (mandatory!)"
246 echo "you said : [" $loginGroupName "]"
253 while [[ "$buildType" != "Release" && "$buildType" != "Debug" ]]
255 echo "Build type : Release/Debug (default is Release)"
257 if [ "$buildType" = "" ]
261 echo "you said : [" $buildType "]"
268 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
270 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
272 if [ "$gdcmVersion" = "" ]
276 echo "you said : [" $gdcmVersion "]"
283 echo " Operating System : $OperatingSystem"
284 echo " Name of the Generation Directory : $generationdir"
285 echo " Install Prefix for Third Party Libraries : $installPrefixThird"
286 echo " Install Prefix for CreaTools : $installPrefix"
287 echo " Boolean for Doc Generation : $docgeneration"
288 echo " Where do you want to get source files from : $sourcesFrom"
289 if [ $sourcesFrom = CVS ]
291 echo " CVS User Name : $cvsUserName"
293 echo " Login User Name : $loginUserName"
294 echo " Login Group Name : $loginGroupName"
295 echo " Build type : $buildType"
296 echo " Gdcm version : $gdcmVersion"
300 echo "Do you confirm your choices : YES/NO ? (default is YES)"
302 if [ "$confirm" = "" ]
308 # GROS SOUCIS : Ou generer le fichier CreaTools-configure.sh?
309 # dans $generationdir/creatools_bin ?
310 # -> il n'est pas encore cree !
311 # dans ./Linux/scripts?
312 # ==> On le genere chez l'utilisateur (no choice!)...
315 configureFile="scripts/CreaTools-configure.sh"
317 echo "#!/bin/bash" > $configureFile
318 echo >> $configureFile
319 echo "#File generated by 'menu.sh'" >> $configureFile
320 echo "#DO NOT edit !" >> $configureFile
321 echo "#(except if you *do* know what you do)" >> $configureFile
322 echo >> $configureFile
323 echo "OperatingSystem=$OperatingSystem" >> $configureFile
324 echo "generationdir=$generationdir" >> $configureFile
325 echo "installPrefix=$installPrefix" >> $configureFile
326 echo "installPrefixThird=$installPrefixThird" >> $configureFile
327 echo "docgeneration=$docgeneration" >> $configureFile
328 echo "sourcesFrom=$sourcesFrom" >> $configureFile
329 echo "cvsUserName=$cvsUserName" >> $configureFile
330 echo "loginUserName=$loginUserName" >> $configureFile
331 echo "loginGroupName=$loginGroupName" >> $configureFile
332 echo "buildType=$buildType" >> $configureFile
333 echo "gdcmVersion=$gdcmVersion" >> $configureFile
341 echo "========================== 1 "
342 source scripts/Check-if-root.sh
343 bash scripts/ThirdParty-install.sh
345 if [ "$sourcesFrom" = "CVS" ]
347 echo "----------------------------------------------------------------------"
349 echo "To go on, run again 'bash menu.sh' as '$loginUserName', in a new window"
350 echo "---------------------------------------------------------------------"
352 echo "----------------------------------------------------------------------"
354 echo "To go on, run again 'bash menu.sh' in a new window"
355 echo "---------------------------------------------------------------------"
358 echo "==> You HAVE to leave current window to continue!"
364 echo "========================== 1.1 "
365 source scripts/Check-if-root.sh
366 bash scripts/ThirdParty-install-gdcm.sh
370 echo "========================== 1.2 "
371 echo "sorry, not yet available"
376 echo "========================== 1.3 "
377 echo "sorry, not yet available"
384 bash scripts/CreaTools-load.sh
386 source scripts/CreaTools-configure.sh
387 bash scripts/CreaTools-compile.sh
389 bash scripts/CreaTools-install.sh
390 echo "You HAVE to leave current window to continue!"
396 echo "========================== 2.1"
397 bash scripts/CreaTools-load.sh
401 echo "========================== 2.2"
402 source scripts/CreaTools-configure.sh
404 bash scripts/CreaTools-compile.sh
406 # To allow (*very* aware) user to patch code, later
407 if [ ! -e $generationdir/creatools_source ]
409 echo "You probabely made a mistake : "
410 echo "Directory $loginUserName $generationdir/creatools_source not found"
411 echo "Make sure you know the mistake"
412 echo "Hit any key to continue"
413 echo "Fix the mistake!"
416 chown -R $loginUserName $generationdir/creatools_source
417 chgrp -R $loginGroupName $generationdir/creatools_source
418 # Too much time consuming
419 #chown -R $loginUserName $generationdir/creatools_source
420 #chgrp -R $loginGroupName $generationdir/creatools_source
430 # echo "==================================================="
433 # echo "YOU NEED TO RUN THIS ONE AS root"
434 # echo "==================================================="
440 echo "========================= 4"
442 bash scripts/CreaTools-install.sh
446 # echo "You HAVE to leave current window to continue!"
448 # echo "==> Hit any key to close current window"
454 if [ $expanded = "NO" ]
463 echo "========================= 5"
464 bash scripts/CreaTools-uninstall.sh
466 echo "==> Hit any key to go on"
472 echo "==================================="
475 echo "==> Hit any key to go on"
481 echo "==================================="
483 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
484 # if user configured without installing third party library,
485 # Last third party library is still in use! JPR
488 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
492 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
493 grep "installPrefixThird=" /etc/bashrc
494 echo "VTK_DIR : " $VTK_DIR
495 echo "ITK_DIR : " $ITK_DIR
496 echo "GDCM_DIR : " $GDCM_DIR
498 echo "installPrefixThird ... " $installPrefixThird
501 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
503 echo $installPrefixThird/share/creatools_third_party_library_config.sh
505 more $installPrefixThird/share/creatools_third_party_library_config.sh
511 if [ -f $installPrefix/share/creatools_base_library_config.sh ]
513 echo $installPrefix/share/creatools_base_library_config.sh
515 more $installPrefix/share/creatools_base_library_config.sh
518 echo "installPrefix ... " $installPrefix
521 echo "VTK_DIR : " $VTK_DIR
522 echo "ITK_DIR : " $ITK_DIR
523 echo "GDCM_DIR : " $GDCM_DIR
524 echo "crea_DIR : " $crea_DIR
525 echo "BBTK_DIR : " $BBTK_DIR
526 echo "creaMaracasVisu_DIR : " $creaMaracasVisu_DIR
527 echo "creaEnvironment_DIR : " $creaEnvironment_DIR
528 echo "creaBruker_DIR : " $creaBruker_DIR
529 echo "creaImageIO_DIR : " $creaImageIO_DIR
530 echo "creaContours_DIR : " $creaContours_DIR
531 echo "creaRigidRegistration_DIR :" $creaRigidRegistration_DIR
532 echo "bbtkGEditor_DIR : " $bbtkGEditor_DIR
533 echo "creaTools_DIR : " $creaTools_DIR
534 echo "creaMiniTools_DIR : " $creaMiniTools_DIR
535 echo "==================================="
537 echo "Press any key to continue"
547 # Hiden option, usefull at debug time
548 bash scripts/ThirdParty-install_no_compile.sh
555 echo "Your answer must be in {0, 1, 2, 5, 6, 7, 8, 9} (was [ $i ])"
557 echo "Your answer must be in {0, 1, 2.1, 2.2, 2.3, 5, 6, 7, 8, 9} (was [ $i ])"