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 "]"
88 echo "Name of the Generation Directory (default is /tmp/myGenerationDir)"
90 if [ "$generationdir" = "" ]
92 generationdir="/tmp/myGenerationDir"
94 echo "you said : [" $generationdir "]"su
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!)"
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 creer 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
264 echo "========================== $i "
265 sh scripts/ThirdParty-install.sh
268 while [ "$vtkdirVariable" = "" ]
270 echo " Set VTK_DIR environment variable"
273 echo "you said [" $vtkdirVariable "]"
276 #while [ "$vtkdirVariable" = "" ]
278 # echo " Set VTK_DIR environment variable"
279 # read vtkdirVariable
281 #echo "you said [" $vtkdirVariable "]"
283 latexCompilerVariable=""
284 while [ "$latexCompilerVariable" = "" ]
286 echo " Set LATEX_COMPILER environment variable"
287 read latexCompilerVariable
289 echo "you said [" $latexCompilerVariable "]"
291 sed -i -e '/.*VTK_DIR*/ d' /etc/bashrc
292 sed -i -e '/.*LATEX_COMPILER*/ d' /etc/bashrc
293 echo "export VTK_DIR=$vtkdirVariable" >> /etc/bashrc
294 echo "export LATEX_COMPILER=$latexCompilerVariable" >> /etc/bashrc
296 echo "------------------------------------"
298 echo "To go on, run again 'sh menu.sh' as root, in a new window"
299 echo "------------------------------------"
304 echo "========================== $i"
305 sh scripts/CreaTools-compile.sh
307 # To allow (very aware) user to patch code
308 chown -R $generationdir/creatools_source $linuxUserName
309 chgrp -R $generationdir/creatools_source $linuxGroupName
310 # Too much time consuming
311 #chown -R $generationdir/creatools_source $linuxUserName
312 #chgrp -R $generationdir/creatools_source $linuxGroupName
316 echo "========================= $i"
317 sh scripts/CreaTools-install.sh
321 echo "========================= $i"
322 sh scripts/CreaTools-uninstall.sh
330 echo "Your answer must be in {0, 1, 2, 3, 4, 9} (was $i)"