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" ]
88 while [ "$confirm" != "YES" ]
93 while [[ "$OperatingSystem" != "Fedora" && \
94 "$OperatingSystem" != "Ubuntu" && \
96 "$OperatingSystem" != "MacOS" ]]
98 echo "Operating System : Fedora/Ubuntu/MacOS (default :Fedora!)"
100 if [ "$OperatingSystem" = "" ]
102 OperatingSystem="Fedora"
105 echo "you said : [" $OperatingSystem "]"
110 echo "Name of the Generation Directory (default is /tmp/myGenerationDir)"
112 if [ "$generationdir" = "" ]
114 generationdir="/tmp/myGenerationDir"
116 echo "you said : [" $generationdir "]"
121 installPrefixThird="___"
122 echo "Install Prefix For Third Party Library : '$generationdir/thirdparty_install' / '/usr/local' (default is '$generationdir/thirdparty_install')"
123 read installPrefixThird
124 if [ "$installPrefixThird" = "" ]
126 installPrefixThird="$generationdir/thirdparty_install"
128 echo "you said : [" $installPrefixThird "]"
135 echo "Install Prefix for CreaTools : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
137 if [ "$installPrefix" = "" ]
139 installPrefix="$generationdir/creatools_install"
141 echo "you said : [" $installPrefix "]"
147 while [[ "$docgeneration" != "ON" && "$docgeneration" != "OFF" ]]
149 echo "Boolean For Doc Generation : ON/OFF (default is OFF)"
151 if [ "$docgeneration" = "" ]
155 echo "you said : [" $docgeneration "]"
162 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
164 echo "Where do you want to get source files from : CVS/HTML (default is CVS)"
166 if [ "$sourcesFrom" = "" ]
170 echo "you said : [" $sourcesFrom "]"
177 if [ "$sourcesFrom" = "CVS" ]
179 while [ "$cvsUserName" == "" ]
181 echo "CVS User Name (mandatory!)"
184 echo "you said : [" $cvsUserName "]"
186 cvsUserName="ForgetThisOne"
194 while [ "$loginUserName" == "" ]
196 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
198 echo "Login User Name (mandatory!)"
200 echo "you said : [" $loginUserName "]"
206 while [ "$loginGroupName" == "" ]
208 #echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
209 #echo "Login Group Name (mandatory!)"
210 echo "Login Group Name (mandatory!)"
212 echo "you said : [" $loginGroupName "]"
219 while [[ "$buildType" != "Release" && "$Debug " != "HTML" ]]
221 echo "Build type : Release/Debug (default is Release)"
223 if [ "$buildType" = "" ]
227 echo "you said : [" $buildType "]"
234 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
236 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
238 if [ "$gdcmVersion" = "" ]
242 echo "you said : [" $gdcmVersion "]"
249 echo " Operating System : $OperatingSystem"
250 echo " Name of the Generation Directory : $generationdir"
251 echo " Install Prefix for Third Party Libraries : $installPrefixThird"
252 echo " Install Prefix for CreaTools : $installPrefix"
253 echo " Boolean for Doc Generation : $docgeneration"
254 echo " Where do you want to get source files from : $sourcesFrom"
255 if [ $sourcesFrom = CVS ]
257 echo " CVS User Name : $cvsUserName"
259 echo " Login User Name : $loginUserName"
260 echo " Login Group Name : $loginGroupName"
261 echo " Build type : $buildType"
262 echo " Gdcm version : $gdcmVersion"
266 echo "Do you confirm your choices : YES/NO ? (default is YES)"
268 if [ "$confirm" = "" ]
274 # GROS SOUCIS : Ou generer le fichier CreaTools-configure.sh?
275 # dans $generationdir/creatools_bin ?
276 # -> il n'est pas encore cree !
277 # dans ./Linux/scripts?
280 configureFile="scripts/CreaTools-configure.sh"
282 echo "#!/bin/sh" > $configureFile
283 echo >> $configureFile
284 echo "#File generated by 'menu.sh'" >> $configureFile
285 echo "#DO NOT edit !" >> $configureFile
286 echo "#(except if you *know* what you do)" >> $configureFile
287 echo >> $configureFile
288 echo "OperatingSystem=$OperatingSystem" >> $configureFile
289 echo "generationdir=$generationdir" >> $configureFile
290 echo "installPrefix=$installPrefix" >> $configureFile
291 echo "installPrefixThird=$installPrefixThird" >> $configureFile
292 echo "docgeneration=$docgeneration" >> $configureFile
293 echo "sourcesFrom=$sourcesFrom" >> $configureFile
294 echo "cvsUserName=$cvsUserName" >> $configureFile
295 echo "loginUserName=$loginUserName" >> $configureFile
296 echo "loginGroupName=$loginGroupName" >> $configureFile
297 echo "buildType=$buildType" >> $configureFile
298 echo "gdcmVersion=$gdcmVersion" >> $configureFile
307 echo "========================== 1 "
308 source scripts/Check-if-root.sh
309 sh scripts/ThirdParty-install.sh
312 # while [ "$vtkdirVariable" = "" ]
314 # while [ ! -e "$vtkdirVariable" ]
317 # echo " --------------------------------"
318 # echo " Set VTK_DIR environment variable"
319 # echo " --------------------------------"
321 # # #read vtkdirVariable
322 # if [ ! -e "$vtkdirVariable" ]
324 # # echo $vtkdirVariable is NOT a valid directory
328 # echo "you said [" $vtkdirVariable "]"
331 #while [ "$vtkdirVariable" = "" ]
333 # echo " Set VTK_DIR environment variable"
334 # read vtkdirVariable
336 #echo "you said [" $vtkdirVariable "]"
338 # latexCompilerVariable=""
339 # while [ "$latexCompilerVariable" = "" ]
341 # while [ ! -f "$latexCompilerVariable" ]
344 # # echo " ---------------------------------------"
345 # echo " Set LATEX_COMPILER environment variable"
346 # # echo " ---------------------------------------"
348 # read latexCompilerVariable
349 # if [ ! -e "$latexCompilerVariable" ]
351 # echo $latexCompilerVariable is NOT a valid file
355 # echo "you said [" $latexCompilerVariable "]"
357 # sed -i -e '/.*VTK_DIR*/ d' /etc/bashrc
358 # sed -i -e '/.*LATEX_COMPILER*/ d' /etc/bashrc
359 # echo "export VTK_DIR=$vtkdirVariable" >> /etc/bashrc
360 # echo "export LATEX_COMPILER=$latexCompilerVariable" >> /etc/bashrc
362 if [ "$sourcesFrom" = "CVS" ]
364 echo "----------------------------------------------------------------------"
366 echo "To go on, run again 'sh menu.sh' as '$loginUserName', in a new window"
367 echo "---------------------------------------------------------------------"
370 echo "----------------------------------------------------------------------"
372 echo "To go on, run again 'sh menu.sh' in a new window"
373 echo "---------------------------------------------------------------------"
382 echo "========================== 2"
383 sh scripts/CreaTools-load.sh
387 echo "========================== 3"
388 source scripts/CreaTools-configure.sh
389 sh scripts/CreaTools-compile.sh
391 # To allow (*very* aware) user to patch code, later
393 chown -R $loginUserName $generationdir/creatools_source
394 chgrp -R $loginGroupName $generationdir/creatools_source
395 # Too much time consuming
396 #chown -R $loginUserName $generationdir/creatools_source
397 #chgrp -R $loginGroupName $generationdir/creatools_source
405 echo "==================================================="
408 echo "YOU NEED TO RUN THIS ONE AS root"
409 echo "==================================================="
414 echo "========================= 4"
415 sh scripts/CreaTools-install.sh
419 echo "========================= 5"
420 sh scripts/CreaTools-uninstall.sh
426 echo "==================================="
428 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
429 # if user configured without installing third party library,
430 # Last third party library is still in use! JPR
433 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
437 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
438 grep "installPrefixThird=" /etc/bashrc
439 echo "VTK_DIR :...." $VTK_DIR
440 echo "ITK_DIR :...." $ITK_DIR
441 echo "GDCM_DIR :..." $GDCM_DIR
444 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
446 echo $installPrefixThird/share/creatools_third_party_library_config.sh
448 more $installPrefixThird/share/creatools_third_party_library_config.sh
454 if [ -f $installPrefix/share/creatools_base_library_config.sh ]
456 echo $installPrefix/share/creatools_base_library_config.sh
458 more $installPrefix/share/creatools_base_library_config.sh
461 echo "==================================="
463 echo "Press any key to continue"
473 echo "Your answer must be in {0, 1, 2, 3, 4, 5, 9} (was [ $i ])"