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" ]
68 while [ "$confirm" != "YES" ]
73 while [[ "$OperatingSystem" != "Fedora" && \
74 "$OperatingSystem" != "Ubuntu" && \
76 "$OperatingSystem" != "MacOS" ]]
78 echo "Operating System : Fedora/Ubuntu/MacOS (default :Fedora!)"
80 if [ "$OperatingSystem" = "" ]
82 OperatingSystem="Fedora"
85 echo "you said : [" $OperatingSystem "]"
90 echo "Name of the Generation Directory (default is /tmp/myGenerationDir)"
92 if [ "$generationdir" = "" ]
94 generationdir="/tmp/myGenerationDir"
96 echo "you said : [" $generationdir "]"
101 installPrefixThird="___"
102 echo "Install Prefix For Third Party Library : '$generationdir/thirdparty_install' / '/usr/local' (default is '$generationdir/thirdparty_install')"
103 read installPrefixThird
104 if [ "$installPrefixThird" = "" ]
106 installPrefixThird="$generationdir/thirdparty_install"
108 echo "you said : [" $installPrefixThird "]"
115 echo "Install Prefix for CreaTools : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
117 if [ "$installPrefix" = "" ]
119 installPrefix="$generationdir/creatools_install"
121 echo "you said : [" $installPrefix "]"
127 while [[ "$docgeneration" != "YES" && "$docgeneration" != "NO" ]]
129 echo "Boolean For Doc Generation : YES/NO (default is NO)"
131 if [ "$docgeneration" = "" ]
135 echo "you said : [" $docgeneration "]"
142 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
144 echo "Where do you want to get source files from : CVS/HTML (default is CVS)"
146 if [ "$sourcesFrom" = "" ]
150 echo "you said : [" $sourcesFrom "]"
157 if [ "$sourcesFrom" = "CVS" ]
159 while [ "$cvsUserName" == "" ]
161 echo "CVS User Name (mandatory!)"
164 echo "you said : [" $cvsUserName "]"
166 cvsUserName="ForgetThisOne"
174 while [ "$loginUserName" == "" ]
176 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
178 echo "Login User Name (mandatory!)"
180 echo "you said : [" $loginUserName "]"
186 while [ "$loginGroupName" == "" ]
188 #echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
189 #echo "Login Group Name (mandatory!)"
190 echo "Login Group Name (mandatory!)"
192 echo "you said : [" $loginGroupName "]"
199 while [[ "$buildType" != "Release" && "$Debug " != "HTML" ]]
201 echo "Build type : Release/Debug (default is Release)"
203 if [ "$buildType" = "" ]
207 echo "you said : [" $buildType "]"
214 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
216 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
218 if [ "$gdcmVersion" = "" ]
222 echo "you said : [" $gdcmVersion "]"
229 echo " Operating System : $OperatingSystem"
230 echo " Name of the Generation Directory : $generationdir"
231 echo " Install Prefix for Third Party Libraries : $installPrefixThird"
232 echo " Install Prefix for CreaTools : $installPrefix"
233 echo " Boolean for Doc Generation : $docgeneration"
234 echo " Where do you want to get source files from : $sourcesFrom"
235 if [ $sourcesFrom = CVS ]
237 echo " CVS User Name : $cvsUserName"
239 echo " Login User Name : $loginUserName"
240 echo " Login Group Name : $loginGroupName"
241 echo " Build type : $buildType"
242 echo " Gdcm version : $gdcmVersion"
245 echo "Do you confirm your choices : YES/NO ? (default is YES)"
247 if [ "$confirm" = "" ]
253 # GROS SOUCIS : Ou generer le fichier CreaTools-configure.sh?
254 # dans $generationdir/creatools_bin ?
255 # -> il n'est pas encore cree !
256 # dans ./Linux/scripts?
259 configureFile="scripts/CreaTools-configure.sh"
261 echo "#!/bin/sh" > $configureFile
262 echo >> $configureFile
263 echo "#File generated by 'menu.sh'" >> $configureFile
264 echo "#DO NOT edit !" >> $configureFile
265 echo "#(except if you *know* what you do)" >> $configureFile
266 echo >> $configureFile
267 echo "OperatingSystem=$OperatingSystem" >> $configureFile
268 echo "generationdir=$generationdir" >> $configureFile
269 echo "installPrefix=$installPrefix" >> $configureFile
270 echo "installPrefixThird=$installPrefixThird" >> $configureFile
271 echo "docgeneration=$docgeneration" >> $configureFile
272 echo "sourcesFrom=$sourcesFrom" >> $configureFile
273 echo "cvsUserName=$cvsUserName" >> $configureFile
274 echo "loginUserName=$loginUserName" >> $configureFile
275 echo "loginGroupName=$loginGroupName" >> $configureFile
276 echo "buildType=$buildType" >> $configureFile
277 echo "gdcmVersion=$gdcmVersion" >> $configureFile
285 echo "========================== 1 "
286 source scripts/Check-if-root.sh
287 sh scripts/ThirdParty-install.sh
290 # while [ "$vtkdirVariable" = "" ]
292 # while [ ! -e "$vtkdirVariable" ]
295 # echo " --------------------------------"
296 # echo " Set VTK_DIR environment variable"
297 # echo " --------------------------------"
299 # # #read vtkdirVariable
300 # if [ ! -e "$vtkdirVariable" ]
302 # # echo $vtkdirVariable is NOT a valid directory
306 # echo "you said [" $vtkdirVariable "]"
309 #while [ "$vtkdirVariable" = "" ]
311 # echo " Set VTK_DIR environment variable"
312 # read vtkdirVariable
314 #echo "you said [" $vtkdirVariable "]"
316 # latexCompilerVariable=""
317 # while [ "$latexCompilerVariable" = "" ]
319 # while [ ! -f "$latexCompilerVariable" ]
322 # # echo " ---------------------------------------"
323 # echo " Set LATEX_COMPILER environment variable"
324 # # echo " ---------------------------------------"
326 # read latexCompilerVariable
327 # if [ ! -e "$latexCompilerVariable" ]
329 # echo $latexCompilerVariable is NOT a valid file
333 # echo "you said [" $latexCompilerVariable "]"
335 # sed -i -e '/.*VTK_DIR*/ d' /etc/bashrc
336 # sed -i -e '/.*LATEX_COMPILER*/ d' /etc/bashrc
337 # echo "export VTK_DIR=$vtkdirVariable" >> /etc/bashrc
338 # echo "export LATEX_COMPILER=$latexCompilerVariable" >> /etc/bashrc
340 if [ "$sourcesFrom" = "CVS" ]
342 echo "----------------------------------------------------------------------"
344 echo "To go on, run again 'sh menu.sh' as '$loginUserName', in a new window"
345 echo "---------------------------------------------------------------------"
348 echo "----------------------------------------------------------------------"
350 echo "To go on, run again 'sh menu.sh' in a new window"
351 echo "---------------------------------------------------------------------"
360 echo "========================== 2"
361 sh scripts/CreaTools-load.sh
365 echo "========================== 3"
366 source scripts/CreaTools-configure.sh
367 sh scripts/CreaTools-compile.sh
369 # To allow (*very* aware) user to patch code, later
371 chown -R $loginUserName $generationdir/creatools_source
372 chgrp -R $loginGroupName $generationdir/creatools_source
373 # Too much time consuming
374 #chown -R $loginUserName $generationdir/creatools_source
375 #chgrp -R $loginGroupName $generationdir/creatools_source
383 echo "==================================================="
386 echo "YOU NEED TO RUN THIS ONE AS root"
387 echo "==================================================="
392 echo "========================= 4"
393 sh scripts/CreaTools-install.sh
397 echo "========================= 5"
398 sh scripts/CreaTools-uninstall.sh
406 echo "Your answer must be in {0, 1, 2, 3, 4, 5, 9} (was [ $i ])"