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
64 echo "Are these values suitable for you : YES/NO? (default is YES)"
66 if [ "$suitable" = "" ]
75 if [ "$suitable" = "YES" ]
77 source scripts/CreaTools-configure.sh
80 # if [ "$suitable" = "NO" || "$suitable" = "N" || "$suitable" = "no" || "$suitable" = "n" ]
81 if [ "$suitable" = "NO" ]
91 while [ "$confirm" != "YES" ]
96 while [[ "$OperatingSystem" != "Fedora" && \
97 "$OperatingSystem" != "Ubuntu" && \
99 "$OperatingSystem" != "MacOS" ]]
101 echo "Operating System : Fedora/Ubuntu/MacOS (default :Fedora!)"
103 if [ "$OperatingSystem" = "" ]
105 OperatingSystem="Fedora"
108 echo "you said : [" $OperatingSystem "]"
113 echo "Name of the Generation Directory (default is /tmp/myGenerationDir)"
115 if [ "$generationdir" = "" ]
117 generationdir="/tmp/myGenerationDir"
119 echo "you said : [" $generationdir "]"
124 installPrefixThird="___"
125 echo "Install Prefix For Third Party Library : '$generationdir/thirdparty_install' / '/usr/local' (default is '$generationdir/thirdparty_install')"
126 read installPrefixThird
127 if [ "$installPrefixThird" = "" ]
129 installPrefixThird="$generationdir/thirdparty_install"
131 echo "you said : [" $installPrefixThird "]"
138 echo "Install Prefix for CreaTools : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
140 if [ "$installPrefix" = "" ]
142 installPrefix="$generationdir/creatools_install"
144 echo "you said : [" $installPrefix "]"
150 while [[ "$docgeneration" != "YES" && "$docgeneration" != "NO" ]]
152 echo "Boolean For Doc Generation : YES/NO (default is NO)"
154 if [ "$docgeneration" = "" ]
158 echo "you said : [" $docgeneration "]"
165 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
167 echo "Where do you want to get source files from : CVS/HTML (default is CVS)"
169 if [ "$sourcesFrom" = "" ]
173 echo "you said : [" $sourcesFrom "]"
180 if [ "$sourcesFrom" = "CVS" ]
182 while [ "$cvsUserName" == "" ]
184 echo "CVS User Name (mandatory!)"
187 echo "you said : [" $cvsUserName "]"
189 cvsUserName="ForgetThisOne"
197 while [ "$loginUserName" == "" ]
199 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
201 echo "Login User Name (mandatory!)"
203 echo "you said : [" $loginUserName "]"
209 while [ "$loginGroupName" == "" ]
211 #echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
212 #echo "Login Group Name (mandatory!)"
213 echo "Login Group Name (mandatory!)"
215 echo "you said : [" $loginGroupName "]"
222 while [[ "$buildType" != "Release" && "$Debug " != "HTML" ]]
224 echo "Build type : Release/Debug (default is Release)"
226 if [ "$buildType" = "" ]
230 echo "you said : [" $buildType "]"
237 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
239 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
241 if [ "$gdcmVersion" = "" ]
245 echo "you said : [" $gdcmVersion "]"
252 echo " Operating System : $OperatingSystem"
253 echo " Name of the Generation Directory : $generationdir"
254 echo " Install Prefix for Third Party Libraries : $installPrefixThird"
255 echo " Install Prefix for CreaTools : $installPrefix"
256 echo " Boolean for Doc Generation : $docgeneration"
257 echo " Where do you want to get source files from : $sourcesFrom"
258 if [ $sourcesFrom = CVS ]
260 echo " CVS User Name : $cvsUserName"
262 echo " Login User Name : $loginUserName"
263 echo " Login Group Name : $loginGroupName"
264 echo " Build type : $buildType"
265 echo " Gdcm version : $gdcmVersion"
269 echo "Do you confirm your choices : YES/NO ? (default is YES)"
271 if [ "$confirm" = "" ]
277 # GROS SOUCIS : Ou generer le fichier CreaTools-configure.sh?
278 # dans $generationdir/creatools_bin ?
279 # -> il n'est pas encore cree !
280 # dans ./Linux/scripts?
283 configureFile="scripts/CreaTools-configure.sh"
285 echo "#!/bin/sh" > $configureFile
286 echo >> $configureFile
287 echo "#File generated by 'menu.sh'" >> $configureFile
288 echo "#DO NOT edit !" >> $configureFile
289 echo "#(except if you *know* what you do)" >> $configureFile
290 echo >> $configureFile
291 echo "OperatingSystem=$OperatingSystem" >> $configureFile
292 echo "generationdir=$generationdir" >> $configureFile
293 echo "installPrefix=$installPrefix" >> $configureFile
294 echo "installPrefixThird=$installPrefixThird" >> $configureFile
295 echo "docgeneration=$docgeneration" >> $configureFile
296 echo "sourcesFrom=$sourcesFrom" >> $configureFile
297 echo "cvsUserName=$cvsUserName" >> $configureFile
298 echo "loginUserName=$loginUserName" >> $configureFile
299 echo "loginGroupName=$loginGroupName" >> $configureFile
300 echo "buildType=$buildType" >> $configureFile
301 echo "gdcmVersion=$gdcmVersion" >> $configureFile
310 echo "========================== 1 "
311 source scripts/Check-if-root.sh
312 sh scripts/ThirdParty-install.sh
315 # while [ "$vtkdirVariable" = "" ]
317 # while [ ! -e "$vtkdirVariable" ]
320 # echo " --------------------------------"
321 # echo " Set VTK_DIR environment variable"
322 # echo " --------------------------------"
324 # # #read vtkdirVariable
325 # if [ ! -e "$vtkdirVariable" ]
327 # # echo $vtkdirVariable is NOT a valid directory
331 # echo "you said [" $vtkdirVariable "]"
334 #while [ "$vtkdirVariable" = "" ]
336 # echo " Set VTK_DIR environment variable"
337 # read vtkdirVariable
339 #echo "you said [" $vtkdirVariable "]"
341 # latexCompilerVariable=""
342 # while [ "$latexCompilerVariable" = "" ]
344 # while [ ! -f "$latexCompilerVariable" ]
347 # # echo " ---------------------------------------"
348 # echo " Set LATEX_COMPILER environment variable"
349 # # echo " ---------------------------------------"
351 # read latexCompilerVariable
352 # if [ ! -e "$latexCompilerVariable" ]
354 # echo $latexCompilerVariable is NOT a valid file
358 # echo "you said [" $latexCompilerVariable "]"
360 # sed -i -e '/.*VTK_DIR*/ d' /etc/bashrc
361 # sed -i -e '/.*LATEX_COMPILER*/ d' /etc/bashrc
362 # echo "export VTK_DIR=$vtkdirVariable" >> /etc/bashrc
363 # echo "export LATEX_COMPILER=$latexCompilerVariable" >> /etc/bashrc
365 if [ "$sourcesFrom" = "CVS" ]
367 echo "----------------------------------------------------------------------"
369 echo "To go on, run again 'sh menu.sh' as '$loginUserName', in a new window"
370 echo "---------------------------------------------------------------------"
373 echo "----------------------------------------------------------------------"
375 echo "To go on, run again 'sh menu.sh' in a new window"
376 echo "---------------------------------------------------------------------"
385 echo "========================== 2"
386 sh scripts/CreaTools-load.sh
390 echo "========================== 3"
391 source scripts/CreaTools-configure.sh
392 sh scripts/CreaTools-compile.sh
394 # To allow (*very* aware) user to patch code, later
396 chown -R $loginUserName $generationdir/creatools_source
397 chgrp -R $loginGroupName $generationdir/creatools_source
398 # Too much time consuming
399 #chown -R $loginUserName $generationdir/creatools_source
400 #chgrp -R $loginGroupName $generationdir/creatools_source
408 echo "==================================================="
411 echo "YOU NEED TO RUN THIS ONE AS root"
412 echo "==================================================="
417 echo "========================= 4"
418 sh scripts/CreaTools-install.sh
422 echo "========================= 5"
423 sh scripts/CreaTools-uninstall.sh
429 echo "==================================="
431 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
432 # if user configured without installing third party library,
433 # Last third party library is still in use! JPR
436 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
440 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
441 grep "installPrefixThird=" /etc/bashrc
442 echo "VTK_DIR :...." $VTK_DIR
443 echo "ITK_DIR :...." $ITK_DIR
444 echo "GDCM_DIR :..." $GDCM_DIR
447 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
449 echo $installPrefixThird/share/creatools_third_party_library_config.sh
451 more $installPrefixThird/share/creatools_third_party_library_config.sh
457 if [ -f $installPrefix/share/creatools_base_library_config.sh ]
459 echo $installPrefix/share/creatools_base_library_config.sh
461 more $installPrefix/share/creatools_base_library_config.sh
464 echo "==================================="
466 echo "Press any key to continue"
476 echo "Your answer must be in {0, 1, 2, 3, 4, 5, 9} (was [ $i ])"