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
61 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
65 if [ ! -f /etc/bashrc ]
68 echo "You are probabely running under UBUNTU OS ?"
69 echo "Troubles expected! (Hope NO!)"
71 echo "Hit any key to continue"
73 echo export ETC_BASHRC="/etc/bash.bashrc"
75 echo export ETC_BASHRC="/etc/bashrc"
77 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
79 grep "installPrefixThird=" $ETC_BASHRC
80 echo "VTK_DIR :...." $VTK_DIR
81 echo "ITK_DIR :...." $ITK_DIR
82 echo "GDCM_DIR :..." $GDCM_DIR
83 echo "(Have a look at $ETC_BASHRC=, edit it or run again Install Third Party Libraries if you disagree)"
86 echo "Are these values suitable for you : YES/NO? (default is YES)"
88 if [ "$suitable" = "" ]
97 if [[ "$suitable" = "YES" || "$suitable" = "Y" || "$suitable" = "yes" || "$suitable" = "y" ]]
99 source scripts/CreaTools-configure.sh
102 if [[ "$suitable" = "NO" || "$suitable" = "N" || "$suitable" = "no" || "$suitable" = "n" ]]
103 #if [ "$suitable" = "NO" ]
108 while [ "$confirm" != "YES" ]
111 OperatingSystem="XXX"
112 while [[ "$OperatingSystem" != "Fedora" && \
113 "$OperatingSystem" != "Ubuntu" && \
114 "$OperatingSystem" != "MacOS" ]]
116 echo "Operating System : Fedora/Ubuntu/MacOS (default : Fedora)"
118 if [ "$OperatingSystem" = "" ]
120 OperatingSystem="Fedora"
123 echo "you said : [" $OperatingSystem "]"
128 echo "Name of the Generation Directory (default is /tmp/myGenerationDir)"
130 if [ "$generationdir" = "" ]
132 generationdir="/tmp/myGenerationDir"
134 echo "you said : [" $generationdir "]"
139 installPrefixThird="___"
140 echo "Install Prefix For Third Party Library : '$generationdir/thirdparty_install' / '/usr/local' (default is '$generationdir/thirdparty_install')"
141 read installPrefixThird
142 if [ "$installPrefixThird" = "" ]
144 installPrefixThird="$generationdir/thirdparty_install"
146 echo "you said : [" $installPrefixThird "]"
153 echo "Install Prefix for CreaTools : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
155 if [ "$installPrefix" = "" ]
157 installPrefix="$generationdir/creatools_install"
159 echo "you said : [" $installPrefix "]"
165 while [[ "$docgeneration" != "ON" && "$docgeneration" != "OFF" ]]
167 echo "Boolean For Doc Generation : ON/OFF (default is OFF)"
169 if [ "$docgeneration" = "" ]
173 echo "you said : [" $docgeneration "]"
180 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
182 echo "Where do you want to get source files from : CVS/HTML (default is CVS)"
184 if [ "$sourcesFrom" = "" ]
188 echo "you said : [" $sourcesFrom "]"
195 if [ "$sourcesFrom" = "CVS" ]
197 while [ "$cvsUserName" == "" ]
199 echo "CVS User Name (mandatory!)"
202 echo "you said : [" $cvsUserName "]"
204 cvsUserName="ForgetThisOne"
212 while [ "$loginUserName" == "" ]
214 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
216 echo "Login User Name (mandatory!)"
218 echo "you said : [" $loginUserName "]"
224 while [ "$loginGroupName" == "" ]
226 #echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
227 #echo "Login Group Name (mandatory!)"
228 echo "Login Group Name (mandatory!)"
230 echo "you said : [" $loginGroupName "]"
237 while [[ "$buildType" != "Release" && "$buildType" != "Debug" ]]
239 echo "Build type : Release/Debug (default is Release)"
241 if [ "$buildType" = "" ]
245 echo "you said : [" $buildType "]"
252 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
254 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
256 if [ "$gdcmVersion" = "" ]
260 echo "you said : [" $gdcmVersion "]"
267 echo " Operating System : $OperatingSystem"
268 echo " Name of the Generation Directory : $generationdir"
269 echo " Install Prefix for Third Party Libraries : $installPrefixThird"
270 echo " Install Prefix for CreaTools : $installPrefix"
271 echo " Boolean for Doc Generation : $docgeneration"
272 echo " Where do you want to get source files from : $sourcesFrom"
273 if [ $sourcesFrom = CVS ]
275 echo " CVS User Name : $cvsUserName"
277 echo " Login User Name : $loginUserName"
278 echo " Login Group Name : $loginGroupName"
279 echo " Build type : $buildType"
280 echo " Gdcm version : $gdcmVersion"
284 echo "Do you confirm your choices : YES/NO ? (default is YES)"
286 if [ "$confirm" = "" ]
292 # GROS SOUCIS : Ou generer le fichier CreaTools-configure.sh?
293 # dans $generationdir/creatools_bin ?
294 # -> il n'est pas encore cree !
295 # dans ./Linux/scripts?
298 configureFile="scripts/CreaTools-configure.sh"
300 echo "#!/bin/bash" > $configureFile
301 echo >> $configureFile
302 echo "#File generated by 'menu.sh'" >> $configureFile
303 echo "#DO NOT edit !" >> $configureFile
304 echo "#(except if you *know* what you do)" >> $configureFile
305 echo >> $configureFile
306 echo "OperatingSystem=$OperatingSystem" >> $configureFile
307 echo "generationdir=$generationdir" >> $configureFile
308 echo "installPrefix=$installPrefix" >> $configureFile
309 echo "installPrefixThird=$installPrefixThird" >> $configureFile
310 echo "docgeneration=$docgeneration" >> $configureFile
311 echo "sourcesFrom=$sourcesFrom" >> $configureFile
312 echo "cvsUserName=$cvsUserName" >> $configureFile
313 echo "loginUserName=$loginUserName" >> $configureFile
314 echo "loginGroupName=$loginGroupName" >> $configureFile
315 echo "buildType=$buildType" >> $configureFile
316 echo "gdcmVersion=$gdcmVersion" >> $configureFile
325 echo "========================== 1 "
326 source scripts/Check-if-root.sh
327 bash scripts/ThirdParty-install.sh
330 # while [ "$vtkdirVariable" = "" ]
332 # while [ ! -e "$vtkdirVariable" ]
335 # echo " --------------------------------"
336 # echo " Set VTK_DIR environment variable"
337 # echo " --------------------------------"
339 # # #read vtkdirVariable
340 # if [ ! -e "$vtkdirVariable" ]
342 # # echo $vtkdirVariable is NOT a valid directory
346 # echo "you said [" $vtkdirVariable "]"
349 #while [ "$vtkdirVariable" = "" ]
351 # echo " Set VTK_DIR environment variable"
352 # read vtkdirVariable
354 #echo "you said [" $vtkdirVariable "]"
356 # latexCompilerVariable=""
357 # while [ "$latexCompilerVariable" = "" ]
359 # while [ ! -f "$latexCompilerVariable" ]
362 # # echo " ---------------------------------------"
363 # echo " Set LATEX_COMPILER environment variable"
364 # # echo " ---------------------------------------"
366 # read latexCompilerVariable
367 # if [ ! -e "$latexCompilerVariable" ]
369 # echo $latexCompilerVariable is NOT a valid file
373 # echo "you said [" $latexCompilerVariable "]"
375 # sed -i -e '/.*VTK_DIR*/ d' $ETC_BASHRC
376 # sed -i -e '/.*LATEX_COMPILER*/ d' $ETC_BASHRC
377 # echo "export VTK_DIR=$vtkdirVariable" >> $ETC_BASHRC
378 # echo "export LATEX_COMPILER=$latexCompilerVariable" >> $ETC_BASHRC
380 if [ "$sourcesFrom" = "CVS" ]
382 echo "----------------------------------------------------------------------"
384 echo "To go on, run again 'bash menu.sh' as '$loginUserName', in a new window"
385 echo "---------------------------------------------------------------------"
387 echo "----------------------------------------------------------------------"
389 echo "To go on, run again 'bash menu.sh' in a new window"
390 echo "---------------------------------------------------------------------"
393 echo "==> Hit any key to exit close current window"
401 echo "========================== 2"
402 bash scripts/CreaTools-load.sh
406 echo "========================== 3"
407 source scripts/CreaTools-configure.sh
408 bash scripts/CreaTools-compile.sh
410 # To allow (*very* aware) user to patch code, later
412 chown -R $loginUserName $generationdir/creatools_source
413 chgrp -R $loginGroupName $generationdir/creatools_source
414 # Too much time consuming
415 #chown -R $loginUserName $generationdir/creatools_source
416 #chgrp -R $loginGroupName $generationdir/creatools_source
424 echo "==================================================="
427 echo "YOU NEED TO RUN THIS ONE AS root"
428 echo "==================================================="
433 echo "========================= 4"
434 bash scripts/CreaTools-install.sh
436 echo "==> Hit any key to close current window"
442 echo "========================= 5"
443 bash scripts/CreaTools-uninstall.sh
448 echo "==================================="
451 echo "==> Hit any key to go on"
457 echo "==================================="
459 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
460 # if user configured without installing third party library,
461 # Last third party library is still in use! JPR
464 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
468 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
469 grep "installPrefixThird=" /etc/bashrc
470 echo "VTK_DIR :...." $VTK_DIR
471 echo "ITK_DIR :...." $ITK_DIR
472 echo "GDCM_DIR :..." $GDCM_DIR
475 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
477 echo $installPrefixThird/share/creatools_third_party_library_config.sh
479 more $installPrefixThird/share/creatools_third_party_library_config.sh
485 if [ -f $installPrefix/share/creatools_base_library_config.sh ]
487 echo $installPrefix/share/creatools_base_library_config.sh
489 more $installPrefix/share/creatools_base_library_config.sh
492 echo "==================================="
494 echo "Press any key to continue"
504 echo "Your answer must be in {0, 1, 2, 3, 4, 5, 9} (was [ $i ])"