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 echo " Install the CreaTools :..........4 (as root)"
24 echo " Uninstall the CreaTools :..........5 (as root)"
26 echo " Help ..............................7 Help about this menu"
27 echo " Show some Environment Variables ...8"
28 echo " Exit :.............................9"
33 echo "Type in your choice :"
40 #ls -l scripts/CreaTools-configure.sh
41 if [ -f scripts/CreaTools-configure.sh ]
43 while [[ "$suitable" != "YES" && \
44 "$suitable" != "yes" && \
45 "$suitable" != "Y" && \
46 "$suitable" != "y" && \
47 "$suitable" != "NO" && \
48 "$suitable" != "no" ]]
50 echo "'Configure' already done : "
51 echo "------------------------"
52 more scripts/CreaTools-configure.sh
53 echo "------------------------"
55 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
56 # if user configured without installing third party library,
57 # Last third party library is still in use! JPR
60 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
64 if [ ! -f /etc/bashrc ]
66 export ETC_BASHRC="/etc/bash.bashrc"
68 export ETC_BASHRC="/etc/bashrc"
70 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
72 grep "installPrefixThird=" $ETC_BASHRC
73 echo "VTK_DIR :...." $VTK_DIR
74 echo "ITK_DIR :...." $ITK_DIR
75 echo "GDCM_DIR :..." $GDCM_DIR
76 echo "(Have a look at $ETC_BASHRC=, edit it or run again Install Third Party Libraries if you disagree)"
79 echo "Are these values suitable for you : YES/NO? (default is YES)"
81 if [ "$suitable" = "" ]
90 if [[ "$suitable" = "YES" || "$suitable" = "Y" || "$suitable" = "yes" || "$suitable" = "y" ]]
92 source scripts/CreaTools-configure.sh
95 if [[ "$suitable" = "NO" || "$suitable" = "N" || "$suitable" = "no" || "$suitable" = "n" ]]
96 #if [ "$suitable" = "NO" ]
101 while [ "$confirm" != "YES" ]
104 OperatingSystem="XXX"
105 while [[ "$OperatingSystem" != "Fedora" && \
106 "$OperatingSystem" != "Ubuntu" && \
107 "$OperatingSystem" != "MacOS" ]]
109 echo "Operating System : Fedora/Ubuntu/MacOS (default : Fedora)"
111 if [ "$OperatingSystem" = "" ]
113 OperatingSystem="Fedora"
116 echo "you said : [" $OperatingSystem "]"
121 echo "Name of the Generation Directory (default is /tmp/myGenerationDir)"
123 if [ "$generationdir" = "" ]
125 generationdir="/tmp/myGenerationDir"
127 echo "you said : [" $generationdir "]"
132 installPrefixThird="___"
133 echo "Install Prefix For Third Party Library : '$generationdir/thirdparty_install' / '/usr/local' (default is '$generationdir/thirdparty_install')"
134 read installPrefixThird
135 if [ "$installPrefixThird" = "" ]
137 installPrefixThird="$generationdir/thirdparty_install"
139 echo "you said : [" $installPrefixThird "]"
145 echo "Install Prefix for CreaTools : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
147 if [ "$installPrefix" = "" ]
149 installPrefix="$generationdir/creatools_install"
151 echo "you said : [" $installPrefix "]"
157 while [[ "$docgeneration" != "ON" && "$docgeneration" != "OFF" ]]
159 echo "Boolean For Doc Generation : ON/OFF (default is OFF)"
161 if [ "$docgeneration" = "" ]
165 echo "you said : [" $docgeneration "]"
172 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
174 echo "Where do you want to get source files from : CVS/HTML (default is CVS)"
176 if [ "$sourcesFrom" = "" ]
180 echo "you said : [" $sourcesFrom "]"
187 if [ "$sourcesFrom" = "CVS" ]
189 while [ "$cvsUserName" == "" ]
191 echo "CVS User Name (mandatory!)"
194 echo "you said : [" $cvsUserName "]"
196 cvsUserName="ForgetThisOne"
204 while [ "$loginUserName" == "" ]
206 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
208 echo "Login User Name (mandatory!)"
210 echo "you said : [" $loginUserName "]"
216 while [ "$loginGroupName" == "" ]
218 #echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
219 #echo "Login Group Name (mandatory!)"
220 echo "Login Group Name (mandatory!)"
222 echo "you said : [" $loginGroupName "]"
229 while [[ "$buildType" != "Release" && "$buildType" != "Debug" ]]
231 echo "Build type : Release/Debug (default is Release)"
233 if [ "$buildType" = "" ]
237 echo "you said : [" $buildType "]"
244 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
246 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
248 if [ "$gdcmVersion" = "" ]
252 echo "you said : [" $gdcmVersion "]"
259 echo " Operating System : $OperatingSystem"
260 echo " Name of the Generation Directory : $generationdir"
261 echo " Install Prefix for Third Party Libraries : $installPrefixThird"
262 echo " Install Prefix for CreaTools : $installPrefix"
263 echo " Boolean for Doc Generation : $docgeneration"
264 echo " Where do you want to get source files from : $sourcesFrom"
265 if [ $sourcesFrom = CVS ]
267 echo " CVS User Name : $cvsUserName"
269 echo " Login User Name : $loginUserName"
270 echo " Login Group Name : $loginGroupName"
271 echo " Build type : $buildType"
272 echo " Gdcm version : $gdcmVersion"
276 echo "Do you confirm your choices : YES/NO ? (default is YES)"
278 if [ "$confirm" = "" ]
284 # GROS SOUCIS : Ou generer le fichier CreaTools-configure.sh?
285 # dans $generationdir/creatools_bin ?
286 # -> il n'est pas encore cree !
287 # dans ./Linux/scripts?
288 # ==> On le genere chez l'utilisateur (no choice!)...
291 configureFile="scripts/CreaTools-configure.sh"
293 echo "#!/bin/bash" > $configureFile
294 echo >> $configureFile
295 echo "#File generated by 'menu.sh'" >> $configureFile
296 echo "#DO NOT edit !" >> $configureFile
297 echo "#(except if you *know* what you do)" >> $configureFile
298 echo >> $configureFile
299 echo "OperatingSystem=$OperatingSystem" >> $configureFile
300 echo "generationdir=$generationdir" >> $configureFile
301 echo "installPrefix=$installPrefix" >> $configureFile
302 echo "installPrefixThird=$installPrefixThird" >> $configureFile
303 echo "docgeneration=$docgeneration" >> $configureFile
304 echo "sourcesFrom=$sourcesFrom" >> $configureFile
305 echo "cvsUserName=$cvsUserName" >> $configureFile
306 echo "loginUserName=$loginUserName" >> $configureFile
307 echo "loginGroupName=$loginGroupName" >> $configureFile
308 echo "buildType=$buildType" >> $configureFile
309 echo "gdcmVersion=$gdcmVersion" >> $configureFile
317 echo "========================== 1 "
318 source scripts/Check-if-root.sh
319 bash scripts/ThirdParty-install.sh
321 if [ "$sourcesFrom" = "CVS" ]
323 echo "----------------------------------------------------------------------"
325 echo "To go on, run again 'bash menu.sh' as '$loginUserName', in a new window"
326 echo "---------------------------------------------------------------------"
328 echo "----------------------------------------------------------------------"
330 echo "To go on, run again 'bash menu.sh' in a new window"
331 echo "---------------------------------------------------------------------"
334 echo "==> Hit any key to exit close current window"
340 echo "========================== 2"
341 bash scripts/CreaTools-load.sh
345 echo "========================== 3"
346 source scripts/CreaTools-configure.sh
348 bash scripts/CreaTools-compile.sh
350 # To allow (*very* aware) user to patch code, later
351 if [ ! -e $generationdir/creatools_source ]
353 echo "You probabely made a mistake : "
354 echo "Directory $loginUserName $generationdir/creatools_source not found"
355 echo "Make sure you know the mistake"
356 echo "Hit any key to continue"
357 echo "Fix the mistake!"
360 chown -R $loginUserName $generationdir/creatools_source
361 chgrp -R $loginGroupName $generationdir/creatools_source
362 # Too much time consuming
363 #chown -R $loginUserName $generationdir/creatools_source
364 #chgrp -R $loginGroupName $generationdir/creatools_source
374 # echo "==================================================="
377 # echo "YOU NEED TO RUN THIS ONE AS root"
378 # echo "==================================================="
384 echo "========================= 4"
385 bash scripts/CreaTools-install.sh
390 # echo "You HAVE to leave current window to continue!"
392 # echo "==> Hit any key to close current window"
396 echo "You HAVE to leave current window to continue!"
402 echo "========================= 5"
403 bash scripts/CreaTools-uninstall.sh
405 echo "==> Hit any key to go on"
411 echo "==================================="
414 echo "==> Hit any key to go on"
420 echo "==================================="
422 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
423 # if user configured without installing third party library,
424 # Last third party library is still in use! JPR
427 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
431 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
432 grep "installPrefixThird=" /etc/bashrc
433 echo "VTK_DIR :...." $VTK_DIR
434 echo "ITK_DIR :...." $ITK_DIR
435 echo "GDCM_DIR :..." $GDCM_DIR
437 echo "installPrefixThird ... " $installPrefixThird
440 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
442 echo $installPrefixThird/share/creatools_third_party_library_config.sh
444 more $installPrefixThird/share/creatools_third_party_library_config.sh
450 if [ -f $installPrefix/share/creatools_base_library_config.sh ]
452 echo $installPrefix/share/creatools_base_library_config.sh
454 more $installPrefix/share/creatools_base_library_config.sh
457 echo "installPrefix ... " $installPrefix
460 echo "VTK_DIR :...." $VTK_DIR
461 echo "ITK_DIR :...." $ITK_DIR
462 echo "GDCM_DIR :..." $GDCM_DIR
463 echo "CREA_DIR :...................." $CREA_DIR
464 echo "BBTK_DIR :...................." $BBTK_DIR
465 echo "CREAMARACASVISU_DIR :........." $CREAMARACASVISU_DIR
466 echo "CREAENVIRONMENT_DIR :........." $CREAENVIRONMENT_DIR
467 echo "CREABRUKER_DIR :.............." $CREABRUKER_DIR
468 echo "CREAIMAGEIO_DIR :............." $CREAIMAGEIO_DIR
469 echo "CREACONTOUR_DIR :............." $CREACONTOUR_DIR
470 echo "CREARIGIDREGISTRATION_DIR :..." $CREAIGIDREGISTRATION_DIR
471 echo "CREABTKGEDITOR_DIR :.........." $CREABTKGEDITOR_DIR
472 echo "CREATOOLS_DIR :..............." $CREATOOLS_DIR
474 echo "==================================="
476 echo "Press any key to continue"
486 echo "Your answer must be in {0, 1, 2, 3, 4, 5, 7, 8, 9} (was [ $i ])"