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 " Compile the CreaTools : 2"
31 echo " Install the CreaTools : 3"
32 echo " Uninstall the CreaTools : 4"
39 echo "Type in your choice :"
45 ls -l scripts/CreaTools-configure.sh
46 if [ -f scripts/CreaTools-configure.sh ]
48 while [[ "$suitable" != "YES" && \
49 "$suitable" != "NO" ]]
51 echo "'Configure' already done : "
52 echo "------------------------"
53 more scripts/CreaTools-configure.sh
54 echo "------------------------"
55 echo "Are the following values suitable for you : YES/NO? (default is YES)"
57 if [ "$suitable" = "" ]
66 if [ "$suitable" = "NO" ]
71 while [ "$confirm" != "YES" ]
74 while [[ "$OperatingSystem" != "Fedora" && \
75 "$OperatingSystem" != "Ubuntu" && \
76 "$OperatingSystem" != "MacOS" ]]
78 echo "Operating System : Fedora/Ubuntu/MacOS (mandatory!)"
81 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 "]"su
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!)"
175 echo "you said : [" $linuxGroupName "]"
182 while [[ "$buildType" != "Release" && "$Debug " != "HTML" ]]
184 echo "Build type : Release/Debug (default is Release)"
186 if [ "$buildType" = "" ]
190 echo "you said : [" $buildType "]"
197 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
199 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
201 if [ "$gdcmVersion" = "" ]
205 echo "you said : [" $gdcmVersion "]"
212 echo " Operating System : $OperatingSystem"
213 echo " Name of the Generation Directory : $generationdir"
214 echo " Install Prefix : $installPrefix"
215 echo " Boolean for Doc Generation : $docgeneration"
216 echo " Where do you want to get source files from : $sourcesFrom"
217 if [ $sourcesFrom = CVS ]
219 echo " CVS User Name : $cvsUserName"
221 echo " Login User Name : $linuxUserName"
222 echo " Login Group Name : $linuxGroupName"
223 echo " Build type : $buildType"
224 echo " Gdcm version : $gdcmVersion"
227 echo "Do you confirm your choices : YES/NO ? (default is NO)"
231 # GROS SOUCIS : Ou generer le fichier CreaTools-configure.sh?
232 # dans $generationdir/creatools_bin ?
233 # -> il n'est pas encore cree !
234 # dans ./Linux/scripts?
237 configureFile="scripts/CreaTools-configure.sh"
239 echo "#!/bin/sh" > $configureFile
240 echo >> $configureFile
241 echo "#File generated by 'menu.sh'" >> $configureFile
242 echo "#DO NOT edit !" >> $configureFile
243 echo "#(except if you *know* what you do)">> $configureFile
244 echo >> $configureFile
245 echo "OperatingSystem=$OperatingSystem" >> $configureFile
246 echo "generationdir=$generationdir" >> $configureFile
247 echo "installPrefix=$installPrefix" >> $configureFile
248 echo "docgeneration=$docgeneration" >> $configureFile
249 echo "sourcesFrom=$sourcesFrom" >> $configureFile
250 echo "cvsUserName=$cvsUserName" >> $configureFile
251 echo "loginUserName=$linuxUserName" >> $configureFile
252 echo "loginGroupName=$linuxGroupName" >> $configureFile
253 echo "buildType=$buildType" >> $configureFile
254 echo "gdcmVersion=$gdcmVersion" >> $configureFile
263 echo "========================== 1 "
264 sh scripts/ThirdParty-install.sh
267 while [ "$vtkdirVariable" = "" ]
269 echo " Set VTK_DIR environment variable"
272 echo "you said [" $vtkdirVariable "]"
275 #while [ "$vtkdirVariable" = "" ]
277 # echo " Set VTK_DIR environment variable"
278 # read vtkdirVariable
280 #echo "you said [" $vtkdirVariable "]"
282 latexCompilerVariable=""
283 while [ "$latexCompilerVariable" = "" ]
285 echo " Set LATEX_COMPILER environment variable"
286 read latexCompilerVariable
288 echo "you said [" $latexCompilerVariable "]"
290 sed -i -e '/.*VTK_DIR*/ d' /etc/bashrc
291 sed -i -e '/.*LATEX_COMPILER*/ d' /etc/bashrc
292 echo "export VTK_DIR=$vtkdirVariable" >> /etc/bashrc
293 echo "export LATEX_COMPILER=$latexCompilerVariable" >> /etc/bashrc
295 echo "------------------------------------"
297 echo "To go on, run again 'sh menu.sh' as root, in a new window"
298 echo "------------------------------------"
303 echo "========================== 2"
304 sh scripts/CreaTools-compile.sh
306 # To allow (*very* aware) user to patch code, later
307 chown -R $generationdir/creatools_source $linuxUserName
308 chgrp -R $generationdir/creatools_source $linuxGroupName
309 # Too much time consuming
310 #chown -R $generationdir/creatools_source $linuxUserName
311 #chgrp -R $generationdir/creatools_source $linuxGroupName
315 echo "========================= 3"
316 sh scripts/CreaTools-install.sh
320 echo "========================= 4"
321 sh scripts/CreaTools-uninstall.sh
329 echo "Your answer must be in {0, 1, 2, 3, 4, 9} (was $i)"