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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2046 - (show annotations) (download) (as text)
Fri Oct 15 13:48:52 2010 UTC (11 years, 8 months ago) by msalle
File MIME type: application/x-shellscript
File size: 32988 byte(s)
remove extra echo

1 #!/bin/sh
2
3 # Script to build Nikhef-developed gLite tools from source as obtained from CVS
4 # and SVN.
5 #
6 # Author: Mischa Sall\'e
7 #
8 # Questions and comments: <grid-mw-security@nikhef.nl>
9 #
10 ##############################################################################
11 # Global definitions
12 ##############################################################################
13
14 SOURCE_DEFAULT=/tmp/source # Where to download sources
15 BUILD_DEFAULT=/tmp/build # Where to install binaries
16
17 webcvs=http://glite.cvs.cern.ch/cgi-bin/glite.cgi/ # Web CVS location
18 globus_flav=unset
19
20 # Valid return codes: anything less than RC_FAILED is non-blocking
21 RC_SUCCESS=0
22 RC_SKIPPED=1
23 RC_FAILED=2
24 RC_MISSDEP=4
25
26 # Set defaults
27 PROG=`basename $0`
28 DEPEND=1 # Do dependency checks when building all
29 REMOVE=0 # Do NOT remove directories before downloading etc.
30 USAGE=0 # printing of usage is not a default (-;
31 CONFIG="" # No default configuration file
32 STDOUT="" # No file for stdout
33 STDERR="" # No file for stderr
34 PLATFORM="" # No default platform (only used for globus from etics)
35 SOURCE="$SOURCE_DEFAULT" # where to download sources
36 BUILD="$BUILD_DEFAULT" # where to install binaries
37
38 # Parse command line options
39 while getopts ":c:i:s:b:g:dhro:e:p:" i ; do
40 case "$i" in
41 c) CONFIG="$OPTARG" ;;
42 i) INPUT="$OPTARG" ;;
43 s) SOURCE="$OPTARG" ;;
44 b) BUILD="$OPTARG" ;;
45 g) GLOBUS="$OPTARG" ;;
46 d) DEPEND=0 ;;
47 h) USAGE=1 ;;
48 r) REMOVE=1 ;;
49 o) STDOUT="$OPTARG" ;;
50 e) STDERR="$OPTARG" ;;
51 p) PLATFORM="$OPTARG" ;;
52 :) echo "$PROG: option requires an argument -- '$OPTARG'" >&2
53 echo "Try \`$PROG -h' for more information." >&2
54 exit 1 ;;
55 \?) echo "$PROG: invalid option -- '$OPTARG'" >&2
56 echo "Try \`$PROG -h' for more information." >&2
57 exit 1 ;;
58 esac
59 done
60 shift `expr $OPTIND - 1`
61
62 # Check source/build directories...
63 if [ "`echo $SOURCE|cut -c1`" != "/" ];then
64 echo "$PROG: Source directory should be absolute" >&2
65 exit 1
66 fi
67 if [ "`echo $BUILD|cut -c1`" != "/" ];then
68 echo "$PROG: Build directory should be absolute" >&2
69 exit 1
70 fi
71 globus=${GLOBUS:-${BUILD}/globus} # Where to install/find globus
72 gridsite=${BUILD}/gridsite # Where to install/find gridsite
73 glite=${BUILD}/glite # Where to find glite builds
74 # Check globus directory...
75 if [ "`echo $globus|cut -c1`" != "/" ];then
76 echo "$PROG: globus directory should be absolute" >&2
77 exit 1
78 fi
79
80 prefix=${glite} # Where to install glite builds
81
82 # When using a file: get targets from there, otherwise use $*
83 if [ -n "$INPUT" ];then
84 # remove everything starting with # (better not # in names...)
85 targets="`sed 's/#.*$//' $INPUT` $*"
86 else
87 targets="$*"
88 fi
89
90 ##############################################################################
91 # Convenience functions
92 ##############################################################################
93
94
95 # Prints usage message
96 usage() {
97 echo "Usage: `basename $0` [options] [targets]"
98 echo
99 echo "Options:"
100 echo " -c <config> get build options from config file."
101 echo " -i <file> get targets from file, any targets on the cmdline"\
102 "are added."
103 echo " -s specify absolute directory where to checkout sources,"\
104 "default ${SOURCE_DEFAULT}"
105 echo " -b specify absolute install directory,"\
106 "default ${BUILD_DEFAULT}"
107 echo " -g specify absolute globus directory,"\
108 "default ${BUILD_DEFAULT}/globus"
109 echo " -d don't check dependencies."
110 echo " -r remove (old) source directories before checkout."
111 echo " -o <file> send checkout/build stdout to given file."
112 echo " -e <file> send checkout/build stderr to given file."
113 echo " -p <platform> download globus for this platform from etics/VDT"\
114 "instead of building from source."
115 echo " -h show this helptext."
116 echo
117 echo "Format for config file:"
118 echo "<target> [tag:<value>] [compo:<value>] [cvsroot:<value>]"\
119 "[svnroot:<value>] [coopts:<value>]"
120 echo " tag specifies CVS or SVN tag"
121 echo " compo specifies glite component name (e.g. org.glite.security.voms)"
122 echo " cvsroot specifies CVSROOT, when empty use CERN webcvs"
123 echo " svnroot specifies full SVN URL (including component)"
124 echo " coopts specifies checkout options for CVS/SVN"
125 echo "A line can be continued using the \\ char."
126 echo "After a # the remainder of the line is ignored."
127 echo "SVN will only be used if cvsroot is unset AND svnroot is set."
128 echo "coopts are inserted after the checkout command for cvs or svn."
129 echo
130 echo "Notes:"
131 echo "1. when the special target all is specified, all known targets are built."
132 echo "2. targets are build in the specified order."
133 echo "3. when checking dependencies, only dependencies which are actually "
134 echo " being build will be checked."
135 echo
136 echo "Known targets:"
137 for target in $known_targets;do
138 echo " $target"
139 done
140 echo
141 return $RC_SUCCESS
142 }
143 # Function which is used to create the dependency checking functions.
144 # arguments:
145 # $1 - target
146 # $2... - dependencies
147 setdeps() {
148 if [ $# -eq 0 ];then
149 echo "Error: $0 needs at least one argument." >&2
150 return $RC_FAILED
151 fi
152
153 # target
154 target=$1; shift
155 known_targets="$known_targets $target"
156
157 eval rc_$target=$RC_SKIPPED
158
159 depstring=""
160 # Only when we DO want dependency checking...
161 if [ $DEPEND -eq 1 ];then
162 while [ $# -gt 0 ];do
163 # Use RC_FAILED as default for rc_$1 in case it's not defined
164 depstring="$depstring \${rc_$1:-\$RC_FAILED} -lt \$RC_FAILED"
165 shift
166 if [ $# -gt 0 ];then
167 depstring="$depstring -a"
168 fi
169 done
170 fi
171
172 # define the dep_ function
173 if [ -n "$depstring" ];then
174 eval "dep_$target() {
175 if [ $depstring ];then
176 $target
177 rc_$target=\$?
178 else
179 rc_$target=\$RC_MISSDEP
180 fi
181 }"
182 else
183 eval "dep_$target() {
184 $target
185 rc_$target=\$?
186 }"
187 fi
188 }
189
190 # function to get a suitable download command with cmdline args. The result will
191 # be in variable $wget
192 # Expected format:
193 # $wget $URL > $outputfile
194 get_download_cmd() {
195 func=get_downloadcmd
196 if which wget > /dev/null 2> /dev/null;then
197 wget="wget -nv -O -"
198 elif which curl > /dev/null 2> /dev/null;then
199 wget="curl -s"
200 elif which lynx > /dev/null 2> /dev/null;then
201 wget="lynx -dump -source"
202 else
203 echo "$PROG: $func: Cannot find download tool such as wget, curl, lynx etc." >&2
204 exit 1
205 fi
206 }
207
208 # function that parses the CONFIG file and sets all the tag_ compo_ cvsroot_
209 # svnroot_ variables
210 # We cannot use subshells in order to get the vars in the current shell, which
211 # sometimes obfuscates the code a bit.
212 parse_config() {
213 lines=`cat $CONFIG|wc -l`
214 lineno=0
215 line=""
216 cont=0
217 while [ $lineno -lt $lines ];do
218 lineno=`expr $lineno + 1`
219 readline=`sed -n ${lineno}p $CONFIG`
220 # replace trailing [whitespace] \ [whitespace] by a single space
221 subline=`echo "${readline}"|sed 's/[ \t]*\\\[ \t]*$/ /'`
222 line="${line}${subline}"
223 # Continue when continuation char, empty line, or comment line
224 if [ "$subline" != "$readline" ];then
225 cont=1
226 continue
227 fi
228 # line is ready, parse the components
229 first=1
230 for field in `echo $line`;do
231 # first char == '#' ? then go to next line
232 [ "`echo "$field"|cut -c1`" = '#' ] && break
233 # Now differentiate between first compo and others
234 if [ $first -eq 1 ];then
235 name=$field
236 # Make sure we reset the variables
237 eval "tag_$name=\"\""
238 eval "compo_$name=\"\""
239 eval "cvsroot_$name=\"\""
240 eval "svnroot_$name=\"\""
241 eval "coopts_$name=\"\""
242 first=0
243 else
244 case "$field" in
245 tag:*) eval tag_$name=\$\{field#tag:\} ;;
246 compo:*) eval compo_$name=\$\{field#compo:\} ;;
247 cvsroot:*) eval cvsroot_$name=\$\{field#cvsroot:\} ;;
248 svnroot:*) eval svnroot_$name=\$\{field#svnroot:\} ;;
249 coopts:) eval coopts_$name=\$\{field#coopts:\} ;;
250 esac
251 fi
252 done
253 # reset line and cont
254 line=""
255 cont=0
256 done
257 if [ $cont -ne 0 ];then
258 echo "$PROG: Unexpected end of file while parsing $CONFIG" >&2
259 exit 1
260 fi
261 }
262
263 # cvs checkout wrapper: a wget + untar is much faster than anonymous cvs
264 # checkout, especially due to a 30 sec. timeout of the CVS server.
265 cvsget() {
266 name="$1"
267 dir="$2"
268 [ -z "$name" ] && return $RC_FAILED
269 eval compo=\$\{compo_$name\}
270 eval tag=\$\{tag_$name\}
271 eval cvsroot=\$\{cvsroot_$name\}
272 eval coopts=\$\{coopts_$name\}
273 if [ -n "$cvsroot" ];then
274 # optionally remove directory
275 [ $REMOVE -eq 1 ] && rm -rf ${dir:-$compo}
276 # use cvs checkout
277 cvs -d $cvsroot co $coopts \
278 ${tag:+-r $tag} \
279 ${dir:+-d $dir} $compo || return $RC_FAILED
280 else
281 # Use tarball installation: always remove old dir
282 rm -rf ${dir:-$compo}
283 url="${webcvs}${compo}.tar.gz?view=tar${tag:+&pathrev=$tag}"
284 # If custom directory: download in tmpdir and later move to dir
285 if [ -n "$dir" ];then
286 tmpdir=tmpdir.$$
287 mkdir ${tmpdir} && cd ${tmpdir} || return $RC_FAILED
288 fi
289 # Retrieve tarball and untar on the fly
290 eval "${wget} \"$url\"" | tar -zvxf - || return $RC_FAILED
291 # Move downloaded dir into $dir and cleanup
292 if [ -n "$dir" ];then
293 cd .. && \
294 mv ${tmpdir}/${compo} $dir && \
295 rmdir ${tmpdir} || return $RC_FAILED
296 unset tmpdir
297 fi
298 fi
299
300 return $RC_SUCCESS
301 }
302
303 # svn checkout wrapper
304 svnget() {
305 name="$1"
306 dir="$2"
307 [ -z "$name" ] && return $RC_FAILED
308 eval compo=\$\{compo_$name\}
309 eval tag=\$\{tag_$name\}
310 eval svnroot=\$\{svnroot_$name\}
311 eval coopts=\$\{coopts_$name\}
312 realdir=${dir:-$compo}
313 # optionally remove directory
314 [ $REMOVE -eq 1 ] && rm -rf ${realdir}
315 svn co $coopts ${svnroot}${tag} ${realdir} || return $RC_FAILED
316 unset realdir
317
318 return $RC_SUCCESS
319 }
320
321 # general cvs and svn wrapper: use svn ONLY when cvsroot is NOT defined AND
322 # svnroot is defined. In all other cases, use cvsroot
323 get() {
324 name="$1"
325 dir="$2"
326 [ -z "$name" ] && return $RC_FAILED
327 eval cvsroot=\$\{cvsroot_$name\}
328 eval svnroot=\$\{svnroot_$name\}
329 if [ -z "$cvsroot" -a -n "$svnroot" ] ; then
330 svnget $name $dir
331 else
332 cvsget $name $dir
333 fi
334 return $?
335 }
336
337 # Print function for results:
338 # $1 - name of component, result is in $rc_<name of component>
339 print_result() {
340 tool=$1
341 eval rc=\$rc_$tool
342 [ "$rc" = "$RC_SKIPPED" ] && return
343 case "$rc" in
344 $RC_SUCCESS) result="SUCCESS" ;;
345 $RC_MISSDEP) result="MISSING DEPS"
346 MISSING=$RC_MISSDEP ;;
347 $RC_FAILED) result="FAILED"
348 FAILED=$RC_FAILED ;;
349 *) result="UNKNOWN: $rc" ;;
350 esac
351 printf "%-30s: %s\n" "$tool" "$result"
352 }
353
354 # Build the targets and print the results
355 build() {
356 # build the targets
357 for target in $build_targets;do
358 eval dep_$target
359 done
360
361 # Print results
362 for target in $known_targets;do
363 print_result $target
364 done
365 }
366
367 ##############################################################################
368 #
369 # Define all building functions
370 #
371 ##############################################################################
372
373 # GLOBUS
374
375 # globus from VDT/etics tarball
376 globus_etics() {
377 # Find correct globus for platform
378 case "$PLATFORM" in
379 RH4_32)
380 globus_url=http://etics-repository.cern.ch/repository/download/registered/vdt/globus/4.0.3-VDT-1.6.1/slc4_ia32_gcc346/
381 globus_tgz=globus-4.0.3-VDT-1.6.1-7.tar.gz
382 globus_flav=gcc32dbg
383 ;;
384 RH5_64)
385 globus_url=http://etics-repository.cern.ch/repository/download/registered/vdt/globus/4.0.7-VDT-1.10.1/sl5_x86_64_gcc412/
386 globus_tgz=globus-4.0.7-VDT-1.10.1-1.tar.gz
387 globus_flav=gcc64dbg
388 ;;
389 SUSE11_64)
390 globus_url=http://eticssoft.web.cern.ch/eticssoft/repository//vdt/globus/4.0.7-VDT-1.10.1/SUSE11_x86_64_gcc432/
391 globus_tgz=globus-4.0.7-VDT-1.10.1-1.tar.gz
392 globus_flav=gcc64dbg
393 ;;
394 Deb5_64)
395 globus_url=http://etics-repository.cern.ch/repository/download/registered/vdt/globus/4.0.8-VDT-2.0.0/deb5_x86_64_gcc432/
396 globus_tgz=globus-4.0.8-VDT-2.0.0-2.tar.gz
397 globus_flav=gcc64dbg
398 ;;
399 *)
400 echo "Unknown platform: \"$PLATFORM\"" >&2
401 echo "Valid platforms are:" >&2
402 echo " RH4_32" >&2
403 echo " RH5_64" >&2
404 echo " SUSE11_64" >&2
405 echo " Deb5_64" >&2
406 exit 1
407 ;;
408 esac
409
410 # Now download, unpack, and update the tarball
411 cd ${SOURCE}
412 mkdir -p ${globus} && \
413 eval ${wget} ${globus_url}${globus_tgz} > ${globus_tgz} && \
414 tar -C ${globus} -zxf ${globus_tgz} && \
415 cd ${globus} && \
416 find -type f -name \*.la|while read file;do
417 sed s+/opt/globus+${globus}+g ${file} > ${file}.new && \
418 mv -f ${file}.new ${file}
419 done || return $RC_FAILED
420
421 return $RC_SUCCESS
422 }
423
424 # globus directly from source tarball
425 globus_source() {
426 tag=${tag_globus:-4.0.8}
427 major=`echo $tag|cut -d. -f1`
428 minor=`echo $tag|cut -d. -f2`
429 # Where to get which globus toolkit tarball
430 globus_url=http://www-unix.globus.org/ftppub/gt${major}/${major}.${minor}/${tag}/installers/src/
431 globus_tbz=gt${tag}-all-source-installer.tar.bz2
432 globus_srcdir=`basename ${globus_tbz} .tar.bz2`
433
434 # Note: making globus_gridmap_callout_error globus_authz only needed for gt4
435 # interface.
436 cd ${SOURCE}
437 eval ${wget} ${globus_url}${globus_tbz} > ${globus_tbz} && \
438 tar -jxf ${globus_tbz} && \
439 cd ${globus_srcdir} && \
440 ./configure --prefix=${globus} \
441 --disable-gridftp --disable-gsiopenssh --disable-myproxy \
442 --disable-rls --disable-drs --disable-rendezvous --disable-tests \
443 --disable-prewsgram --disable-wsgram --disable-wsjava --disable-wsc \
444 --disable-wsmds --disable-wsdel --disable-wsrft --disable-wscas \
445 --disable-wstests --disable-webmds && \
446 make globus-gsi globus_gridmap_callout_error globus_authz && \
447 make install || return $RC_FAILED
448
449 # (re)evaluate globus flavour
450 globus_flavour
451 if [ $? -eq $RC_FAILED ];then
452 echo "ERROR: Cannot determine globus flavour." >&2
453 echo " Check ${globus}/etc/globus_core/*.gpt" >&2
454 return $RC_FAILED
455 fi
456 return $RC_SUCCESS
457 }
458
459 # Set correct globus flavour
460 globus_flavour() {
461 if [ -n "$PLATFORM" ];then
462 case "$PLATFORM" in
463 RH4_32) globus_flav=gcc32dbg ;;
464 RH5_64) globus_flav=gcc64dbg ;;
465 SUSE11_64) globus_flav=gcc64dbg ;;
466 Deb5_64) globus_flav=gcc64dbg ;;
467 *) echo "Unknown platform: \"$PLATFORM\"" >&2
468 return $RC_FAILED ;;
469 esac
470 else
471 if [ -f "${globus}/etc/globus_core/flavor_gcc64dbg.gpt" ];then
472 globus_flav=gcc64dbg
473 elif [ -f "${globus}/etc/globus_core/flavor_gcc64.gpt" ];then
474 globus_flav=gcc64
475 elif [ -f "${globus}/etc/globus_core/flavor_gcc32dbg.gpt" ];then
476 globus_flav=gcc32dbg
477 elif [ -f "${globus}/etc/globus_core/flavor_gcc32.gpt" ];then
478 globus_flav=gcc32
479 else
480 return $RC_FAILED
481 fi
482 fi
483 return $RC_SUCCESS
484 }
485
486 # wrapper function that either does a source download or etics download
487 globus() {
488 if [ -z "$PLATFORM" ];then
489 globus_source
490 else
491 globus_etics
492 fi
493 }
494
495 # VOMS: (C & C++ API only)
496 voms() {
497 compo_voms=${compo_voms:-org.glite.security.voms}
498 cd ${SOURCE}
499 get voms && \
500 cd ${compo_voms} && \
501 ./configure --prefix=${prefix} --with-globus-prefix=${globus} \
502 --disable-java --with-api-only && \
503 make && \
504 make install || return $RC_FAILED
505 return $RC_SUCCESS
506 }
507
508 # BUILD COMMON-CPP:
509 common_cpp() {
510 compo_common_cpp=${compo_common_cpp:-org.glite.build.common-cpp}
511 cd ${SOURCE}
512 get common_cpp || return $RC_FAILED
513 return $RC_SUCCESS
514 }
515
516 # LCMAPS: Note we can always use the un-threaded flavor for both
517 lcmaps() {
518 compo_lcmaps=${compo_lcmaps:-org.glite.security.lcmaps}
519 cd ${SOURCE}
520 get lcmaps && \
521 cd ${compo_lcmaps} && \
522 cp -fp ../${compo_common_cpp}/m4/globus.m4 \
523 ../${compo_common_cpp}/m4/glite.m4 \
524 ../${compo_common_cpp}/m4/glite_security.m4 \
525 ../${compo_common_cpp}/m4/lcmaps.m4 ./project && \
526 ./bootstrap && \
527 ./configure --prefix=${prefix} --with-glite-location=${glite} \
528 --with-globus-prefix=${globus} \
529 --with-globus-thr-flavor=${globus_flav} \
530 --with-globus-nothr-flavor=${globus_flav} && \
531 make && \
532 make install || return $RC_FAILED
533 return $RC_SUCCESS
534 }
535
536 # LCMAPS-INTERFACE:
537 lcmaps_interface() {
538 dir=org.glite.security.lcmaps-interface
539 compo_lcmaps_interface=${compo_lcmaps_interface:-org.glite.security.lcmaps}
540 # cvsroot_lcmaps_interface=:ext:msalle@glite.cvs.cern.ch:/cvs/glite
541 cd ${SOURCE}
542 get lcmaps_interface $dir && \
543 cd ${dir} && \
544 cp -fp ../${compo_common_cpp}/m4/globus.m4 \
545 ../${compo_common_cpp}/m4/glite.m4 \
546 ../${compo_common_cpp}/m4/glite_security.m4 \
547 ../${compo_common_cpp}/m4/lcmaps.m4 ./project && \
548 ./bootstrap && \
549 ./configure --prefix=${prefix} --with-glite-location=${glite} \
550 --enable-headers && \
551 make && \
552 make install || return $RC_FAILED
553 return $RC_SUCCESS
554 }
555
556 # LCAS:
557 lcas() {
558 compo_lcas=${compo_lcas:-org.glite.security.lcas}
559 cd ${SOURCE}
560 get lcas && \
561 cd ${compo_lcas} && \
562 cp -fp ../${compo_common_cpp}/m4/glite.m4 \
563 ../${compo_common_cpp}/m4/globus.m4 \
564 ../${compo_common_cpp}/m4/lcmaps.m4 ./project && \
565 ./bootstrap && \
566 ./configure --prefix=${prefix} --with-glite-location=${glite} \
567 --with-globus-prefix=${globus} \
568 --with-globus-thr-flavor=${globus_flav}pthr \
569 --with-globus-nothr-flavor=${globus_flav} && \
570 make && \
571 make install || return $RC_FAILED
572 return $RC_SUCCESS
573 }
574
575 # LCAS-INTERFACE:
576 lcas_interface() {
577 compo_lcas_interface=${compo_lcas_interface:-org.glite.security.lcas-interface}
578 cd ${SOURCE}
579 get lcas_interface && \
580 cd ${compo_lcas_interface} && \
581 cp -fp ../${compo_common_cpp}/m4/glite.m4 ./project && \
582 ./bootstrap && \
583 ./configure --prefix=${prefix} && \
584 make install || return $RC_FAILED
585 return $RC_SUCCESS
586 }
587
588 # GLEXEC: extra LDFLAG needed (only) for certain platforms, incl Debian-5 64
589 glexec() {
590 compo_glexec=${compo_glexec:-org.glite.security.glexec}
591 cd ${SOURCE}
592 get glexec && \
593 cd ${compo_glexec} && \
594 cp -fp ../${compo_common_cpp}/m4/glite.m4 ./project && \
595 ./bootstrap && \
596 ./configure --prefix=${prefix} --with-glite-location=${glite} && \
597 make && \
598 make install || return $RC_FAILED
599 return $RC_SUCCESS
600 }
601
602 # LCMAPS PLUGINS BASIC:
603 lcmaps_plugins_basic() {
604 compo_lcmaps_plugins_basic=${compo_lcmaps_plugins_basic:-org.glite.security.lcmaps-plugins-basic}
605 cd ${SOURCE}
606 get lcmaps_plugins_basic && \
607 cd ${compo_lcmaps_plugins_basic} && \
608 cp -fp ../${compo_common_cpp}/m4/glite.m4 \
609 ../${compo_common_cpp}/m4/globus.m4 \
610 ../${compo_common_cpp}/m4/lcmaps.m4 \
611 ../${compo_common_cpp}/m4/gridlist.m4 ./project && \
612 ./bootstrap && \
613 ./configure --prefix=${prefix} --with-glite-location=${glite} \
614 --with-globus-prefix=${globus} \
615 --with-globus-thr-flavor=${globus_flav}pthr \
616 --with-globus-nothr-flavor=${globus_flav} && \
617 make && \
618 make install || return $RC_FAILED
619 return $RC_SUCCESS
620 }
621
622 # LCMAPS PLUGINS VERIFY-PROXY:
623 lcmaps_plugins_verify_proxy() {
624 compo_lcmaps_plugins_verify_proxy=${compo_lcmaps_plugins_verify_proxy:-org.glite.security.lcmaps-plugins-verify-proxy}
625 cd ${SOURCE}
626 get lcmaps_plugins_verify_proxy && \
627 cd ${compo_lcmaps_plugins_verify_proxy} && \
628 cp -fp ../${compo_common_cpp}/m4/glite.m4 \
629 ../${compo_common_cpp}/m4/glite_security.m4 ./project && \
630 ./bootstrap && \
631 ./configure --prefix=${prefix} --with-glite-location=${glite} && \
632 make && \
633 make install || return $RC_FAILED
634 return $RC_SUCCESS
635 }
636
637 # LCMAPS PLUGINS VOMS:
638 lcmaps_plugins_voms() {
639 compo_lcmaps_plugins_voms=${compo_lcmaps_plugins_voms:-org.glite.security.lcmaps-plugins-voms}
640 cd ${SOURCE}
641 get lcmaps_plugins_voms && \
642 cd ${compo_lcmaps_plugins_voms} && \
643 cp -fp ../${compo_common_cpp}/m4/glite.m4 \
644 ../${compo_common_cpp}/m4/glite_security.m4 \
645 ../${compo_common_cpp}/m4/globus.m4 \
646 ../${compo_common_cpp}/m4/lcmaps.m4 \
647 ../${compo_common_cpp}/m4/gridlist.m4 ./project && \
648 ./bootstrap && \
649 ./configure --prefix=${glite} --with-glite-location=${glite} \
650 --with-globus-prefix=${globus} \
651 --with-globus-thr-flavor=${globus_flav}pthr \
652 --with-globus-nothr-flavor=${globus_flav} && \
653 make && \
654 make install || return $RC_FAILED
655 return $RC_SUCCESS
656 }
657
658 # LCMAPS PLUGINS AFS:
659 lcmaps_plugins_afs() {
660 compo_lcmaps_plugins_afs=${compo_lcmaps_plugins_afs:-org.glite.security.lcmaps-plugins-afs}
661 cd ${SOURCE}
662 get lcmaps_plugins_afs && \
663 cd ${compo_lcmaps_plugins_afs} && \
664 cp -fp ../${compo_common_cpp}/m4/glite.m4 \
665 ../${compo_common_cpp}/m4/globus.m4 ./project && \
666 ./bootstrap && \
667 ./configure --prefix=${glite} --with-glite-location=${glite} \
668 --with-globus-prefix=${globus} \
669 --with-globus-thr-flavor=${globus_flav}pthr \
670 --with-globus-nothr-flavor=${globus_flav} && \
671 make && \
672 make install || return $RC_FAILED
673 return $RC_SUCCESS
674 }
675
676 # LCMAPS PLUGINS GUMS:
677 lcmaps_plugins_gums() {
678 compo_lcmaps_plugins_gums=${compo_lcmaps_plugins_gums:-org.glite.security.lcmaps-plugins-gums}
679 cd ${SOURCE}
680 get lcmaps_plugins_gums && \
681 cd ${compo_lcmaps_plugins_gums} && \
682 cp -fp ../${compo_common_cpp}/m4/glite.m4 \
683 ../${compo_common_cpp}/m4/glite_security.m4 \
684 ../${compo_common_cpp}/m4/globus.m4 ./project && \
685 ./bootstrap && \
686 ./configure --prefix=${glite} --with-glite-location=${glite} \
687 --with-globus-prefix=${globus} \
688 --with-globus-thr-flavor=${globus_flav}pthr \
689 --with-globus-nothr-flavor=${globus_flav} && \
690 make && \
691 make install || return $RC_FAILED
692 return $RC_SUCCESS
693 }
694
695 # PEP-C LIB: Will install in same libdir as LCMAPS
696 pep_c_lib() {
697 compo_pep_c_lib=${compo_pep_c_lib:-org.glite.authz.pep-c}
698 svnroot_pep_c_lib=${svnroot_pep_c_lib:-http://svnweb.cern.ch/guest/glxa/pep-c-lib/tags/}
699 tag_pep_c_lib=${tag_pep_c_lib:-1_3_0}
700 cd ${SOURCE}
701 # Make sure PEP-C is installed in lcmaps directory or else use default.
702 [ -f "${glite}/lib64/liblcmaps.so" ] && \
703 pepclibdir=${glite}/lib64 || \
704 pepclibdir=${glite}/lib
705 get pep_c_lib && \
706 cd ${compo_pep_c_lib} && \
707 ./autotools.sh && \
708 ./configure --prefix=${glite} --libdir=${pepclibdir} && \
709 make && \
710 make html && \
711 make install || return $RC_FAILED
712 return $RC_SUCCESS
713 }
714
715 # LCMAPS PLUGINS C-PEP
716 lcmaps_plugins_c_pep() {
717 compo_lcmaps_plugins_c_pep=${compo_lcmaps_plugins_c_pep:-org.glite.security.lcmaps-plugins-c-pep}
718 cd ${SOURCE}
719 get lcmaps_plugins_c_pep && \
720 cd ${compo_lcmaps_plugins_c_pep} && \
721 cp -fp ../${compo_common_cpp}/m4/glite.m4 \
722 ../${compo_common_cpp}/m4/glite_security.m4 ./project && \
723 ./bootstrap && \
724 ./configure --prefix=${glite} --with-glite-location=${glite} && \
725 make && \
726 make install || return $RC_FAILED
727 return $RC_SUCCESS
728 }
729
730 # SAML2XACML2 LIB:
731 saml2_xacml2_c_lib() {
732 compo_saml2_xacml2_c_lib=${compo_saml2_xacml2_c_lib:-org.glite.security.saml2-xacml2-c-lib}
733 cd ${SOURCE}
734 get saml2_xacml2_c_lib && \
735 cd ${compo_saml2_xacml2_c_lib} && \
736 cp -fp ../${compo_common_cpp}/m4/glite.m4 ./project && \
737 export CXXFLAGS=-fPIC && \
738 tar -zxf gsoap-2.7.17.tar.gz && \
739 cd gsoap-2.7 && \
740 ../autogen.sh && \
741 ./configure --prefix=${glite} && \
742 make && \
743 make install && \
744 cd ../xacml-1.0 && \
745 ../autogen.sh && \
746 ./configure --prefix=${glite} --with-gsoap=${glite} && \
747 make && \
748 make install || return $RC_FAILED
749 return $RC_SUCCESS
750 }
751
752 # LCMAPS PLUGINS SCAS CLIENT:
753 lcmaps_plugins_scas_client() {
754 compo_lcmaps_plugins_scas_client=${compo_lcmaps_plugins_scas_client:-org.glite.security.lcmaps-plugins-scas-client}
755 cd ${SOURCE}
756 get lcmaps_plugins_scas_client && \
757 cd ${compo_lcmaps_plugins_scas_client} && \
758 cp -fp ../${compo_common_cpp}/m4/glite.m4 \
759 ../${compo_common_cpp}/m4/glite_security.m4 \
760 ../${compo_common_cpp}/m4/lcmaps.m4 ./project && \
761 ./bootstrap && \
762 ./configure --prefix=${glite} --with-glite-location=${glite} && \
763 make && \
764 make install || return $RC_FAILED
765 return $RC_SUCCESS
766 }
767
768 # SCAS
769 scas() {
770 compo_scas=${compo_scas:-org.glite.security.scas}
771 cd ${SOURCE}
772 get scas && \
773 cd ${compo_scas} && \
774 cp -fp ../${compo_common_cpp}/m4/globus.m4 \
775 ../${compo_common_cpp}/m4/glite.m4 \
776 ../${compo_common_cpp}/m4/glite_security.m4 \
777 ../${compo_common_cpp}/m4/lcmaps.m4 ./project && \
778 ./bootstrap && \
779 ./configure --prefix=${prefix} --with-glite-location=${glite} \
780 --with-globus-prefix=${globus} \
781 --with-globus-thr-flavor=${globus_flav}pthr \
782 --with-globus-nothr-flavor=${globus_flav} && \
783 make && \
784 make install || return $RC_FAILED
785 return $RC_SUCCESS
786 }
787
788 # EES
789 ees() {
790 compo_ees=${compo_ees:-ees}
791 svnroot_ees=${svnroot_ees:-https://svn@ndpfsvn.nikhef.nl/repos/pdpsoft/trunk/grid-mw-security/ees}
792 cd ${SOURCE}
793 get ees && \
794 cd ${compo_ees} && \
795 cp -fp ../${compo_common_cpp}/m4/glite.m4 \
796 ../${compo_common_cpp}/m4/glite_security.m4 ./m4 && \
797 sh ./autogen.sh && \
798 ./configure --prefix=${prefix} --with-glite-location=${glite} \
799 --with-saml2xacml2=${glite} && \
800 make && \
801 make install || return $RC_FAILED
802 return $RC_SUCCESS
803 }
804
805 # LCAS PLUGINS BASIC:
806 lcas_plugins_basic() {
807 compo_lcas_plugins_basic=${compo_lcas_plugins_basic:-org.glite.security.lcas-plugins-basic}
808 cd ${SOURCE}
809 get lcas_plugins_basic && \
810 cd ${compo_lcas_plugins_basic} && \
811 cp -fp ../${compo_common_cpp}/m4/glite.m4 \
812 ../${compo_common_cpp}/m4/globus.m4 \
813 ../${compo_common_cpp}/m4/gridlist.m4 ./project && \
814 ./bootstrap && \
815 ./configure --prefix=${glite} --with-glite-location=${glite} \
816 --with-globus-prefix=${globus} \
817 --with-globus-thr-flavor=${globus_flav}pthr \
818 --with-globus-nothr-flavor=${globus_flav} && \
819 make && \
820 make install || return $RC_FAILED
821 return $RC_SUCCESS
822 }
823
824 # LCAS PLUGINS CHECK-EXECUTABLE:
825 lcas_plugins_check_executable() {
826 compo_lcas_plugins_check_executable=${compo_lcas_plugins_check_executable:-org.glite.security.lcas-plugins-check-executable}
827 cd ${SOURCE}
828 get lcas_plugins_check_executable && \
829 cd ${compo_lcas_plugins_check_executable} && \
830 cp -fp ../${compo_common_cpp}/m4/glite.m4 \
831 ../${compo_common_cpp}/m4/globus.m4 \
832 ../${compo_common_cpp}/m4/gridlist.m4 ./project && \
833 ./bootstrap && \
834 ./configure --prefix=${glite} --with-glite-location=${glite} \
835 --with-globus-prefix=${globus} \
836 --with-globus-thr-flavor=${globus_flav}pthr \
837 --with-globus-nothr-flavor=${globus_flav} && \
838 make && \
839 make install || return $RC_FAILED
840 return $RC_SUCCESS
841 }
842
843 # GRIDSITE CORE:
844 gridsite_core() {
845 compo_gridsite_core=${compo_gridsite_core:-org.gridsite.core}
846 # Take libdir from lcas
847 [ -f "${glite}/lib64/liblcas.so" ] && \
848 gridsitelibdir=lib64 || \
849 gridsitelibdir=lib
850 cd ${SOURCE}
851 get gridsite_core && \
852 cd ${compo_gridsite_core}/src && \
853 make prefix=${gridsite} libdir=${gridsitelibdir} && \
854 make prefix=${gridsite} install || return $RC_FAILED
855 return $RC_SUCCESS
856 }
857
858 # LCAS PLUGINS VOMS:
859 lcas_plugins_voms() {
860 compo_lcas_plugins_voms=${compo_lcas_plugins_voms:-org.glite.security.lcas-plugins-voms}
861 cd ${SOURCE}
862 get lcas_plugins_voms && \
863 cd ${compo_lcas_plugins_voms} && \
864 cp -fp ../${compo_common_cpp}/m4/glite.m4 \
865 ../${compo_common_cpp}/m4/glite_security.m4 \
866 ../${compo_common_cpp}/m4/globus.m4 \
867 ../${compo_common_cpp}/m4/gridsite.m4 \
868 ../${compo_common_cpp}/m4/gridlist.m4 ./project && \
869 ./bootstrap && \
870 ./configure --prefix=${glite} --with-glite-location=${glite} \
871 --with-globus-prefix=${globus} \
872 --with-globus-thr-flavor=${globus_flav}pthr \
873 --with-globus-nothr-flavor=${globus_flav} \
874 --with-gridsite-prefix=${gridsite} \
875 --with-gridsite-ssl=system && \
876 make && \
877 make install || return $RC_FAILED
878 return $RC_SUCCESS
879 }
880
881 # LCAS-LCMAPS GT4 interface:
882 # Note: only reason for building two extra globus targets
883 # globus_gridmap_callout_error globus_authz
884 lcas_lcmaps_gt4_interface() {
885 compo_lcas_lcmaps_gt4_interface=${compo_lcas_lcmaps_gt4_interface:-org.glite.security.lcas-lcmaps-gt4-interface}
886 cd ${SOURCE}
887 get lcas_lcmaps_gt4_interface && \
888 cd ${compo_lcas_lcmaps_gt4_interface} && \
889 cp -fp ../${compo_common_cpp}/m4/glite.m4 \
890 ../${compo_common_cpp}/m4/globus.m4 \
891 ../${compo_common_cpp}/m4/lcmaps.m4 ./project && \
892 ./bootstrap && \
893 ./configure --prefix=${prefix} \
894 --with-glite-location=${glite} \
895 --with-globus-prefix=${globus} \
896 --with-globus-thr-flavor=${globus_flav}pthr \
897 --with-globus-nothr-flavor=${globus_flav} && \
898 make && \
899 make install || return $RC_FAILED
900 return $RC_SUCCESS
901 }
902
903 ##############################################################################
904 #
905 # Define all dependency functions, NOTE: the order of the setdeps statements is
906 # important!
907 #
908 ##############################################################################
909
910 # GLOBUS: no dependencies
911 setdeps globus
912
913 # BUILD COMMON-CPP: no dependencies
914 setdeps common_cpp
915
916 # VOMS: depends globus
917 setdeps voms globus
918
919 # LCMAPS: depends globus, voms, common-cpp
920 setdeps lcmaps globus voms common_cpp
921
922 # LCMAPS-INTERFACE: depends common-cpp
923 setdeps lcmaps_interface common_cpp
924
925 # LCAS: depends globus, common-cpp
926 setdeps lcas globus common_cpp
927
928 # LCAS-INTERFACE: depends common-cpp
929 setdeps lcas_interface common_cpp
930
931 # GLEXEC: depends globus, lcmaps, common-cpp, lcas, lcas-interface
932 setdeps glexec common_cpp lcmaps_interface
933
934 # LCMAPS PLUGINS BASIC: depends globus, lcmaps, common-cpp
935 setdeps lcmaps_plugins_basic globus lcmaps common_cpp
936
937 # LCMAPS PLUGINS VERIFY-PROXY: depends lcmaps, common-cpp
938 setdeps lcmaps_plugins_verify_proxy lcmaps common_cpp
939
940 # LCMAPS PLUGINS VOMS: depends globus, voms, lcmaps, common-cpp
941 setdeps lcmaps_plugins_voms globus voms lcmaps common_cpp
942
943 # LCMAPS PLUGINS AFS: depends lcmaps, common-cpp
944 setdeps lcmaps_plugins_afs lcmaps common_cpp
945
946 # LCMAPS PLUGINS GUMS: depends lcmaps, common-cpp
947 setdeps lcmaps_plugins_gums lcmaps common_cpp
948
949 # PEP-C LIB: Not dependent on LCMAPS, but need to install it in right place
950 setdeps pep_c_lib lcmaps
951
952 # LCMAPS PLUGINS C-PEP: depends lcmaps, pep-c lib, common-cpp
953 setdeps lcmaps_plugins_c_pep lcmaps pep_c_lib common_cpp
954
955 # SAML2XACML2 LIB: depends common-cpp
956 setdeps saml2_xacml2_c_lib common_cpp
957
958 # LCMAPS PLUGINS SCAS CLIENT: depends saml2-xacml2-c-lib, common-cpp
959 setdeps lcmaps_plugins_scas_client lcmaps saml2_xacml2_c_lib common_cpp
960
961 # SCAS: depends saml2-xacml2-c-lib, common-cpp, lcmaps
962 setdeps scas saml2_xacml2_c_lib common_cpp lcmaps
963
964 # EES: depends saml2-xacml2-c-lib, common-cpp
965 setdeps ees saml2_xacml2_c_lib common_cpp
966
967 # LCAS PLUGINS BASIC: depends globus, lcas, common-cpp
968 setdeps lcas_plugins_basic globus lcas common_cpp
969
970 # LCAS PLUGINS CHECK-EXECUTABLE: depends globus, lcas, common-cpp
971 setdeps lcas_plugins_check_executable globus lcas common_cpp
972
973 # GRIDSITE Core:
974 setdeps gridsite_core
975
976 # LCAS PLUGINS VOMS: depends globus, voms, lcas, common-cpp, gridsite
977 setdeps lcas_plugins_voms globus voms lcas common_cpp gridsite_core
978
979 # LCAS-LCMAPS GT4 interface: depends globus, lcmaps, common-cpp, lcas, lcas-interface
980 setdeps lcas_lcmaps_gt4_interface globus lcmaps common_cpp lcas lcas_interface
981
982 ##############################################################################
983 #
984 # Build all tools, taking care of dependencies
985 #
986 ##############################################################################
987
988 # Now that we know all the targets, we can print usage if requested
989 if [ "$USAGE" -eq 1 ];then
990 usage
991 exit 0
992 fi
993
994 # Find suitable download command
995 get_download_cmd
996
997 # Parse the config file, if one is specified
998 if [ -n "$CONFIG" ];then
999 parse_config
1000 fi
1001
1002 # Figure out the build targets
1003 build_targets=""
1004 # Check for special build all target
1005 if [ "$targets" = "all" ];then
1006 build_targets=$known_targets
1007 else
1008 for target in $targets;do
1009 echo $known_targets|tr ' ' '\n'|grep -q "^$target$" && \
1010 build_targets="$build_targets $target" || \
1011 echo "Skipping unknown target \"$target\"" >&2
1012 done
1013 fi
1014
1015 MISSING=0
1016 FAILED=0
1017 # Anything to be done?
1018 if [ -n "$build_targets" ];then
1019 # create the source dir
1020 mkdir -p ${SOURCE} || {
1021 echo "Creating of ${SOURCE} FAILED" >&2
1022 exit 1 # Fatal...
1023 }
1024
1025 # Get globus_flavour just in case we won't build. If it will be build, it
1026 # will be reset afterwards.
1027 globus_flavour
1028
1029 # make sure default common_cpp is defined, as it is used by so many.
1030 compo_common_cpp=${compo_common_cpp:-org.glite.build.common-cpp}
1031
1032 # Do the builds and print results
1033 if [ -z "$STDOUT" ];then
1034 if [ -z "$STDERR" ];then
1035 build
1036 else
1037 build 2> $STDERR
1038 fi
1039 else
1040 if [ -z "$STDERR" ];then
1041 build > $STDOUT
1042 else
1043 build > $STDOUT 2> $STDERR
1044 fi
1045 fi
1046 fi
1047
1048 exit `expr $MISSING + $FAILED`

Properties

Name Value
svn:executable *

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