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 "]"
193 while [[ "$docgeneration" != "ON" && "$docgeneration" != "OFF" ]]
195 echo "Boolean For Doc Generation : ON/OFF (default is OFF)"
197 if [ "$docgeneration" = "" ]
201 echo "you said : [" $docgeneration "]"
208 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
210 echo "Where do you want to get source files from : CVS/HTML ( CVS : for registered CREATIS users only! )"
212 if [ "$sourcesFrom" = "" ]
216 echo "you said : [" $sourcesFrom "]"
223 if [ "$sourcesFrom" = "CVS" ]
225 while [ "$cvsUserName" == "" ]
227 echo "CVS User Name ( registered CREATIS user : mandatory!)"
230 echo "you said : [" $cvsUserName "]"
232 cvsUserName="ForgetThisOne"
240 while [ "$loginUserName" == "" ]
242 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
244 echo "Login User Name (mandatory!)"
246 echo "you said : [" $loginUserName "]"
252 while [ "$loginGroupName" == "" ]
254 #echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
255 #echo "Login Group Name (mandatory!)"
256 echo "Login Group Name (mandatory!)"
258 echo "you said : [" $loginGroupName "]"
265 while [[ "$buildType" != "Release" && "$buildType" != "Debug" ]]
267 echo "Build type : Release/Debug (default is Release)"
269 if [ "$buildType" = "" ]
273 echo "you said : [" $buildType "]"
280 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
282 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
284 if [ "$gdcmVersion" = "" ]
288 echo "you said : [" $gdcmVersion "]"
295 echo " Operating System : $OperatingSystem"
296 echo " Number of Cores : $corenumber"
297 echo " Name of the Generation Directory : $generationdir"
298 echo " Install Prefix for Third Party Libraries : $installPrefixThird"
299 echo " Install Prefix for CreaTools : $installPrefix"
300 echo " Boolean for Doc Generation : $docgeneration"
301 echo " Where do you want to get source files from : $sourcesFrom"
302 if [ $sourcesFrom = CVS ]
304 echo " CVS User Name : $cvsUserName"
306 echo " Login User Name : $loginUserName"
307 echo " Login Group Name : $loginGroupName"
308 echo " Build type : $buildType"
309 echo " Gdcm version : $gdcmVersion"
313 echo "Do you confirm your choices : YES/NO ? (default is YES)"
315 if [ "$confirm" = "" ]
321 # GROS SOUCIS : Ou generer le fichier CreaTools-configure.sh?
322 # dans $generationdir/creatools_bin ?
323 # -> il n'est pas encore cree !
324 # dans ./Linux/scripts?
325 # ==> On le genere chez l'utilisateur (no choice!)...
328 configureFile="scripts/CreaTools-configure.sh"
330 echo "#!/bin/bash" > $configureFile
331 echo >> $configureFile
332 echo "#File generated by 'menu.sh'" >> $configureFile
333 echo "#DO NOT edit !" >> $configureFile
334 echo "#(except if you *do* know what you do)" >> $configureFile
335 echo >> $configureFile
336 echo "OperatingSystem=$OperatingSystem" >> $configureFile
337 echo "corenumber=$corenumber" >> $configureFile
338 echo "generationdir=$generationdir" >> $configureFile
339 echo "installPrefix=$installPrefix" >> $configureFile
340 echo "installPrefixThird=$installPrefixThird" >> $configureFile
341 echo "docgeneration=$docgeneration" >> $configureFile
342 echo "sourcesFrom=$sourcesFrom" >> $configureFile
343 echo "cvsUserName=$cvsUserName" >> $configureFile
344 echo "loginUserName=$loginUserName" >> $configureFile
345 echo "loginGroupName=$loginGroupName" >> $configureFile
346 echo "buildType=$buildType" >> $configureFile
347 echo "gdcmVersion=$gdcmVersion" >> $configureFile
355 echo "========================== 1 "
356 source scripts/Check-if-root.sh
357 bash scripts/ThirdParty-install.sh
359 if [ "$sourcesFrom" = "CVS" ]
361 echo "----------------------------------------------------------------------"
363 echo "To go on, run again 'bash menu.sh' as '$loginUserName', in a new window"
364 echo "---------------------------------------------------------------------"
366 echo "----------------------------------------------------------------------"
368 echo "To go on, run again 'bash menu.sh' in a new window"
369 echo "---------------------------------------------------------------------"
372 echo "==> You HAVE to leave current window to continue!"
378 echo "========================== 1.1 "
379 source scripts/Check-if-root.sh
380 bash scripts/ThirdParty-install-gdcm.sh
384 echo "========================== 1.2 "
385 echo "sorry, not yet available"
390 echo "========================== 1.3 "
391 echo "sorry, not yet available"
398 bash scripts/CreaTools-load.sh
400 source scripts/CreaTools-configure.sh
401 bash scripts/CreaTools-compile.sh
403 bash scripts/CreaTools-install.sh
404 echo "You HAVE to leave current window to continue!"
410 echo "========================== 2.1"
411 bash scripts/CreaTools-load.sh
415 echo "========================== 2.2"
416 source scripts/CreaTools-configure.sh
418 bash scripts/CreaTools-compile.sh
420 # To allow (*very* aware) user to patch code, later
421 if [ ! -e $generationdir/creatools_source ]
423 echo "You probabely made a mistake : "
424 echo "Directory $loginUserName $generationdir/creatools_source not found"
425 echo "Make sure you know the mistake"
426 echo "Hit any key to continue"
427 echo "Fix the mistake!"
430 chown -R $loginUserName $generationdir/creatools_source
431 chgrp -R $loginGroupName $generationdir/creatools_source
432 # Too much time consuming
433 #chown -R $loginUserName $generationdir/creatools_source
434 #chgrp -R $loginGroupName $generationdir/creatools_source
444 # echo "==================================================="
447 # echo "YOU NEED TO RUN THIS ONE AS root"
448 # echo "==================================================="
454 echo "========================= 4"
456 bash scripts/CreaTools-install.sh
460 # echo "You HAVE to leave current window to continue!"
462 # echo "==> Hit any key to close current window"
468 if [ $expanded = "NO" ]
477 echo "========================= 5"
478 bash scripts/CreaTools-uninstall.sh
480 echo "==> Hit any key to go on"
486 echo "==================================="
489 echo "==> Hit any key to go on"
495 echo "==================================="
497 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
498 # if user configured without installing third party library,
499 # Last third party library is still in use! JPR
502 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
506 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
507 grep "installPrefixThird=" /etc/bashrc
508 echo "VTK_DIR : " $VTK_DIR
509 echo "ITK_DIR : " $ITK_DIR
510 echo "GDCM_DIR : " $GDCM_DIR
512 echo "installPrefixThird ... " $installPrefixThird
515 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
517 echo "Third party config file : " $installPrefixThird/share/creatools_third_party_library_config.sh
519 more $installPrefixThird/share/creatools_third_party_library_config.sh
525 if [ -f $installPrefix/share/creatools_base_library_config.sh ]
527 echo "Creatools base library config file : " $installPrefix/share/creatools_base_library_config.sh
529 more $installPrefix/share/creatools_base_library_config.sh
532 echo "installPrefix ... " $installPrefix
535 echo "VTK_DIR : " $VTK_DIR
536 echo "ITK_DIR : " $ITK_DIR
537 echo "GDCM_DIR : " $GDCM_DIR
539 echo "crea_DIR : " $crea_DIR
540 echo "BBTK_DIR : " $BBTK_DIR
541 echo "creaMaracasVisu_DIR : " $creaMaracasVisu_DIR
542 echo "creaEnvironment_DIR : " $creaEnvironment_DIR
543 echo "creaBruker_DIR : " $creaBruker_DIR
544 echo "creaImageIO_DIR : " $creaImageIO_DIR
545 echo "creaContours_DIR : " $creaContours_DIR
546 echo "creaRigidRegistration_DIR :" $creaRigidRegistration_DIR
547 echo "bbtkGEditor_DIR : " $bbtkGEditor_DIR
548 echo "creaTools_DIR : " $creaTools_DIR
549 echo "creaMiniTools_DIR : " $creaMiniTools_DIR
550 echo "==================================="
552 echo "Press any key to continue"
562 # Hiden option, usefull at debug time
563 bash scripts/ThirdParty-install_no_compile.sh
570 echo "Your answer must be in {0, 1, 2, 5, 6, 7, 8, 9} (was [ $i ])"
572 echo "Your answer must be in {0, 1, 2.1, 2.2, 2.3, 5, 6, 7, 8, 9} (was [ $i ])"