/[pdpsoft]/trunk/grid-mw-security/glexec/util/glexec_from_source/glexec_globus_from_source.sh
ViewVC logotype

Contents of /trunk/grid-mw-security/glexec/util/glexec_from_source/glexec_globus_from_source.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1787 - (show annotations) (download) (as text)
Fri Jun 18 10:03:38 2010 UTC (11 years, 7 months ago) by msalle
File MIME type: application/x-shellscript
File size: 14881 byte(s)
Adding locations (commented out) for GT5


1 #!/bin/sh
2
3 # Example script to demonstrate how to build gLExec and its gLite dependencies
4 # from source as obtained from CVS.
5 #
6 # Author: Mischa Sall\'e
7 #
8 # Questions and comments: <grid-mw-security@nikhef.nl>
9 #
10 ##############################################################################
11 # Global definitions, change where needed:
12 ##############################################################################
13
14 export source=/tmp/source # Where to download sources
15 export globus=/tmp/build/globus # Where to install globus
16 export glite=/tmp/build/glite # Where to find glite builds
17
18 # Do NOT change the remaining global variables
19 export prefix=${glite} # Where to install glite builds
20 # (normally same as ${glite}
21 #export CVSROOT=:pserver:anonymous@glite.cvs.cern.ch:/cvs/glite # anonymous CVS
22 export webcvs=http://glite.cvs.cern.ch/cgi-bin/glite.cgi/ # Web CVS
23 export globus_flav=unset
24
25 ##############################################################################
26 # Convenience functions
27 ##############################################################################
28
29 # Print function for results:
30 # $1 - name of component
31 # $2 - result of component
32 print_result() {
33 case "$2" in
34 -1) result="MISSING DEPS" ;;
35 0) result="SUCCESS" ;;
36 1) result="FAILED" ;;
37 *) result="UNKNOWN" ;;
38 esac
39 printf "%-30s: %s\n" "$1" "$result" >&2
40 }
41
42 # cvs checkout wrapper: a wget + untar is much faster than anonymous cvs
43 # checkout, especially due to a 30 sec. timeout of the CVS server.
44 cvsget() {
45 if [ $# -eq 1 ];then
46 url=${webcvs}${1}.tar.gz\?view=tar
47 elif [ $# -eq 2 ];then
48 url=${webcvs}${1}.tar.gz\?view=tar\&pathrev=$2
49 else
50 echo "Syntax error in $0 function" >&2
51 echo "Usage: $0 <component> [tar]" >&2
52 return 1
53 fi
54 # Retrieve tarball and untar on the fly
55 wget -nv -O - $url | tar -zvxf - || return 1
56 return 0
57 }
58
59 ##############################################################################
60 #
61 # Define all building functions
62 #
63 ##############################################################################
64
65 # GLOBUS
66 globus() {
67 # Where to get which globus toolkit tarball
68 # GT4:
69 globus_url=http://www-unix.globus.org/ftppub/gt4/4.0/4.0.8/installers/src/
70 globus_tbz=gt4.0.8-all-source-installer.tar.bz2
71 # GT5:
72 # globus_url=http://www-unix.globus.org/ftppub/gt5/5.0/5.0.1/installers/src/
73 # globus_tbz=gt5.0.1-all-source-installer.tar.bz2
74 #
75 globus_srcdir=`basename ${globus_tbz} .tar.bz2`
76
77 cd ${source}
78 wget -nv -O ${globus_tbz} ${globus_url}${globus_tbz} && \
79 tar -jxf ${globus_tbz} && \
80 cd ${globus_srcdir} && \
81 ./configure --prefix=${globus} \
82 --disable-gridftp --disable-gsiopenssh --disable-myproxy \
83 --disable-rls --disable-drs --disable-rendezvous --disable-tests \
84 --disable-prewsgram --disable-wsgram --disable-wsjava --disable-wsc \
85 --disable-wsmds --disable-wsdel --disable-wsrft --disable-wscas \
86 --disable-wstests --disable-webmds && \
87 make globus-gsi && \
88 make install || return 1
89
90 # Set correct globus flavour:
91 if [ -f "${globus}/etc/globus_core/flavor_gcc64dbg.gpt" ];then
92 globus_flav=gcc64dbg
93 elif [ -f "${globus}/etc/globus_core/flavor_gcc64.gpt" ];then
94 globus_flav=gcc64
95 elif [ -f "${globus}/etc/globus_core/flavor_gcc32dbg.gpt" ];then
96 globus_flav=gcc32dbg
97 elif [ -f "${globus}/etc/globus_core/flavor_gcc32.gpt" ];then
98 globus_flav=gcc32
99 else
100 echo "ERROR: Cannot determine globus flavour." >&2
101 echo " Check ${globus}/etc/globus_core/*.gpt" >&2
102 return 1
103 fi
104 return 0
105 }
106
107 # VOMS: (C & C++ API only)
108 voms() {
109 cd ${source}
110 cvsget org.glite.security.voms glite-security-voms_R_1_9_16_2 && \
111 cd org.glite.security.voms && \
112 ./configure --prefix=${prefix} --with-globus-prefix=${globus} \
113 --disable-java --with-api-only && \
114 make && \
115 make install || return 1
116 return 0
117 }
118
119 # BUILD COMMON-CPP:
120 build_common_cpp() {
121 cd ${source}
122 # cvsget org.glite.build.common-cpp glite-build-common-cpp_R_3_2_8_1 || return 1
123 cvsget org.glite.build.common-cpp || return 1
124 return 0
125 }
126
127 # LCMAPS: Note we use the un-threaded flavor for both: only one present
128 lcmaps() {
129 cd ${source}
130 cvsget org.glite.security.lcmaps && \
131 cd org.glite.security.lcmaps && \
132 cp -p ../org.glite.build.common-cpp/m4/{globus,glite,glite_security,lcmaps}.m4 ./project && \
133 ./bootstrap && \
134 ./configure --prefix=${prefix} --with-glite-location=${glite} \
135 --with-globus-prefix=${globus} \
136 --with-globus-thr-flavor=${globus_flav} \
137 --with-globus-nothr-flavor=${globus_flav} && \
138 make && \
139 make install || return 1
140 return 0
141 }
142
143 # LCAS:
144 lcas() {
145 cd ${source}
146 cvsget org.glite.security.lcas && \
147 cd org.glite.security.lcas && \
148 cp -p ../org.glite.build.common-cpp/m4/{glite,globus,lcmaps}.m4 ./project && \
149 ./bootstrap && \
150 ./configure --prefix=${prefix} --with-glite-location=${glite} \
151 --with-globus-prefix=${globus} \
152 --with-globus-thr-flavor=${globus_flav}pthr \
153 --with-globus-nothr-flavor=${globus_flav} && \
154 make && \
155 make install || return 1
156 return 0
157 }
158
159 # LCAS-INTERFACE:
160 lcas_interface() {
161 cd ${source}
162 cvsget org.glite.security.lcas-interface && \
163 cd org.glite.security.lcas-interface && \
164 cp -p ../org.glite.build.common-cpp/m4/glite.m4 ./project && \
165 ./bootstrap && \
166 ./configure --prefix=${prefix} && \
167 make install || return 1
168 return 0
169 }
170
171 # GLEXEC: extra LDFLAG needed (only) for certain platforms, incl Debian-5 64
172 glexec() {
173 cd ${source}
174 cvsget org.glite.security.glexec && \
175 cd org.glite.security.glexec && \
176 cp -p ../org.glite.build.common-cpp/m4/{glite,globus,lcmaps}.m4 ./project && \
177 ./bootstrap && \
178 LDFLAGS="-Wl,-rpath -Wl,${globus}/lib" \
179 ./configure --prefix=${prefix} \
180 --with-glite-location=${glite} \
181 --with-globus-prefix=${globus} \
182 --with-globus-thr-flavor=${globus_flav}pthr \
183 --with-globus-nothr-flavor=${globus_flav} && \
184 make && \
185 make install || return 1
186 return 0
187 }
188
189 # LCMAPS PLUGINS BASIC:
190 lcmaps_plugins_basic() {
191 cd ${source}
192 cvsget org.glite.security.lcmaps-plugins-basic && \
193 cd org.glite.security.lcmaps-plugins-basic && \
194 cp -p ../org.glite.build.common-cpp/m4/{glite,globus,lcmaps,gridlist}.m4 ./project && \
195 ./bootstrap && \
196 ./configure --prefix=${prefix} --with-glite-location=${glite} \
197 --with-globus-prefix=${globus} \
198 --with-globus-thr-flavor=${globus_flav}pthr \
199 --with-globus-nothr-flavor=${globus_flav} && \
200 make && \
201 make install || return 1
202 return 0
203 }
204
205 # LCMAPS PLUGINS VERIFY-PROXY:
206 lcmaps_plugins_verify_proxy() {
207 cd ${source}
208 cvsget org.glite.security.lcmaps-plugins-verify-proxy && \
209 cd org.glite.security.lcmaps-plugins-verify-proxy && \
210 cp -p ../org.glite.build.common-cpp/m4/{glite,glite_security}.m4 ./project && \
211 ./bootstrap && \
212 ./configure --prefix=${prefix} --with-glite-location=${glite} && \
213 make && \
214 make install || return 1
215 return 0
216 }
217
218 # LCMAPS PLUGINS VOMS:
219 lcmaps_plugins_voms() {
220 cd ${source}
221 cvsget org.glite.security.lcmaps-plugins-voms && \
222 cd org.glite.security.lcmaps-plugins-voms && \
223 cp -p ../org.glite.build.common-cpp/m4/{glite,glite_security,globus,lcmaps,gridlist}.m4 ./project && \
224 ./bootstrap && \
225 ./configure --prefix=${glite} --with-glite-location=${glite} \
226 --with-globus-prefix=${globus} \
227 --with-globus-thr-flavor=${globus_flav}pthr \
228 --with-globus-nothr-flavor=${globus_flav} && \
229 make && \
230 make install || return 1
231 return 0
232 }
233
234 # PEP-C LIB: Will install in same libdir as LCMAPS
235 pep_c_lib() {
236 cd ${source}
237 # Make sure PEP-C is installed in lcmaps directory or else use default.
238 [ -f "${glite}/lib64/liblcmaps.so" ] && \
239 pepclibdir=${glite}/lib64 || \
240 pepclibdir=${glite}/lib
241 svn co http://svnweb.cern.ch/guest/glxa/pep-c-lib/tags/1_3_0 org.glite.authz.pep-c && \
242 cd org.glite.authz.pep-c && \
243 ./autotools.sh && \
244 ./configure --prefix=${glite} --libdir=${pepclibdir} && \
245 make && \
246 make html && \
247 make install || return 1
248 return 0
249 }
250
251 # LCMAPS PLUGINS C-PEP
252 lcmaps_plugins_c_pep() {
253 cd ${source}
254 cvsget org.glite.security.lcmaps-plugins-c-pep && \
255 cd org.glite.security.lcmaps-plugins-c-pep && \
256 cp -p ../org.glite.build.common-cpp/m4/{glite,glite_security}.m4 ./project && \
257 ./bootstrap && \
258 ./configure --prefix=${glite} --with-glite-location=${glite} && \
259 make && \
260 make install || return 1
261 return 0
262 }
263
264 # SAML2XACML2 LIB:
265 saml2_xacml2_c_lib() {
266 cd ${source}
267 cvsget org.glite.security.saml2-xacml2-c-lib && \
268 cd org.glite.security.saml2-xacml2-c-lib && \
269 cp -v -p ../org.glite.build.common-cpp/m4/glite.m4 ./project && \
270 export CXXFLAGS=-fPIC && \
271 cd gsoap-2.7 && \
272 ../autogen.sh && \
273 ./configure --prefix=${glite} && \
274 make && \
275 make install && \
276 cd ../xacml-1.0 && \
277 ../autogen.sh && \
278 ./configure --prefix=${glite} --with-gsoap=${glite} && \
279 make && \
280 make install || return 1
281 return 0
282 }
283
284 # LCMAPS PLUGINS SCAS CLIENT:
285 lcmaps_plugins_scas_client() {
286 cd ${source}
287 cvsget org.glite.security.lcmaps-plugins-scas-client && \
288 cd org.glite.security.lcmaps-plugins-scas-client && \
289 cp -p ../org.glite.build.common-cpp/m4/{glite,glite_security,lcmaps}.m4 ./project && \
290 ./bootstrap && \
291 ./configure --prefix=${glite} --with-glite-location=${glite} && \
292 make && \
293 make install || return 1
294 return 0
295 }
296
297 # LCAS PLUGINS BASIC:
298 lcas_plugins_basic() {
299 cd ${source}
300 cvsget org.glite.security.lcas-plugins-basic && \
301 cd org.glite.security.lcas-plugins-basic && \
302 cp -p ../org.glite.build.common-cpp/m4/{glite,globus,gridlist}.m4 ./project && \
303 ./bootstrap && \
304 ./configure --prefix=${glite} --with-glite-location=${glite} \
305 --with-globus-prefix=${globus} \
306 --with-globus-thr-flavor=${globus_flav}pthr \
307 --with-globus-nothr-flavor=${globus_flav} && \
308 make && \
309 make install || return 1
310 return 0
311 }
312
313 # LCAS PLUGINS CHECK-EXECUTABLE:
314 lcas_plugins_check_executable() {
315 cd ${source}
316 cvsget org.glite.security.lcas-plugins-check-executable && \
317 cd org.glite.security.lcas-plugins-check-executable && \
318 cp -p ../org.glite.build.common-cpp/m4/{glite,globus,gridlist}.m4 ./project && \
319 ./bootstrap && \
320 ./configure --prefix=${glite} --with-glite-location=${glite} \
321 --with-globus-prefix=${globus} \
322 --with-globus-thr-flavor=${globus_flav}pthr \
323 --with-globus-nothr-flavor=${globus_flav} && \
324 make && \
325 make install || return 1
326 return 0
327 }
328
329 ##############################################################################
330 #
331 # Build all tools, taking care of dependencies, first create source directory.
332 #
333 ##############################################################################
334
335 mkdir -p ${source} || {
336 echo "Creating of ${source} FAILED" >&2
337 exit 1 # Fatal...
338 }
339
340 # GLOBUS: no dependencies
341 globus
342 rc_globus=$?
343
344 # BUILD COMMON-CPP: no dependencies
345 build_common_cpp
346 rc_macros=$?
347
348 # VOMS: depends globus
349 if [ $rc_globus -eq 0 ];then
350 voms
351 rc_voms=$?
352 else
353 rc_voms=-1
354 fi
355
356 # LCMAPS: depends globus, voms, common-cpp
357 if [ $rc_globus -eq 0 -a $rc_voms -eq 0 -a $rc_macros -eq 0 ];then
358 lcmaps
359 rc_lcmaps=$?
360 else
361 rc_lcmaps=-1
362 fi
363
364 # LCAS: depends globus, common-cpp
365 if [ $rc_globus -eq 0 -a $rc_macros -eq 0 ];then
366 lcas
367 rc_lcas=$?
368 else
369 rc_lcas=-1
370 fi
371
372 # LCAS-INTERFACE: depends common-cpp
373 if [ $rc_macros -eq 0 ];then
374 lcas_interface
375 rc_lcas_interface=$?
376 else
377 rc_lcas_interface=-1
378 fi
379
380 # GLEXEC: depends globus, lcmaps, common-cpp, lcas, lcas-interface
381 if [ $rc_globus -eq 0 -a $rc_lcmaps -eq 0 -a $rc_macros -eq 0 -a \
382 $rc_lcas -eq 0 -a $rc_lcas_interface -eq 0 ];then
383 glexec
384 rc_glexec=$?
385 else
386 rc_glexec=-1
387 fi
388
389 # LCMAPS PLUGINS BASIC: depends globus, lcmaps, common-cpp
390 if [ $rc_globus -eq 0 -a $rc_lcmaps -eq 0 -a $rc_macros -eq 0 ];then
391 lcmaps_plugins_basic
392 rc_lcmaps_plugins_basic=$?
393 else
394 rc_lcmaps_plugins_basic=-1
395 fi
396
397 # LCMAPS PLUGINS VERIFY-PROXY: depends lcmaps, common-cpp
398 if [ $rc_lcmaps -eq 0 -a $rc_macros -eq 0 ];then
399 lcmaps_plugins_verify_proxy
400 rc_lcmaps_plugins_verify_proxy=$?
401 else
402 rc_lcmaps_plugins_verify_proxy=-1
403 fi
404
405 # LCMAPS PLUGINS VOMS: depends globus, voms, lcmaps, common-cpp
406 if [ $rc_globus -eq 0 -a $rc_voms -eq 0 -a $rc_lcmaps -eq 0 -a \
407 $rc_macros -eq 0 ];then
408 lcmaps_plugins_voms
409 rc_lcmaps_plugins_voms=$?
410 else
411 rc_lcmaps_plugins_voms=-1
412 fi
413
414 # PEP-C LIB: Not dependent on LCMAPS, but need to install it in right place
415 if [ $rc_lcmaps -eq 0 ];then
416 pep_c_lib
417 rc_pep_c_lib=$?
418 else
419 rc_pep_c_lib=-1
420 fi
421
422 # LCMAPS PLUGINS C-PEP: depends lcmaps, pep-c lib, common-cpp
423 if [ $rc_lcmaps -eq 0 -a $rc_pep_c_lib -eq 0 -a $rc_macros -eq 0 ];then
424 lcmaps_plugins_c_pep
425 rc_lcmaps_plugins_c_pep=$?
426 else
427 rc_lcmaps_plugins_c_pep=-1
428 fi
429
430 # SAML2XACML2 LIB: depends common-cpp
431 if [ $rc_macros -eq 0 ];then
432 saml2_xacml2_c_lib
433 rc_saml2_xacml2_c_lib=$?
434 else
435 rc_saml2_xacml2_c_lib=-1
436 fi
437
438 # LCMAPS PLUGINS SCAS CLIENT: depends saml2-xacml2-c-lib, common-cpp
439 if [ $rc_lcmaps -eq 0 -a $rc_saml2_xacml2_c_lib -eq 0 -a $rc_macros -eq 0 ];then
440 lcmaps_plugins_scas_client
441 rc_lcmaps_plugins_scas_client=$?
442 else
443 rc_lcmaps_plugins_scas_client=-1
444 fi
445
446 # LCAS PLUGINS BASIC: depends globus, lcas, common-cpp
447 if [ $rc_globus -eq 0 -a $rc_lcas -eq 0 -a $rc_macros -eq 0 ];then
448 lcas_plugins_basic
449 rc_lcas_plugins_basic=$?
450 else
451 rc_lcas_plugins_basic=-1
452 fi
453
454 # LCAS PLUGINS CHECK-EXECUTABLE: depends globus, lcas, common-cpp
455 if [ $rc_globus -eq 0 -a $rc_lcas -eq 0 -a $rc_macros -eq 0 ];then
456 lcas_plugins_check_executable
457 rc_lcas_plugins_check_executable=$?
458 else
459 rc_lcas_plugins_check_executable=-1
460 fi
461
462 ##############################################################################
463 #
464 # Print results
465 #
466 ##############################################################################
467
468 print_result "GLOBUS" $rc_globus
469 print_result "BUILD-COMMON-CPP" $rc_macros
470 print_result "VOMS" $rc_voms
471 print_result "LCMAPS" $rc_lcmaps
472 print_result "LCAS" $rc_lcas
473 print_result "LCAS interface" $rc_lcas_interface
474 print_result "gLExec" $rc_glexec
475 print_result "LCMAPS plugins-basic" $rc_lcmaps_plugins_basic
476 print_result "LCMAPS plugins-verify-proxy" $rc_lcmaps_plugins_verify_proxy
477 print_result "LCMAPS plugins-voms" $rc_lcmaps_plugins_voms
478 print_result "PEP-C Library" $rc_pep_c_lib
479 print_result "LCMAPS plugins-c-pep" $rc_lcmaps_plugins_c_pep
480 print_result "SAML2-XACML2 C-library" $rc_saml2_xacml2_c_lib
481 print_result "LCMAPS plugins-scas-client" $rc_lcmaps_plugins_scas_client
482 print_result "LCAS plugins-basic" $rc_lcas_plugins_basic
483 print_result "LCAS plugins-check-executable" $rc_lcas_plugins_check_executable
484

Properties

Name Value
svn:executable *

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28