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
401 bash scripts/ThirdParty-install-VTK.sh
402 bash scripts/ThirdParty-install-Finalize.sh
407 echo "========================== 1.2 "
408 source scripts/Check-if-root.sh
409 bash scripts/ThirdParty-install-gdcm.sh
410 bash scripts/ThirdParty-install-Finalize.sh
414 echo "========================== 1.3 "
415 source scripts/Check-if-root.sh
416 bash scripts/ThirdParty-install-ITK.sh
417 bash scripts/ThirdParty-install-Finalize.sh
424 bash scripts/CreaTools-load.sh
426 source scripts/CreaTools-configure.sh
427 bash scripts/CreaTools-compile.sh
429 bash scripts/CreaTools-install.sh
430 echo "You HAVE to leave current window to continue!"
436 echo "========================== 2.1"
437 bash scripts/CreaTools-load.sh
441 echo "========================== 2.2"
442 source scripts/CreaTools-configure.sh
444 bash scripts/CreaTools-compile.sh
446 # To allow (*very* aware) user to patch code, later
447 if [ ! -e $generationdir/creatools_source ]
449 echo "You probabely made a mistake : "
450 echo "Directory $loginUserName $generationdir/creatools_source not found"
451 echo "Make sure you know the mistake"
452 echo "Hit any key to continue"
453 echo "Fix the mistake!"
456 chown -R $loginUserName $generationdir/creatools_source
457 chgrp -R $loginGroupName $generationdir/creatools_source
458 # Too much time consuming
459 #chown -R $loginUserName $generationdir/creatools_source
460 #chgrp -R $loginGroupName $generationdir/creatools_source
470 # echo "==================================================="
473 # echo "YOU NEED TO RUN THIS ONE AS root"
474 # echo "==================================================="
480 echo "========================= 4"
482 bash scripts/CreaTools-install.sh
486 # echo "You HAVE to leave current window to continue!"
488 # echo "==> Hit any key to close current window"
494 if [ $expanded = "NO" ]
503 echo "========================= 5"
504 bash scripts/CreaTools-uninstall.sh
506 echo "==> Hit any key to go on"
512 echo "==================================="
515 echo "==> Hit any key to go on"
521 echo "==================================="
523 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
524 # if user configured without installing third party library,
525 # Last third party library is still in use! JPR
528 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
532 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
533 grep "installPrefixThird=" /etc/bashrc
534 echo "VTK_DIR : " $VTK_DIR
535 echo "ITK_DIR : " $ITK_DIR
536 echo "GDCM_DIR : " $GDCM_DIR
538 echo "installPrefixThird ... " $installPrefixThird
541 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
543 echo "Third party config file : " $installPrefixThird/share/creatools_third_party_library_config.sh
545 more $installPrefixThird/share/creatools_third_party_library_config.sh
551 if [ -f $installPrefix/share/creatools_base_library_config.sh ]
553 echo "Creatools base library config file : " $installPrefix/share/creatools_base_library_config.sh
555 more $installPrefix/share/creatools_base_library_config.sh
558 echo "installPrefix ... " $installPrefix
561 echo "VTK_DIR : " $VTK_DIR
562 echo "ITK_DIR : " $ITK_DIR
563 echo "GDCM_DIR : " $GDCM_DIR
565 echo "crea_DIR : " $crea_DIR
566 echo "BBTK_DIR : " $BBTK_DIR
567 echo "creaMaracasVisu_DIR : " $creaMaracasVisu_DIR
568 echo "creaEnvironment_DIR : " $creaEnvironment_DIR
569 echo "creaBruker_DIR : " $creaBruker_DIR
570 echo "creaImageIO_DIR : " $creaImageIO_DIR
571 echo "creaContours_DIR : " $creaContours_DIR
572 echo "creaRigidRegistration_DIR :" $creaRigidRegistration_DIR
573 echo "bbtkGEditor_DIR : " $bbtkGEditor_DIR
574 echo "creaTools_DIR : " $creaTools_DIR
575 echo "creaMiniTools_DIR : " $creaMiniTools_DIR
576 echo "Ido_DIR : " $Ido_DIR
577 echo "==================================="
579 echo "Press any key to continue"
589 # Hiden option, usefull at debug time
590 bash scripts/ThirdParty-install_no_compile.sh
597 echo "Your answer must be in {0, 1, 2, 5, 6, 7, 8, 9} (was [ $i ])"
599 echo "Your answer must be in {0, 1, 2.1, 2.2, 2.3, 5, 6, 7, 8, 9} (was [ $i ])"