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 " Show some Environment Variables ...8"
27 echo " Exit :.............................9"
32 echo "Type in your choice :"
39 #ls -l scripts/CreaTools-configure.sh
40 if [ -f scripts/CreaTools-configure.sh ]
42 while [[ "$suitable" != "YES" && \
43 "$suitable" != "NO" ]]
45 echo "'Configure' already done : "
46 echo "------------------------"
47 more scripts/CreaTools-configure.sh
48 echo "------------------------"
50 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
51 # if user configured without installing third party library,
52 # Last third party library is still in use! JPR
53 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
57 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
58 grep "installPrefixThird=" /etc/bashrc
59 echo "VTK_DIR :...." $VTK_DIR
60 echo "ITK_DIR :...." $ITK_DIR
61 echo "GDCM_DIR :..." $GDCM_DIR
62 echo "(Have a look at /etc/bashrc, edit it or run again Install Third Party Libraries if you disagree)"
65 echo "Are these values suitable for you : YES/NO? (default is YES)"
67 if [ "$suitable" = "" ]
76 if [ "$suitable" = "YES" ]
78 source scripts/CreaTools-configure.sh
81 # if [ "$suitable" = "NO" || "$suitable" = "N" || "$suitable" = "no" || "$suitable" = "n" ]
82 if [ "$suitable" = "NO" ]
92 while [ "$confirm" != "YES" ]
97 while [[ "$OperatingSystem" != "Fedora" && \
98 "$OperatingSystem" != "Ubuntu" && \
100 "$OperatingSystem" != "MacOS" ]]
102 echo "Operating System : Fedora/Ubuntu/MacOS (default :Fedora!)"
104 if [ "$OperatingSystem" = "" ]
106 OperatingSystem="Fedora"
109 echo "you said : [" $OperatingSystem "]"
114 echo "Name of the Generation Directory (default is /tmp/myGenerationDir)"
116 if [ "$generationdir" = "" ]
118 generationdir="/tmp/myGenerationDir"
120 echo "you said : [" $generationdir "]"
125 installPrefixThird="___"
126 echo "Install Prefix For Third Party Library : '$generationdir/thirdparty_install' / '/usr/local' (default is '$generationdir/thirdparty_install')"
127 read installPrefixThird
128 if [ "$installPrefixThird" = "" ]
130 installPrefixThird="$generationdir/thirdparty_install"
132 echo "you said : [" $installPrefixThird "]"
139 echo "Install Prefix for CreaTools : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
141 if [ "$installPrefix" = "" ]
143 installPrefix="$generationdir/creatools_install"
145 echo "you said : [" $installPrefix "]"
151 while [[ "$docgeneration" != "YES" && "$docgeneration" != "NO" ]]
153 echo "Boolean For Doc Generation : YES/NO (default is NO)"
155 if [ "$docgeneration" = "" ]
159 echo "you said : [" $docgeneration "]"
166 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
168 echo "Where do you want to get source files from : CVS/HTML (default is CVS)"
170 if [ "$sourcesFrom" = "" ]
174 echo "you said : [" $sourcesFrom "]"
181 if [ "$sourcesFrom" = "CVS" ]
183 while [ "$cvsUserName" == "" ]
185 echo "CVS User Name (mandatory!)"
188 echo "you said : [" $cvsUserName "]"
190 cvsUserName="ForgetThisOne"
198 while [ "$loginUserName" == "" ]
200 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
202 echo "Login User Name (mandatory!)"
204 echo "you said : [" $loginUserName "]"
210 while [ "$loginGroupName" == "" ]
212 #echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
213 #echo "Login Group Name (mandatory!)"
214 echo "Login Group Name (mandatory!)"
216 echo "you said : [" $loginGroupName "]"
223 while [[ "$buildType" != "Release" && "$Debug " != "HTML" ]]
225 echo "Build type : Release/Debug (default is Release)"
227 if [ "$buildType" = "" ]
231 echo "you said : [" $buildType "]"
238 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
240 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
242 if [ "$gdcmVersion" = "" ]
246 echo "you said : [" $gdcmVersion "]"
253 echo " Operating System : $OperatingSystem"
254 echo " Name of the Generation Directory : $generationdir"
255 echo " Install Prefix for Third Party Libraries : $installPrefixThird"
256 echo " Install Prefix for CreaTools : $installPrefix"
257 echo " Boolean for Doc Generation : $docgeneration"
258 echo " Where do you want to get source files from : $sourcesFrom"
259 if [ $sourcesFrom = CVS ]
261 echo " CVS User Name : $cvsUserName"
263 echo " Login User Name : $loginUserName"
264 echo " Login Group Name : $loginGroupName"
265 echo " Build type : $buildType"
266 echo " Gdcm version : $gdcmVersion"
270 echo "Do you confirm your choices : YES/NO ? (default is YES)"
272 if [ "$confirm" = "" ]
278 # GROS SOUCIS : Ou generer le fichier CreaTools-configure.sh?
279 # dans $generationdir/creatools_bin ?
280 # -> il n'est pas encore cree !
281 # dans ./Linux/scripts?
284 configureFile="scripts/CreaTools-configure.sh"
286 echo "#!/bin/sh" > $configureFile
287 echo >> $configureFile
288 echo "#File generated by 'menu.sh'" >> $configureFile
289 echo "#DO NOT edit !" >> $configureFile
290 echo "#(except if you *know* what you do)" >> $configureFile
291 echo >> $configureFile
292 echo "OperatingSystem=$OperatingSystem" >> $configureFile
293 echo "generationdir=$generationdir" >> $configureFile
294 echo "installPrefix=$installPrefix" >> $configureFile
295 echo "installPrefixThird=$installPrefixThird" >> $configureFile
296 echo "docgeneration=$docgeneration" >> $configureFile
297 echo "sourcesFrom=$sourcesFrom" >> $configureFile
298 echo "cvsUserName=$cvsUserName" >> $configureFile
299 echo "loginUserName=$loginUserName" >> $configureFile
300 echo "loginGroupName=$loginGroupName" >> $configureFile
301 echo "buildType=$buildType" >> $configureFile
302 echo "gdcmVersion=$gdcmVersion" >> $configureFile
311 echo "========================== 1 "
312 source scripts/Check-if-root.sh
313 sh scripts/ThirdParty-install.sh
316 # while [ "$vtkdirVariable" = "" ]
318 # while [ ! -e "$vtkdirVariable" ]
321 # echo " --------------------------------"
322 # echo " Set VTK_DIR environment variable"
323 # echo " --------------------------------"
325 # # #read vtkdirVariable
326 # if [ ! -e "$vtkdirVariable" ]
328 # # echo $vtkdirVariable is NOT a valid directory
332 # echo "you said [" $vtkdirVariable "]"
335 #while [ "$vtkdirVariable" = "" ]
337 # echo " Set VTK_DIR environment variable"
338 # read vtkdirVariable
340 #echo "you said [" $vtkdirVariable "]"
342 # latexCompilerVariable=""
343 # while [ "$latexCompilerVariable" = "" ]
345 # while [ ! -f "$latexCompilerVariable" ]
348 # # echo " ---------------------------------------"
349 # echo " Set LATEX_COMPILER environment variable"
350 # # echo " ---------------------------------------"
352 # read latexCompilerVariable
353 # if [ ! -e "$latexCompilerVariable" ]
355 # echo $latexCompilerVariable is NOT a valid file
359 # echo "you said [" $latexCompilerVariable "]"
361 # sed -i -e '/.*VTK_DIR*/ d' /etc/bashrc
362 # sed -i -e '/.*LATEX_COMPILER*/ d' /etc/bashrc
363 # echo "export VTK_DIR=$vtkdirVariable" >> /etc/bashrc
364 # echo "export LATEX_COMPILER=$latexCompilerVariable" >> /etc/bashrc
366 if [ "$sourcesFrom" = "CVS" ]
368 echo "----------------------------------------------------------------------"
370 echo "To go on, run again 'sh menu.sh' as '$loginUserName', in a new window"
371 echo "---------------------------------------------------------------------"
374 echo "----------------------------------------------------------------------"
376 echo "To go on, run again 'sh menu.sh' in a new window"
377 echo "---------------------------------------------------------------------"
386 echo "========================== 2"
387 sh scripts/CreaTools-load.sh
391 echo "========================== 3"
392 source scripts/CreaTools-configure.sh
393 sh scripts/CreaTools-compile.sh
395 # To allow (*very* aware) user to patch code, later
397 chown -R $loginUserName $generationdir/creatools_source
398 chgrp -R $loginGroupName $generationdir/creatools_source
399 # Too much time consuming
400 #chown -R $loginUserName $generationdir/creatools_source
401 #chgrp -R $loginGroupName $generationdir/creatools_source
409 echo "==================================================="
412 echo "YOU NEED TO RUN THIS ONE AS root"
413 echo "==================================================="
418 echo "========================= 4"
419 sh scripts/CreaTools-install.sh
423 echo "========================= 5"
424 sh scripts/CreaTools-uninstall.sh
430 echo "==================================="
432 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
433 # if user configured without installing third party library,
434 # Last third party library is still in use! JPR
437 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
441 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
442 grep "installPrefixThird=" /etc/bashrc
443 echo "VTK_DIR :...." $VTK_DIR
444 echo "ITK_DIR :...." $ITK_DIR
445 echo "GDCM_DIR :..." $GDCM_DIR
448 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
450 echo $installPrefixThird/share/creatools_third_party_library_config.sh
452 more $installPrefixThird/share/creatools_third_party_library_config.sh
458 if [ -f $installPrefix/share/creatools_base_library_config.sh ]
460 echo $installPrefix/share/creatools_base_library_config.sh
462 more $installPrefix/share/creatools_base_library_config.sh
465 echo "==================================="
467 echo "Press any key to continue"
477 echo "Your answer must be in {0, 1, 2, 3, 4, 5, 9} (was [ $i ])"