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 ]
67 echo "You are probabely running under UBUNTU OS ?"
68 echo "Troubles expected! (Hope NO!)"
70 echo "Hit any key to continue"
72 echo export ETC_BASHRC="/etc/bash.bashrc"
74 echo export ETC_BASHRC="/etc/bashrc"
76 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
78 grep "installPrefixThird=" $ETC_BASHRC
79 echo "VTK_DIR :...." $VTK_DIR
80 echo "ITK_DIR :...." $ITK_DIR
81 echo "GDCM_DIR :..." $GDCM_DIR
82 echo "(Have a look at $ETC_BASHRC=, edit it or run again Install Third Party Libraries if you disagree)"
85 echo "Are these values suitable for you : YES/NO? (default is YES)"
87 if [ "$suitable" = "" ]
96 if [[ "$suitable" = "YES" || "$suitable" = "Y" || "$suitable" = "yes" || "$suitable" = "y" ]]
98 source scripts/CreaTools-configure.sh
101 if [[ "$suitable" = "NO" || "$suitable" = "N" || "$suitable" = "no" || "$suitable" = "n" ]]
102 #if [ "$suitable" = "NO" ]
107 while [ "$confirm" != "YES" ]
110 OperatingSystem="XXX"
111 while [[ "$OperatingSystem" != "Fedora" && \
112 "$OperatingSystem" != "Ubuntu" && \
113 "$OperatingSystem" != "MacOS" ]]
115 echo "Operating System : Fedora/Ubuntu/MacOS (default : Fedora)"
117 if [ "$OperatingSystem" = "" ]
119 OperatingSystem="Fedora"
122 echo "you said : [" $OperatingSystem "]"
127 echo "Name of the Generation Directory (default is /tmp/myGenerationDir)"
129 if [ "$generationdir" = "" ]
131 generationdir="/tmp/myGenerationDir"
133 echo "you said : [" $generationdir "]"
138 installPrefixThird="___"
139 echo "Install Prefix For Third Party Library : '$generationdir/thirdparty_install' / '/usr/local' (default is '$generationdir/thirdparty_install')"
140 read installPrefixThird
141 if [ "$installPrefixThird" = "" ]
143 installPrefixThird="$generationdir/thirdparty_install"
145 echo "you said : [" $installPrefixThird "]"
151 echo "Install Prefix for CreaTools : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
153 if [ "$installPrefix" = "" ]
155 installPrefix="$generationdir/creatools_install"
157 echo "you said : [" $installPrefix "]"
163 while [[ "$docgeneration" != "ON" && "$docgeneration" != "OFF" ]]
165 echo "Boolean For Doc Generation : ON/OFF (default is OFF)"
167 if [ "$docgeneration" = "" ]
171 echo "you said : [" $docgeneration "]"
178 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
180 echo "Where do you want to get source files from : CVS/HTML (default is CVS)"
182 if [ "$sourcesFrom" = "" ]
186 echo "you said : [" $sourcesFrom "]"
193 if [ "$sourcesFrom" = "CVS" ]
195 while [ "$cvsUserName" == "" ]
197 echo "CVS User Name (mandatory!)"
200 echo "you said : [" $cvsUserName "]"
202 cvsUserName="ForgetThisOne"
210 while [ "$loginUserName" == "" ]
212 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
214 echo "Login User Name (mandatory!)"
216 echo "you said : [" $loginUserName "]"
222 while [ "$loginGroupName" == "" ]
224 #echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
225 #echo "Login Group Name (mandatory!)"
226 echo "Login Group Name (mandatory!)"
228 echo "you said : [" $loginGroupName "]"
235 while [[ "$buildType" != "Release" && "$buildType" != "Debug" ]]
237 echo "Build type : Release/Debug (default is Release)"
239 if [ "$buildType" = "" ]
243 echo "you said : [" $buildType "]"
250 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
252 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
254 if [ "$gdcmVersion" = "" ]
258 echo "you said : [" $gdcmVersion "]"
265 echo " Operating System : $OperatingSystem"
266 echo " Name of the Generation Directory : $generationdir"
267 echo " Install Prefix for Third Party Libraries : $installPrefixThird"
268 echo " Install Prefix for CreaTools : $installPrefix"
269 echo " Boolean for Doc Generation : $docgeneration"
270 echo " Where do you want to get source files from : $sourcesFrom"
271 if [ $sourcesFrom = CVS ]
273 echo " CVS User Name : $cvsUserName"
275 echo " Login User Name : $loginUserName"
276 echo " Login Group Name : $loginGroupName"
277 echo " Build type : $buildType"
278 echo " Gdcm version : $gdcmVersion"
282 echo "Do you confirm your choices : YES/NO ? (default is YES)"
284 if [ "$confirm" = "" ]
290 # GROS SOUCIS : Ou generer le fichier CreaTools-configure.sh?
291 # dans $generationdir/creatools_bin ?
292 # -> il n'est pas encore cree !
293 # dans ./Linux/scripts?
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
323 echo "========================== 1 "
324 source scripts/Check-if-root.sh
325 bash scripts/ThirdParty-install.sh
328 # while [ "$vtkdirVariable" = "" ]
330 # while [ ! -e "$vtkdirVariable" ]
333 # echo " --------------------------------"
334 # echo " Set VTK_DIR environment variable"
335 # echo " --------------------------------"
337 # # #read vtkdirVariable
338 # if [ ! -e "$vtkdirVariable" ]
340 # # echo $vtkdirVariable is NOT a valid directory
344 # echo "you said [" $vtkdirVariable "]"
347 #while [ "$vtkdirVariable" = "" ]
349 # echo " Set VTK_DIR environment variable"
350 # read vtkdirVariable
352 #echo "you said [" $vtkdirVariable "]"
354 # latexCompilerVariable=""
355 # while [ "$latexCompilerVariable" = "" ]
357 # while [ ! -f "$latexCompilerVariable" ]
360 # # echo " ---------------------------------------"
361 # echo " Set LATEX_COMPILER environment variable"
362 # # echo " ---------------------------------------"
364 # read latexCompilerVariable
365 # if [ ! -e "$latexCompilerVariable" ]
367 # echo $latexCompilerVariable is NOT a valid file
371 # echo "you said [" $latexCompilerVariable "]"
373 # sed -i -e '/.*VTK_DIR*/ d' $ETC_BASHRC
374 # sed -i -e '/.*LATEX_COMPILER*/ d' $ETC_BASHRC
375 # echo "export VTK_DIR=$vtkdirVariable" >> $ETC_BASHRC
376 # echo "export LATEX_COMPILER=$latexCompilerVariable" >> $ETC_BASHRC
378 if [ "$sourcesFrom" = "CVS" ]
380 echo "----------------------------------------------------------------------"
382 echo "To go on, run again 'bash menu.sh' as '$loginUserName', in a new window"
383 echo "---------------------------------------------------------------------"
385 echo "----------------------------------------------------------------------"
387 echo "To go on, run again 'bash menu.sh' in a new window"
388 echo "---------------------------------------------------------------------"
391 echo "==> Hit any key to exit close current window"
399 echo "========================== 2"
400 bash scripts/CreaTools-load.sh
404 echo "========================== 3"
405 source scripts/CreaTools-configure.sh
406 bash scripts/CreaTools-compile.sh
408 # To allow (*very* aware) user to patch code, later
410 chown -R $loginUserName $generationdir/creatools_source
411 chgrp -R $loginGroupName $generationdir/creatools_source
412 # Too much time consuming
413 #chown -R $loginUserName $generationdir/creatools_source
414 #chgrp -R $loginGroupName $generationdir/creatools_source
422 echo "==================================================="
425 echo "YOU NEED TO RUN THIS ONE AS root"
426 echo "==================================================="
431 echo "========================= 4"
432 bash scripts/CreaTools-install.sh
434 echo "==> Hit any key to close current window"
440 echo "========================= 5"
441 bash scripts/CreaTools-uninstall.sh
446 echo "==================================="
449 echo "==> Hit any key to go on"
455 echo "==================================="
457 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
458 # if user configured without installing third party library,
459 # Last third party library is still in use! JPR
462 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
466 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
467 grep "installPrefixThird=" /etc/bashrc
468 echo "VTK_DIR :...." $VTK_DIR
469 echo "ITK_DIR :...." $ITK_DIR
470 echo "GDCM_DIR :..." $GDCM_DIR
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 "==================================="
492 echo "Press any key to continue"
502 echo "Your answer must be in {0, 1, 2, 3, 4, 5, 9} (was [ $i ])"