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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2160 - (show annotations) (download) (as text)
Sun Jan 30 17:40:33 2011 UTC (10 years, 11 months ago) by msalle
File MIME type: application/x-shellscript
File size: 47488 byte(s)
Number of bug fixes:
- removal globus libdir: it's almost impossible to hack around the hard-coded
  /lib
- voms install location is now read in from file
- rename gridsite_core module into gridsite, it wasn't consistent anyway
- only save install locations for globus gridsite and voms when they fail:
  they're unimportant for other compos
- properly return/propagate globus exit value.
- fix mistake in setting old-style voms_includes
- remove globus flavor from old-voms, it would not build libvomsapi.so, only
  flavoured ones and lcmaps etc. would fail.
- set correct libdir for gsoap configure.

Now builds on RH-5 old-style glite and new-style EPEL


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 VERSION=0.2.0-1
15
16 SOURCE_DEFAULT=/tmp/source # Where to download sources
17 NEWTARGETFILE_DEFAULT="failedcomps.txt"
18 NEWFLAGFILE_DEFAULT="configflag.txt"
19 NEWFLAGFILE_TMP=/tmp/${NEWFLAGFILE_DEFAULT}$$
20 DESTDIR_DEFAULT=/tmp/build # Where to install binaries
21
22 webcvs=http://glite.cvs.cern.ch/cgi-bin/glite.cgi/ # Web CVS location
23 mwsec_svnroot=https://ndpfsvn.nikhef.nl/repos/mwsec/
24 globus_baseurl=http://www.globus.org/ftppub/ # Base for globus tarball
25 globus_flavor=unset
26
27 # Valid return codes: anything less than RC_FAILED is non-blocking
28 RC_SUCCESS=0
29 RC_SKIPPED=1
30 RC_FAILED=2
31 RC_MISSDEP=4
32
33 myexit() {
34 if [ -f "$NEWFLAGFILE_TMP" ];then
35 rm $NEWFLAGFILE_TMP
36 fi
37 exit $1
38 }
39
40 # Define error function
41 error() {
42 echo "$PROG: $*" >&2
43 myexit 1
44 }
45
46 # Define warning function
47 warning() {
48 echo "$PROG: $*" >&2
49 }
50
51 # Define a message only printed when verbose
52 verb_msg() {
53 if [ $VERBOSE -eq 1 ];then
54 echo "$PROG: $*"
55 fi
56 }
57
58 # Set defaults
59 PROG=`basename $0`
60 GNU_DEF_PFX="/usr/local"
61
62 CONFIG="" # No default configuration file
63 COMPO=""
64 TARGETFILE=""
65 NEWTARGETFILE=""
66 myDISTDIR=""
67 SOURCE="$SOURCE_DEFAULT" # where to download sources
68 myDESTDIR="$DESTDIR_DEFAULT" # where to stage builds
69 DESTDIR_flag="DESTDIR=$myDESTDIR"
70 DEPEND=1 # Do dependency checks when building all
71 DIST=0
72 USAGE=0 # printing of usage is not a default (-;
73 REMOVE=0 # Do NOT remove directories before downloading etc.
74 EXIT_ON_ERROR=0 # Continue on failing target
75 STDOUT="" # No file for stdout
76 STDERR="" # No file for stderr
77 PLATFORM="" # No default platform (only used for globus from etics)
78 FLAGS=""
79 FLAGFILE=""
80 NEWFLAGFILE=""
81 VERBOSE=0
82
83 # Parse command line options
84 while getopts ":c:C:i:I:s:dDhrxo:e:p:F:f:N:Vv" i ; do
85 case "$i" in
86 c) CONFIG="$OPTARG" ;;
87 C) COMPO="$COMPO target:$OPTARG" ;;
88 i) TARGETFILE="$OPTARG" ;;
89 I) NEWTARGETFILE="$OPTARG" ;;
90 s) SOURCE="$OPTARG" ;;
91 d) DEPEND=0 ;;
92 D) DIST=1 ;;
93 h) USAGE=1 ;;
94 r) REMOVE=1 ;;
95 x) EXIT_ON_ERROR=1 ;;
96 o) STDOUT="$OPTARG" ;;
97 e) STDERR="$OPTARG" ;;
98 p) PLATFORM="$OPTARG" ;;
99 F) FLAGS="$FLAGS `echo $OPTARG|tr ',' ' '`" ;;
100 f) FLAGFILE="$OPTARG" ;;
101 N) NEWFLAGFILE="$OPTARG" ;;
102 V) VERBOSE=1 ;;
103 v) echo "$PROG version: $VERSION"
104 myexit 0 ;;
105 :) echo "$PROG: option requires an argument -- '$OPTARG'" >&2
106 echo "Try \`$PROG -h' for more information." >&2
107 myexit 1 ;;
108 \?) echo "$PROG: invalid option -- '$OPTARG'" >&2
109 echo "Try \`$PROG -h' for more information." >&2
110 myexit 1 ;;
111 esac
112 done
113 shift `expr $OPTIND - 1`
114
115 ##############################################################################
116 # Convenience functions
117 ##############################################################################
118
119
120 # Prints usage message
121 usage() {
122 echo "Usage: `basename $0` [options] [targets]"
123 echo
124 echo "Options:"
125 echo " -c <config> get build options from config file."
126 echo " -C <opts> specify extra build options "\
127 "(will override those from file),"
128 echo " use , as separator between options"
129 echo " -i <file> get targets from file, any targets on the cmdline"\
130 "are added."
131 echo " -I <file> save list of failed (failed or missing dependencies)"\
132 " into file."
133 echo " -s specify directory where to checkout sources,"
134 echo " default ${SOURCE_DEFAULT}"
135 echo " -d don't check dependencies."
136 echo " -D create dist tarballs, will be put in DISTDIR,"
137 echo " default: source dir, see -s. Set using -F."
138 echo " -r remove (old) source directories before checkout."
139 echo " -x exit on first failing target (default continue)."
140 echo " -o <file> send checkout/build stdout to given file."
141 echo " -e <file> send checkout/build stderr to given file."
142 echo " -p <platform> download globus for this platform from etics/VDT"\
143 "instead of"
144 echo " building from source, \"-p help\" prints"\
145 "valid options."
146 echo " -f <flagfile> get extra configure flags from file,"
147 echo " default <sourcedir>/$NEWTARGETFILE_DEFAULT"
148 echo " -F <flags> specify extra configure flags "\
149 "(will override those from file),"
150 echo " use , as separator between options."
151 echo " -N <flagfile> save flags for a new build (using -f) into file,"
152 echo " default <sourcedir>/$NEWFLAGFILE_DEFAULT"
153 echo " -V be more verbose."
154 echo " -h show this helptext."
155 echo
156 echo "Exit values:"
157 echo " 1 non-build related error"
158 echo " $RC_FAILED at least one build failed, but no failed dependencies"
159 echo " $RC_MISSDEP at least one build missed dependencies, but no build"\
160 "failed"
161 echo " `expr $RC_FAILED + $RC_MISSDEP` at least one build failed and at"\
162 "least on build missed dependencies"
163 echo
164 echo "Format for config file:"
165 echo "<target> [tag:<value>] [compo:<value>] [cvsroot:<value>]"\
166 "[svnroot:<value>] [coopts:<value>]"
167 echo "where"
168 echo " tag specifies CVS or SVN tag"
169 echo " compo specifies glite component name"\
170 "(e.g. org.glite.security.voms)"
171 echo " cvsroot specifies CVSROOT"
172 echo " cvsrootweb specifies ROOT to use for CVS tarball download"
173 echo " svnroot specifies full SVN URL (including component)"
174 echo " coopts specifies checkout options for CVS/SVN"
175 echo "A configline can be continued using the \\ char."
176 echo "After a # the remainder of the line is ignored."
177 echo "coopts are inserted after the checkout command for cvs or svn."
178 echo "The same fields can be used for the -C option, e.g.:"
179 echo " -C glexec,tag:tags/glexec/0.8.2"
180 echo
181 echo "Notes:"
182 echo "1. when the special target all is specified,"\
183 "all known targets are built."
184 echo "2. targets are build in the specified order, first those in a"\
185 "optional input"
186 echo " file, then those on the command line."
187 echo "3. when checking dependencies, only dependencies which are"\
188 "actually being"
189 echo " build will be checked."
190 echo
191 echo "Known targets:"
192 for target in $known_targets;do
193 echo " $target"
194 done
195 echo
196 return $RC_SUCCESS
197 }
198
199 # Function which is used to create the dependency checking functions.
200 # arguments:
201 # $1 - target
202 # $2... - dependencies
203 setdeps() {
204 if [ $# -eq 0 ];then
205 echo "Error: $0 needs at least one argument." >&2
206 return $RC_FAILED
207 fi
208
209 # target
210 target=$1; shift
211 known_targets="$known_targets $target"
212
213 eval rc_$target=$RC_SKIPPED
214
215 depstring=""
216 # Only when we DO want dependency checking...
217 if [ $DEPEND -eq 1 ];then
218 while [ $# -gt 0 ];do
219 # Use RC_FAILED as default for rc_$1 in case it's not defined
220 depstring="$depstring \${rc_$1:-\$RC_FAILED} -lt \$RC_FAILED"
221 shift
222 if [ $# -gt 0 ];then
223 depstring="$depstring -a"
224 fi
225 done
226 fi
227
228 # define the dep_ function
229 if [ -n "$depstring" ];then
230 eval "dep_$target() {
231 if [ $depstring ];then
232 $target
233 rc_$target=\$?
234 else
235 rc_$target=\$RC_MISSDEP
236 fi
237 return \$rc_$target
238 }"
239 else
240 eval "dep_$target() {
241 $target
242 rc_$target=\$?
243 return \$rc_$target
244 }"
245 fi
246 }
247
248 # function to get a suitable download command with cmdline args. The result will
249 # be in variable $wget
250 # Expected format:
251 # $wget $URL > $outputfile
252 get_download_cmd() {
253 func=get_downloadcmd
254 if which wget > /dev/null 2> /dev/null;then
255 wget="wget -nv -O -"
256 elif which curl > /dev/null 2> /dev/null;then
257 wget="curl -s"
258 elif which lynx > /dev/null 2> /dev/null;then
259 wget="lynx -dump -source"
260 else
261 error "$func: Cannot find download tool such as wget, curl, lynx etc."
262 fi
263 }
264
265 # Parses a single configuration line/entry, i.e. for a single component
266 parse_config_line() {
267 first=1
268 for field in `echo $line`;do
269 # first char == '#' ? then go to next line
270 [ "`echo "$field"|cut -c1`" = '#' ] && break
271 # Now differentiate between first compo and others
272 if [ $first -eq 1 ];then
273 name=$field
274 # Make sure we reset the variables
275 eval "tag_$name=\"\""
276 eval "compo_$name=\"\""
277 eval "cvsroot_$name=\"\""
278 eval "cvsrootweb_$name=\"\""
279 eval "svnroot_$name=\"\""
280 eval "coopts_$name=\"\""
281 first=0
282 else
283 case "$field" in
284 tag:*) eval tag_$name=\$\{field#tag:\} ;;
285 compo:*) eval compo_$name=\$\{field#compo:\} ;;
286 cvsroot:*) eval cvsroot_$name=\$\{field#cvsroot:\} ;;
287 cvsrootweb:*) eval cvsrootweb_$name=\$\{field#cvsrootweb:\} ;;
288 svnroot:*) eval svnroot_$name=\$\{field#svnroot:\} ;;
289 coopts:) eval coopts_$name=\$\{field#coopts:\} ;;
290 esac
291 fi
292 done
293 }
294
295 # function that parses the CONFIG file and COMPO options and sets all the tag_
296 # compo_ cvsroot_ svnroot_ variables
297 # We cannot use subshells in order to get the vars in the current shell, which
298 # sometimes obfuscates the code a bit.
299 parse_config() {
300 if [ -n "$CONFIG" ];then
301 lines=`cat $CONFIG|wc -l`
302 lineno=0
303 line=""
304 cont=0
305 while [ $lineno -lt $lines ];do
306 lineno=`expr $lineno + 1`
307 readline=`sed -n ${lineno}p $CONFIG`
308 # replace trailing [whitespace] \ [whitespace] by a single space
309 subline=`echo "${readline}"|sed 's/[ \t]*\\\[ \t]*$/ /'`
310 line="${line}${subline}"
311 # Continue when continuation char, empty line, or comment line
312 if [ "$subline" != "$readline" ];then
313 cont=1
314 continue
315 fi
316 # line is ready, parse the components
317 parse_config_line $line
318 # reset line and cont
319 line=""
320 cont=0
321 done
322 if [ $cont -ne 0 ];then
323 error "Unexpected end of file while parsing $CONFIG"
324 fi
325 fi
326
327 if [ -n "$COMPO" ];then
328 for readline in `echo "$COMPO"|sed 's/ target:/\n/g'`;do
329 line=`echo "${readline}"|tr , ' '|sed 's/[ \t]*\\\[ \t]*$/ /'`
330 parse_config_line $line
331 done
332 fi
333 }
334
335 # Parses a configuration flag, coming from either FLAGFILE or FLAGS.
336 parse_flag() {
337 flag="$1"
338 case "$flag" in
339 prefix=*|libdir=*|includedir=*|sysconfdir=*)
340 eval my$flag
341 var=`echo $flag|cut -d= -f1`
342 eval ${var}_flag="--$flag" ;;
343
344 DESTDIR=*)
345 eval my$flag
346 [ -n "$myDESTDIR" ] && DESTDIR_flag=$flag
347 ;;
348
349 DISTDIR=*)
350 eval my$flag ;;
351
352 globus=*|gridsite=*|voms=*)
353 eval my$flag ;;
354
355 # prefix/includes flags for *other* components.
356 globus-prefix=*|\
357 gridsite-prefix=*|gridsite-libdir=*|\
358 voms-prefix=*|voms-includes=*|voms-libdir=*|\
359 lcmaps-prefix=*|lcmaps-includes=*|lcmaps-libdir=*|\
360 lcas-prefix=*|lcas-includes=*|lcas-libdir=*|\
361 jobrep-api-prefix=*|jobrep-api-includes=*|jobrep-api-libdir=*|\
362 pep-api-prefix=*|pep-api-libdir=*|\
363 xacml-prefix=*|xacml-libdir=*)
364 var=`echo $flag|cut -d= -f1|tr '-' '_'`
365 value=`echo $flag|cut -d= -f2`
366 eval ${var}="$value"
367 eval ${var}_flag="--with-$flag" ;;
368
369 # globus flavor for other components.
370 globus-flavor=*)
371 globus_flavor=`echo $flag|cut -d= -f2`
372 globus_flavor_flag="--with-globus-nothr-flavor=$globus_flavor" ;;
373
374 *) error "Unknown configure flag \"$flag\" specified" ;;
375 esac
376 echo "$flag" >> $NEWFLAGFILE_TMP
377 }
378
379 # Saves configuration flags from temporary file
380 save_flags() {
381 rm -f $NEWFLAGFILE
382 echo "# WARNING: this is a CREATED file, local changes will (probably) get lost" \
383 > $NEWFLAGFILE
384 echo "# This file contains all configure flags:" >> $NEWFLAGFILE
385 echo "# $PROG -f $NEWFLAGFILE" >> $NEWFLAGFILE
386 for flag in `cut -d'=' -f1 $NEWFLAGFILE_TMP|sort -u`;do
387 case "$flag" in
388 prefix|libdir|includedir|sysconfdir|DESTDIR|DISTDIR)
389 eval value="\$my$flag"
390 eval echo "$flag=$value" >> $NEWFLAGFILE ;;
391 globus|voms|gridsite)
392 eval value="\$my$flag"
393 eval rc=\$rc_$flag
394 # Only save these build flags if the component failed
395 if [ "$rc" = "$RC_FAILED" -o "$rc" = "$RC_MISSDEP" ];then
396 eval echo "$flag=$value" >> $NEWFLAGFILE
397 fi ;;
398 *-prefix|*-includes|*-libdir|globus-flavor)
399 eval value="\$`echo $flag|tr '-' '_'`"
400 eval echo "$flag=$value" >> $NEWFLAGFILE ;;
401 *) error "Unknown configure flag \"$flag\" found" ;;
402 esac
403 done
404 rm -f $NEWFLAGFILE_TMP
405 }
406
407 # cvs checkout wrapper: a wget + untar is much faster than anonymous cvs
408 # checkout, especially due to a 30 sec. timeout of the CVS server.
409 cvsget() {
410 name="$1"
411 dir="$2"
412 [ -z "$name" ] && return $RC_FAILED
413 eval compo=\$\{compo_$name\}
414 eval tag=\$\{tag_$name\}
415 eval cvsroot=\$\{cvsroot_$name\}
416 eval coopts=\$\{coopts_$name\}
417 # optionally remove directory
418 [ $REMOVE -eq 1 ] && rm -rf ${dir:-$compo}
419 # use cvs checkout
420 cvs -d $cvsroot co $coopts \
421 ${tag:+-r $tag} \
422 ${dir:+-d $dir} $compo || return $RC_FAILED
423
424 return $RC_SUCCESS
425 }
426
427 cvswebget() {
428 name="$1"
429 dir="$2"
430 [ -z "$name" ] && return $RC_FAILED
431 eval compo=\$\{compo_$name\}
432 eval tag=\$\{tag_$name\}
433 eval cvsrootweb=\$\{cvsrootweb_$name\}
434 eval coopts=\$\{coopts_$name\}
435 url="${cvsrootweb:-$webcvs}${compo}.tar.gz?view=tar${tag:+&pathrev=$tag}"
436 # Use tarball installation: always remove old dir
437 rm -rf ${dir:-$compo}
438 # If custom directory: download in tmpdir and later move to dir
439 if [ -n "$dir" ];then
440 tmpdir=tmpdir.$$
441 mkdir ${tmpdir} && cd ${tmpdir} || return $RC_FAILED
442 fi
443 # Retrieve tarball and untar on the fly
444 eval "${wget} \"$url\"" | tar -zvxf - || return $RC_FAILED
445 # Move downloaded dir into $dir and cleanup
446 if [ -n "$dir" ];then
447 cd .. && \
448 mv ${tmpdir}/${compo} $dir && \
449 rmdir ${tmpdir} || return $RC_FAILED
450 unset tmpdir
451 fi
452
453 return $RC_SUCCESS
454 }
455
456 # svn checkout wrapper
457 svnget() {
458 name="$1"
459 dir="$2"
460 [ -z "$name" ] && return $RC_FAILED
461 eval compo=\$\{compo_$name\}
462 eval tag=\$\{tag_$name:-trunk/$compo\}
463 eval svnroot=\$\{svnroot_$name:-$mwsec_svnroot\}
464 eval coopts=\$\{coopts_$name\}
465 realdir=${dir:-$compo}
466 # optionally remove directory
467 [ $REMOVE -eq 1 ] && rm -rf ${realdir}
468 svn co $coopts ${svnroot}${tag} ${realdir} || return $RC_FAILED
469 unset realdir
470
471 return $RC_SUCCESS
472 }
473
474 # general cvs and svn wrapper: use svn ONLY when cvsroot is NOT defined AND
475 # svnroot is defined. In all other cases, use cvsroot
476 get() {
477 name="$1"
478 dir="$2"
479 [ -z "$name" ] && return $RC_FAILED
480 eval cvsroot=\$\{cvsroot_$name\}
481 eval cvsrootweb=\$\{cvsrootweb_$name\}
482 eval svnroot=\$\{svnroot_$name\}
483 if [ -n "$cvsroot" ] ; then
484 cvsget $name $dir
485 elif [ -n "$cvsrootweb" ] ; then
486 cvswebget $name $dir
487 else
488 svnget $name $dir
489 fi
490 return $?
491 }
492
493 # Print function for results:
494 # $1 - name of component, result is in $rc_<name of component>
495 print_result() {
496 tool=$1
497 eval rc=\$rc_$tool
498 [ "$rc" = "$RC_SKIPPED" ] && return
499 case "$rc" in
500 $RC_SUCCESS) result="SUCCESS" ;;
501 $RC_MISSDEP) result="MISSING DEPS"
502 echo "$tool" >> $NEWTARGETFILE
503 MISSING=$RC_MISSDEP ;;
504 $RC_FAILED) result="FAILED"
505 echo "$tool" >> $NEWTARGETFILE
506 FAILED=$RC_FAILED ;;
507 *) result="UNKNOWN: $rc" ;;
508 esac
509 printf "%-30s: %s\n" "$tool" "$result"
510 }
511
512 # Creates dist tarball and moves it to the ${SOURCE} directory.
513 make_dist() {
514 if [ $DIST -eq 1 ];then
515 # Allow for an optionally given tarball
516 if [ -n "$1" ];then
517 tarball=$1
518 else
519 package=`grep "^PACKAGE *= *" Makefile|sed 's/PACKAGE *= *//'`
520 version=`grep "^VERSION *= *" Makefile|sed 's/VERSION *= *//'`
521 tarball=${package}-${version}.tar.gz
522 fi
523 if [ -f "$tarball" ];then
524 rm -f $tarball
525 fi
526 make dist && mv $tarball ${myDISTDIR} || return $RC_FAILED
527 fi
528 return $RC_SUCCESS
529 }
530
531 # Build the targets and print the results
532 build() {
533 t0=`date +%s`
534 # build the targets
535 for target in $build_targets;do
536 eval dep_$target
537 [ $EXIT_ON_ERROR -eq 1 -a $? -ge $RC_FAILED ] && break
538 done
539 t1=`date +%s`
540
541 if [ -n "$NEWTARGETFILE" ];then
542 rm -f $NEWTARGETFILE
543 echo "# WARNING: this is a CREATED file, local changes will "\
544 "(probably) get lost" > $NEWTARGETFILE
545 echo "# This file contains all failed components:" >> $NEWTARGETFILE
546 echo "# $PROG -i $NEWTARGETFILE" >> $NEWTARGETFILE
547 fi
548 # Print results
549 for target in $known_targets;do
550 print_result $target
551 done
552 # Save flags file
553 save_flags
554
555 echo "Total build time: `expr $t1 - $t0` seconds"
556 }
557
558 # Sets the default configure flags for a built component, and saves them to the tmp file.
559 set_def_compo_flags() {
560 compo=$1; shift
561 name=`echo $compo|tr '_' '-'`
562 for var in $*;do
563 case "$var" in
564 prefix)
565 if [ -n "$myDESTDIR" -o -n "$myprefix" ];then
566 value="${myDESTDIR}/${myprefix:-$GNU_DEF_PFX}"
567 eval ${compo}_${var}="$value"
568 eval ${compo}_${var}_flag="--with-${name}-${var}=$value"
569 echo "${name}-${var}=$value" >> $NEWFLAGFILE_TMP
570 fi
571 ;;
572 includes)
573 # Only set includes flags when we have overridden the default
574 # location, otherwise prefix is sufficient.
575 if [ -n "$myincludedir" ];then
576 value="${myDESTDIR}/${myincludedir}"
577 eval ${compo}_${var}="$value"
578 eval ${compo}_${var}_flag="--with-${name}-${var}=$value"
579 echo "${name}-${var}=$value" >> $NEWFLAGFILE_TMP
580 fi
581 ;;
582 libdir)
583 # Only set libdir flags when we have overridden the default
584 # location, otherwise prefix is sufficient.
585 if [ -n "$mylibdir" ];then
586 value="${myDESTDIR}/${mylibdir}"
587 eval ${compo}_${var}="$value"
588 eval ${compo}_${var}_flag="--with-${name}-${var}=$value"
589 echo "${name}-${var}=$value" >> $NEWFLAGFILE_TMP
590 fi
591 ;;
592 *) error "Unknown flag type \"$var\" specified"
593 ;;
594 esac
595 done
596 }
597
598 # Sets configure flags for a built component assuming the ${compo}_* is already set.
599 # Then saves the flags to the tmp file.
600 set_compo_flags() {
601 compo=$1; shift
602 name=`echo $compo|tr '_' '-'`
603 for var in $*;do
604 eval ${compo}_${var}_flag=""
605 eval value=\$${compo}_${var}
606 if [ -n "$value" ];then
607 case "$var" in
608 prefix)
609 eval ${compo}_${var}_flag="--with-${name}-${var}=$value"
610 echo "${name}-${var}=$value" >> $NEWFLAGFILE_TMP
611 ;;
612 includes)
613 eval ${compo}_${var}_flag="--with-${name}-${var}=$value"
614 echo "${name}-${var}=$value" >> $NEWFLAGFILE_TMP
615 ;;
616 libdir)
617 eval ${compo}_${var}_flag="--with-${name}-${var}=$value"
618 echo "${name}-${var}=$value" >> $NEWFLAGFILE_TMP
619 ;;
620 flavor)
621 eval ${compo}_${var}_flag="--with-${name}-nothr-${var}=$value"
622 echo "${name}-${var}=$value" >> $NEWFLAGFILE_TMP
623 ;;
624 *) error "Unknown flag type \"$var\" specified"
625 ;;
626 esac
627 fi
628 done
629 }
630
631 ##############################################################################
632 #
633 # Define all building functions
634 #
635 ##############################################################################
636
637 # GLOBUS
638
639
640 # print known platforms for globus tarball
641 globus_etics_platform() {
642 echo "Valid platforms are:"
643 echo " RH4_32"
644 echo " RH5_64"
645 echo " SUSE11_64"
646 echo " Deb5_64"
647 }
648
649 # globus from VDT/etics tarball
650 globus_etics() {
651 # Find correct globus for platform
652 case "$PLATFORM" in
653 RH4_32)
654 globus_url=http://etics-repository.cern.ch/repository/download/registered/vdt/globus/4.0.3-VDT-1.6.1/slc4_ia32_gcc346/
655 globus_tgz=globus-4.0.3-VDT-1.6.1-7.tar.gz
656 globus_flavor=gcc32dbg
657 ;;
658 RH5_64)
659 globus_url=http://etics-repository.cern.ch/repository/download/registered/vdt/globus/4.0.7-VDT-1.10.1/sl5_x86_64_gcc412/
660 globus_tgz=globus-4.0.7-VDT-1.10.1-1.tar.gz
661 globus_flavor=gcc64dbg
662 ;;
663 SUSE11_64)
664 globus_url=http://eticssoft.web.cern.ch/eticssoft/repository//vdt/globus/4.0.7-VDT-1.10.1/SUSE11_x86_64_gcc432/
665 globus_tgz=globus-4.0.7-VDT-1.10.1-1.tar.gz
666 globus_flavor=gcc64dbg
667 ;;
668 Deb5_64)
669 globus_url=http://etics-repository.cern.ch/repository/download/registered/vdt/globus/4.0.8-VDT-2.0.0/deb5_x86_64_gcc432/
670 globus_tgz=globus-4.0.8-VDT-2.0.0-2.tar.gz
671 globus_flavor=gcc64dbg
672 ;;
673 *)
674 echo "Unknown platform: \"$PLATFORM\"" >&2
675 globus_etics_platform >&2
676 myexit 1
677 ;;
678 esac
679
680 # Now download, unpack, and update the tarball
681 cd ${SOURCE}
682 mkdir -p ${globus_prefix} && \
683 eval ${wget} ${globus_url}${globus_tgz} > ${globus_tgz} && \
684 tar -C ${globus_prefix} -zxf ${globus_tgz} && \
685 cd ${globus_prefix} && \
686 find . -type f -name lib\*.la|while read file;do
687 sed s+/opt/globus+${globus_prefix}+g ${file} > ${file}.new && \
688 mv -f ${file}.new ${file}
689 done || return $RC_FAILED
690
691 # Setup globus flags for other compos
692 set_compo_flags globus prefix flavor
693
694 return $RC_SUCCESS
695 }
696
697 # globus directly from source tarball
698 globus_source() {
699 tag=${tag_globus:-4.0.8}
700 major=`echo $tag|cut -d. -f1`
701 minor=`echo $tag|cut -d. -f2`
702 # Where to get which globus toolkit tarball
703 globus_url=${globus_baseurl}gt${major}/${major}.${minor}/${tag}/installers/src/
704 globus_tbz=gt${tag}-all-source-installer.tar.bz2
705 globus_srcdir=`basename ${globus_tbz} .tar.bz2`
706
707 # Note: making globus_gridmap_callout_error globus_authz only needed for gt4
708 # interface.
709 cd ${SOURCE}
710 eval ${wget} ${globus_url}${globus_tbz} > ${globus_tbz} && \
711 tar -jxf ${globus_tbz} && \
712 cd ${globus_srcdir} && \
713 ./configure --prefix=${globus_prefix} \
714 --disable-gridftp --disable-gsiopenssh --disable-myproxy \
715 --disable-rls --disable-drs --disable-rendezvous \
716 --disable-tests --disable-prewsgram --disable-wsgram \
717 --disable-wsjava --disable-wsc --disable-wsmds --disable-wsdel \
718 --disable-wsrft --disable-wscas --disable-wstests \
719 --disable-webmds && \
720 make globus-gsi globus_gridmap_callout_error globus_authz && \
721 make install || return $RC_FAILED
722
723 # (re)evaluate globus flavour
724 globus_flavour
725
726 # Setup globus flags for other compos
727 set_compo_flags globus prefix flavor
728
729 return $RC_SUCCESS
730 }
731
732 # Set correct globus flavour
733 globus_flavour() {
734 if [ -n "$PLATFORM" ];then
735 case "$PLATFORM" in
736 RH4_32) globus_flavor=gcc32dbg ;;
737 RH5_64) globus_flavor=gcc64dbg ;;
738 SUSE11_64) globus_flavor=gcc64dbg ;;
739 Deb5_64) globus_flavor=gcc64dbg ;;
740 *) echo "Unknown platform: \"$PLATFORM\"" >&2
741 return $RC_FAILED ;;
742 esac
743 else
744 if [ -f "${globus_prefix}/etc/globus_core/flavor_gcc64dbg.gpt" ];then
745 globus_flavor=gcc64dbg
746 elif [ -f "${globus_prefix}/etc/globus_core/flavor_gcc64.gpt" ];then
747 globus_flavor=gcc64
748 elif [ -f "${globus_prefix}/etc/globus_core/flavor_gcc32dbg.gpt" ];then
749 globus_flavor=gcc32dbg
750 elif [ -f "${globus_prefix}/etc/globus_core/flavor_gcc32.gpt" ];then
751 globus_flavor=gcc32
752 else
753 # Assume we're building a flavor-less version
754 globus_flavor=""
755 fi
756 fi
757 return $RC_SUCCESS
758 }
759
760 # wrapper function that either does a source download or etics download
761 globus() {
762 globus_prefix=${myDESTDIR}/${myglobus:-${myprefix:-$GNU_DEF_PFX}}
763 # Now unpack or build globus
764 if [ -z "$PLATFORM" ];then
765 globus_source
766 return $?
767 else
768 globus_etics
769 return $?
770 fi
771 }
772
773 # VOMS development version, directly from CNAF via git, for OpenSSL1.0
774 voms_git() {
775 compo_voms=${compo_voms:-org.glite.security.voms}
776 myvoms=${myvoms:-${myprefix:-$GNU_DEF_PFX}}
777 # Already setup variables for other components: voms overrides libdir...
778 voms_prefix=${myDESTDIR}/${myvoms}
779 voms_includes=""
780 if [ -n "${mylibdir}" ];then
781 myvomslibdir=${myvoms}/`basename ${mylibdir}`
782 voms_libdir=${myDESTDIR}/${myvomslibdir}
783 else
784 myvomslibdir=${myvoms}/lib
785 voms_libdir=""
786 fi
787 cd ${SOURCE}
788 # optionally remove directory
789 [ $REMOVE -eq 1 ] && rm -rf ${compo_voms}
790 if [ -d ${compo_voms} ];then
791 cd ${compo_voms} && \
792 git checkout voms_R_2_0_0_RC1 && \
793 git fetch && \
794 git reset --hard || return $RC_FAILED
795 else
796 git clone -n git://testbed002.cnaf.infn.it/opt/gits/voms.git ${compo_voms} && \
797 cd ${compo_voms} && \
798 git checkout voms_R_2_0_0_RC1 || return $RC_FAILED
799 fi
800 ./configure --prefix=${myvoms} --libdir=${myvomslibdir} ${sysconfdir_flag} \
801 ${includedir_flag} \
802 --disable-glite --disable-java --with-api-only && \
803 make && \
804 make ${DESTDIR_flag} libdir=${myvomslibdir} install || return $RC_FAILED
805 set_compo_flags voms prefix includes libdir
806 return $RC_SUCCESS
807 }
808
809 # VOMS development version, directly from CNAF
810 voms_devel() {
811 compo_voms=${compo_voms:-org.glite.security.voms}
812 myvoms=${myvoms:-${myprefix:-$GNU_DEF_PFX}}
813 # Already setup variables for other components: voms overrides libdir...
814 voms_prefix=${myDESTDIR}/${myvoms}
815 voms_includes=""
816 if [ -n "${mylibdir}" ];then
817 myvomslibdir=${myvoms}/`basename ${mylibdir}`
818 voms_libdir=${myDESTDIR}/${myvomslibdir}
819 else
820 myvomslibdir=${myvoms}/lib
821 voms_libdir=""
822 fi
823 cd ${SOURCE}
824 # optionally remove directory
825 [ $REMOVE -eq 1 ] && rm -rf ${compo_voms}
826 echo "t" |svn co --no-auth-cache --username anonymous --password anonymous \
827 https://svn.forge.cnaf.infn.it/svn/voms/voms/branches/voms-2-0-series ${compo_voms} && \
828 cd ${compo_voms} && \
829 ./autogen.sh && \
830 ./configure --prefix=${myvoms} --libdir=${myvomslibdir} ${sysconfdir_flag} \
831 --disable-glite --disable-java --with-api-only && \
832 make && \
833 make ${DESTDIR_flag} libdir=${myvomslibdir} install || return $RC_FAILED
834 # Fix for old style includedir
835 if grep -q '@includedir@/glite/security/voms' src/include/Makefile.am ; then
836 voms_includes=${voms_prefix}/include/glite/security
837 else
838 voms_includes=""
839 fi
840 set_compo_flags voms prefix includes libdir
841 return $RC_SUCCESS
842 }
843
844 voms_cerncvs() {
845 compo_voms=${compo_voms:-org.glite.security.voms}
846 cvsrootweb_voms=${cvsrootweb_voms:-$webcvs}
847 myvoms=${myvoms:-${myprefix:-$GNU_DEF_PFX}}
848 if [ -n "$globus_flavor" ]; then
849 # myglobusflavor_flag="--with-globus-flavor=$globus_flavor"
850 myglobusflavor_flag=""
851 else
852 myglobusflavor_flag=""
853 fi
854 # Already setup variables for other components: voms overrides libdir...
855 voms_prefix=${myDESTDIR}/${myvoms}
856 voms_includes=""
857 if [ -n "${mylibdir}" ];then
858 myvomslibdir=${myvoms}/`basename ${mylibdir}`
859 voms_libdir=${myDESTDIR}/${myvomslibdir}
860 else
861 myvomslibdir=${myvoms}/lib
862 voms_libdir=""
863 fi
864 cd ${SOURCE}
865 get voms && \
866 cd ${compo_voms} && \
867 ./autogen.sh && \
868 ./configure --prefix=${myvoms} --libdir=${myvomslibdir} ${sysconfdir_flag} \
869 ${globus_prefix_flag} ${myglobusflavor_flag} \
870 --disable-glite --disable-java --with-api-only && \
871 make && \
872 make ${DESTDIR_flag} libdir=${myvomslibdir} install || return $RC_FAILED
873 # Fix for old style includedir
874 grep -q '@includedir@/glite/security/voms' src/include/Makefile.am && \
875 voms_includes=${voms_prefix}/include/glite/security
876 set_compo_flags voms prefix includes libdir
877 return $RC_SUCCESS
878 }
879
880 # VOMS: (C & C++ API only)
881 voms() {
882 if [ "$tag_voms" = "devel" ];then
883 voms_devel
884 return $?
885 elif [ "$tag_voms" = "git" ];then
886 voms_git
887 return $?
888 else
889 voms_cerncvs
890 return $?
891 fi
892 }
893
894 # LCMAPS: Note we can always use the un-threaded flavor for both
895 lcmaps() {
896 compo_lcmaps=${compo_lcmaps:-lcmaps}
897 cd ${SOURCE}
898 get lcmaps && \
899 cd ${compo_lcmaps} && \
900 ./bootstrap && \
901 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
902 ${includedir_flag} \
903 ${voms_prefix_flag} ${voms_includes_flag} ${voms_libdir_flag} \
904 ${globus_prefix_flag} \
905 ${globus_flavor_flag} && \
906 make && \
907 make ${DESTDIR_flag} install && \
908 make_dist || return $RC_FAILED
909 set_def_compo_flags lcmaps prefix includes libdir
910 # remove liblcmaps*.la files from installation. It's a hack...
911 cd ${lcmaps_libdir:-${lcmaps_prefix:-${myDESTDIR}/$GNU_DEF_PFX}}
912 warning "Removing liblcmaps\*.la files from $findlibdir"
913 find . -name liblcmaps\*.la -exec rm "{}" \;
914 rc_lcmaps_interface=$RC_SUCCESS
915 return $RC_SUCCESS
916 }
917
918 # LCMAPS-INTERFACE:
919 lcmaps_interface() {
920 if [ "$rc_lcmaps" = "$RC_SUCCESS" ];then
921 warning "No need to build lcmaps_interface: "\
922 "lcmaps has been build successfully."
923 return $RC_SUCCESS
924 fi
925 dir=lcmaps-interface
926 compo_lcmaps_interface=${compo_lcmaps_interface:-lcmaps}
927 cd ${SOURCE}
928 get lcmaps_interface $dir && \
929 cd ${dir} && \
930 ./bootstrap && \
931 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
932 ${includedir_flag} \
933 --enable-headers && \
934 make && \
935 make ${DESTDIR_flag} install || return $RC_FAILED
936 set_def_compo_flags lcmaps prefix includes libdir
937 return $RC_SUCCESS
938 }
939
940 # LCAS:
941 lcas() {
942 compo_lcas=${compo_lcas:-lcas}
943 cd ${SOURCE}
944 get lcas && \
945 cd ${compo_lcas} && \
946 ./bootstrap && \
947 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
948 ${includedir_flag} \
949 ${globus_prefix_flag} ${globus_flavor_flag} && \
950 make && \
951 make ${DESTDIR_flag} install && \
952 make_dist || return $RC_FAILED
953 set_def_compo_flags lcas prefix includes libdir
954 rc_lcas_interface=$RC_SUCCESS
955 return $RC_SUCCESS
956 }
957
958 # LCAS-INTERFACE:
959 lcas_interface() {
960 if [ "$rc_lcas" = "$RC_SUCCESS" ];then
961 warning "No need to build lcas_interface: lcas has been build successfully."
962 return $RC_SUCCESS
963 fi
964 compo_lcas_interface=${compo_lcas_interface:-lcas}
965 cd ${SOURCE}
966 get lcas_interface $dir && \
967 cd ${compo_lcas_interface} && \
968 ./bootstrap && \
969 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
970 ${includedir_flag} \
971 --enable-headers && \
972 make ${DESTDIR_flag} install || return $RC_FAILED
973 set_def_compo_flags lcas prefix includes libdir
974 return $RC_SUCCESS
975 }
976
977 # glexec >=0.8
978 glexec() {
979 compo_glexec=${compo_glexec:-glexec}
980 cd ${SOURCE}
981 get glexec && \
982 cd ${compo_glexec} && \
983 ./bootstrap && \
984 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
985 ${lcmaps_prefix_flag} ${lcmaps_includes_flag} ${lcmaps_libdir_flag} && \
986 make && \
987 make ${DESTDIR_flag} install && \
988 make_dist || return $RC_FAILED
989 return $RC_SUCCESS
990 }
991
992 # LCMAPS PLUGINS BASIC:
993 lcmaps_plugins_basic() {
994 compo_lcmaps_plugins_basic=${compo_lcmaps_plugins_basic:-lcmaps-plugins-basic}
995 cd ${SOURCE}
996 get lcmaps_plugins_basic && \
997 cd ${compo_lcmaps_plugins_basic} && \
998 ./bootstrap && \
999 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1000 ${lcmaps_prefix_flag} ${lcmaps_includes_flag} ${lcmaps_libdir_flag} && \
1001 make && \
1002 make ${DESTDIR_flag} install && \
1003 make_dist || return $RC_FAILED
1004 return $RC_SUCCESS
1005 }
1006
1007 # LCMAPS PLUGINS VERIFY-PROXY:
1008 lcmaps_plugins_verify_proxy() {
1009 compo_lcmaps_plugins_verify_proxy=${compo_lcmaps_plugins_verify_proxy:-lcmaps-plugins-verify-proxy}
1010 cd ${SOURCE}
1011 get lcmaps_plugins_verify_proxy && \
1012 cd ${compo_lcmaps_plugins_verify_proxy} && \
1013 ./bootstrap && \
1014 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1015 ${lcmaps_prefix_flag} ${lcmaps_includes_flag} ${lcmaps_libdir_flag} && \
1016 make && \
1017 make ${DESTDIR_flag} install && \
1018 make_dist || return $RC_FAILED
1019 return $RC_SUCCESS
1020 }
1021
1022 # LCMAPS PLUGINS VOMS:
1023 lcmaps_plugins_voms() {
1024 compo_lcmaps_plugins_voms=${compo_lcmaps_plugins_voms:-lcmaps-plugins-voms}
1025 cd ${SOURCE}
1026 get lcmaps_plugins_voms && \
1027 cd ${compo_lcmaps_plugins_voms} && \
1028 ./bootstrap && \
1029 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1030 ${lcmaps_prefix_flag} ${lcmaps_includes_flag} ${lcmaps_libdir_flag} \
1031 ${globus_prefix_flag} ${globus_flavor_flag} \
1032 ${voms_prefix_flag} ${voms_includes_flag} ${voms_libdir_flag} && \
1033 make && \
1034 make ${DESTDIR_flag} install && \
1035 make_dist || return $RC_FAILED
1036 return $RC_SUCCESS
1037 }
1038
1039 # LCMAPS PLUGINS AFS:
1040 lcmaps_plugins_afs() {
1041 compo_lcmaps_plugins_afs=${compo_lcmaps_plugins_afs:-lcmaps-plugins-afs}
1042 cd ${SOURCE}
1043 get lcmaps_plugins_afs && \
1044 cd ${compo_lcmaps_plugins_afs} && \
1045 ./bootstrap && \
1046 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1047 ${lcmaps_prefix_flag} ${lcmaps_includes_flag} ${lcmaps_libdir_flag} \
1048 ${globus_prefix_flag} ${globus_flavor_flag} && \
1049 make && \
1050 make ${DESTDIR_flag} install && \
1051 make_dist || return $RC_FAILED
1052 return $RC_SUCCESS
1053 }
1054
1055 # LCMAPS PLUGINS GUMS:
1056 lcmaps_plugins_gums() {
1057 compo_lcmaps_plugins_gums=${compo_lcmaps_plugins_gums:-lcmaps-plugins-gums}
1058 cd ${SOURCE}
1059 get lcmaps_plugins_gums && \
1060 cd ${compo_lcmaps_plugins_gums} && \
1061 ./bootstrap && \
1062 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1063 ${lcmaps_prefix_flag} ${lcmaps_includes_flag} ${lcmaps_libdir_flag} && \
1064 make && \
1065 make ${DESTDIR_flag} install && \
1066 make_dist || return $RC_FAILED
1067 return $RC_SUCCESS
1068 }
1069
1070 # PEP-C LIB: Will install in same libdir as LCMAPS
1071 pep_api() {
1072 compo_pep_api=${compo_pep_api:-pep-api}
1073 svnroot_pep_api=${svnroot_pep_api_c:-http://svnweb.cern.ch/guest/glxa/pep-c-lib/}
1074 tag_pep_api=${tag_pep_api:-branches/1_3}
1075 mypep_api=${myprefix:-$GNU_DEF_PFX}
1076 cd ${SOURCE}
1077 get pep_api && \
1078 cd ${compo_pep_api} && \
1079 ./autotools.sh && \
1080 ./configure --prefix=${mypep_api} ${libdir_flag} \
1081 --datadir=${myDESTDIR}/${mypep_api}/share && \
1082 make && \
1083 make ${DESTDIR_flag} install && \
1084 make doxygen && \
1085 make_dist || return $RC_FAILED
1086 set_def_compo_flags pep_api prefix
1087 return $RC_SUCCESS
1088 }
1089
1090 # LCMAPS PLUGINS C-PEP
1091 lcmaps_plugins_c_pep() {
1092 compo_lcmaps_plugins_c_pep=${compo_lcmaps_plugins_c_pep:-lcmaps-plugins-c-pep}
1093 cd ${SOURCE}
1094 get lcmaps_plugins_c_pep && \
1095 cd ${compo_lcmaps_plugins_c_pep} && \
1096 ./bootstrap && \
1097 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1098 ${lcmaps_prefix_flag} ${lcmaps_includes_flag} ${lcmaps_libdir_flag} \
1099 ${pep_api_prefix_flag} ${pep_api_libdir_flag} && \
1100 make && \
1101 make ${DESTDIR_flag} install && \
1102 make_dist || return $RC_FAILED
1103 return $RC_SUCCESS
1104 }
1105
1106 # Jobrepository:
1107 jobrep_api() {
1108 compo_jobrep_api=${compo_jobrep_api:-jobrepository}
1109 cd ${SOURCE}
1110 get jobrep_api && \
1111 cd ${compo_jobrep_api} && \
1112 ./bootstrap && \
1113 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1114 ${includedir_flag} && \
1115 make && \
1116 make ${DESTDIR_flag} install && \
1117 make_dist || return $RC_FAILED
1118 set_def_compo_flags jobrep_api prefix includes libdir
1119 return $RC_SUCCESS
1120 }
1121
1122 # LCMAPS PLUGINS JOBREP
1123 lcmaps_plugins_jobrep() {
1124 compo_lcmaps_plugins_jobrep=${compo_lcmaps_plugins_jobrep:-lcmaps-plugins-jobrep}
1125 cd ${SOURCE}
1126 get lcmaps_plugins_jobrep && \
1127 cd ${compo_lcmaps_plugins_jobrep} && \
1128 ./bootstrap && \
1129 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1130 ${lcmaps_prefix_flag} ${lcmaps_includes_flag} ${lcmaps_libdir_flag} \
1131 ${jobrep_api_prefix_flag} ${jobrep_api_includes_flag} ${jobrep_api_libdir_flag} \
1132 ${globus_prefix_flag} ${globus_flavor_flag} && \
1133 make && \
1134 make ${DESTDIR_flag} install && \
1135 make_dist || return $RC_FAILED
1136 return $RC_SUCCESS
1137 }
1138
1139 # SAML2XACML2 LIB:
1140 saml2_xacml2_c_lib() {
1141 compo_saml2_xacml2_c_lib=${compo_saml2_xacml2_c_lib:-saml2-xacml2-c-lib}
1142 gsoap_prefix=${myDESTDIR}/${myprefix:-$GNU_DEF_PFX}
1143 if [ -n "${mylibdir}" ];then
1144 gsoap_libdir=${gsoap_prefix}/`basename ${mylibdir}`
1145 mygsoaplibdir_flag="--libdir=$gsoap_libdir"
1146 else
1147 gsoap_libdir=""
1148 mygsoaplibdir_flag=""
1149 fi
1150 cd ${SOURCE}
1151 export CXXFLAGS="-fPIC ${CXXFLAGS}"
1152 get saml2_xacml2_c_lib && \
1153 cd ${compo_saml2_xacml2_c_lib} && \
1154 # Only for new style SAML2-XACML2-C-lib do we have gsoap as tarball
1155 gsoap_tarball="`ls gsoap-2.7*.tar.gz 2>/dev/null`"
1156 if [ -n "$gsoap_tarball" ];then
1157 tar -zxf ${gsoap_tarball} || echo $RC_FAILED
1158 fi
1159 cd gsoap-2.7 && \
1160 ./configure --prefix=${gsoap_prefix} ${mygsoaplibdir_flag} && \
1161 make && \
1162 make install && \
1163 cd ../xacml-1.0 && \
1164 ./bootstrap && \
1165 ./configure ${prefix_flag} ${libdir_flag} \
1166 --with-gsoap=${gsoap_prefix} && \
1167 make && \
1168 make ${DESTDIR_flag} install && \
1169 make_dist || return $RC_FAILED
1170 set_def_compo_flags xacml prefix
1171 return $RC_SUCCESS
1172 }
1173
1174 # LCMAPS PLUGINS SCAS CLIENT:
1175 lcmaps_plugins_scas_client() {
1176 compo_lcmaps_plugins_scas_client=${compo_lcmaps_plugins_scas_client:-lcmaps-plugins-scas-client}
1177 cd ${SOURCE}
1178 get lcmaps_plugins_scas_client && \
1179 cd ${compo_lcmaps_plugins_scas_client} && \
1180 ./bootstrap && \
1181 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1182 ${lcmaps_prefix_flag} ${lcmaps_includes_flag} ${lcmaps_libdir_flag} \
1183 ${xacml_prefix_flag} ${xacml_libdir_flag} && \
1184 make && \
1185 make ${DESTDIR_flag} install && \
1186 make_dist || return $RC_FAILED
1187 return $RC_SUCCESS
1188 }
1189
1190 # SCAS
1191 scas() {
1192 compo_scas=${compo_scas:-scas}
1193 cd ${SOURCE}
1194 get scas && \
1195 cd ${compo_scas} && \
1196 ./bootstrap && \
1197 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1198 ${lcas_prefix_flag} ${lcas_includes_flag} ${lcas_libdir_flag} \
1199 ${lcmaps_prefix_flag} ${lcmaps_includes_flag} ${lcmaps_libdir_flag} \
1200 ${xacml_prefix_flag} ${xacml_libdir_flag} \
1201 ${globus_prefix_flag} ${globus_flavor_flag} && \
1202 make && \
1203 make ${DESTDIR_flag} install && \
1204 make_dist || return $RC_FAILED
1205 return $RC_SUCCESS
1206 }
1207
1208 # EES
1209 ees() {
1210 compo_ees=${compo_ees:-ees}
1211 # If no svn root is given, use the defaults, depending on tag
1212 if [ -z "$svnroot_ees" ];then
1213 svnroot_ees=https://ndpfsvn.nikhef.nl/repos/pdpsoft/
1214 fi
1215 if [ -z "$tag_ees" -o "$tag_ees" = "HEAD" ];then # develop version
1216 tag_ees=trunk/grid-mw-security/ees
1217 fi
1218 cd ${SOURCE}
1219 get ees && \
1220 cd ${compo_ees} && \
1221 ./bootstrap && \
1222 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1223 ${xacml_prefix_flag} ${xacml_libdir_flag} && \
1224 make && \
1225 make ${DESTDIR_flag} install && \
1226 make_dist || return $RC_FAILED
1227 return $RC_SUCCESS
1228 }
1229
1230 # LCAS PLUGINS BASIC:
1231 lcas_plugins_basic() {
1232 compo_lcas_plugins_basic=${compo_lcas_plugins_basic:-lcas-plugins-basic}
1233 cd ${SOURCE}
1234 get lcas_plugins_basic && \
1235 cd ${compo_lcas_plugins_basic} && \
1236 ./bootstrap && \
1237 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1238 ${lcas_prefix_flag} ${lcas_includes_flag} ${lcas_libdir_flag} \
1239 ${globus_prefix_flag} ${globus_flavor_flag} && \
1240 make && \
1241 make ${DESTDIR_flag} install && \
1242 make_dist || return $RC_FAILED
1243 return $RC_SUCCESS
1244 }
1245
1246 # LCAS PLUGINS CHECK-EXECUTABLE:
1247 lcas_plugins_check_executable() {
1248 compo_lcas_plugins_check_executable=${compo_lcas_plugins_check_executable:-lcas-plugins-check-executable}
1249 cd ${SOURCE}
1250 get lcas_plugins_check_executable && \
1251 cd ${compo_lcas_plugins_check_executable} && \
1252 ./bootstrap && \
1253 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1254 ${lcas_prefix_flag} ${lcas_includes_flag} ${lcas_libdir_flag} \
1255 ${globus_prefix_flag} ${globus_flavor_flag} && \
1256 make && \
1257 make ${DESTDIR_flag} install && \
1258 make_dist || return $RC_FAILED
1259 return $RC_SUCCESS
1260 }
1261
1262 # GRIDSITE CORE:
1263 gridsite() {
1264 compo_gridsite=${compo_gridsite:-org.gridsite.core}
1265 cvsrootweb_gridsite=${cvsrootweb_gridsite:-$webcvs}
1266 mygridsite=${mygridsite:-${myprefix:-$GNU_DEF_PFX}}
1267 # Already setup variables for other components
1268 gridsite_prefix=${myDESTDIR}/${mygridsite}
1269 if [ -n "${mylibdir}" ];then
1270 gridsitelibdir=`basename ${mylibdir}`
1271 gridsite_libdir=${gridsite_prefix}/${gridsitelibdir}
1272 else
1273 gridsitelibdir=lib
1274 gridsite_libdir=""
1275 fi
1276 cd ${SOURCE}
1277 get gridsite && \
1278 cd ${compo_gridsite}/src && \
1279 make prefix=${mygridsite} libdir=${gridsitelibdir} && \
1280 make prefix=${myDESTDIR}/${mygridsite} libdir=${gridsitelibdir} install || \
1281 return $RC_FAILED
1282
1283 VERSION=`grep "^PATCH_VERSION" ../VERSION|cut -d= -f2`
1284 make_dist ../gridsite-${VERSION}.src.tar.gz || return $RC_FAILED
1285
1286 # Setup gridsite flag for other compos
1287 set_compo_flags gridsite prefix libdir
1288 return $RC_SUCCESS
1289 }
1290
1291 # LCAS PLUGINS VOMS:
1292 lcas_plugins_voms() {
1293 compo_lcas_plugins_voms=${compo_lcas_plugins_voms:-lcas-plugins-voms}
1294 cd ${SOURCE}
1295 get lcas_plugins_voms && \
1296 cd ${compo_lcas_plugins_voms} && \
1297 ./bootstrap && \
1298 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1299 ${lcas_prefix_flag} ${lcas_includes_flag} ${lcas_libdir_flag} \
1300 ${globus_prefix_flag} ${globus_flavor_flag} \
1301 ${voms_prefix_flag} ${voms_includes_flag} ${voms_libdir_flag} \
1302 ${gridsite_prefix_flag} &&
1303 make && \
1304 make ${DESTDIR_flag} install && \
1305 make_dist || return $RC_FAILED
1306 return $RC_SUCCESS
1307 }
1308
1309 # LCAS-LCMAPS GT4 interface:
1310 # Note: only reason for building two extra globus targets
1311 # globus_gridmap_callout_error globus_authz
1312 lcas_lcmaps_gt4_interface() {
1313 compo_lcas_lcmaps_gt4_interface=${compo_lcas_lcmaps_gt4_interface:-lcas-lcmaps-gt4-interface}
1314 cd ${SOURCE}
1315 get lcas_lcmaps_gt4_interface && \
1316 cd ${compo_lcas_lcmaps_gt4_interface} && \
1317 ./bootstrap && \
1318 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1319 ${lcas_prefix_flag} ${lcas_includes_flag} ${lcas_libdir_flag} \
1320 ${lcmaps_prefix_flag} ${lcmaps_includes_flag} ${lcmaps_libdir_flag} \
1321 ${globus_prefix_flag} ${globus_flavor_flag} && \
1322 make && \
1323 make ${DESTDIR_flag} install && \
1324 make_dist || return $RC_FAILED
1325 return $RC_SUCCESS
1326 }
1327
1328 ##############################################################################
1329 #
1330 # Define all dependency functions, NOTE: the order of the setdeps statements is
1331 # important!
1332 #
1333 ##############################################################################
1334
1335 # GLOBUS: no dependencies
1336 setdeps globus
1337
1338 # VOMS: depends globus
1339 setdeps voms globus
1340
1341 # LCMAPS: depends globus, voms
1342 setdeps lcmaps globus voms
1343
1344 # LCMAPS-INTERFACE: no dependencies
1345 setdeps lcmaps_interface
1346
1347 # LCAS: depends globus
1348 setdeps lcas globus
1349
1350 # LCAS-INTERFACE: no dependencies
1351 setdeps lcas_interface
1352
1353 # GLEXEC: depends lcmaps_interface
1354 setdeps glexec lcmaps_interface
1355
1356 # LCMAPS PLUGINS BASIC: depends lcmaps-interface
1357 setdeps lcmaps_plugins_basic lcmaps-interface
1358
1359 # LCMAPS PLUGINS VERIFY-PROXY: depends lcmaps-interface
1360 setdeps lcmaps_plugins_verify_proxy lcmaps_interface
1361
1362 # LCMAPS PLUGINS VOMS: depends globus, voms, lcmaps-interface
1363 setdeps lcmaps_plugins_voms globus voms lcmaps_interface
1364
1365 # LCMAPS PLUGINS AFS: depends lcmaps-interface
1366 setdeps lcmaps_plugins_afs globus lcmaps_interface
1367
1368 # LCMAPS PLUGINS GUMS: depends lcmaps-interface
1369 setdeps lcmaps_plugins_gums lcmaps_interface
1370
1371 # PEP-C LIB: no dependencies
1372 setdeps pep_api
1373
1374 # LCMAPS PLUGINS C-PEP: depends pep-c lib, lcmaps-interface
1375 setdeps lcmaps_plugins_c_pep pep_api lcmaps_interface
1376
1377 # Jobrepository: no dependencies
1378 setdeps jobrep_api
1379
1380 # LCMAPS PLUGINS JOBREP: depends jobrepository lib, lcmaps-interface
1381 setdeps lcmaps_plugins_jobrep jobrep_api globus lcmaps_interface
1382
1383 # SAML2XACML2 LIB: no dependencies
1384 setdeps saml2_xacml2_c_lib
1385
1386 # LCMAPS PLUGINS SCAS CLIENT: depends saml2-xacml2-c-lib, lcmaps-interface
1387 setdeps lcmaps_plugins_scas_client saml2_xacml2_c_lib lcmaps_interface
1388
1389 # SCAS: depends saml2-xacml2-c-lib, lcmaps, lcas
1390 setdeps scas saml2_xacml2_c_lib lcmaps lcas
1391
1392 # EES: depends saml2-xacml2-c-lib
1393 setdeps ees saml2_xacml2_c_lib
1394
1395 # LCAS PLUGINS BASIC: depends globus, lcas-interface
1396 setdeps lcas_plugins_basic globus lcas_interface
1397
1398 # LCAS PLUGINS CHECK-EXECUTABLE: depends globus, lcas-interface
1399 setdeps lcas_plugins_check_executable globus lcas_interface
1400
1401 # GRIDSITE Core:
1402 setdeps gridsite
1403
1404 # LCAS PLUGINS VOMS: depends globus, voms, gridsite-core, lcas-interface
1405 setdeps lcas_plugins_voms globus voms gridsite lcas_interface
1406
1407 # LCAS-LCMAPS GT4 interface: depends globus, lcmaps, common-cpp, lcas, lcas-interface
1408 setdeps lcas_lcmaps_gt4_interface globus lcmaps lcas
1409
1410 ##############################################################################
1411 #
1412 # Build all tools, taking care of dependencies
1413 #
1414 ##############################################################################
1415
1416 # Now that we know all the targets, we can print usage if requested
1417 if [ "$USAGE" -eq 1 ];then
1418 usage
1419 myexit 0
1420 fi
1421
1422 # If we just wanted platform help, print it now
1423 if [ "$PLATFORM" = "help" ];then
1424 globus_etics_platform
1425 myexit 0
1426 fi
1427
1428 # Check source directory...
1429 if [ "`echo $SOURCE|cut -c1`" != "/" ];then
1430 SOURCE="`pwd`/$SOURCE"
1431 warning "Making source directory absolute: $SOURCE"
1432 fi
1433
1434 # When using a file: get targets also from there (instead of only using $*)
1435 TARGETS=""
1436 if [ -n "$TARGETFILE" ];then
1437 # remove everything starting with # (better not # in names...)
1438 TARGETS="`sed 's/#.*$//' $TARGETFILE`"
1439 fi
1440 # If we put something in it:
1441 if [ -n "$TARGETS" ];then
1442 TARGETS="$TARGETS $*"
1443 else
1444 TARGETS="$*"
1445 fi
1446
1447 # Check if anything needs doing...
1448 if [ -z "$TARGETS" ];then
1449 echo "No targets specified, nothing to be done."
1450 myexit 0
1451 fi
1452
1453 # Setup file to save the failed targets into.
1454 if [ -z "$NEWTARGETFILE" ];then
1455 NEWTARGETFILE=$SOURCE/$NEWTARGETFILE_DEFAULT
1456 fi
1457
1458 # Setup myDISTDIR
1459 if [ -z "$myDISTDIR" ];then
1460 myDISTDIR=$SOURCE
1461 fi
1462
1463 # Make sure we have an (empty) temp file
1464 touch $NEWFLAGFILE_TMP
1465 # Setup configure flags specified in file
1466 if [ -n "$FLAGFILE" ];then
1467 lines=`cat $FLAGFILE|wc -l`
1468 lineno=0
1469 while [ $lineno -lt $lines ];do
1470 lineno=`expr $lineno + 1`
1471 line=`sed -n ${lineno}p $FLAGFILE|sed 's/#.*$//'`
1472 if [ -n "$line" ];then
1473 parse_flag "$line"
1474 fi
1475 done
1476 fi
1477
1478 # Setup configure flags specified on cmdline
1479 if [ -n "$FLAGS" ];then
1480 for i in `echo "$FLAGS"`;do
1481 parse_flag $i
1482 done
1483 fi
1484
1485 # Setup file to save the failed targets into.
1486 if [ -z "$NEWFLAGFILE" ];then
1487 NEWFLAGFILE=$SOURCE/$NEWFLAGFILE_DEFAULT
1488 fi
1489
1490 # Find suitable download command
1491 get_download_cmd
1492
1493 # Parse the config options
1494 parse_config
1495
1496 # Figure out the build targets
1497 # Check for special build all target and make all unique
1498 # - substitute 'all' -> $known_targets
1499 # - re-uniquefy
1500 # - remove empty lines
1501 reqs=`echo "$TARGETS"|tr ' ' '\n'|sed "s/^all$/$known_targets/"|tr ' ' '\n'|sort -u|grep -v '^$'`
1502
1503 # loop over all known targets and pick out the requested ones
1504 build_targets=""
1505 for known in `echo $known_targets|tr ' ' '\n'`;do
1506 reqs_new=`echo $reqs|tr ' ' '\n'|grep -v "^$known$"`
1507 # if different, we have a match
1508 if [ "$reqs_new" != "$reqs" ];then
1509 reqs=$reqs_new
1510 build_targets=`echo $build_targets $known`
1511 fi
1512 done
1513 # Anything left is unknown target...
1514 if [ -n "$reqs" ];then
1515 error "Unknown target(s): $reqs"
1516 fi
1517
1518 MISSING=0
1519 FAILED=0
1520 # Anything to be done?
1521 if [ -n "$build_targets" ];then
1522 # create the source dir
1523 mkdir -p ${SOURCE} || error "Creating of ${SOURCE} FAILED"
1524
1525 # Get globus_flavour just in case we won't build. If it will be build, it
1526 # will be reset afterwards.
1527 globus_flavour
1528
1529 # make sure default common_cpp is defined, as it is used by so many.
1530 compo_common_cpp=${compo_common_cpp:-org.glite.build.common-cpp}
1531
1532 # Do the builds and print results
1533 if [ -z "$STDOUT" ];then
1534 if [ -z "$STDERR" ];then
1535 build
1536 else
1537 build 2> $STDERR
1538 fi
1539 else
1540 if [ -z "$STDERR" ];then
1541 build > $STDOUT
1542 else
1543 build > $STDOUT 2> $STDERR
1544 fi
1545 fi
1546 fi
1547
1548 myexit `expr $MISSING + $FAILED`

Properties

Name Value
svn:executable *

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