]> Creatis software - creaToolsTools.git/blob - Install/scripts/make-install.sh
Exec of this one follows make.sh
[creaToolsTools.git] / Install / scripts / make-install.sh
1 #!/bin/sh
2
3 if [ $# = 0 ]
4 then
5 echo "Use it as :"
6 echo "sh make-install.sh <nameOfTheGenerationDirectory> <BooleanForDocGeneration> <userNameForCVS> <installPrefix> <buildType> <GDCM Version>"
7 echo "with 'installPrefix' : /usr/local or <directory where you want to generate>/creatools_install"
8 echo "with 'GDCM Version' : GDCM1 / GDCM2"
9 echo " "
10 echo "ex : sh make-install.sh /tmp/gendir OFF jpr /tmp/gendir/creatools_install Debug GDCM2"
11 exit 0
12 fi
13
14 echo $#
15 echo "----------"
16 echo $0
17 echo $1
18 echo $2
19 echo $3
20 echo $4
21 echo $5
22 echo $6
23 echo "----------"
24
25 if [ $# != 6 ]
26 then 
27 echo "sh make-install.sh <nameOfTheGenerationDirectory> <BooleanForDocGeneration> <userNameForCVS> <installPrefix> <buildType> <GDCM Version>"
28 echo "with 'installPrefix' : /usr/local or <directory where you want to generate>/creatools_install"
29 echo " "
30 echo "ex : sh make-install.sh /tmp/gendir OFF jpr /tmp/gendir/creatools_install Debug GDCM2"
31 exit 0
32 fi
33
34 # @echo off
35
36 #allow user to choose the generation dir
37 #allow user to choose to generate the doc or not
38
39 generationdir=$1
40 cvsUserName=$3
41 installPrefix=$4
42 buildType=$5
43 gdcmVersion=$6
44
45 scriptDir=$PWD
46 echo scriptDir
47 echo $scriptDir
48
49
50 # /// \TODO check if directories exist.
51 # /// \ exit 0 if they don't (message: run install.sh first!")
52 #mkdir $generationdir
53 #mkdir $generationdir/creatools_source
54 #mkdir $generationdir/creatools_bin
55
56  creasource=crea
57  bbtksource=bbtk
58  creamaracassource=creaMaracasVisu
59  creaenvironmentsource=creaEnvironment
60  creabrukersource=creaBruker
61  creaimagesource=creaImageIO
62  creacontourssource=creaContours
63  crearigidregistrationssource=creaRigidRegistration
64  bbtkgeditorsource=bbtkGEditor
65  creatoolssource=creaTools
66  
67 cd $generationdir
68
69 # start_point : used at debug time : start point of the script
70 # ex : if everything is OK, but bbtkGEditor, 
71 # cvs upate bbtkGEditor manually,and use :
72 # start_point=10
73 # in order not to cvs co everything, nor recompile everything.
74
75 start_point=0
76
77
78
79
80 cd $scriptDir
81
82
83 # -------------------------
84 #        start_point =  2 : CREA
85 #-------------------------
86 if [ $start_point -le 2 ]
87 then
88 # CREA
89 # the following stupid test is used at debug time; Please don't remove!
90 #if [ true = false ]
91 if [ true = true ]
92 then
93  sh compilemod.sh       $buildType   $creasource $generationdir  
94
95 fi
96 fi
97  creadll=$generationdir/creatools_bin/creaBin
98  LD_LIBRARY_PATH=$creadll:LD_LIBRARY_$PATH
99  
100
101
102 # -------------------------
103 #        start_point =  3 : BBTK
104 #-------------------------
105 if [ $start_point -le 3 ]
106 then
107 # the following stupid test is used at debug time; Please don't remove!
108 #if [ true = false ]
109 if [ true = true ]
110 then
111 # BBTK
112  sh compilemod.sh       $buildType $bbtksource $generationdir 
113 fi
114 fi
115  bbtkdll=$generationdir/creatools_bin/bbtkBin
116  LD_LIBRARY_PATH=$bbtkdll:$LD_LIBRARY_PATH
117
118
119 # -------------------------
120 #        start_point =  4 : creaMaracasVisu
121 #-------------------------
122 if [ $start_point -le 4 ]
123 then
124 # the following stupid test is used at debug time; Please don't remove!
125 #if [ true = false ]
126 if [ true = true ]
127 then
128 # creaMaracasVisu
129  sh compilemod.sh               $buildType $creamaracassource $generationdir 
130 fi
131 fi
132  creamaracasdll=$generationdir/creatools_bin/creamaracasBin
133  LD_LIBRARY_PATH=$creamaracasdll:$LD_LIBRARY_PATH
134
135
136 # -------------------------
137 #        start_point =  5 : creaEnvironment
138 #-------------------------
139 if [ $start_point -le 5 ]
140 then
141 # the following stupid test is used at debug time; Please don't remove!
142 #if [ true = false ]
143 if [ true = true ]
144 then
145 # creaEnvironment
146  sh compilemod.sh $buildType    $creaenvironmentsource $generationdir
147 fi
148 fi
149  creaenvironmentdll=$generationdir/creatools_bin/creaenvironmentBin
150  LD_LIBRARY_PATH=$creaenvironmentdll:$LD_LIBRARY_PATH
151
152
153 # -------------------------
154 #        start_point =  6 : creaBruker
155 #-------------------------
156 if [ $start_point -le 6 ]
157 then
158 # the following stupid test is used at debug time; Please don't remove!
159 #if [ true = false ]
160 if [ true = true ]
161 then
162 # creaBruker
163  sh compilemod.sh $buildType    $creabrukersource  $generationdir
164  echo generationdir 
165 fi
166 fi
167  creabrukerdll=$generationdir/creatools_bin/creabrukerBin
168  LD_LIBRARY_PATH=$creabrukerdll:$LD_LIBRARY_PATH
169
170
171 # -------------------------
172 #        start_point =  7 : creaImageIO
173 #-------------------------
174 if [ $start_point -le 7 ]
175 then
176  # the following stupid test is used at debug time; Please don't remove!
177 #if [ true = false ]
178 if [ true = true ]
179 then
180 # creaImageIO
181  sh compilemod.sh               $buildType $creaimagesource $generationdir
182 fi
183 fi
184  creaimagedll=$generationdir/creatools_bin/creaimageBin
185  LD_LIBRARY_PATH=$creaimagedll:$LD_LIBRARY_PATH
186
187
188 # -------------------------
189 #        start_point =  8 : creaContour
190 #-------------------------
191 if [ $start_point -le 8 ]
192 then
193 # the following stupid test is used at debug time; Please don't remove!
194 #if [ true = false ]
195 if [ true = true ]
196 then
197 # creaContours
198  sh compilemod.sh               $buildType $creacontourssource $generationdir
199 fi
200 fi
201 # creacontourdll=$generationdir/creatools_bin/creacontoursBin
202 # LD_LIBRARY_PATH=$creacontoursdll:$LD_LIBRARY_PATH
203
204
205 # -------------------------
206 #        start_point =  9 : creaRigidRegistration
207 #-------------------------
208 if [ $start_point -le 9 ]
209 then
210 # the following stupid test is used at debug time; Please don't remove!
211 #if [ true = false ]
212 if [ true = true ]
213 then
214  sh compilemod.sh                       $buildType $crearigidregistrationssource $generationdir
215 fi
216 fi
217 # crearigidregistrationdll=$generationdir/creatools_bin/crearigidregistrationBin
218 # LD_LIBRARY_PATH=$crearigidregistrationdll:$LD_LIBRARY_PATH
219
220
221 # -------------------------
222 #        start_point =  10 : bbtkGEditor
223 #-------------------------
224 if [ $start_point -le 10 ]
225 then
226 # the following stupid test is used at debug time; Please don't remove!
227 #if [ true = false ]
228 if [ true = true ]
229 then
230 # bbtkGEditor
231  sh compilemod.sh               $buildType $bbtkgeditorsource $generationdir
232 fi
233 fi
234 # bbtkgeditordll=$generationdir/creatools_bin/bbtkgeditorBin
235 # LD_LIBRARY_PATH=$bbtkgeditordll:$LD_LIBRARY_PATH
236
237
238 # -------------------------
239 #        start_point =  11 : creaTools
240 #-------------------------
241 if [ $start_point -le 11 ]
242 then
243 # the following stupid test is used at debug time; Please don't remove!
244 #if [ true = false ]
245 if [ true = true ]
246 then
247 # creaTools
248  sh compilemod.sh                  $buildType $creatoolssource $generationdir
249 fi
250 fi
251
252
253 #  creatoolsdll=$generationdir/creatools_bin/creatoolsBin
254 #  LD_LIBRARY_PATH=$creatoolssdll:$LD_LIBRARY_PATH
255
256
257 CREATOOLS_INSTALL_DIR=$installPrefix
258 sudo rm        $CREATOOLS_INSTALL_DIR/share/creatools_base_library_config.sh
259 sudo touch     $CREATOOLS_INSTALL_DIR/share/creatools_base_library_config.sh
260 sudo chmod 666 $CREATOOLS_INSTALL_DIR/share/creatools_base_library_config.sh
261
262 #######################################
263
264 sudo touch     $installPrefix/share/creatools_base_library_config.sh
265 sudo chmod 666 $installPrefix/share/creatools_base_library_config.sh
266
267
268 sudo echo export PATH='$'PATH:$installPrefix/bin                                  >> $installPrefix/share/creatools_base_library_config.sh
269 sudo echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib/creatools >> $installPrefix/share/creatools_base_library_config.sh
270 sudo echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib64/creatools >> $installPrefix/share/creatools_base_library_config.sh
271
272 #  modify .bashrc
273 # - remove line 'sh $installPrefix/creatools_install/share/creatools_base_party_libraries_config.sh' if any (with accurate value for ???)
274 sed -i -e '/.*creatools_base_library_config.*/ d' ~/.bashrc
275
276 # - add line 'sh $installPrefix/creatools_install/share/creatools_base_libraries_config.sh' (with accurate value for ???)
277 echo source $installPrefix/share/creatools_base_library_config.sh >> ~/.bashrc 
278
279
280 # shutdown /s
281 # exit /b