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 :"
47 while [ "$confirm" != "YES" ]
50 while [[ "$OperatingSystem" != "Fedora" && \
51 "$OperatingSystem" != "Ubuntu" && \
52 "$OperatingSystem" != "MacOS" ]]
54 echo "Operating System : Fedora/Ubuntu/MacOS (mandatory!)"
57 echo "you said : [" $OperatingSystem "]"
64 echo "Name of the Generation Directory (default is /tmp/myGenerationDir)"
66 if [ "$generationdir" = "" ]
68 generationdir="/tmp/myGenerationDir"
70 echo "you said : [" $generationdir "]"su
77 echo "Install Prefix : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
79 if [ "$installPrefix" = "" ]
81 installPrefix="$generationdir/creatools_install"
83 echo "you said : [" $installPrefix "]"
89 while [[ "$docgeneration" != "YES" && "$docgeneration" != "NO" ]]
91 echo "Boolean For Doc Generation : YES/NO (default is NO)"
93 if [ "$docgeneration" = "" ]
97 echo "you said : [" $docgeneration "]"
104 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
106 echo "Where do you want to get source files from : CVS/HTML (default is HTML)"
108 if [ "$sourcesFrom" = "" ]
112 echo "you said : [" $sourcesFrom "]"
119 if [ "$sourcesFrom" = "CVS" ]
121 while [ "$cvsUserName" == "" ]
123 echo "CVS User Name (mandatory!)"
126 echo "you said : [" $cvsUserName "]"
128 cvsUserName="ForgetThisOne"
135 while [ "$linuxUserName" == "" ]
137 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
139 echo "Login User Name (mandatory!)"
141 echo "you said : [" $linuxUserName "]"
147 while [ "$linuxGroupName" == "" ]
149 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
150 echo "Login Group Name (mandatory!)"
152 echo "you said : [" $linuxGroupName "]"
159 while [[ "$buildType" != "Release" && "$Debug " != "HTML" ]]
161 echo "Build type : Release/Debug (default is Release)"
163 if [ "$buildType" = "" ]
167 echo "you said : [" $buildType "]"
174 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
176 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
178 if [ "$gdcmVersion" = "" ]
182 echo "you said : [" $gdcmVersion "]"
189 echo " Operating System : $OperatingSystem"
190 echo " Name of the Generation Directory : $generationdir"
191 echo " Install Prefix : $installPrefix"
192 echo " Boolean For Doc Generation : $docgeneration"
193 echo " Where do you want to get source files from : $sourcesFrom"
194 if [ $sourcesFrom = CVS ]
196 echo " CVS User Name : $cvsUserName"
198 echo " Login User Name : $linuxUserName"
199 echo " Login Group Name : $linuxGroupName"
200 echo " Build type : $buildType"
201 echo " Gdcm version : $gdcmVersion"
204 echo "Do you confirm your choices : YES/NO ? (default is NO)"
209 # GROS SOUCIS : Ou creer le fichier CreaTools-configure.sh?
210 # dans $generationdir/creatools_bin ?
211 # -> il n'est pas encore cree !
212 # dans ./Linux/scripts?
215 configureFile="scripts/CreaTools-configure.sh"
217 echo "#!/bin/sh" > $configureFile
218 echo >> $configureFile
219 echo "#File generated by 'menu.sh'" >> $configureFile
220 echo "#DO NOT edit !" >> $configureFile
221 echo "#(except if you *know* what you do)">> $configureFile
222 echo >> $configureFile
223 echo "OperatingSystem=$OperatingSystem" >> $configureFile
224 echo "generationdir=$generationdir" >> $configureFile
225 echo "installPrefix=$installPrefix" >> $configureFile
226 echo "docgeneration=$docgeneration" >> $configureFile
227 echo "sourcesFrom=$sourcesFrom" >> $configureFile
228 echo "cvsUserName=$cvsUserName" >> $configureFile
229 echo "loginUserName=$linuxUserName" >> $configureFile
230 echo "loginGroupName=$linuxGroupName" >> $configureFile
231 echo "buildType=$buildType" >> $configureFile
232 echo "gdcmVersion=$gdcmVersion" >> $configureFile
239 echo "========================== $i "
240 sh scripts/ThirdParty-install.sh
243 while [ "$vtkdirVariable" = "" ]
245 echo " Set VTK_DIR environment variable"
248 echo "you said [" $vtkdirVariable "]"
251 #while [ "$vtkdirVariable" = "" ]
253 # echo " Set VTK_DIR environment variable"
254 # read vtkdirVariable
256 #echo "you said [" $vtkdirVariable "]"
258 latexCompilerVariable=""
259 while [ "$latexCompilerVariable" = "" ]
261 echo " Set LATEX_COMPILER environment variable"
262 read latexCompilerVariable
264 echo "you said [" $latexCompilerVariable "]"
266 sed -i -e '/.*VTK_DIR*/ d' /etc/bashrc
267 sed -i -e '/.*LATEX_COMPILER*/ d' /etc/bashrc
268 echo "export VTK_DIR=$vtkdirVariable" >> /etc/bashrc
269 echo "export LATEX_COMPILER=$latexCompilerVariable" >> /etc/bashrc
271 echo "------------------------------------"
273 echo "To go on, run again 'sh menu.sh' as root, in a new window"
274 echo "------------------------------------"
279 echo "========================== $i"
280 sh scripts/CreaTools-compile.sh
282 # To allow (very aware) user to patch code
283 chown -R $generationdir/creatools_source $linuxUserName
284 chgrp -R $generationdir/creatools_source $linuxGroupName
285 # Too much time consuming
286 #chown -R $generationdir/creatools_source $linuxUserName
287 #chgrp -R $generationdir/creatools_source $linuxGroupName
291 echo "========================= $i"
292 sh scripts/CreaTools-install.sh
296 echo "========================= $i"
297 sh scripts/CreaTools-uninstall.sh
305 echo "Your answer must be in {0, 1, 2, 3, 4, 9} (was $i)"