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 " install all base stuff :.. ....1.0"
25 echo " (cmake, doxygen, graphviz, ...)"
26 echo " Get and Compile vtk :.. .......1.1"
27 echo " Get and Compile gdcm :.. ......1.2"
28 echo " Get and Compile itk :.. .......1.3"
31 echo " Install Third Party Libraries :....1 (as root)"
34 if [ $expanded = "YES" ]
36 echo " Get the 'CreaTools' source files :.2.1 (CVS : as user!)"
37 echo " Compile the CreaTools :..........2.2"
38 # Install creatools as user (no longer as root) // JPR 2/5/2011
39 echo " Install the CreaTools :..........2.3"
41 echo " Get and Install the 'CreaTools':...2"
44 if [ $expanded = "NO" ]
46 echo " Use Expanded menu :................5 "
48 echo " Use compact menu :.................5 "
50 echo " Uninstall the CreaTools :..........6 "
51 echo " Help ..............................7 Help about this menu"
52 echo " Show some Environment Variables ...8"
53 echo " Exit :.............................9"
58 echo "Type in your choice :"
65 #ls -l scripts/CreaTools-configure.sh
66 if [ -f scripts/CreaTools-configure.sh ]
68 while [[ "$suitable" != "YES" && \
69 "$suitable" != "yes" && \
70 "$suitable" != "Y" && \
71 "$suitable" != "y" && \
72 "$suitable" != "NO" && \
73 "$suitable" != "no" ]]
75 echo "'Configure' already done : "
76 echo "------------------------"
77 more scripts/CreaTools-configure.sh
78 echo "------------------------"
80 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
81 # if user configured without installing third party library,
82 # Last third party library is still in use! JPR
85 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
89 # Install creatools as user (no longer as root) // JPR 2/5/2011
90 #if [ ! -f /etc/bashrc ]
92 # export ETC_BASHRC="/etc/bash.bashrc"
94 # export ETC_BASHRC="/etc/bashrc"
96 export ETC_BASHRC=$HOME/.bashrc
97 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
99 grep "installPrefixThird=" $ETC_BASHRC
100 echo "VTK_DIR : " $VTK_DIR
101 echo "ITK_DIR : " $ITK_DIR
102 echo "GDCM_DIR : " $GDCM_DIR
103 echo "(Have a look at $ETC_BASHRC=, edit it or run again Install Third Party Libraries if you disagree)"
106 echo "Are these values suitable for you : YES/NO? (default is YES)"
108 if [ "$suitable" = "" ]
117 if [[ "$suitable" = "YES" || "$suitable" = "Y" || "$suitable" = "yes" || "$suitable" = "y" ]]
119 source scripts/CreaTools-configure.sh
122 if [[ "$suitable" = "NO" || "$suitable" = "N" || "$suitable" = "no" || "$suitable" = "n" ]]
123 #if [ "$suitable" = "NO" ]
128 while [ "$confirm" != "YES" ]
130 # ///\TODO what about SuSE? Debian? Mandriva? Gentoo?
131 OperatingSystem="XXX"
132 while [[ "$OperatingSystem" != "Fedora" && \
133 "$OperatingSystem" != "Ubuntu" && \
134 "$OperatingSystem" != "MacOS" ]]
136 echo "Operating System : Fedora/Ubuntu/MacOS (default : Fedora)"
138 if [ "$OperatingSystem" = "" ]
140 OperatingSystem="Fedora"
143 echo "you said : [" $OperatingSystem "]"
148 echo "How many cores on your computer 2 (default is 2)"
150 if [ "$corenumber" = "" ]
154 echo "you said : [" $corenumber "]"
160 echo "Name of the Generation Directory (default is ~/myDefaultGenerationDir)"
162 if [ "$generationdir" = "" ]
164 generationdir="~/myDefaultGenerationDir"
166 echo "you said : [" $generationdir "]"
171 installPrefixThird="___"
172 echo "Install Prefix For Third Party Library : '$generationdir/thirdparty_install' / '/usr/local' (default is '$generationdir/thirdparty_install')"
173 read installPrefixThird
174 if [ "$installPrefixThird" = "" ]
176 installPrefixThird="$generationdir/thirdparty_install"
178 echo "you said : [" $installPrefixThird "]"
184 echo "Install Prefix for CreaTools : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
186 if [ "$installPrefix" = "" ]
188 installPrefix="$generationdir/creatools_install"
190 echo "you said : [" $installPrefix "]"
198 while [[ "$docgeneration" != "ON" && "$docgeneration" != "OFF" ]]
200 echo "Boolean For Doc Generation : ON/OFF (default is OFF)"
202 if [ "$docgeneration" = "" ]
206 echo "you said : [" $docgeneration "]"
217 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
219 echo "Where do you want to get source files from : CVS/HTML ( CVS : for registered CREATIS users only! )"
221 if [ "$sourcesFrom" = "" ]
225 echo "you said : [" $sourcesFrom "]"
232 if [ "$sourcesFrom" = "CVS" ]
234 while [ "$cvsUserName" == "" ]
236 echo "CVS User Name ( registered CREATIS user : mandatory!)"
239 echo "you said : [" $cvsUserName "]"
241 cvsUserName="ForgetThisOne"
249 while [ "$loginUserName" == "" ]
251 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
253 echo "Login User Name (mandatory!)"
255 echo "you said : [" $loginUserName "]"
261 while [ "$loginGroupName" == "" ]
263 #echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
264 #echo "Login Group Name (mandatory!)"
265 echo "Login Group Name (mandatory!)"
267 echo "you said : [" $loginGroupName "]"
274 while [[ "$buildType" != "Release" && "$buildType" != "Debug" ]]
276 echo "Build type : Release/Debug (default is Release)"
278 if [ "$buildType" = "" ]
282 echo "you said : [" $buildType "]"
289 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
291 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
293 if [ "$gdcmVersion" = "" ]
297 echo "you said : [" $gdcmVersion "]"
304 echo " Operating System : $OperatingSystem"
305 echo " Number of Cores : $corenumber"
306 echo " Name of the Generation Directory : $generationdir"
307 echo " Install Prefix for Third Party Libraries : $installPrefixThird"
308 echo " Install Prefix for CreaTools : $installPrefix"
309 echo " Boolean for Doc Generation : $docgeneration"
310 echo " Where do you want to get source files from : $sourcesFrom"
311 if [ $sourcesFrom = CVS ]
313 echo " CVS User Name : $cvsUserName"
315 echo " Login User Name : $loginUserName"
316 echo " Login Group Name : $loginGroupName"
317 echo " Build type : $buildType"
318 echo " Gdcm version : $gdcmVersion"
322 echo "Do you confirm your choices : YES/NO ? (default is YES)"
324 if [ "$confirm" = "" ]
330 # GROS SOUCIS : Ou generer le fichier CreaTools-configure.sh?
331 # dans $generationdir/creatools_bin ?
332 # -> il n'est pas encore cree !
333 # dans ./Linux/scripts?
334 # ==> On le genere chez l'utilisateur (no choice!)...
337 configureFile="scripts/CreaTools-configure.sh"
339 echo "#!/bin/bash" > $configureFile
340 echo >> $configureFile
341 echo "#File generated by 'menu.sh'" >> $configureFile
342 echo "#DO NOT edit !" >> $configureFile
343 echo "#(except if you *do* know what you do)" >> $configureFile
344 echo >> $configureFile
345 echo "OperatingSystem=$OperatingSystem" >> $configureFile
346 echo "corenumber=$corenumber" >> $configureFile
347 echo "generationdir=$generationdir" >> $configureFile
348 echo "installPrefix=$installPrefix" >> $configureFile
349 echo "installPrefixThird=$installPrefixThird" >> $configureFile
350 echo "docgeneration=$docgeneration" >> $configureFile
351 echo "sourcesFrom=$sourcesFrom" >> $configureFile
352 echo "cvsUserName=$cvsUserName" >> $configureFile
353 echo "loginUserName=$loginUserName" >> $configureFile
354 echo "loginGroupName=$loginGroupName" >> $configureFile
355 echo "buildType=$buildType" >> $configureFile
356 echo "gdcmVersion=$gdcmVersion" >> $configureFile
364 echo "========================== 1 "
365 source scripts/Check-if-root.sh
366 bash scripts/ThirdParty-install-Base-Stuff.sh
367 bash scripts/ThirdParty-install-VTK.sh
368 bash scripts/ThirdParty-install-gdcm.sh
369 bash scripts/ThirdParty-install-ITK.sh
370 bash scripts/ThirdParty-install.sh
371 bash scripts/ThirdParty-install-Finalize.sh
373 if [ "$sourcesFrom" = "CVS" ]
375 echo "----------------------------------------------------------------------"
377 echo "To go on, run again 'bash menu.sh' as '$loginUserName', in a new window"
378 echo "---------------------------------------------------------------------"
380 echo "----------------------------------------------------------------------"
382 echo "To go on, run again 'bash menu.sh' in a new window"
383 echo "---------------------------------------------------------------------"
386 echo "==> You HAVE to leave current window to continue!"
392 echo "========================== 1.0 "
393 source scripts/Check-if-root.sh
394 bash scripts/ThirdParty-install-Base-Stuff.sh
395 bash scripts/ThirdParty-install-Finalize.sh
399 echo "========================== 1.1 "
400 source scripts/Check-if-root.sh
402 bash scripts/ThirdParty-install-VTK.sh
404 bash scripts/ThirdParty-install-Finalize.sh
409 echo "========================== 1.2 "
410 source scripts/Check-if-root.sh
411 bash scripts/ThirdParty-install-gdcm.sh
412 bash scripts/ThirdParty-install-Finalize.sh
416 echo "========================== 1.3 "
417 source scripts/Check-if-root.sh
418 bash scripts/ThirdParty-install-ITK.sh
419 bash scripts/ThirdParty-install-Finalize.sh
426 bash scripts/CreaTools-load.sh
428 source scripts/CreaTools-configure.sh
429 bash scripts/CreaTools-compile.sh
431 bash scripts/CreaTools-install.sh
432 echo "You HAVE to leave current window to continue!"
438 echo "========================== 2.1"
439 bash scripts/CreaTools-load.sh
443 echo "========================== 2.2"
444 source scripts/CreaTools-configure.sh
446 bash scripts/CreaTools-compile.sh
448 # To allow (*very* aware) user to patch code, later
449 if [ ! -e $generationdir/creatools_source ]
451 echo "You probabely made a mistake : "
452 echo "Directory $loginUserName $generationdir/creatools_source not found"
453 echo "Make sure you know the mistake"
454 echo "Hit any key to continue"
455 echo "Fix the mistake!"
458 chown -R $loginUserName $generationdir/creatools_source
459 chgrp -R $loginGroupName $generationdir/creatools_source
460 # Too much time consuming
461 #chown -R $loginUserName $generationdir/creatools_source
462 #chgrp -R $loginGroupName $generationdir/creatools_source
472 # echo "==================================================="
475 # echo "YOU NEED TO RUN THIS ONE AS root"
476 # echo "==================================================="
482 echo "========================= 4"
484 bash scripts/CreaTools-install.sh
488 # echo "You HAVE to leave current window to continue!"
490 # echo "==> Hit any key to close current window"
496 if [ $expanded = "NO" ]
505 echo "========================= 5"
506 bash scripts/CreaTools-uninstall.sh
508 echo "==> Hit any key to go on"
514 echo "==================================="
517 echo "==> Hit any key to go on"
523 echo "==================================="
525 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
526 # if user configured without installing third party library,
527 # Last third party library is still in use! JPR
530 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
534 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
535 grep "installPrefixThird=" /etc/bashrc
536 echo "VTK_DIR : " $VTK_DIR
537 echo "ITK_DIR : " $ITK_DIR
538 echo "GDCM_DIR : " $GDCM_DIR
540 echo "installPrefixThird ... " $installPrefixThird
543 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
545 echo "Third party config file : " $installPrefixThird/share/creatools_third_party_library_config.sh
547 more $installPrefixThird/share/creatools_third_party_library_config.sh
553 if [ -f $installPrefix/share/creatools_base_library_config.sh ]
555 echo "Creatools base library config file : " $installPrefix/share/creatools_base_library_config.sh
557 more $installPrefix/share/creatools_base_library_config.sh
560 echo "installPrefix ... " $installPrefix
563 echo "VTK_DIR : " $VTK_DIR
564 echo "ITK_DIR : " $ITK_DIR
565 echo "GDCM_DIR : " $GDCM_DIR
567 echo "crea_DIR : " $crea_DIR
568 echo "BBTK_DIR : " $BBTK_DIR
569 echo "creaMaracasVisu_DIR : " $creaMaracasVisu_DIR
570 echo "creaEnvironment_DIR : " $creaEnvironment_DIR
571 echo "creaBruker_DIR : " $creaBruker_DIR
572 echo "creaImageIO_DIR : " $creaImageIO_DIR
573 echo "creaContours_DIR : " $creaContours_DIR
574 echo "creaRigidRegistration_DIR :" $creaRigidRegistration_DIR
575 echo "bbtkGEditor_DIR : " $bbtkGEditor_DIR
576 echo "creaTools_DIR : " $creaTools_DIR
577 echo "creaMiniTools_DIR : " $creaMiniTools_DIR
578 echo "Ido_DIR : " $Ido_DIR
579 echo "==================================="
581 echo "Press any key to continue"
591 # Hiden option, usefull at debug time
592 bash scripts/ThirdParty-install_no_compile.sh
599 echo "Your answer must be in {0, 1, 2, 5, 6, 7, 8, 9} (was [ $i ])"
601 echo "Your answer must be in {0, 1, 2.1, 2.2, 2.3, 5, 6, 7, 8, 9} (was [ $i ])"