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 "]"
87 echo "Name of the Generation Directory (default is /tmp/myGenerationDir)"
89 if [ "$generationdir" = "" ]
91 generationdir="/tmp/myGenerationDir"
93 echo "you said : [" $generationdir "]"
100 echo "Install Prefix : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
102 if [ "$installPrefix" = "" ]
104 installPrefix="$generationdir/creatools_install"
106 echo "you said : [" $installPrefix "]"
112 while [[ "$docgeneration" != "YES" && "$docgeneration" != "NO" ]]
114 echo "Boolean For Doc Generation : YES/NO (default is NO)"
116 if [ "$docgeneration" = "" ]
120 echo "you said : [" $docgeneration "]"
127 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
129 echo "Where do you want to get source files from : CVS/HTML (default is HTML)"
131 if [ "$sourcesFrom" = "" ]
135 echo "you said : [" $sourcesFrom "]"
142 if [ "$sourcesFrom" = "CVS" ]
144 while [ "$cvsUserName" == "" ]
146 echo "CVS User Name (mandatory!)"
149 echo "you said : [" $cvsUserName "]"
151 cvsUserName="ForgetThisOne"
158 while [ "$linuxUserName" == "" ]
160 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
162 echo "Login User Name (mandatory!)"
164 echo "you said : [" $linuxUserName "]"
170 while [ "$linuxGroupName" == "" ]
172 #echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
173 #echo "Login Group Name (mandatory!)"
174 echo "Login Group Name (mandatory!)"
176 echo "you said : [" $linuxGroupName "]"
183 while [[ "$buildType" != "Release" && "$Debug " != "HTML" ]]
185 echo "Build type : Release/Debug (default is Release)"
187 if [ "$buildType" = "" ]
191 echo "you said : [" $buildType "]"
198 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
200 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
202 if [ "$gdcmVersion" = "" ]
206 echo "you said : [" $gdcmVersion "]"
213 echo " Operating System : $OperatingSystem"
214 echo " Name of the Generation Directory : $generationdir"
215 echo " Install Prefix : $installPrefix"
216 echo " Boolean for Doc Generation : $docgeneration"
217 echo " Where do you want to get source files from : $sourcesFrom"
218 if [ $sourcesFrom = CVS ]
220 echo " CVS User Name : $cvsUserName"
222 echo " Login User Name : $linuxUserName"
223 echo " Login Group Name : $linuxGroupName"
224 echo " Build type : $buildType"
225 echo " Gdcm version : $gdcmVersion"
228 echo "Do you confirm your choices : YES/NO ? (default is NO)"
232 # GROS SOUCIS : Ou generer le fichier CreaTools-configure.sh?
233 # dans $generationdir/creatools_bin ?
234 # -> il n'est pas encore cree !
235 # dans ./Linux/scripts?
238 configureFile="scripts/CreaTools-configure.sh"
240 echo "#!/bin/sh" > $configureFile
241 echo >> $configureFile
242 echo "#File generated by 'menu.sh'" >> $configureFile
243 echo "#DO NOT edit !" >> $configureFile
244 echo "#(except if you *know* what you do)">> $configureFile
245 echo >> $configureFile
246 echo "OperatingSystem=$OperatingSystem" >> $configureFile
247 echo "generationdir=$generationdir" >> $configureFile
248 echo "installPrefix=$installPrefix" >> $configureFile
249 echo "docgeneration=$docgeneration" >> $configureFile
250 echo "sourcesFrom=$sourcesFrom" >> $configureFile
251 echo "cvsUserName=$cvsUserName" >> $configureFile
252 echo "loginUserName=$linuxUserName" >> $configureFile
253 echo "loginGroupName=$linuxGroupName" >> $configureFile
254 echo "buildType=$buildType" >> $configureFile
255 echo "gdcmVersion=$gdcmVersion" >> $configureFile
263 echo "========================== 1 "
264 sh scripts/ThirdParty-install.sh
267 while [ "$vtkdirVariable" = "" ]
270 echo " --------------------------------"
271 echo " Set VTK_DIR environment variable"
272 echo " --------------------------------"
276 echo "you said [" $vtkdirVariable "]"
279 #while [ "$vtkdirVariable" = "" ]
281 # echo " Set VTK_DIR environment variable"
282 # read vtkdirVariable
284 #echo "you said [" $vtkdirVariable "]"
286 latexCompilerVariable=""
287 while [ "$latexCompilerVariable" = "" ]
290 echo " ---------------------------------------"
291 echo " Set LATEX_COMPILER environment variable"
292 echo " ---------------------------------------"
294 read latexCompilerVariable
296 echo "you said [" $latexCompilerVariable "]"
298 sed -i -e '/.*VTK_DIR*/ d' /etc/bashrc
299 sed -i -e '/.*LATEX_COMPILER*/ d' /etc/bashrc
300 echo "export VTK_DIR=$vtkdirVariable" >> /etc/bashrc
301 echo "export LATEX_COMPILER=$latexCompilerVariable" >> /etc/bashrc
303 echo "---------------------------------------------------------"
305 echo "To go on, run again 'sh menu.sh' as root, in a new window"
306 echo "---------------------------------------------------------"
311 echo "========================== 3"
312 sh scripts/CreaTools-load.sh
316 echo "========================== 3"
317 sh scripts/CreaTools-compile.sh
319 # To allow (*very* aware) user to patch code, later
320 chown -R $linuxUserName $generationdir/creatools_source
321 chgrp -R $linuxGroupName $generationdir/creatools_source
322 # Too much time consuming
323 #chown -R $linuxUserName $generationdir/creatools_source
324 #chgrp -R $linuxGroupName $generationdir/creatools_source
328 echo "========================= 4"
329 sh scripts/CreaTools-install.sh
333 echo "========================= 5"
334 sh scripts/CreaTools-uninstall.sh
342 echo "Your answer must be in {0, 1, 2, 3, 4, 5, 9} (was $i)"