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 "How many cores on your computer 2 (default is 2)"
147 if [ "$corenumber" = "" ]
151 echo "you said : [" $corenumber "]"
157 echo "Name of the Generation Directory (default is ~/creaToolsGenerationDir)"
159 if [ "$generationdir" = "" ]
161 generationdir="~/creaToolsGenerationDir"
163 echo "you said : [" $generationdir "]"
168 installPrefixThird="___"
169 echo "Install Prefix For Third Party Library : '$generationdir/thirdparty_install' / '/usr/local' (default is '$generationdir/thirdparty_install')"
170 read installPrefixThird
171 if [ "$installPrefixThird" = "" ]
173 installPrefixThird="$generationdir/thirdparty_install"
175 echo "you said : [" $installPrefixThird "]"
181 echo "Install Prefix for CreaTools : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
183 if [ "$installPrefix" = "" ]
185 installPrefix="$generationdir/creatools_install"
187 echo "you said : [" $installPrefix "]"
195 while [[ "$docgeneration" != "ON" && "$docgeneration" != "OFF" ]]
197 echo "Boolean For Doc Generation : ON/OFF (default is OFF)"
199 if [ "$docgeneration" = "" ]
203 echo "you said : [" $docgeneration "]"
213 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
215 echo "Where do you want to get source files from : CVS/HTML ( CVS : for registered CREATIS users only! )"
217 if [ "$sourcesFrom" = "" ]
221 echo "you said : [" $sourcesFrom "]"
228 if [ "$sourcesFrom" = "CVS" ]
230 while [ "$cvsUserName" == "" ]
232 echo "CVS User Name ( registered CREATIS user : mandatory!)"
235 echo "you said : [" $cvsUserName "]"
237 cvsUserName="ForgetThisOne"
245 while [ "$loginUserName" == "" ]
247 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
249 echo "Login User Name (mandatory!)"
251 echo "you said : [" $loginUserName "]"
257 while [ "$loginGroupName" == "" ]
259 #echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
260 #echo "Login Group Name (mandatory!)"
261 echo "Login Group Name (mandatory!)"
263 echo "you said : [" $loginGroupName "]"
270 while [[ "$buildType" != "Release" && "$buildType" != "Debug" ]]
272 echo "Build type : Release/Debug (default is Release)"
274 if [ "$buildType" = "" ]
278 echo "you said : [" $buildType "]"
285 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
287 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
289 if [ "$gdcmVersion" = "" ]
293 echo "you said : [" $gdcmVersion "]"
300 echo " Operating System : $OperatingSystem"
301 echo " Number of Cores : $corenumber"
302 echo " Name of the Generation Directory : $generationdir"
303 echo " Install Prefix for Third Party Libraries : $installPrefixThird"
304 echo " Install Prefix for CreaTools : $installPrefix"
305 echo " Boolean for Doc Generation : $docgeneration"
306 echo " Where do you want to get source files from : $sourcesFrom"
307 if [ $sourcesFrom = CVS ]
309 echo " CVS User Name : $cvsUserName"
311 echo " Login User Name : $loginUserName"
312 echo " Login Group Name : $loginGroupName"
313 echo " Build type : $buildType"
314 echo " Gdcm version : $gdcmVersion"
318 echo "Do you confirm your choices : YES/NO ? (default is YES)"
320 if [ "$confirm" = "" ]
326 # GROS SOUCIS : Ou generer le fichier CreaTools-configure.sh?
327 # dans $generationdir/creatools_bin ?
328 # -> il n'est pas encore cree !
329 # dans ./Linux/scripts?
330 # ==> On le genere chez l'utilisateur (no choice!)...
333 configureFile="scripts/CreaTools-configure.sh"
335 echo "#!/bin/bash" > $configureFile
336 echo >> $configureFile
337 echo "#File generated by 'menu.sh'" >> $configureFile
338 echo "#DO NOT edit !" >> $configureFile
339 echo "#(except if you *do* know what you do)" >> $configureFile
340 echo >> $configureFile
341 echo "OperatingSystem=$OperatingSystem" >> $configureFile
342 echo "corenumber=$corenumber" >> $configureFile
343 echo "generationdir=$generationdir" >> $configureFile
344 echo "installPrefix=$installPrefix" >> $configureFile
345 echo "installPrefixThird=$installPrefixThird" >> $configureFile
346 echo "docgeneration=$docgeneration" >> $configureFile
347 echo "sourcesFrom=$sourcesFrom" >> $configureFile
348 echo "cvsUserName=$cvsUserName" >> $configureFile
349 echo "loginUserName=$loginUserName" >> $configureFile
350 echo "loginGroupName=$loginGroupName" >> $configureFile
351 echo "buildType=$buildType" >> $configureFile
352 echo "gdcmVersion=$gdcmVersion" >> $configureFile
360 echo "========================== 1 "
361 source scripts/Check-if-root.sh
362 bash scripts/ThirdParty-install.sh
364 if [ "$sourcesFrom" = "CVS" ]
366 echo "----------------------------------------------------------------------"
368 echo "To go on, run again 'bash menu.sh' as '$loginUserName', in a new window"
369 echo "---------------------------------------------------------------------"
371 echo "----------------------------------------------------------------------"
373 echo "To go on, run again 'bash menu.sh' in a new window"
374 echo "---------------------------------------------------------------------"
377 echo "==> You HAVE to leave current window to continue!"
383 echo "========================== 1.1 "
384 source scripts/Check-if-root.sh
385 bash scripts/ThirdParty-install-gdcm.sh
389 echo "========================== 1.2 "
390 echo "sorry, not yet available"
395 echo "========================== 1.3 "
396 echo "sorry, not yet available"
403 bash scripts/CreaTools-load.sh
405 source scripts/CreaTools-configure.sh
406 bash scripts/CreaTools-compile.sh
408 bash scripts/CreaTools-install.sh
409 echo "You HAVE to leave current window to continue!"
415 echo "========================== 2.1"
416 bash scripts/CreaTools-load.sh
420 echo "========================== 2.2"
421 source scripts/CreaTools-configure.sh
423 bash scripts/CreaTools-compile.sh
425 # To allow (*very* aware) user to patch code, later
426 if [ ! -e $generationdir/creatools_source ]
428 echo "You probabely made a mistake : "
429 echo "Directory $loginUserName $generationdir/creatools_source not found"
430 echo "Make sure you know the mistake"
431 echo "Hit any key to continue"
432 echo "Fix the mistake!"
435 chown -R $loginUserName $generationdir/creatools_source
436 chgrp -R $loginGroupName $generationdir/creatools_source
437 # Too much time consuming
438 #chown -R $loginUserName $generationdir/creatools_source
439 #chgrp -R $loginGroupName $generationdir/creatools_source
449 # echo "==================================================="
452 # echo "YOU NEED TO RUN THIS ONE AS root"
453 # echo "==================================================="
459 echo "========================= 4"
461 bash scripts/CreaTools-install.sh
465 # echo "You HAVE to leave current window to continue!"
467 # echo "==> Hit any key to close current window"
473 if [ $expanded = "NO" ]
482 echo "========================= 5"
483 bash scripts/CreaTools-uninstall.sh
485 echo "==> Hit any key to go on"
491 echo "==================================="
494 echo "==> Hit any key to go on"
500 echo "==================================="
502 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
503 # if user configured without installing third party library,
504 # Last third party library is still in use! JPR
507 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
511 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
512 grep "installPrefixThird=" /etc/bashrc
513 echo "VTK_DIR : " $VTK_DIR
514 echo "ITK_DIR : " $ITK_DIR
515 echo "GDCM_DIR : " $GDCM_DIR
517 echo "installPrefixThird ... " $installPrefixThird
520 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
522 echo "Third party config file : " $installPrefixThird/share/creatools_third_party_library_config.sh
524 more $installPrefixThird/share/creatools_third_party_library_config.sh
530 if [ -f $installPrefix/share/creatools_base_library_config.sh ]
532 echo "Creatools base library config file : " $installPrefix/share/creatools_base_library_config.sh
534 more $installPrefix/share/creatools_base_library_config.sh
537 echo "installPrefix ... " $installPrefix
540 echo "VTK_DIR : " $VTK_DIR
541 echo "ITK_DIR : " $ITK_DIR
542 echo "GDCM_DIR : " $GDCM_DIR
544 echo "crea_DIR : " $crea_DIR
545 echo "BBTK_DIR : " $BBTK_DIR
546 echo "creaMaracasVisu_DIR : " $creaMaracasVisu_DIR
547 echo "creaEnvironment_DIR : " $creaEnvironment_DIR
548 echo "creaBruker_DIR : " $creaBruker_DIR
549 echo "creaImageIO_DIR : " $creaImageIO_DIR
550 echo "creaContours_DIR : " $creaContours_DIR
551 echo "creaRigidRegistration_DIR :" $creaRigidRegistration_DIR
552 echo "bbtkGEditor_DIR : " $bbtkGEditor_DIR
553 echo "creaTools_DIR : " $creaTools_DIR
554 echo "creaMiniTools_DIR : " $creaMiniTools_DIR
555 echo "Ido_DIR : " $Ido_DIR
556 echo "==================================="
558 echo "Press any key to continue"
568 # Hiden option, usefull at debug time
569 bash scripts/ThirdParty-install_no_compile.sh
576 echo "Your answer must be in {0, 1, 2, 5, 6, 7, 8, 9} (was [ $i ])"
578 echo "Your answer must be in {0, 1, 2.1, 2.2, 2.3, 5, 6, 7, 8, 9} (was [ $i ])"