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" = "" ]
54 if [ "$suitable" = "YES" ]
56 source scripts/CreaTools-configure.sh
59 # if [ "$suitable" = "NO" || "$suitable" = "N" || "$suitable" = "no" || "$suitable" = "n" ]
60 if [ "$suitable" = "NO" ]
70 while [ "$confirm" != "YES" ]
75 while [[ "$OperatingSystem" != "Fedora" && \
76 "$OperatingSystem" != "Ubuntu" && \
78 "$OperatingSystem" != "MacOS" ]]
80 echo "Operating System : Fedora/Ubuntu/MacOS (default :Fedora!)"
82 if [ "$OperatingSystem" = "" ]
84 OperatingSystem="Fedora"
87 echo "you said : [" $OperatingSystem "]"
92 echo "Name of the Generation Directory (default is /tmp/myGenerationDir)"
94 if [ "$generationdir" = "" ]
96 generationdir="/tmp/myGenerationDir"
98 echo "you said : [" $generationdir "]"
103 installPrefixThird="___"
104 echo "Install Prefix For Third Party Library : '$generationdir/thirdparty_install' / '/usr/local' (default is '$generationdir/thirdparty_install')"
105 read installPrefixThird
106 if [ "$installPrefixThird" = "" ]
108 installPrefixThird="$generationdir/thirdparty_install"
110 echo "you said : [" $installPrefixThird "]"
117 echo "Install Prefix for CreaTools : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
119 if [ "$installPrefix" = "" ]
121 installPrefix="$generationdir/creatools_install"
123 echo "you said : [" $installPrefix "]"
129 while [[ "$docgeneration" != "YES" && "$docgeneration" != "NO" ]]
131 echo "Boolean For Doc Generation : YES/NO (default is NO)"
133 if [ "$docgeneration" = "" ]
137 echo "you said : [" $docgeneration "]"
144 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
146 echo "Where do you want to get source files from : CVS/HTML (default is CVS)"
148 if [ "$sourcesFrom" = "" ]
152 echo "you said : [" $sourcesFrom "]"
159 if [ "$sourcesFrom" = "CVS" ]
161 while [ "$cvsUserName" == "" ]
163 echo "CVS User Name (mandatory!)"
166 echo "you said : [" $cvsUserName "]"
168 cvsUserName="ForgetThisOne"
176 while [ "$loginUserName" == "" ]
178 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
180 echo "Login User Name (mandatory!)"
182 echo "you said : [" $loginUserName "]"
188 while [ "$loginGroupName" == "" ]
190 #echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
191 #echo "Login Group Name (mandatory!)"
192 echo "Login Group Name (mandatory!)"
194 echo "you said : [" $loginGroupName "]"
201 while [[ "$buildType" != "Release" && "$Debug " != "HTML" ]]
203 echo "Build type : Release/Debug (default is Release)"
205 if [ "$buildType" = "" ]
209 echo "you said : [" $buildType "]"
216 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
218 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
220 if [ "$gdcmVersion" = "" ]
224 echo "you said : [" $gdcmVersion "]"
231 echo " Operating System : $OperatingSystem"
232 echo " Name of the Generation Directory : $generationdir"
233 echo " Install Prefix for Third Party Libraries : $installPrefixThird"
234 echo " Install Prefix for CreaTools : $installPrefix"
235 echo " Boolean for Doc Generation : $docgeneration"
236 echo " Where do you want to get source files from : $sourcesFrom"
237 if [ $sourcesFrom = CVS ]
239 echo " CVS User Name : $cvsUserName"
241 echo " Login User Name : $loginUserName"
242 echo " Login Group Name : $loginGroupName"
243 echo " Build type : $buildType"
244 echo " Gdcm version : $gdcmVersion"
247 echo "Do you confirm your choices : YES/NO ? (default is YES)"
249 if [ "$confirm" = "" ]
255 # GROS SOUCIS : Ou generer le fichier CreaTools-configure.sh?
256 # dans $generationdir/creatools_bin ?
257 # -> il n'est pas encore cree !
258 # dans ./Linux/scripts?
261 configureFile="scripts/CreaTools-configure.sh"
263 echo "#!/bin/sh" > $configureFile
264 echo >> $configureFile
265 echo "#File generated by 'menu.sh'" >> $configureFile
266 echo "#DO NOT edit !" >> $configureFile
267 echo "#(except if you *know* what you do)" >> $configureFile
268 echo >> $configureFile
269 echo "OperatingSystem=$OperatingSystem" >> $configureFile
270 echo "generationdir=$generationdir" >> $configureFile
271 echo "installPrefix=$installPrefix" >> $configureFile
272 echo "installPrefixThird=$installPrefixThird" >> $configureFile
273 echo "docgeneration=$docgeneration" >> $configureFile
274 echo "sourcesFrom=$sourcesFrom" >> $configureFile
275 echo "cvsUserName=$cvsUserName" >> $configureFile
276 echo "loginUserName=$loginUserName" >> $configureFile
277 echo "loginGroupName=$loginGroupName" >> $configureFile
278 echo "buildType=$buildType" >> $configureFile
279 echo "gdcmVersion=$gdcmVersion" >> $configureFile
287 echo "========================== 1 "
288 source scripts/Check-if-root.sh
289 sh scripts/ThirdParty-install.sh
292 # while [ "$vtkdirVariable" = "" ]
294 # while [ ! -e "$vtkdirVariable" ]
297 # echo " --------------------------------"
298 # echo " Set VTK_DIR environment variable"
299 # echo " --------------------------------"
301 # # #read vtkdirVariable
302 # if [ ! -e "$vtkdirVariable" ]
304 # # echo $vtkdirVariable is NOT a valid directory
308 # echo "you said [" $vtkdirVariable "]"
311 #while [ "$vtkdirVariable" = "" ]
313 # echo " Set VTK_DIR environment variable"
314 # read vtkdirVariable
316 #echo "you said [" $vtkdirVariable "]"
318 # latexCompilerVariable=""
319 # while [ "$latexCompilerVariable" = "" ]
321 # while [ ! -f "$latexCompilerVariable" ]
324 # # echo " ---------------------------------------"
325 # echo " Set LATEX_COMPILER environment variable"
326 # # echo " ---------------------------------------"
328 # read latexCompilerVariable
329 # if [ ! -e "$latexCompilerVariable" ]
331 # echo $latexCompilerVariable is NOT a valid file
335 # echo "you said [" $latexCompilerVariable "]"
337 # sed -i -e '/.*VTK_DIR*/ d' /etc/bashrc
338 # sed -i -e '/.*LATEX_COMPILER*/ d' /etc/bashrc
339 # echo "export VTK_DIR=$vtkdirVariable" >> /etc/bashrc
340 # echo "export LATEX_COMPILER=$latexCompilerVariable" >> /etc/bashrc
342 if [ "$sourcesFrom" = "CVS" ]
344 echo "----------------------------------------------------------------------"
346 echo "To go on, run again 'sh menu.sh' as '$loginUserName', in a new window"
347 echo "---------------------------------------------------------------------"
350 echo "----------------------------------------------------------------------"
352 echo "To go on, run again 'sh menu.sh' in a new window"
353 echo "---------------------------------------------------------------------"
362 echo "========================== 2"
363 sh scripts/CreaTools-load.sh
367 echo "========================== 3"
368 source scripts/CreaTools-configure.sh
369 sh scripts/CreaTools-compile.sh
371 # To allow (*very* aware) user to patch code, later
373 chown -R $loginUserName $generationdir/creatools_source
374 chgrp -R $loginGroupName $generationdir/creatools_source
375 # Too much time consuming
376 #chown -R $loginUserName $generationdir/creatools_source
377 #chgrp -R $loginGroupName $generationdir/creatools_source
385 echo "==================================================="
388 echo "YOU NEED TO RUN THIS ONE AS root"
389 echo "==================================================="
394 echo "========================= 4"
395 sh scripts/CreaTools-install.sh
399 echo "========================= 5"
400 sh scripts/CreaTools-uninstall.sh
408 echo "Your answer must be in {0, 1, 2, 3, 4, 5, 9} (was [ $i ])"