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 "LINUX/MacOS User Name (mandatory!)"
139 echo "you said : [" $linuxUserName "]"
146 while [[ "$buildType" != "Release" && "$Debug " != "HTML" ]]
148 echo "Build type : Release/Debug (default is Release)"
150 if [ "$buildType" = "" ]
154 echo "you said : [" $buildType "]"
161 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
163 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
165 if [ "$gdcmVersion" = "" ]
169 echo "you said : [" $gdcmVersion "]"
176 echo " Operating System : $OperatingSystem"
177 echo " Name of the Generation Directory : $generationdir"
178 echo " Install Prefix : $installPrefix"
179 echo " Boolean For Doc Generation : $docgeneration"
180 echo " Where do you want to get source files from : $sourcesFrom"
181 if [ $sourcesFrom = CVS ]
183 echo " CVS User Name : $cvsUserName"
185 echo " LINUX/MacOS User Name : $linuxUserName"
186 echo " Build type : $buildType"
187 echo " Gdcm version : $gdcmVersion"
190 echo "Do you confirm your choices : YES/NO ? (default is NO)"
195 # GROS SOUCIS : Ou creer le fichier CreaTools-configure.sh?
196 # dans $generationdir/creatools_bin ?
197 # -> il n'est pas encore cree !
198 # dans ./Linux/scripts?
201 configureFile="scripts/CreaTools-configure.sh"
203 echo "#!/bin/sh" > $configureFile
204 echo >> $configureFile
205 echo "#File generated by 'menu.sh'" >> $configureFile
206 echo "#DO NOT edit !" >> $configureFile
207 echo "#(except if you *know* what you do)">> $configureFile
208 echo >> $configureFile
209 echo "OperatingSystem=$OperatingSystem" >> $configureFile
210 echo "generationdir=$generationdir" >> $configureFile
211 echo "installPrefix=$installPrefix" >> $configureFile
212 echo "docgeneration=$docgeneration" >> $configureFile
213 echo "sourcesFrom=$sourcesFrom" >> $configureFile
214 echo "cvsUserName=$cvsUserName" >> $configureFile
215 echo "linuxUserName=$linuxUserName" >> $configureFile
216 echo "buildType=$buildType" >> $configureFile
217 echo "gdcmVersion=$gdcmVersion" >> $configureFile
224 echo "========================== $i "
225 sh scripts/ThirdParty-install.sh
228 while [ "$vtkdirVariable" = "" ]
230 echo " Set VTK_DIR environment variable"
233 echo "you said [" $vtkdirVariable "]"
236 #while [ "$vtkdirVariable" = "" ]
238 # echo " Set VTK_DIR environment variable"
239 # read vtkdirVariable
241 #echo "you said [" $vtkdirVariable "]"
243 latexCompilerVariable=""
244 while [ "$latexCompilerVariable" = "" ]
246 echo " Set LATEX_COMPILER environment variable"
247 read latexCompilerVariable
249 echo "you said [" $latexCompilerVariable "]"
251 sed -i -e '/.*VTK_DIR*/ d' /etc/bashrc
252 sed -i -e '/.*LATEX_COMPILER*/ d' /etc/bashrc
253 echo "export VTK_DIR=$vtkdirVariable" >> /etc/bashrc
254 echo "export LATEX_COMPILER=$latexCompilerVariable" >> /etc/bashrc
256 echo "------------------------------------"
258 echo "To go on, run again 'sh menu.sh' as root, in a new window"
259 echo "------------------------------------"
264 echo "========================== $i"
265 sh scripts/CreaTools-compile.sh
269 echo "========================= $i"
270 sh scripts/CreaTools-install.sh
274 echo "========================= $i"
275 sh scripts/CreaTools-uninstall.sh
283 echo "Your answer must be in {0, 1, 2, 3, 4, 9} (was $i)"