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" = "" ]
67 if [ "$suitable" = "NO" ]
72 while [ "$confirm" != "YES" ]
75 while [[ "$OperatingSystem" != "Fedora" && \
76 "$OperatingSystem" != "Ubuntu" && \
77 "$OperatingSystem" != "MacOS" ]]
79 echo "Operating System : Fedora/Ubuntu/MacOS (mandatory!)"
82 echo "you said : [" $OperatingSystem "]"
88 echo "Name of the Generation Directory (default is /tmp/myGenerationDir)"
90 if [ "$generationdir" = "" ]
92 generationdir="/tmp/myGenerationDir"
94 echo "you said : [" $generationdir "]"
101 echo "Install Prefix : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
103 if [ "$installPrefix" = "" ]
105 installPrefix="$generationdir/creatools_install"
107 echo "you said : [" $installPrefix "]"
113 while [[ "$docgeneration" != "YES" && "$docgeneration" != "NO" ]]
115 echo "Boolean For Doc Generation : YES/NO (default is NO)"
117 if [ "$docgeneration" = "" ]
121 echo "you said : [" $docgeneration "]"
128 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
130 echo "Where do you want to get source files from : CVS/HTML (default is HTML)"
132 if [ "$sourcesFrom" = "" ]
136 echo "you said : [" $sourcesFrom "]"
143 if [ "$sourcesFrom" = "CVS" ]
145 while [ "$cvsUserName" == "" ]
147 echo "CVS User Name (mandatory!)"
150 echo "you said : [" $cvsUserName "]"
152 cvsUserName="ForgetThisOne"
159 while [ "$linuxUserName" == "" ]
161 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
163 echo "Login User Name (mandatory!)"
165 echo "you said : [" $linuxUserName "]"
171 while [ "$linuxGroupName" == "" ]
173 #echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
174 #echo "Login Group Name (mandatory!)"
175 echo "Login Group Name (mandatory!)"
177 echo "you said : [" $linuxGroupName "]"
184 while [[ "$buildType" != "Release" && "$Debug " != "HTML" ]]
186 echo "Build type : Release/Debug (default is Release)"
188 if [ "$buildType" = "" ]
192 echo "you said : [" $buildType "]"
199 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
201 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
203 if [ "$gdcmVersion" = "" ]
207 echo "you said : [" $gdcmVersion "]"
214 echo " Operating System : $OperatingSystem"
215 echo " Name of the Generation Directory : $generationdir"
216 echo " Install Prefix : $installPrefix"
217 echo " Boolean for Doc Generation : $docgeneration"
218 echo " Where do you want to get source files from : $sourcesFrom"
219 if [ $sourcesFrom = CVS ]
221 echo " CVS User Name : $cvsUserName"
223 echo " Login User Name : $linuxUserName"
224 echo " Login Group Name : $linuxGroupName"
225 echo " Build type : $buildType"
226 echo " Gdcm version : $gdcmVersion"
229 echo "Do you confirm your choices : YES/NO ? (default is NO)"
233 # GROS SOUCIS : Ou generer le fichier CreaTools-configure.sh?
234 # dans $generationdir/creatools_bin ?
235 # -> il n'est pas encore cree !
236 # dans ./Linux/scripts?
239 configureFile="scripts/CreaTools-configure.sh"
241 echo "#!/bin/sh" > $configureFile
242 echo >> $configureFile
243 echo "#File generated by 'menu.sh'" >> $configureFile
244 echo "#DO NOT edit !" >> $configureFile
245 echo "#(except if you *know* what you do)">> $configureFile
246 echo >> $configureFile
247 echo "OperatingSystem=$OperatingSystem" >> $configureFile
248 echo "generationdir=$generationdir" >> $configureFile
249 echo "installPrefix=$installPrefix" >> $configureFile
250 echo "docgeneration=$docgeneration" >> $configureFile
251 echo "sourcesFrom=$sourcesFrom" >> $configureFile
252 echo "cvsUserName=$cvsUserName" >> $configureFile
253 echo "loginUserName=$linuxUserName" >> $configureFile
254 echo "loginGroupName=$linuxGroupName" >> $configureFile
255 echo "buildType=$buildType" >> $configureFile
256 echo "gdcmVersion=$gdcmVersion" >> $configureFile
265 echo "========================== 1 "
266 sh scripts/ThirdParty-install.sh
269 while [ "$vtkdirVariable" = "" ]
271 echo " Set VTK_DIR environment variable"
274 echo "you said [" $vtkdirVariable "]"
277 #while [ "$vtkdirVariable" = "" ]
279 # echo " Set VTK_DIR environment variable"
280 # read vtkdirVariable
282 #echo "you said [" $vtkdirVariable "]"
284 latexCompilerVariable=""
285 while [ "$latexCompilerVariable" = "" ]
287 echo " Set LATEX_COMPILER environment variable"
288 read latexCompilerVariable
290 echo "you said [" $latexCompilerVariable "]"
292 sed -i -e '/.*VTK_DIR*/ d' /etc/bashrc
293 sed -i -e '/.*LATEX_COMPILER*/ d' /etc/bashrc
294 echo "export VTK_DIR=$vtkdirVariable" >> /etc/bashrc
295 echo "export LATEX_COMPILER=$latexCompilerVariable" >> /etc/bashrc
297 echo "------------------------------------"
299 echo "To go on, run again 'sh menu.sh' as root, in a new window"
300 echo "------------------------------------"
305 echo "========================== 3"
306 sh scripts/CreaTools-load.sh
313 echo "========================== 3"
314 sh scripts/CreaTools-compile.sh
316 # To allow (*very* aware) user to patch code, later
317 chown -R $linuxUserName $generationdir/creatools_source
318 chgrp -R $linuxGroupName $generationdir/creatools_source
319 # Too much time consuming
320 #chown -R $linuxUserName $generationdir/creatools_source
321 #chgrp -R $linuxGroupName $generationdir/creatools_source
325 echo "========================= 4"
326 sh scripts/CreaTools-install.sh
330 echo "========================= 5"
331 sh scripts/CreaTools-uninstall.sh
339 echo "Your answer must be in {0, 1, 2, 3, 4, 5, 9} (was $i)"