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 (as root)"
25 # echo " Uninstall the CreaTools :..........5 (as root)"
26 echo " Install the CreaTools :..........4 "
27 echo " Uninstall the CreaTools :..........5 "
29 echo " Help ..............................7 Help about this menu"
30 echo " Show some Environment Variables ...8"
31 echo " Exit :.............................9"
36 echo "Type in your choice :"
43 #ls -l scripts/CreaTools-configure.sh
44 if [ -f scripts/CreaTools-configure.sh ]
46 while [[ "$suitable" != "YES" && \
47 "$suitable" != "yes" && \
48 "$suitable" != "Y" && \
49 "$suitable" != "y" && \
50 "$suitable" != "NO" && \
51 "$suitable" != "no" ]]
53 echo "'Configure' already done : "
54 echo "------------------------"
55 more scripts/CreaTools-configure.sh
56 echo "------------------------"
58 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
59 # if user configured without installing third party library,
60 # Last third party library is still in use! JPR
63 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
67 # Install creatools as user (no longer as root) // JPR 2/5/2011
68 #if [ ! -f /etc/bashrc ]
70 # export ETC_BASHRC="/etc/bash.bashrc"
72 # export ETC_BASHRC="/etc/bashrc"
74 export ETC_BASHRC=$HOME/.bashrc
75 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
77 grep "installPrefixThird=" $ETC_BASHRC
78 echo "VTK_DIR :...." $VTK_DIR
79 echo "ITK_DIR :...." $ITK_DIR
80 echo "GDCM_DIR :..." $GDCM_DIR
81 echo "(Have a look at $ETC_BASHRC=, edit it or run again Install Third Party Libraries if you disagree)"
84 echo "Are these values suitable for you : YES/NO? (default is YES)"
86 if [ "$suitable" = "" ]
95 if [[ "$suitable" = "YES" || "$suitable" = "Y" || "$suitable" = "yes" || "$suitable" = "y" ]]
97 source scripts/CreaTools-configure.sh
100 if [[ "$suitable" = "NO" || "$suitable" = "N" || "$suitable" = "no" || "$suitable" = "n" ]]
101 #if [ "$suitable" = "NO" ]
106 while [ "$confirm" != "YES" ]
109 OperatingSystem="XXX"
110 while [[ "$OperatingSystem" != "Fedora" && \
111 "$OperatingSystem" != "Ubuntu" && \
112 "$OperatingSystem" != "MacOS" ]]
114 echo "Operating System : Fedora/Ubuntu/MacOS (default : Fedora)"
116 if [ "$OperatingSystem" = "" ]
118 OperatingSystem="Fedora"
121 echo "you said : [" $OperatingSystem "]"
126 echo "Name of the Generation Directory (default is /tmp/myGenerationDir)"
128 if [ "$generationdir" = "" ]
130 generationdir="/tmp/myGenerationDir"
132 echo "you said : [" $generationdir "]"
137 installPrefixThird="___"
138 echo "Install Prefix For Third Party Library : '$generationdir/thirdparty_install' / '/usr/local' (default is '$generationdir/thirdparty_install')"
139 read installPrefixThird
140 if [ "$installPrefixThird" = "" ]
142 installPrefixThird="$generationdir/thirdparty_install"
144 echo "you said : [" $installPrefixThird "]"
150 echo "Install Prefix for CreaTools : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
152 if [ "$installPrefix" = "" ]
154 installPrefix="$generationdir/creatools_install"
156 echo "you said : [" $installPrefix "]"
162 while [[ "$docgeneration" != "ON" && "$docgeneration" != "OFF" ]]
164 echo "Boolean For Doc Generation : ON/OFF (default is OFF)"
166 if [ "$docgeneration" = "" ]
170 echo "you said : [" $docgeneration "]"
177 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
179 echo "Where do you want to get source files from : CVS/HTML (default is CVS)"
181 if [ "$sourcesFrom" = "" ]
185 echo "you said : [" $sourcesFrom "]"
192 if [ "$sourcesFrom" = "CVS" ]
194 while [ "$cvsUserName" == "" ]
196 echo "CVS User Name (mandatory!)"
199 echo "you said : [" $cvsUserName "]"
201 cvsUserName="ForgetThisOne"
209 while [ "$loginUserName" == "" ]
211 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
213 echo "Login User Name (mandatory!)"
215 echo "you said : [" $loginUserName "]"
221 while [ "$loginGroupName" == "" ]
223 #echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
224 #echo "Login Group Name (mandatory!)"
225 echo "Login Group Name (mandatory!)"
227 echo "you said : [" $loginGroupName "]"
234 while [[ "$buildType" != "Release" && "$buildType" != "Debug" ]]
236 echo "Build type : Release/Debug (default is Release)"
238 if [ "$buildType" = "" ]
242 echo "you said : [" $buildType "]"
249 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
251 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
253 if [ "$gdcmVersion" = "" ]
257 echo "you said : [" $gdcmVersion "]"
264 echo " Operating System : $OperatingSystem"
265 echo " Name of the Generation Directory : $generationdir"
266 echo " Install Prefix for Third Party Libraries : $installPrefixThird"
267 echo " Install Prefix for CreaTools : $installPrefix"
268 echo " Boolean for Doc Generation : $docgeneration"
269 echo " Where do you want to get source files from : $sourcesFrom"
270 if [ $sourcesFrom = CVS ]
272 echo " CVS User Name : $cvsUserName"
274 echo " Login User Name : $loginUserName"
275 echo " Login Group Name : $loginGroupName"
276 echo " Build type : $buildType"
277 echo " Gdcm version : $gdcmVersion"
281 echo "Do you confirm your choices : YES/NO ? (default is YES)"
283 if [ "$confirm" = "" ]
289 # GROS SOUCIS : Ou generer le fichier CreaTools-configure.sh?
290 # dans $generationdir/creatools_bin ?
291 # -> il n'est pas encore cree !
292 # dans ./Linux/scripts?
293 # ==> On le genere chez l'utilisateur (no choice!)...
296 configureFile="scripts/CreaTools-configure.sh"
298 echo "#!/bin/bash" > $configureFile
299 echo >> $configureFile
300 echo "#File generated by 'menu.sh'" >> $configureFile
301 echo "#DO NOT edit !" >> $configureFile
302 echo "#(except if you *know* what you do)" >> $configureFile
303 echo >> $configureFile
304 echo "OperatingSystem=$OperatingSystem" >> $configureFile
305 echo "generationdir=$generationdir" >> $configureFile
306 echo "installPrefix=$installPrefix" >> $configureFile
307 echo "installPrefixThird=$installPrefixThird" >> $configureFile
308 echo "docgeneration=$docgeneration" >> $configureFile
309 echo "sourcesFrom=$sourcesFrom" >> $configureFile
310 echo "cvsUserName=$cvsUserName" >> $configureFile
311 echo "loginUserName=$loginUserName" >> $configureFile
312 echo "loginGroupName=$loginGroupName" >> $configureFile
313 echo "buildType=$buildType" >> $configureFile
314 echo "gdcmVersion=$gdcmVersion" >> $configureFile
322 echo "========================== 1 "
323 source scripts/Check-if-root.sh
324 bash scripts/ThirdParty-install.sh
326 if [ "$sourcesFrom" = "CVS" ]
328 echo "----------------------------------------------------------------------"
330 echo "To go on, run again 'bash menu.sh' as '$loginUserName', in a new window"
331 echo "---------------------------------------------------------------------"
333 echo "----------------------------------------------------------------------"
335 echo "To go on, run again 'bash menu.sh' in a new window"
336 echo "---------------------------------------------------------------------"
339 echo "==> Hit any key to exit close current window"
345 echo "========================== 2"
346 bash scripts/CreaTools-load.sh
350 echo "========================== 3"
351 source scripts/CreaTools-configure.sh
353 bash scripts/CreaTools-compile.sh
355 # To allow (*very* aware) user to patch code, later
356 if [ ! -e $generationdir/creatools_source ]
358 echo "You probabely made a mistake : "
359 echo "Directory $loginUserName $generationdir/creatools_source not found"
360 echo "Make sure you know the mistake"
361 echo "Hit any key to continue"
362 echo "Fix the mistake!"
365 chown -R $loginUserName $generationdir/creatools_source
366 chgrp -R $loginGroupName $generationdir/creatools_source
367 # Too much time consuming
368 #chown -R $loginUserName $generationdir/creatools_source
369 #chgrp -R $loginGroupName $generationdir/creatools_source
379 # echo "==================================================="
382 # echo "YOU NEED TO RUN THIS ONE AS root"
383 # echo "==================================================="
389 echo "========================= 4"
390 bash scripts/CreaTools-install.sh
395 # echo "You HAVE to leave current window to continue!"
397 # echo "==> Hit any key to close current window"
401 echo "You HAVE to leave current window to continue!"
407 echo "========================= 5"
408 bash scripts/CreaTools-uninstall.sh
410 echo "==> Hit any key to go on"
416 echo "==================================="
419 echo "==> Hit any key to go on"
425 echo "==================================="
427 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
428 # if user configured without installing third party library,
429 # Last third party library is still in use! JPR
432 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
436 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
437 grep "installPrefixThird=" /etc/bashrc
438 echo "VTK_DIR :...." $VTK_DIR
439 echo "ITK_DIR :...." $ITK_DIR
440 echo "GDCM_DIR :..." $GDCM_DIR
442 echo "installPrefixThird ... " $installPrefixThird
445 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
447 echo $installPrefixThird/share/creatools_third_party_library_config.sh
449 more $installPrefixThird/share/creatools_third_party_library_config.sh
455 if [ -f $installPrefix/share/creatools_base_library_config.sh ]
457 echo $installPrefix/share/creatools_base_library_config.sh
459 more $installPrefix/share/creatools_base_library_config.sh
462 echo "installPrefix ... " $installPrefix
465 echo "VTK_DIR :...." $VTK_DIR
466 echo "ITK_DIR :...." $ITK_DIR
467 echo "GDCM_DIR :..." $GDCM_DIR
468 echo "CREA_DIR :...................." $CREA_DIR
469 echo "BBTK_DIR :...................." $BBTK_DIR
470 echo "CREAMARACASVISU_DIR :........." $CREAMARACASVISU_DIR
471 echo "CREAENVIRONMENT_DIR :........." $CREAENVIRONMENT_DIR
472 echo "CREABRUKER_DIR :.............." $CREABRUKER_DIR
473 echo "CREAIMAGEIO_DIR :............." $CREAIMAGEIO_DIR
474 echo "CREACONTOUR_DIR :............." $CREACONTOUR_DIR
475 echo "CREARIGIDREGISTRATION_DIR :..." $CREAIGIDREGISTRATION_DIR
476 echo "CREABTKGEDITOR_DIR :.........." $CREABTKGEDITOR_DIR
477 echo "CREATOOLS_DIR :..............." $CREATOOLS_DIR
479 echo "==================================="
481 echo "Press any key to continue"
491 echo "Your answer must be in {0, 1, 2, 3, 4, 5, 7, 8, 9} (was [ $i ])"