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"
21 echo " Install Third Party Libraries :....1 (as root)"
22 if [ $expanded = "YES" ]
24 echo " Get the 'CreaTools' source files :.2.1 (CVS : as user!)"
25 echo " Compile the CreaTools :..........2.2"
26 # Install creatools as user (no longer as root) // JPR 2/5/2011
27 echo " Install the CreaTools :..........2.3"
29 echo " Get and Install the 'CreaTools':...2"
32 if [ $expanded = "NO" ]
34 echo " Use Expanded menu :................5 "
36 echo " Use compact menu :.................5 "
38 echo " Uninstall the CreaTools :..........6 "
39 echo " Help ..............................7 Help about this menu"
40 echo " Show some Environment Variables ...8"
41 echo " Exit :.............................9"
46 echo "Type in your choice :"
53 #ls -l scripts/CreaTools-configure.sh
54 if [ -f scripts/CreaTools-configure.sh ]
56 while [[ "$suitable" != "YES" && \
57 "$suitable" != "yes" && \
58 "$suitable" != "Y" && \
59 "$suitable" != "y" && \
60 "$suitable" != "NO" && \
61 "$suitable" != "no" ]]
63 echo "'Configure' already done : "
64 echo "------------------------"
65 more scripts/CreaTools-configure.sh
66 echo "------------------------"
68 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
69 # if user configured without installing third party library,
70 # Last third party library is still in use! JPR
73 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
77 # Install creatools as user (no longer as root) // JPR 2/5/2011
78 #if [ ! -f /etc/bashrc ]
80 # export ETC_BASHRC="/etc/bash.bashrc"
82 # export ETC_BASHRC="/etc/bashrc"
84 export ETC_BASHRC=$HOME/.bashrc
85 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
87 grep "installPrefixThird=" $ETC_BASHRC
88 echo "VTK_DIR : " $VTK_DIR
89 echo "ITK_DIR : " $ITK_DIR
90 echo "GDCM_DIR : " $GDCM_DIR
91 echo "(Have a look at $ETC_BASHRC=, edit it or run again Install Third Party Libraries if you disagree)"
94 echo "Are these values suitable for you : YES/NO? (default is YES)"
96 if [ "$suitable" = "" ]
105 if [[ "$suitable" = "YES" || "$suitable" = "Y" || "$suitable" = "yes" || "$suitable" = "y" ]]
107 source scripts/CreaTools-configure.sh
110 if [[ "$suitable" = "NO" || "$suitable" = "N" || "$suitable" = "no" || "$suitable" = "n" ]]
111 #if [ "$suitable" = "NO" ]
116 while [ "$confirm" != "YES" ]
119 OperatingSystem="XXX"
120 while [[ "$OperatingSystem" != "Fedora" && \
121 "$OperatingSystem" != "Ubuntu" && \
122 "$OperatingSystem" != "MacOS" ]]
124 echo "Operating System : Fedora/Ubuntu/MacOS (default : Fedora)"
126 if [ "$OperatingSystem" = "" ]
128 OperatingSystem="Fedora"
131 echo "you said : [" $OperatingSystem "]"
136 echo "Name of the Generation Directory (default is /tmp/myGenerationDir)"
138 if [ "$generationdir" = "" ]
140 generationdir="/tmp/myGenerationDir"
142 echo "you said : [" $generationdir "]"
147 installPrefixThird="___"
148 echo "Install Prefix For Third Party Library : '$generationdir/thirdparty_install' / '/usr/local' (default is '$generationdir/thirdparty_install')"
149 read installPrefixThird
150 if [ "$installPrefixThird" = "" ]
152 installPrefixThird="$generationdir/thirdparty_install"
154 echo "you said : [" $installPrefixThird "]"
160 echo "Install Prefix for CreaTools : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
162 if [ "$installPrefix" = "" ]
164 installPrefix="$generationdir/creatools_install"
166 echo "you said : [" $installPrefix "]"
172 while [[ "$docgeneration" != "ON" && "$docgeneration" != "OFF" ]]
174 echo "Boolean For Doc Generation : ON/OFF (default is OFF)"
176 if [ "$docgeneration" = "" ]
180 echo "you said : [" $docgeneration "]"
187 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
189 echo "Where do you want to get source files from : CVS/HTML (default is CVS)"
191 if [ "$sourcesFrom" = "" ]
195 echo "you said : [" $sourcesFrom "]"
202 if [ "$sourcesFrom" = "CVS" ]
204 while [ "$cvsUserName" == "" ]
206 echo "CVS User Name (mandatory!)"
209 echo "you said : [" $cvsUserName "]"
211 cvsUserName="ForgetThisOne"
219 while [ "$loginUserName" == "" ]
221 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
223 echo "Login User Name (mandatory!)"
225 echo "you said : [" $loginUserName "]"
231 while [ "$loginGroupName" == "" ]
233 #echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
234 #echo "Login Group Name (mandatory!)"
235 echo "Login Group Name (mandatory!)"
237 echo "you said : [" $loginGroupName "]"
244 while [[ "$buildType" != "Release" && "$buildType" != "Debug" ]]
246 echo "Build type : Release/Debug (default is Release)"
248 if [ "$buildType" = "" ]
252 echo "you said : [" $buildType "]"
259 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
261 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
263 if [ "$gdcmVersion" = "" ]
267 echo "you said : [" $gdcmVersion "]"
274 echo " Operating System : $OperatingSystem"
275 echo " Name of the Generation Directory : $generationdir"
276 echo " Install Prefix for Third Party Libraries : $installPrefixThird"
277 echo " Install Prefix for CreaTools : $installPrefix"
278 echo " Boolean for Doc Generation : $docgeneration"
279 echo " Where do you want to get source files from : $sourcesFrom"
280 if [ $sourcesFrom = CVS ]
282 echo " CVS User Name : $cvsUserName"
284 echo " Login User Name : $loginUserName"
285 echo " Login Group Name : $loginGroupName"
286 echo " Build type : $buildType"
287 echo " Gdcm version : $gdcmVersion"
291 echo "Do you confirm your choices : YES/NO ? (default is YES)"
293 if [ "$confirm" = "" ]
299 # GROS SOUCIS : Ou generer le fichier CreaTools-configure.sh?
300 # dans $generationdir/creatools_bin ?
301 # -> il n'est pas encore cree !
302 # dans ./Linux/scripts?
303 # ==> On le genere chez l'utilisateur (no choice!)...
306 configureFile="scripts/CreaTools-configure.sh"
308 echo "#!/bin/bash" > $configureFile
309 echo >> $configureFile
310 echo "#File generated by 'menu.sh'" >> $configureFile
311 echo "#DO NOT edit !" >> $configureFile
312 echo "#(except if you *know* what you do)" >> $configureFile
313 echo >> $configureFile
314 echo "OperatingSystem=$OperatingSystem" >> $configureFile
315 echo "generationdir=$generationdir" >> $configureFile
316 echo "installPrefix=$installPrefix" >> $configureFile
317 echo "installPrefixThird=$installPrefixThird" >> $configureFile
318 echo "docgeneration=$docgeneration" >> $configureFile
319 echo "sourcesFrom=$sourcesFrom" >> $configureFile
320 echo "cvsUserName=$cvsUserName" >> $configureFile
321 echo "loginUserName=$loginUserName" >> $configureFile
322 echo "loginGroupName=$loginGroupName" >> $configureFile
323 echo "buildType=$buildType" >> $configureFile
324 echo "gdcmVersion=$gdcmVersion" >> $configureFile
332 echo "========================== 1 "
333 source scripts/Check-if-root.sh
334 bash scripts/ThirdParty-install.sh
336 if [ "$sourcesFrom" = "CVS" ]
338 echo "----------------------------------------------------------------------"
340 echo "To go on, run again 'bash menu.sh' as '$loginUserName', in a new window"
341 echo "---------------------------------------------------------------------"
343 echo "----------------------------------------------------------------------"
345 echo "To go on, run again 'bash menu.sh' in a new window"
346 echo "---------------------------------------------------------------------"
349 echo "==> You HAVE to leave current window to continue!"
356 bash scripts/CreaTools-load.sh
358 source scripts/CreaTools-configure.sh
359 bash scripts/CreaTools-compile.sh
361 bash scripts/CreaTools-install.sh
362 echo "You HAVE to leave current window to continue!"
368 echo "========================== 2.1"
369 bash scripts/CreaTools-load.sh
373 echo "========================== 2.2"
374 source scripts/CreaTools-configure.sh
376 bash scripts/CreaTools-compile.sh
378 # To allow (*very* aware) user to patch code, later
379 if [ ! -e $generationdir/creatools_source ]
381 echo "You probabely made a mistake : "
382 echo "Directory $loginUserName $generationdir/creatools_source not found"
383 echo "Make sure you know the mistake"
384 echo "Hit any key to continue"
385 echo "Fix the mistake!"
388 chown -R $loginUserName $generationdir/creatools_source
389 chgrp -R $loginGroupName $generationdir/creatools_source
390 # Too much time consuming
391 #chown -R $loginUserName $generationdir/creatools_source
392 #chgrp -R $loginGroupName $generationdir/creatools_source
402 # echo "==================================================="
405 # echo "YOU NEED TO RUN THIS ONE AS root"
406 # echo "==================================================="
412 echo "========================= 4"
414 bash scripts/CreaTools-install.sh
418 # echo "You HAVE to leave current window to continue!"
420 # echo "==> Hit any key to close current window"
426 if [ $expanded = "NO" ]
435 echo "========================= 5"
436 bash scripts/CreaTools-uninstall.sh
438 echo "==> Hit any key to go on"
444 echo "==================================="
447 echo "==> Hit any key to go on"
453 echo "==================================="
455 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
456 # if user configured without installing third party library,
457 # Last third party library is still in use! JPR
460 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
464 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
465 grep "installPrefixThird=" /etc/bashrc
466 echo "VTK_DIR : " $VTK_DIR
467 echo "ITK_DIR : " $ITK_DIR
468 echo "GDCM_DIR : " $GDCM_DIR
470 echo "installPrefixThird ... " $installPrefixThird
473 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
475 echo $installPrefixThird/share/creatools_third_party_library_config.sh
477 more $installPrefixThird/share/creatools_third_party_library_config.sh
483 if [ -f $installPrefix/share/creatools_base_library_config.sh ]
485 echo $installPrefix/share/creatools_base_library_config.sh
487 more $installPrefix/share/creatools_base_library_config.sh
490 echo "installPrefix ... " $installPrefix
493 echo "VTK_DIR : " $VTK_DIR
494 echo "ITK_DIR : " $ITK_DIR
495 echo "GDCM_DIR : " $GDCM_DIR
496 echo "crea_DIR : " $crea_DIR
497 echo "bbtk_DIR : " $bbtk_DIR
498 echo "creaMaracasVisu_DIR : " $creaMaracasVisu_DIR
499 echo "creaEnvironment_DIR : " $creaEnvironment_DIR
500 echo "creaBruker_DIR : " $creaBruker_DIR
501 echo "creaImageIO_DIR : " $creaImageIO_DIR
502 echo "creaContours_DIR : " $creaContours_DIR
503 echo "creaRigidRegistration_DIR :" $creaRigidRegistration_DIR
504 echo "bbtkGEditor_DIR : " $bbtkGEditor_DIR
505 echo "creaTools_DIR : " $creaTools_DIR
507 echo "==================================="
509 echo "Press any key to continue"
519 bash scripts/ThirdParty-install_no_compile.sh
526 echo "Your answer must be in {0, 1, 2, 5, 6, 7, 8, 9} (was [ $i ])"
528 echo "Your answer must be in {0, 1, 2.1, 2.2, 2.3, 5, 6, 7, 8, 9} (was [ $i ])"