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" != "NO" ]]
46 echo "'Configure' already done : "
47 echo "------------------------"
48 more scripts/CreaTools-configure.sh
49 echo "------------------------"
51 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
52 # if user configured without installing third party library,
53 # Last third party library is still in use! JPR
54 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
58 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
59 grep "installPrefixThird=" /etc/bashrc
60 echo "VTK_DIR :...." $VTK_DIR
61 echo "ITK_DIR :...." $ITK_DIR
62 echo "GDCM_DIR :..." $GDCM_DIR
63 echo "(Have a look at /etc/bashrc, edit it or run again Install Third Party Libraries if you disagree)"
66 echo "Are these values suitable for you : YES/NO? (default is YES)"
68 if [ "$suitable" = "" ]
77 if [ "$suitable" = "YES" ]
79 source scripts/CreaTools-configure.sh
82 # if [ "$suitable" = "NO" || "$suitable" = "N" || "$suitable" = "no" || "$suitable" = "n" ]
83 if [ "$suitable" = "NO" ]
89 while [ "$confirm" != "YES" ]
94 while [[ "$OperatingSystem" != "Fedora" && \
95 "$OperatingSystem" != "Ubuntu" && \
97 "$OperatingSystem" != "MacOS" ]]
99 echo "Operating System : Fedora/Ubuntu/MacOS (default : Fedora)"
101 if [ "$OperatingSystem" = "" ]
103 OperatingSystem="Fedora"
106 echo "you said : [" $OperatingSystem "]"
111 echo "Name of the Generation Directory (default is /tmp/myGenerationDir)"
113 if [ "$generationdir" = "" ]
115 generationdir="/tmp/myGenerationDir"
117 echo "you said : [" $generationdir "]"
122 installPrefixThird="___"
123 echo "Install Prefix For Third Party Library : '$generationdir/thirdparty_install' / '/usr/local' (default is '$generationdir/thirdparty_install')"
124 read installPrefixThird
125 if [ "$installPrefixThird" = "" ]
127 installPrefixThird="$generationdir/thirdparty_install"
129 echo "you said : [" $installPrefixThird "]"
136 echo "Install Prefix for CreaTools : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
138 if [ "$installPrefix" = "" ]
140 installPrefix="$generationdir/creatools_install"
142 echo "you said : [" $installPrefix "]"
148 while [[ "$docgeneration" != "ON" && "$docgeneration" != "OFF" ]]
150 echo "Boolean For Doc Generation : ON/OFF (default is OFF)"
152 if [ "$docgeneration" = "" ]
156 echo "you said : [" $docgeneration "]"
163 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
165 echo "Where do you want to get source files from : CVS/HTML (default is CVS)"
167 if [ "$sourcesFrom" = "" ]
171 echo "you said : [" $sourcesFrom "]"
178 if [ "$sourcesFrom" = "CVS" ]
180 while [ "$cvsUserName" == "" ]
182 echo "CVS User Name (mandatory!)"
185 echo "you said : [" $cvsUserName "]"
187 cvsUserName="ForgetThisOne"
195 while [ "$loginUserName" == "" ]
197 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
199 echo "Login User Name (mandatory!)"
201 echo "you said : [" $loginUserName "]"
207 while [ "$loginGroupName" == "" ]
209 #echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
210 #echo "Login Group Name (mandatory!)"
211 echo "Login Group Name (mandatory!)"
213 echo "you said : [" $loginGroupName "]"
220 while [[ "$buildType" != "Release" && "$buildType" != "Debug" ]]
222 echo "Build type : Release/Debug (default is Release)"
224 if [ "$buildType" = "" ]
228 echo "you said : [" $buildType "]"
235 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
237 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
239 if [ "$gdcmVersion" = "" ]
243 echo "you said : [" $gdcmVersion "]"
250 echo " Operating System : $OperatingSystem"
251 echo " Name of the Generation Directory : $generationdir"
252 echo " Install Prefix for Third Party Libraries : $installPrefixThird"
253 echo " Install Prefix for CreaTools : $installPrefix"
254 echo " Boolean for Doc Generation : $docgeneration"
255 echo " Where do you want to get source files from : $sourcesFrom"
256 if [ $sourcesFrom = CVS ]
258 echo " CVS User Name : $cvsUserName"
260 echo " Login User Name : $loginUserName"
261 echo " Login Group Name : $loginGroupName"
262 echo " Build type : $buildType"
263 echo " Gdcm version : $gdcmVersion"
267 echo "Do you confirm your choices : YES/NO ? (default is YES)"
269 if [ "$confirm" = "" ]
275 # GROS SOUCIS : Ou generer le fichier CreaTools-configure.sh?
276 # dans $generationdir/creatools_bin ?
277 # -> il n'est pas encore cree !
278 # dans ./Linux/scripts?
281 configureFile="scripts/CreaTools-configure.sh"
283 echo "#!/bin/sh" > $configureFile
284 echo >> $configureFile
285 echo "#File generated by 'menu.sh'" >> $configureFile
286 echo "#DO NOT edit !" >> $configureFile
287 echo "#(except if you *know* what you do)" >> $configureFile
288 echo >> $configureFile
289 echo "OperatingSystem=$OperatingSystem" >> $configureFile
290 echo "generationdir=$generationdir" >> $configureFile
291 echo "installPrefix=$installPrefix" >> $configureFile
292 echo "installPrefixThird=$installPrefixThird" >> $configureFile
293 echo "docgeneration=$docgeneration" >> $configureFile
294 echo "sourcesFrom=$sourcesFrom" >> $configureFile
295 echo "cvsUserName=$cvsUserName" >> $configureFile
296 echo "loginUserName=$loginUserName" >> $configureFile
297 echo "loginGroupName=$loginGroupName" >> $configureFile
298 echo "buildType=$buildType" >> $configureFile
299 echo "gdcmVersion=$gdcmVersion" >> $configureFile
308 echo "========================== 1 "
309 source scripts/Check-if-root.sh
310 sh scripts/ThirdParty-install.sh
313 # while [ "$vtkdirVariable" = "" ]
315 # while [ ! -e "$vtkdirVariable" ]
318 # echo " --------------------------------"
319 # echo " Set VTK_DIR environment variable"
320 # echo " --------------------------------"
322 # # #read vtkdirVariable
323 # if [ ! -e "$vtkdirVariable" ]
325 # # echo $vtkdirVariable is NOT a valid directory
329 # echo "you said [" $vtkdirVariable "]"
332 #while [ "$vtkdirVariable" = "" ]
334 # echo " Set VTK_DIR environment variable"
335 # read vtkdirVariable
337 #echo "you said [" $vtkdirVariable "]"
339 # latexCompilerVariable=""
340 # while [ "$latexCompilerVariable" = "" ]
342 # while [ ! -f "$latexCompilerVariable" ]
345 # # echo " ---------------------------------------"
346 # echo " Set LATEX_COMPILER environment variable"
347 # # echo " ---------------------------------------"
349 # read latexCompilerVariable
350 # if [ ! -e "$latexCompilerVariable" ]
352 # echo $latexCompilerVariable is NOT a valid file
356 # echo "you said [" $latexCompilerVariable "]"
358 # sed -i -e '/.*VTK_DIR*/ d' /etc/bashrc
359 # sed -i -e '/.*LATEX_COMPILER*/ d' /etc/bashrc
360 # echo "export VTK_DIR=$vtkdirVariable" >> /etc/bashrc
361 # echo "export LATEX_COMPILER=$latexCompilerVariable" >> /etc/bashrc
363 if [ "$sourcesFrom" = "CVS" ]
365 echo "----------------------------------------------------------------------"
367 echo "To go on, run again 'sh menu.sh' as '$loginUserName', in a new window"
368 echo "---------------------------------------------------------------------"
370 echo "----------------------------------------------------------------------"
372 echo "To go on, run again 'sh menu.sh' in a new window"
373 echo "---------------------------------------------------------------------"
376 echo "==> Hit any key to exit close current window"
384 echo "========================== 2"
385 sh scripts/CreaTools-load.sh
389 echo "========================== 3"
390 source scripts/CreaTools-configure.sh
391 sh scripts/CreaTools-compile.sh
393 # To allow (*very* aware) user to patch code, later
395 chown -R $loginUserName $generationdir/creatools_source
396 chgrp -R $loginGroupName $generationdir/creatools_source
397 # Too much time consuming
398 #chown -R $loginUserName $generationdir/creatools_source
399 #chgrp -R $loginGroupName $generationdir/creatools_source
407 echo "==================================================="
410 echo "YOU NEED TO RUN THIS ONE AS root"
411 echo "==================================================="
416 echo "========================= 4"
417 sh scripts/CreaTools-install.sh
419 echo "==> Hit any key to close current window"
425 echo "========================= 5"
426 sh scripts/CreaTools-uninstall.sh
431 echo "==================================="
434 echo "==> Hit any key to go on"
440 echo "==================================="
442 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
443 # if user configured without installing third party library,
444 # Last third party library is still in use! JPR
447 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
451 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
452 grep "installPrefixThird=" /etc/bashrc
453 echo "VTK_DIR :...." $VTK_DIR
454 echo "ITK_DIR :...." $ITK_DIR
455 echo "GDCM_DIR :..." $GDCM_DIR
458 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
460 echo $installPrefixThird/share/creatools_third_party_library_config.sh
462 more $installPrefixThird/share/creatools_third_party_library_config.sh
468 if [ -f $installPrefix/share/creatools_base_library_config.sh ]
470 echo $installPrefix/share/creatools_base_library_config.sh
472 more $installPrefix/share/creatools_base_library_config.sh
475 echo "==================================="
477 echo "Press any key to continue"
487 echo "Your answer must be in {0, 1, 2, 3, 4, 5, 9} (was [ $i ])"