13 echo " Choose what you want to do :"
15 echo " Configure :..........................0 "
16 echo " Install Third Party Libraries :......1 (as root)"
17 echo " Get the 'CreaTools' source files :...2 (CVS : as user!)"
18 echo " Compile the CreaTools :............3 "
19 echo " Install the CreaTools :............4 (as root)"
20 echo " Uninstall the CreaTools :............5 (as root)"
22 echo " Exit :...............................9"
27 echo "Type in your choice :"
33 #ls -l scripts/CreaTools-configure.sh
34 if [ -f scripts/CreaTools-configure.sh ]
36 while [[ "$suitable" != "YES" && \
37 "$suitable" != "NO" ]]
39 echo "'Configure' already done : "
40 echo "------------------------"
41 more scripts/CreaTools-configure.sh
42 echo "------------------------"
43 echo "Are the following values suitable for you : YES/NO? (default is YES)"
45 if [ "$suitable" = "" ]
53 if [ "$suitable" = "YES" ]
55 source scripts/CreaTools-configure.sh
58 # if [ "$suitable" = "NO" || "$suitable" = "N" || "$suitable" = "no" || "$suitable" = "n" ]
59 if [ "$suitable" = "NO" ]
69 while [ "$confirm" != "YES" ]
74 while [[ "$OperatingSystem" != "Fedora" && \
75 "$OperatingSystem" != "Ubuntu" && \
77 "$OperatingSystem" != "MacOS" ]]
79 echo "Operating System : Fedora/Ubuntu/MacOS (default :Fedora!)"
81 if [ "$OperatingSystem" = "" ]
83 OperatingSystem="Fedora"
86 echo "you said : [" $OperatingSystem "]"
91 echo "Name of the Generation Directory (default is /tmp/myGenerationDir)"
93 if [ "$generationdir" = "" ]
95 generationdir="/tmp/myGenerationDir"
97 echo "you said : [" $generationdir "]"
102 installPrefixThird="___"
103 echo "Install Prefix For Third Party Library : '$generationdir/thirdparty_install' / '/usr/local' (default is '$generationdir/thirdparty_install')"
104 read installPrefixThird
105 if [ "$installPrefixThird" = "" ]
107 installPrefixThird="$generationdir/thirdparty_install"
109 echo "you said : [" $installPrefixThird "]"
116 echo "Install Prefix for CreaTools : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
118 if [ "$installPrefix" = "" ]
120 installPrefix="$generationdir/creatools_install"
122 echo "you said : [" $installPrefix "]"
128 while [[ "$docgeneration" != "YES" && "$docgeneration" != "NO" ]]
130 echo "Boolean For Doc Generation : YES/NO (default is NO)"
132 if [ "$docgeneration" = "" ]
136 echo "you said : [" $docgeneration "]"
143 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
145 echo "Where do you want to get source files from : CVS/HTML (default is CVS)"
147 if [ "$sourcesFrom" = "" ]
151 echo "you said : [" $sourcesFrom "]"
158 if [ "$sourcesFrom" = "CVS" ]
160 while [ "$cvsUserName" == "" ]
162 echo "CVS User Name (mandatory!)"
165 echo "you said : [" $cvsUserName "]"
167 cvsUserName="ForgetThisOne"
175 while [ "$loginUserName" == "" ]
177 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
179 echo "Login User Name (mandatory!)"
181 echo "you said : [" $loginUserName "]"
187 while [ "$loginGroupName" == "" ]
189 #echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
190 #echo "Login Group Name (mandatory!)"
191 echo "Login Group Name (mandatory!)"
193 echo "you said : [" $loginGroupName "]"
200 while [[ "$buildType" != "Release" && "$Debug " != "HTML" ]]
202 echo "Build type : Release/Debug (default is Release)"
204 if [ "$buildType" = "" ]
208 echo "you said : [" $buildType "]"
215 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
217 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
219 if [ "$gdcmVersion" = "" ]
223 echo "you said : [" $gdcmVersion "]"
230 echo " Operating System : $OperatingSystem"
231 echo " Name of the Generation Directory : $generationdir"
232 echo " Install Prefix for Third Party Libraries : $installPrefixThird"
233 echo " Install Prefix for CreaTools : $installPrefix"
234 echo " Boolean for Doc Generation : $docgeneration"
235 echo " Where do you want to get source files from : $sourcesFrom"
236 if [ $sourcesFrom = CVS ]
238 echo " CVS User Name : $cvsUserName"
240 echo " Login User Name : $loginUserName"
241 echo " Login Group Name : $loginGroupName"
242 echo " Build type : $buildType"
243 echo " Gdcm version : $gdcmVersion"
246 echo "Do you confirm your choices : YES/NO ? (default is YES)"
248 if [ "$confirm" = "" ]
254 # GROS SOUCIS : Ou generer le fichier CreaTools-configure.sh?
255 # dans $generationdir/creatools_bin ?
256 # -> il n'est pas encore cree !
257 # dans ./Linux/scripts?
260 configureFile="scripts/CreaTools-configure.sh"
262 echo "#!/bin/sh" > $configureFile
263 echo >> $configureFile
264 echo "#File generated by 'menu.sh'" >> $configureFile
265 echo "#DO NOT edit !" >> $configureFile
266 echo "#(except if you *know* what you do)" >> $configureFile
267 echo >> $configureFile
268 echo "OperatingSystem=$OperatingSystem" >> $configureFile
269 echo "generationdir=$generationdir" >> $configureFile
270 echo "installPrefix=$installPrefix" >> $configureFile
271 echo "installPrefixThird=$installPrefixThird" >> $configureFile
272 echo "docgeneration=$docgeneration" >> $configureFile
273 echo "sourcesFrom=$sourcesFrom" >> $configureFile
274 echo "cvsUserName=$cvsUserName" >> $configureFile
275 echo "loginUserName=$loginUserName" >> $configureFile
276 echo "loginGroupName=$loginGroupName" >> $configureFile
277 echo "buildType=$buildType" >> $configureFile
278 echo "gdcmVersion=$gdcmVersion" >> $configureFile
286 echo "========================== 1 "
287 source scripts/Check-if-root.sh
288 sh scripts/ThirdParty-install.sh
291 # while [ "$vtkdirVariable" = "" ]
293 # while [ ! -e "$vtkdirVariable" ]
296 # echo " --------------------------------"
297 # echo " Set VTK_DIR environment variable"
298 # echo " --------------------------------"
300 # # #read vtkdirVariable
301 # if [ ! -e "$vtkdirVariable" ]
303 # # echo $vtkdirVariable is NOT a valid directory
307 # echo "you said [" $vtkdirVariable "]"
310 #while [ "$vtkdirVariable" = "" ]
312 # echo " Set VTK_DIR environment variable"
313 # read vtkdirVariable
315 #echo "you said [" $vtkdirVariable "]"
317 # latexCompilerVariable=""
318 # while [ "$latexCompilerVariable" = "" ]
320 # while [ ! -f "$latexCompilerVariable" ]
323 # # echo " ---------------------------------------"
324 # echo " Set LATEX_COMPILER environment variable"
325 # # echo " ---------------------------------------"
327 # read latexCompilerVariable
328 # if [ ! -e "$latexCompilerVariable" ]
330 # echo $latexCompilerVariable is NOT a valid file
334 # echo "you said [" $latexCompilerVariable "]"
336 # sed -i -e '/.*VTK_DIR*/ d' /etc/bashrc
337 # sed -i -e '/.*LATEX_COMPILER*/ d' /etc/bashrc
338 # echo "export VTK_DIR=$vtkdirVariable" >> /etc/bashrc
339 # echo "export LATEX_COMPILER=$latexCompilerVariable" >> /etc/bashrc
341 if [ "$sourcesFrom" = "CVS" ]
343 echo "----------------------------------------------------------------------"
345 echo "To go on, run again 'sh menu.sh' as '$loginUserName', in a new window"
346 echo "---------------------------------------------------------------------"
349 echo "----------------------------------------------------------------------"
351 echo "To go on, run again 'sh menu.sh' in a new window"
352 echo "---------------------------------------------------------------------"
361 echo "========================== 2"
362 sh scripts/CreaTools-load.sh
366 echo "========================== 3"
367 source scripts/CreaTools-configure.sh
368 sh scripts/CreaTools-compile.sh
370 # To allow (*very* aware) user to patch code, later
372 chown -R $loginUserName $generationdir/creatools_source
373 chgrp -R $loginGroupName $generationdir/creatools_source
374 # Too much time consuming
375 #chown -R $loginUserName $generationdir/creatools_source
376 #chgrp -R $loginGroupName $generationdir/creatools_source
384 echo "==================================================="
387 echo "YOU NEED TO RUN THIS ONE AS root"
388 echo "==================================================="
393 echo "========================= 4"
394 sh scripts/CreaTools-install.sh
398 echo "========================= 5"
399 sh scripts/CreaTools-uninstall.sh
407 echo "Your answer must be in {0, 1, 2, 3, 4, 5, 9} (was [ $i ])"