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