3 if [ -f scripts/CreaTools-configure.sh ]
5 source scripts/CreaTools-configure.sh
17 echo " Choose what you want to do :"
19 echo " Configure :........................0 "
20 echo " Install Third Party Libraries :....1 (as root)"
21 echo " Get the 'CreaTools' source files :.2 (CVS : as user!)"
22 echo " Compile the CreaTools :..........3 "
23 # Install creatools as user (no longer as root) // JPR 2/5/2011
24 echo " Install the CreaTools :..........4 "
25 echo " Uninstall the CreaTools :..........5 "
27 echo " Help ..............................7 Help about this menu"
28 echo " Show some Environment Variables ...8"
29 echo " Exit :.............................9"
34 echo "Type in your choice :"
41 #ls -l scripts/CreaTools-configure.sh
42 if [ -f scripts/CreaTools-configure.sh ]
44 while [[ "$suitable" != "YES" && \
45 "$suitable" != "yes" && \
46 "$suitable" != "Y" && \
47 "$suitable" != "y" && \
48 "$suitable" != "NO" && \
49 "$suitable" != "no" ]]
51 echo "'Configure' already done : "
52 echo "------------------------"
53 more scripts/CreaTools-configure.sh
54 echo "------------------------"
56 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
57 # if user configured without installing third party library,
58 # Last third party library is still in use! JPR
61 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
65 # Install creatools as user (no longer as root) // JPR 2/5/2011
66 #if [ ! -f /etc/bashrc ]
68 # export ETC_BASHRC="/etc/bash.bashrc"
70 # export ETC_BASHRC="/etc/bashrc"
72 export ETC_BASHRC=$HOME/.bashrc
73 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
75 grep "installPrefixThird=" $ETC_BASHRC
76 echo "VTK_DIR :...." $VTK_DIR
77 echo "ITK_DIR :...." $ITK_DIR
78 echo "GDCM_DIR :..." $GDCM_DIR
79 echo "(Have a look at $ETC_BASHRC=, edit it or run again Install Third Party Libraries if you disagree)"
82 echo "Are these values suitable for you : YES/NO? (default is YES)"
84 if [ "$suitable" = "" ]
93 if [[ "$suitable" = "YES" || "$suitable" = "Y" || "$suitable" = "yes" || "$suitable" = "y" ]]
95 source scripts/CreaTools-configure.sh
98 if [[ "$suitable" = "NO" || "$suitable" = "N" || "$suitable" = "no" || "$suitable" = "n" ]]
99 #if [ "$suitable" = "NO" ]
104 while [ "$confirm" != "YES" ]
107 OperatingSystem="XXX"
108 while [[ "$OperatingSystem" != "Fedora" && \
109 "$OperatingSystem" != "Ubuntu" && \
110 "$OperatingSystem" != "MacOS" ]]
112 echo "Operating System : Fedora/Ubuntu/MacOS (default : Fedora)"
114 if [ "$OperatingSystem" = "" ]
116 OperatingSystem="Fedora"
119 echo "you said : [" $OperatingSystem "]"
124 echo "Name of the Generation Directory (default is /tmp/myGenerationDir)"
126 if [ "$generationdir" = "" ]
128 generationdir="/tmp/myGenerationDir"
130 echo "you said : [" $generationdir "]"
135 installPrefixThird="___"
136 echo "Install Prefix For Third Party Library : '$generationdir/thirdparty_install' / '/usr/local' (default is '$generationdir/thirdparty_install')"
137 read installPrefixThird
138 if [ "$installPrefixThird" = "" ]
140 installPrefixThird="$generationdir/thirdparty_install"
142 echo "you said : [" $installPrefixThird "]"
148 echo "Install Prefix for CreaTools : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
150 if [ "$installPrefix" = "" ]
152 installPrefix="$generationdir/creatools_install"
154 echo "you said : [" $installPrefix "]"
160 while [[ "$docgeneration" != "ON" && "$docgeneration" != "OFF" ]]
162 echo "Boolean For Doc Generation : ON/OFF (default is OFF)"
164 if [ "$docgeneration" = "" ]
168 echo "you said : [" $docgeneration "]"
175 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
177 echo "Where do you want to get source files from : CVS/HTML (default is CVS)"
179 if [ "$sourcesFrom" = "" ]
183 echo "you said : [" $sourcesFrom "]"
190 if [ "$sourcesFrom" = "CVS" ]
192 while [ "$cvsUserName" == "" ]
194 echo "CVS User Name (mandatory!)"
197 echo "you said : [" $cvsUserName "]"
199 cvsUserName="ForgetThisOne"
207 while [ "$loginUserName" == "" ]
209 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
211 echo "Login User Name (mandatory!)"
213 echo "you said : [" $loginUserName "]"
219 while [ "$loginGroupName" == "" ]
221 #echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
222 #echo "Login Group Name (mandatory!)"
223 echo "Login Group Name (mandatory!)"
225 echo "you said : [" $loginGroupName "]"
232 while [[ "$buildType" != "Release" && "$buildType" != "Debug" ]]
234 echo "Build type : Release/Debug (default is Release)"
236 if [ "$buildType" = "" ]
240 echo "you said : [" $buildType "]"
247 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
249 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
251 if [ "$gdcmVersion" = "" ]
255 echo "you said : [" $gdcmVersion "]"
262 echo " Operating System : $OperatingSystem"
263 echo " Name of the Generation Directory : $generationdir"
264 echo " Install Prefix for Third Party Libraries : $installPrefixThird"
265 echo " Install Prefix for CreaTools : $installPrefix"
266 echo " Boolean for Doc Generation : $docgeneration"
267 echo " Where do you want to get source files from : $sourcesFrom"
268 if [ $sourcesFrom = CVS ]
270 echo " CVS User Name : $cvsUserName"
272 echo " Login User Name : $loginUserName"
273 echo " Login Group Name : $loginGroupName"
274 echo " Build type : $buildType"
275 echo " Gdcm version : $gdcmVersion"
279 echo "Do you confirm your choices : YES/NO ? (default is YES)"
281 if [ "$confirm" = "" ]
287 # GROS SOUCIS : Ou generer le fichier CreaTools-configure.sh?
288 # dans $generationdir/creatools_bin ?
289 # -> il n'est pas encore cree !
290 # dans ./Linux/scripts?
291 # ==> On le genere chez l'utilisateur (no choice!)...
294 configureFile="scripts/CreaTools-configure.sh"
296 echo "#!/bin/bash" > $configureFile
297 echo >> $configureFile
298 echo "#File generated by 'menu.sh'" >> $configureFile
299 echo "#DO NOT edit !" >> $configureFile
300 echo "#(except if you *know* what you do)" >> $configureFile
301 echo >> $configureFile
302 echo "OperatingSystem=$OperatingSystem" >> $configureFile
303 echo "generationdir=$generationdir" >> $configureFile
304 echo "installPrefix=$installPrefix" >> $configureFile
305 echo "installPrefixThird=$installPrefixThird" >> $configureFile
306 echo "docgeneration=$docgeneration" >> $configureFile
307 echo "sourcesFrom=$sourcesFrom" >> $configureFile
308 echo "cvsUserName=$cvsUserName" >> $configureFile
309 echo "loginUserName=$loginUserName" >> $configureFile
310 echo "loginGroupName=$loginGroupName" >> $configureFile
311 echo "buildType=$buildType" >> $configureFile
312 echo "gdcmVersion=$gdcmVersion" >> $configureFile
320 echo "========================== 1 "
321 source scripts/Check-if-root.sh
322 bash scripts/ThirdParty-install.sh
324 if [ "$sourcesFrom" = "CVS" ]
326 echo "----------------------------------------------------------------------"
328 echo "To go on, run again 'bash menu.sh' as '$loginUserName', in a new window"
329 echo "---------------------------------------------------------------------"
331 echo "----------------------------------------------------------------------"
333 echo "To go on, run again 'bash menu.sh' in a new window"
334 echo "---------------------------------------------------------------------"
337 echo "==> Hit any key to exit close current window"
343 echo "========================== 2"
344 bash scripts/CreaTools-load.sh
348 echo "========================== 3"
349 source scripts/CreaTools-configure.sh
351 bash scripts/CreaTools-compile.sh
353 # To allow (*very* aware) user to patch code, later
354 if [ ! -e $generationdir/creatools_source ]
356 echo "You probabely made a mistake : "
357 echo "Directory $loginUserName $generationdir/creatools_source not found"
358 echo "Make sure you know the mistake"
359 echo "Hit any key to continue"
360 echo "Fix the mistake!"
363 chown -R $loginUserName $generationdir/creatools_source
364 chgrp -R $loginGroupName $generationdir/creatools_source
365 # Too much time consuming
366 #chown -R $loginUserName $generationdir/creatools_source
367 #chgrp -R $loginGroupName $generationdir/creatools_source
377 # echo "==================================================="
380 # echo "YOU NEED TO RUN THIS ONE AS root"
381 # echo "==================================================="
387 echo "========================= 4"
389 bash scripts/CreaTools-install.sh
394 # echo "You HAVE to leave current window to continue!"
396 # echo "==> Hit any key to close current window"
400 echo "You HAVE to leave current window to continue!"
406 echo "========================= 5"
407 bash scripts/CreaTools-uninstall.sh
409 echo "==> Hit any key to go on"
415 echo "==================================="
418 echo "==> Hit any key to go on"
424 echo "==================================="
426 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
427 # if user configured without installing third party library,
428 # Last third party library is still in use! JPR
431 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
435 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
436 grep "installPrefixThird=" /etc/bashrc
437 echo "VTK_DIR :...." $VTK_DIR
438 echo "ITK_DIR :...." $ITK_DIR
439 echo "GDCM_DIR :..." $GDCM_DIR
441 echo "installPrefixThird ... " $installPrefixThird
444 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
446 echo $installPrefixThird/share/creatools_third_party_library_config.sh
448 more $installPrefixThird/share/creatools_third_party_library_config.sh
454 if [ -f $installPrefix/share/creatools_base_library_config.sh ]
456 echo $installPrefix/share/creatools_base_library_config.sh
458 more $installPrefix/share/creatools_base_library_config.sh
461 echo "installPrefix ... " $installPrefix
464 echo "VTK_DIR :...." $VTK_DIR
465 echo "ITK_DIR :...." $ITK_DIR
466 echo "GDCM_DIR :..." $GDCM_DIR
467 echo "CREA_DIR :...................." $CREA_DIR
468 echo "BBTK_DIR :...................." $BBTK_DIR
469 echo "CREAMARACASVISU_DIR :........." $CREAMARACASVISU_DIR
470 echo "CREAENVIRONMENT_DIR :........." $CREAENVIRONMENT_DIR
471 echo "CREABRUKER_DIR :.............." $CREABRUKER_DIR
472 echo "CREAIMAGEIO_DIR :............." $CREAIMAGEIO_DIR
473 echo "CREACONTOUR_DIR :............." $CREACONTOUR_DIR
474 echo "CREARIGIDREGISTRATION_DIR :..." $CREAIGIDREGISTRATION_DIR
475 echo "CREABTKGEDITOR_DIR :.........." $CREABTKGEDITOR_DIR
476 echo "CREATOOLS_DIR :..............." $CREATOOLS_DIR
478 echo "==================================="
480 echo "Press any key to continue"
490 echo "Your answer must be in {0, 1, 2, 3, 4, 5, 7, 8, 9} (was [ $i ])"