7 echo "==================================================="
10 echo "YOU NEED TO RUN THIS ONE AS root"
11 echo "==================================================="
26 echo " Choose what you want to do :"
29 echo " Install Third Party Libraries : 1"
30 echo " Get the 'CreaTools' source files : 2"
31 echo " Compile the CreaTools : 3"
32 echo " Install the CreaTools : 4"
33 echo " Uninstall the CreaTools : 5"
40 echo "Type in your choice :"
46 #ls -l scripts/CreaTools-configure.sh
47 if [ -f scripts/CreaTools-configure.sh ]
49 while [[ "$suitable" != "YES" && \
50 "$suitable" != "NO" ]]
52 echo "'Configure' already done : "
53 echo "------------------------"
54 more scripts/CreaTools-configure.sh
55 echo "------------------------"
56 echo "Are the following values suitable for you : YES/NO? (default is YES)"
58 if [ "$suitable" = "" ]
66 if [ "$suitable" = "YES" ]
68 source scripts/CreaTools-configure.sh
71 if [ "$suitable" = "NO" ]
76 while [ "$confirm" != "YES" ]
79 while [[ "$OperatingSystem" != "Fedora" && \
80 "$OperatingSystem" != "Ubuntu" && \
81 "$OperatingSystem" != "MacOS" ]]
83 echo "Operating System : Fedora/Ubuntu/MacOS (mandatory!)"
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 "]"
104 echo "Install Prefix : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
106 if [ "$installPrefix" = "" ]
108 installPrefix="$generationdir/creatools_install"
110 echo "you said : [" $installPrefix "]"
116 while [[ "$docgeneration" != "YES" && "$docgeneration" != "NO" ]]
118 echo "Boolean For Doc Generation : YES/NO (default is NO)"
120 if [ "$docgeneration" = "" ]
124 echo "you said : [" $docgeneration "]"
131 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
133 echo "Where do you want to get source files from : CVS/HTML (default is HTML)"
135 if [ "$sourcesFrom" = "" ]
139 echo "you said : [" $sourcesFrom "]"
146 if [ "$sourcesFrom" = "CVS" ]
148 while [ "$cvsUserName" == "" ]
150 echo "CVS User Name (mandatory!)"
153 echo "you said : [" $cvsUserName "]"
155 cvsUserName="ForgetThisOne"
162 while [ "$loginUserName" == "" ]
164 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
166 echo "Login User Name (mandatory!)"
168 echo "you said : [" $loginUserName "]"
174 while [ "$loginGroupName" == "" ]
176 #echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
177 #echo "Login Group Name (mandatory!)"
178 echo "Login Group Name (mandatory!)"
180 echo "you said : [" $loginGroupName "]"
187 while [[ "$buildType" != "Release" && "$Debug " != "HTML" ]]
189 echo "Build type : Release/Debug (default is Release)"
191 if [ "$buildType" = "" ]
195 echo "you said : [" $buildType "]"
202 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
204 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
206 if [ "$gdcmVersion" = "" ]
210 echo "you said : [" $gdcmVersion "]"
217 echo " Operating System : $OperatingSystem"
218 echo " Name of the Generation Directory : $generationdir"
219 echo " Install Prefix : $installPrefix"
220 echo " Boolean for Doc Generation : $docgeneration"
221 echo " Where do you want to get source files from : $sourcesFrom"
222 if [ $sourcesFrom = CVS ]
224 echo " CVS User Name : $cvsUserName"
226 echo " Login User Name : $loginUserName"
227 echo " Login Group Name : $loginGroupName"
228 echo " Build type : $buildType"
229 echo " Gdcm version : $gdcmVersion"
232 echo "Do you confirm your choices : YES/NO ? (default is NO)"
236 # GROS SOUCIS : Ou generer le fichier CreaTools-configure.sh?
237 # dans $generationdir/creatools_bin ?
238 # -> il n'est pas encore cree !
239 # dans ./Linux/scripts?
242 configureFile="scripts/CreaTools-configure.sh"
244 echo "#!/bin/sh" > $configureFile
245 echo >> $configureFile
246 echo "#File generated by 'menu.sh'" >> $configureFile
247 echo "#DO NOT edit !" >> $configureFile
248 echo "#(except if you *know* what you do)">> $configureFile
249 echo >> $configureFile
250 echo "OperatingSystem=$OperatingSystem" >> $configureFile
251 echo "generationdir=$generationdir" >> $configureFile
252 echo "installPrefix=$installPrefix" >> $configureFile
253 echo "docgeneration=$docgeneration" >> $configureFile
254 echo "sourcesFrom=$sourcesFrom" >> $configureFile
255 echo "cvsUserName=$cvsUserName" >> $configureFile
256 echo "loginUserName=$loginUserName" >> $configureFile
257 echo "loginGroupName=$loginGroupName" >> $configureFile
258 echo "buildType=$buildType" >> $configureFile
259 echo "gdcmVersion=$gdcmVersion" >> $configureFile
267 echo "========================== 1 "
268 sh scripts/ThirdParty-install.sh
271 while [ "$vtkdirVariable" = "" ]
273 while [ ! -e "$vtkdirVariable" ]
276 echo " --------------------------------"
277 echo " Set VTK_DIR environment variable"
278 echo " --------------------------------"
281 if [ ! -e "$vtkdirVariable" ]
283 echo $vtkdirVariable is NOT a valid directory
287 echo "you said [" $vtkdirVariable "]"
290 #while [ "$vtkdirVariable" = "" ]
292 # echo " Set VTK_DIR environment variable"
293 # read vtkdirVariable
295 #echo "you said [" $vtkdirVariable "]"
297 latexCompilerVariable=""
298 while [ "$latexCompilerVariable" = "" ]
300 while [ ! -f "$latexCompilerVariable" ]
303 echo " ---------------------------------------"
304 echo " Set LATEX_COMPILER environment variable"
305 echo " ---------------------------------------"
307 read latexCompilerVariable
308 if [ ! -e "$latexCompilerVariable" ]
310 echo $latexCompilerVariable is NOT a valid file
314 echo "you said [" $latexCompilerVariable "]"
316 sed -i -e '/.*VTK_DIR*/ d' /etc/bashrc
317 sed -i -e '/.*LATEX_COMPILER*/ d' /etc/bashrc
318 echo "export VTK_DIR=$vtkdirVariable" >> /etc/bashrc
319 echo "export LATEX_COMPILER=$latexCompilerVariable" >> /etc/bashrc
321 echo "---------------------------------------------------------"
323 echo "To go on, run again 'sh menu.sh' as root, in a new window"
324 echo "---------------------------------------------------------"
329 echo "========================== 3"
330 sh scripts/CreaTools-load.sh
334 echo "========================== 3"
335 source scripts/CreaTools-configure.sh
336 sh scripts/CreaTools-compile.sh
338 # To allow (*very* aware) user to patch code, later
340 chown -R $loginUserName $generationdir/creatools_source
341 chgrp -R $loginGroupName $generationdir/creatools_source
342 # Too much time consuming
343 #chown -R $loginUserName $generationdir/creatools_source
344 #chgrp -R $loginGroupName $generationdir/creatools_source
348 echo "========================= 4"
349 sh scripts/CreaTools-install.sh
353 echo "========================= 5"
354 sh scripts/CreaTools-uninstall.sh
362 echo "Your answer must be in {0, 1, 2, 3, 4, 5, 9} (was [ $i ])"