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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2160 - (hide annotations) (download) (as text)
Sun Jan 30 17:40:33 2011 UTC (11 years, 3 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 msalle 2157 #!/bin/sh
2 msalle 2033
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 msalle 2155 VERSION=0.2.0-1
15 msalle 2069
16 msalle 2033 SOURCE_DEFAULT=/tmp/source # Where to download sources
17 msalle 2156 NEWTARGETFILE_DEFAULT="failedcomps.txt"
18     NEWFLAGFILE_DEFAULT="configflag.txt"
19     NEWFLAGFILE_TMP=/tmp/${NEWFLAGFILE_DEFAULT}$$
20 msalle 2155 DESTDIR_DEFAULT=/tmp/build # Where to install binaries
21 msalle 2033
22     webcvs=http://glite.cvs.cern.ch/cgi-bin/glite.cgi/ # Web CVS location
23 msalle 2155 mwsec_svnroot=https://ndpfsvn.nikhef.nl/repos/mwsec/
24 msalle 2064 globus_baseurl=http://www.globus.org/ftppub/ # Base for globus tarball
25 msalle 2156 globus_flavor=unset
26 msalle 2033
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 msalle 2156 myexit() {
34     if [ -f "$NEWFLAGFILE_TMP" ];then
35     rm $NEWFLAGFILE_TMP
36     fi
37     exit $1
38     }
39 msalle 2033
40 msalle 2052 # Define error function
41     error() {
42     echo "$PROG: $*" >&2
43 msalle 2156 myexit 1
44 msalle 2052 }
45    
46 msalle 2062 # Define warning function
47 msalle 2156 warning() {
48 msalle 2062 echo "$PROG: $*" >&2
49     }
50    
51 msalle 2160 # Define a message only printed when verbose
52     verb_msg() {
53     if [ $VERBOSE -eq 1 ];then
54     echo "$PROG: $*"
55     fi
56     }
57    
58 msalle 2156 # 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 msalle 2033 # Parse command line options
84 msalle 2156 while getopts ":c:C:i:I:s:dDhrxo:e:p:F:f:N:Vv" i ; do
85 msalle 2033 case "$i" in
86     c) CONFIG="$OPTARG" ;;
87 msalle 2155 C) COMPO="$COMPO target:$OPTARG" ;;
88 msalle 2156 i) TARGETFILE="$OPTARG" ;;
89     I) NEWTARGETFILE="$OPTARG" ;;
90 msalle 2033 s) SOURCE="$OPTARG" ;;
91     d) DEPEND=0 ;;
92 msalle 2156 D) DIST=1 ;;
93 msalle 2033 h) USAGE=1 ;;
94     r) REMOVE=1 ;;
95 msalle 2063 x) EXIT_ON_ERROR=1 ;;
96 msalle 2033 o) STDOUT="$OPTARG" ;;
97     e) STDERR="$OPTARG" ;;
98 msalle 2043 p) PLATFORM="$OPTARG" ;;
99 msalle 2156 F) FLAGS="$FLAGS `echo $OPTARG|tr ',' ' '`" ;;
100     f) FLAGFILE="$OPTARG" ;;
101     N) NEWFLAGFILE="$OPTARG" ;;
102     V) VERBOSE=1 ;;
103 msalle 2069 v) echo "$PROG version: $VERSION"
104 msalle 2156 myexit 0 ;;
105 msalle 2033 :) echo "$PROG: option requires an argument -- '$OPTARG'" >&2
106     echo "Try \`$PROG -h' for more information." >&2
107 msalle 2156 myexit 1 ;;
108 msalle 2033 \?) echo "$PROG: invalid option -- '$OPTARG'" >&2
109     echo "Try \`$PROG -h' for more information." >&2
110 msalle 2156 myexit 1 ;;
111 msalle 2033 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 msalle 2043 echo " -c <config> get build options from config file."
126 msalle 2156 echo " -C <opts> specify extra build options "\
127     "(will override those from file),"
128     echo " use , as separator between options"
129 msalle 2043 echo " -i <file> get targets from file, any targets on the cmdline"\
130 msalle 2033 "are added."
131 msalle 2156 echo " -I <file> save list of failed (failed or missing dependencies)"\
132     " into file."
133 msalle 2062 echo " -s specify directory where to checkout sources,"
134 msalle 2048 echo " default ${SOURCE_DEFAULT}"
135 msalle 2043 echo " -d don't check dependencies."
136 msalle 2156 echo " -D create dist tarballs, will be put in DISTDIR,"
137     echo " default: source dir, see -s. Set using -F."
138 msalle 2043 echo " -r remove (old) source directories before checkout."
139 msalle 2063 echo " -x exit on first failing target (default continue)."
140 msalle 2043 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 msalle 2048 "instead of"
144     echo " building from source, \"-p help\" prints"\
145     "valid options."
146 msalle 2156 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 msalle 2043 echo " -h show this helptext."
155 msalle 2033 echo
156 msalle 2052 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 msalle 2033 echo "Format for config file:"
165     echo "<target> [tag:<value>] [compo:<value>] [cvsroot:<value>]"\
166     "[svnroot:<value>] [coopts:<value>]"
167 msalle 2048 echo "where"
168 msalle 2033 echo " tag specifies CVS or SVN tag"
169 msalle 2048 echo " compo specifies glite component name"\
170     "(e.g. org.glite.security.voms)"
171 msalle 2156 echo " cvsroot specifies CVSROOT"
172     echo " cvsrootweb specifies ROOT to use for CVS tarball download"
173 msalle 2033 echo " svnroot specifies full SVN URL (including component)"
174     echo " coopts specifies checkout options for CVS/SVN"
175 msalle 2048 echo "A configline can be continued using the \\ char."
176 msalle 2033 echo "After a # the remainder of the line is ignored."
177     echo "coopts are inserted after the checkout command for cvs or svn."
178 msalle 2156 echo "The same fields can be used for the -C option, e.g.:"
179     echo " -C glexec,tag:tags/glexec/0.8.2"
180 msalle 2033 echo
181     echo "Notes:"
182 msalle 2048 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 msalle 2033 echo
191     echo "Known targets:"
192     for target in $known_targets;do
193 msalle 2034 echo " $target"
194 msalle 2033 done
195     echo
196     return $RC_SUCCESS
197     }
198 msalle 2048
199 msalle 2033 # 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 msalle 2063 return \$rc_$target
238 msalle 2033 }"
239     else
240     eval "dep_$target() {
241     $target
242     rc_$target=\$?
243 msalle 2063 return \$rc_$target
244 msalle 2033 }"
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 msalle 2052 error "$func: Cannot find download tool such as wget, curl, lynx etc."
262 msalle 2033 fi
263     }
264    
265 msalle 2156 # Parses a single configuration line/entry, i.e. for a single component
266 msalle 2155 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 msalle 2156 # function that parses the CONFIG file and COMPO options and sets all the tag_
296     # compo_ cvsroot_ svnroot_ variables
297 msalle 2033 # 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 msalle 2156 if [ -n "$CONFIG" ];then
301     lines=`cat $CONFIG|wc -l`
302     lineno=0
303 msalle 2033 line=""
304     cont=0
305 msalle 2156 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 msalle 2033 fi
326    
327 msalle 2156 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 msalle 2155 }
334    
335 msalle 2156 # Parses a configuration flag, coming from either FLAGFILE or FLAGS.
336 msalle 2155 parse_flag() {
337 msalle 2156 flag="$1"
338 msalle 2155 case "$flag" in
339 msalle 2156 prefix=*|libdir=*|includedir=*|sysconfdir=*)
340     eval my$flag
341     var=`echo $flag|cut -d= -f1`
342     eval ${var}_flag="--$flag" ;;
343 msalle 2155
344     DESTDIR=*)
345 msalle 2156 eval my$flag
346     [ -n "$myDESTDIR" ] && DESTDIR_flag=$flag
347     ;;
348 msalle 2155
349 msalle 2156 DISTDIR=*)
350     eval my$flag ;;
351 msalle 2155
352 msalle 2160 globus=*|gridsite=*|voms=*)
353 msalle 2156 eval my$flag ;;
354 msalle 2155
355 msalle 2156 # prefix/includes flags for *other* components.
356 msalle 2160 globus-prefix=*|\
357     gridsite-prefix=*|gridsite-libdir=*|\
358 msalle 2156 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 msalle 2160 xacml-prefix=*|xacml-libdir=*)
364 msalle 2156 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 msalle 2155
369 msalle 2156 # globus flavor for other components.
370 msalle 2155 globus-flavor=*)
371 msalle 2156 globus_flavor=`echo $flag|cut -d= -f2`
372     globus_flavor_flag="--with-globus-nothr-flavor=$globus_flavor" ;;
373 msalle 2155
374 msalle 2156 *) error "Unknown configure flag \"$flag\" specified" ;;
375 msalle 2155 esac
376 msalle 2156 echo "$flag" >> $NEWFLAGFILE_TMP
377 msalle 2155 }
378    
379 msalle 2156 # Saves configuration flags from temporary file
380 msalle 2155 save_flags() {
381 msalle 2156 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 msalle 2155 case "$flag" in
388 msalle 2160 prefix|libdir|includedir|sysconfdir|DESTDIR|DISTDIR)
389 msalle 2156 eval value="\$my$flag"
390     eval echo "$flag=$value" >> $NEWFLAGFILE ;;
391 msalle 2160 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 msalle 2156 *-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 msalle 2155 esac
403     done
404 msalle 2156 rm -f $NEWFLAGFILE_TMP
405 msalle 2155 }
406    
407 msalle 2033 # 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 msalle 2041 dir="$2"
412 msalle 2033 [ -z "$name" ] && return $RC_FAILED
413     eval compo=\$\{compo_$name\}
414     eval tag=\$\{tag_$name\}
415     eval cvsroot=\$\{cvsroot_$name\}
416 msalle 2156 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 msalle 2155 eval cvsrootweb=\$\{cvsrootweb_$name\}
434 msalle 2033 eval coopts=\$\{coopts_$name\}
435 msalle 2156 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 msalle 2033 fi
443 msalle 2156 # 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 msalle 2033
453     return $RC_SUCCESS
454     }
455    
456     # svn checkout wrapper
457     svnget() {
458     name="$1"
459 msalle 2041 dir="$2"
460 msalle 2033 [ -z "$name" ] && return $RC_FAILED
461     eval compo=\$\{compo_$name\}
462 msalle 2155 eval tag=\$\{tag_$name:-trunk/$compo\}
463     eval svnroot=\$\{svnroot_$name:-$mwsec_svnroot\}
464 msalle 2033 eval coopts=\$\{coopts_$name\}
465 msalle 2041 realdir=${dir:-$compo}
466 msalle 2033 # optionally remove directory
467 msalle 2042 [ $REMOVE -eq 1 ] && rm -rf ${realdir}
468 msalle 2041 svn co $coopts ${svnroot}${tag} ${realdir} || return $RC_FAILED
469 msalle 2042 unset realdir
470 msalle 2041
471 msalle 2033 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 msalle 2041 dir="$2"
479 msalle 2033 [ -z "$name" ] && return $RC_FAILED
480     eval cvsroot=\$\{cvsroot_$name\}
481 msalle 2155 eval cvsrootweb=\$\{cvsrootweb_$name\}
482 msalle 2033 eval svnroot=\$\{svnroot_$name\}
483 msalle 2156 if [ -n "$cvsroot" ] ; then
484 msalle 2155 cvsget $name $dir
485 msalle 2156 elif [ -n "$cvsrootweb" ] ; then
486     cvswebget $name $dir
487 msalle 2155 else
488 msalle 2041 svnget $name $dir
489 msalle 2033 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 msalle 2156 $RC_SUCCESS) result="SUCCESS" ;;
501 msalle 2033 $RC_MISSDEP) result="MISSING DEPS"
502 msalle 2156 echo "$tool" >> $NEWTARGETFILE
503 msalle 2033 MISSING=$RC_MISSDEP ;;
504     $RC_FAILED) result="FAILED"
505 msalle 2156 echo "$tool" >> $NEWTARGETFILE
506 msalle 2033 FAILED=$RC_FAILED ;;
507     *) result="UNKNOWN: $rc" ;;
508     esac
509     printf "%-30s: %s\n" "$tool" "$result"
510     }
511    
512 msalle 2156 # 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 msalle 2036 # Build the targets and print the results
532     build() {
533 msalle 2047 t0=`date +%s`
534 msalle 2036 # build the targets
535     for target in $build_targets;do
536     eval dep_$target
537 msalle 2063 [ $EXIT_ON_ERROR -eq 1 -a $? -ge $RC_FAILED ] && break
538 msalle 2036 done
539 msalle 2047 t1=`date +%s`
540 msalle 2036
541 msalle 2156 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 msalle 2155 fi
548 msalle 2036 # Print results
549     for target in $known_targets;do
550     print_result $target
551     done
552 msalle 2155 # Save flags file
553     save_flags
554    
555 msalle 2047 echo "Total build time: `expr $t1 - $t0` seconds"
556 msalle 2036 }
557    
558 msalle 2156 # 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 msalle 2155 set_compo_flags() {
601 msalle 2156 compo=$1; shift
602 msalle 2155 name=`echo $compo|tr '_' '-'`
603 msalle 2156 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 msalle 2155 fi
628 msalle 2156 done
629 msalle 2155 }
630    
631 msalle 2033 ##############################################################################
632     #
633     # Define all building functions
634     #
635     ##############################################################################
636    
637     # GLOBUS
638 msalle 2043
639 msalle 2048
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 msalle 2043 # 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 msalle 2156 globus_flavor=gcc32dbg
657 msalle 2043 ;;
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 msalle 2156 globus_flavor=gcc64dbg
662 msalle 2043 ;;
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 msalle 2156 globus_flavor=gcc64dbg
667 msalle 2043 ;;
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 msalle 2156 globus_flavor=gcc64dbg
672 msalle 2043 ;;
673     *)
674     echo "Unknown platform: \"$PLATFORM\"" >&2
675 msalle 2048 globus_etics_platform >&2
676 msalle 2156 myexit 1
677 msalle 2043 ;;
678     esac
679    
680     # Now download, unpack, and update the tarball
681 msalle 2045 cd ${SOURCE}
682 msalle 2156 mkdir -p ${globus_prefix} && \
683 msalle 2043 eval ${wget} ${globus_url}${globus_tgz} > ${globus_tgz} && \
684 msalle 2156 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 msalle 2043 mv -f ${file}.new ${file}
689     done || return $RC_FAILED
690 msalle 2155
691 msalle 2160 # Setup globus flags for other compos
692     set_compo_flags globus prefix flavor
693    
694 msalle 2043 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 msalle 2033 # Where to get which globus toolkit tarball
703 msalle 2064 globus_url=${globus_baseurl}gt${major}/${major}.${minor}/${tag}/installers/src/
704 msalle 2043 globus_tbz=gt${tag}-all-source-installer.tar.bz2
705 msalle 2033 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 msalle 2160 ./configure --prefix=${globus_prefix} \
714 msalle 2033 --disable-gridftp --disable-gsiopenssh --disable-myproxy \
715 msalle 2052 --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 msalle 2033 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 msalle 2155
726 msalle 2160 # Setup globus flags for other compos
727     set_compo_flags globus prefix flavor
728    
729 msalle 2033 return $RC_SUCCESS
730     }
731    
732 msalle 2043 # Set correct globus flavour
733 msalle 2033 globus_flavour() {
734 msalle 2043 if [ -n "$PLATFORM" ];then
735     case "$PLATFORM" in
736 msalle 2156 RH4_32) globus_flavor=gcc32dbg ;;
737     RH5_64) globus_flavor=gcc64dbg ;;
738     SUSE11_64) globus_flavor=gcc64dbg ;;
739     Deb5_64) globus_flavor=gcc64dbg ;;
740 msalle 2043 *) echo "Unknown platform: \"$PLATFORM\"" >&2
741     return $RC_FAILED ;;
742     esac
743 msalle 2033 else
744 msalle 2156 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 msalle 2043 else
753 msalle 2156 # Assume we're building a flavor-less version
754     globus_flavor=""
755 msalle 2043 fi
756 msalle 2033 fi
757     return $RC_SUCCESS
758     }
759    
760 msalle 2043 # wrapper function that either does a source download or etics download
761     globus() {
762 msalle 2156 globus_prefix=${myDESTDIR}/${myglobus:-${myprefix:-$GNU_DEF_PFX}}
763     # Now unpack or build globus
764 msalle 2043 if [ -z "$PLATFORM" ];then
765     globus_source
766 msalle 2160 return $?
767 msalle 2043 else
768     globus_etics
769 msalle 2160 return $?
770 msalle 2043 fi
771     }
772    
773 msalle 2092 # VOMS development version, directly from CNAF via git, for OpenSSL1.0
774     voms_git() {
775     compo_voms=${compo_voms:-org.glite.security.voms}
776 msalle 2156 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 msalle 2092 cd ${SOURCE}
788 msalle 2155 # optionally remove directory
789     [ $REMOVE -eq 1 ] && rm -rf ${compo_voms}
790 msalle 2156 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 msalle 2155 --disable-glite --disable-java --with-api-only && \
803 msalle 2092 make && \
804 msalle 2156 make ${DESTDIR_flag} libdir=${myvomslibdir} install || return $RC_FAILED
805     set_compo_flags voms prefix includes libdir
806 msalle 2092 return $RC_SUCCESS
807     }
808    
809 msalle 2061 # VOMS development version, directly from CNAF
810     voms_devel() {
811     compo_voms=${compo_voms:-org.glite.security.voms}
812 msalle 2156 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 msalle 2061 cd ${SOURCE}
824 msalle 2155 # 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 msalle 2061 cd ${compo_voms} && \
829     ./autogen.sh && \
830 msalle 2156 ./configure --prefix=${myvoms} --libdir=${myvomslibdir} ${sysconfdir_flag} \
831 msalle 2155 --disable-glite --disable-java --with-api-only && \
832 msalle 2061 make && \
833 msalle 2156 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 msalle 2160 voms_includes=${voms_prefix}/include/glite/security
837 msalle 2156 else
838     voms_includes=""
839     fi
840     set_compo_flags voms prefix includes libdir
841 msalle 2061 return $RC_SUCCESS
842     }
843    
844 msalle 2155 voms_cerncvs() {
845     compo_voms=${compo_voms:-org.glite.security.voms}
846     cvsrootweb_voms=${cvsrootweb_voms:-$webcvs}
847 msalle 2156 myvoms=${myvoms:-${myprefix:-$GNU_DEF_PFX}}
848 msalle 2157 if [ -n "$globus_flavor" ]; then
849 msalle 2160 # myglobusflavor_flag="--with-globus-flavor=$globus_flavor"
850     myglobusflavor_flag=""
851 msalle 2157 else
852     myglobusflavor_flag=""
853     fi
854 msalle 2156 # 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 msalle 2155 cd ${SOURCE}
865     get voms && \
866     cd ${compo_voms} && \
867     ./autogen.sh && \
868 msalle 2156 ./configure --prefix=${myvoms} --libdir=${myvomslibdir} ${sysconfdir_flag} \
869 msalle 2157 ${globus_prefix_flag} ${myglobusflavor_flag} \
870 msalle 2155 --disable-glite --disable-java --with-api-only && \
871     make && \
872 msalle 2156 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 msalle 2158 voms_includes=${voms_prefix}/include/glite/security
876 msalle 2156 set_compo_flags voms prefix includes libdir
877 msalle 2155 return $RC_SUCCESS
878     }
879    
880 msalle 2033 # VOMS: (C & C++ API only)
881     voms() {
882 msalle 2061 if [ "$tag_voms" = "devel" ];then
883     voms_devel
884     return $?
885 msalle 2092 elif [ "$tag_voms" = "git" ];then
886     voms_git
887     return $?
888 msalle 2155 else
889     voms_cerncvs
890     return $?
891 msalle 2061 fi
892 msalle 2033 }
893    
894 msalle 2043 # LCMAPS: Note we can always use the un-threaded flavor for both
895 msalle 2033 lcmaps() {
896 msalle 2155 compo_lcmaps=${compo_lcmaps:-lcmaps}
897 msalle 2033 cd ${SOURCE}
898 msalle 2115 get lcmaps && \
899     cd ${compo_lcmaps} && \
900 msalle 2033 ./bootstrap && \
901 msalle 2155 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
902     ${includedir_flag} \
903 msalle 2156 ${voms_prefix_flag} ${voms_includes_flag} ${voms_libdir_flag} \
904 msalle 2160 ${globus_prefix_flag} \
905 msalle 2156 ${globus_flavor_flag} && \
906 msalle 2033 make && \
907 msalle 2156 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 msalle 2155 rc_lcmaps_interface=$RC_SUCCESS
915 msalle 2033 return $RC_SUCCESS
916     }
917    
918     # LCMAPS-INTERFACE:
919     lcmaps_interface() {
920 msalle 2156 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 msalle 2155 dir=lcmaps-interface
926     compo_lcmaps_interface=${compo_lcmaps_interface:-lcmaps}
927 msalle 2033 cd ${SOURCE}
928 msalle 2115 get lcmaps_interface $dir && \
929     cd ${dir} && \
930 msalle 2033 ./bootstrap && \
931 msalle 2155 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
932     ${includedir_flag} \
933     --enable-headers && \
934 msalle 2041 make && \
935 msalle 2155 make ${DESTDIR_flag} install || return $RC_FAILED
936 msalle 2156 set_def_compo_flags lcmaps prefix includes libdir
937 msalle 2033 return $RC_SUCCESS
938     }
939    
940     # LCAS:
941     lcas() {
942 msalle 2155 compo_lcas=${compo_lcas:-lcas}
943 msalle 2033 cd ${SOURCE}
944 msalle 2115 get lcas && \
945     cd ${compo_lcas} && \
946 msalle 2033 ./bootstrap && \
947 msalle 2155 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
948     ${includedir_flag} \
949 msalle 2160 ${globus_prefix_flag} ${globus_flavor_flag} && \
950 msalle 2033 make && \
951 msalle 2156 make ${DESTDIR_flag} install && \
952     make_dist || return $RC_FAILED
953     set_def_compo_flags lcas prefix includes libdir
954 msalle 2155 rc_lcas_interface=$RC_SUCCESS
955 msalle 2033 return $RC_SUCCESS
956     }
957    
958     # LCAS-INTERFACE:
959     lcas_interface() {
960 msalle 2156 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 msalle 2155 compo_lcas_interface=${compo_lcas_interface:-lcas}
965 msalle 2033 cd ${SOURCE}
966 msalle 2155 get lcas_interface $dir && \
967 msalle 2115 cd ${compo_lcas_interface} && \
968 msalle 2033 ./bootstrap && \
969 msalle 2155 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
970     ${includedir_flag} \
971     --enable-headers && \
972     make ${DESTDIR_flag} install || return $RC_FAILED
973 msalle 2156 set_def_compo_flags lcas prefix includes libdir
974 msalle 2033 return $RC_SUCCESS
975     }
976    
977 msalle 2155 # glexec >=0.8
978 msalle 2033 glexec() {
979 msalle 2155 compo_glexec=${compo_glexec:-glexec}
980 msalle 2033 cd ${SOURCE}
981 msalle 2115 get glexec && \
982     cd ${compo_glexec} && \
983 msalle 2033 ./bootstrap && \
984 msalle 2155 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
985 msalle 2156 ${lcmaps_prefix_flag} ${lcmaps_includes_flag} ${lcmaps_libdir_flag} && \
986 msalle 2033 make && \
987 msalle 2156 make ${DESTDIR_flag} install && \
988     make_dist || return $RC_FAILED
989 msalle 2033 return $RC_SUCCESS
990     }
991    
992     # LCMAPS PLUGINS BASIC:
993     lcmaps_plugins_basic() {
994 msalle 2155 compo_lcmaps_plugins_basic=${compo_lcmaps_plugins_basic:-lcmaps-plugins-basic}
995 msalle 2033 cd ${SOURCE}
996     get lcmaps_plugins_basic && \
997 msalle 2115 cd ${compo_lcmaps_plugins_basic} && \
998 msalle 2033 ./bootstrap && \
999 msalle 2155 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1000 msalle 2156 ${lcmaps_prefix_flag} ${lcmaps_includes_flag} ${lcmaps_libdir_flag} && \
1001 msalle 2033 make && \
1002 msalle 2156 make ${DESTDIR_flag} install && \
1003     make_dist || return $RC_FAILED
1004 msalle 2033 return $RC_SUCCESS
1005     }
1006    
1007     # LCMAPS PLUGINS VERIFY-PROXY:
1008     lcmaps_plugins_verify_proxy() {
1009 msalle 2155 compo_lcmaps_plugins_verify_proxy=${compo_lcmaps_plugins_verify_proxy:-lcmaps-plugins-verify-proxy}
1010 msalle 2033 cd ${SOURCE}
1011     get lcmaps_plugins_verify_proxy && \
1012 msalle 2115 cd ${compo_lcmaps_plugins_verify_proxy} && \
1013 msalle 2033 ./bootstrap && \
1014 msalle 2155 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1015 msalle 2156 ${lcmaps_prefix_flag} ${lcmaps_includes_flag} ${lcmaps_libdir_flag} && \
1016 msalle 2033 make && \
1017 msalle 2156 make ${DESTDIR_flag} install && \
1018     make_dist || return $RC_FAILED
1019 msalle 2033 return $RC_SUCCESS
1020     }
1021    
1022     # LCMAPS PLUGINS VOMS:
1023     lcmaps_plugins_voms() {
1024 msalle 2155 compo_lcmaps_plugins_voms=${compo_lcmaps_plugins_voms:-lcmaps-plugins-voms}
1025 msalle 2033 cd ${SOURCE}
1026 msalle 2037 get lcmaps_plugins_voms && \
1027 msalle 2115 cd ${compo_lcmaps_plugins_voms} && \
1028 msalle 2033 ./bootstrap && \
1029 msalle 2155 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1030 msalle 2156 ${lcmaps_prefix_flag} ${lcmaps_includes_flag} ${lcmaps_libdir_flag} \
1031 msalle 2160 ${globus_prefix_flag} ${globus_flavor_flag} \
1032 msalle 2156 ${voms_prefix_flag} ${voms_includes_flag} ${voms_libdir_flag} && \
1033 msalle 2033 make && \
1034 msalle 2156 make ${DESTDIR_flag} install && \
1035     make_dist || return $RC_FAILED
1036 msalle 2033 return $RC_SUCCESS
1037     }
1038    
1039     # LCMAPS PLUGINS AFS:
1040     lcmaps_plugins_afs() {
1041 msalle 2155 compo_lcmaps_plugins_afs=${compo_lcmaps_plugins_afs:-lcmaps-plugins-afs}
1042 msalle 2033 cd ${SOURCE}
1043     get lcmaps_plugins_afs && \
1044 msalle 2115 cd ${compo_lcmaps_plugins_afs} && \
1045 msalle 2033 ./bootstrap && \
1046 msalle 2155 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1047 msalle 2156 ${lcmaps_prefix_flag} ${lcmaps_includes_flag} ${lcmaps_libdir_flag} \
1048 msalle 2160 ${globus_prefix_flag} ${globus_flavor_flag} && \
1049 msalle 2033 make && \
1050 msalle 2156 make ${DESTDIR_flag} install && \
1051     make_dist || return $RC_FAILED
1052 msalle 2033 return $RC_SUCCESS
1053     }
1054    
1055     # LCMAPS PLUGINS GUMS:
1056     lcmaps_plugins_gums() {
1057 msalle 2155 compo_lcmaps_plugins_gums=${compo_lcmaps_plugins_gums:-lcmaps-plugins-gums}
1058 msalle 2033 cd ${SOURCE}
1059     get lcmaps_plugins_gums && \
1060 msalle 2115 cd ${compo_lcmaps_plugins_gums} && \
1061 msalle 2033 ./bootstrap && \
1062 msalle 2155 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1063 msalle 2156 ${lcmaps_prefix_flag} ${lcmaps_includes_flag} ${lcmaps_libdir_flag} && \
1064 msalle 2033 make && \
1065 msalle 2156 make ${DESTDIR_flag} install && \
1066     make_dist || return $RC_FAILED
1067 msalle 2033 return $RC_SUCCESS
1068     }
1069    
1070     # PEP-C LIB: Will install in same libdir as LCMAPS
1071 msalle 2155 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 msalle 2156 mypep_api=${myprefix:-$GNU_DEF_PFX}
1076 msalle 2033 cd ${SOURCE}
1077 msalle 2155 get pep_api && \
1078     cd ${compo_pep_api} && \
1079 msalle 2033 ./autotools.sh && \
1080 msalle 2156 ./configure --prefix=${mypep_api} ${libdir_flag} \
1081     --datadir=${myDESTDIR}/${mypep_api}/share && \
1082 msalle 2033 make && \
1083 msalle 2156 make ${DESTDIR_flag} install && \
1084     make doxygen && \
1085     make_dist || return $RC_FAILED
1086     set_def_compo_flags pep_api prefix
1087 msalle 2033 return $RC_SUCCESS
1088     }
1089    
1090     # LCMAPS PLUGINS C-PEP
1091     lcmaps_plugins_c_pep() {
1092 msalle 2155 compo_lcmaps_plugins_c_pep=${compo_lcmaps_plugins_c_pep:-lcmaps-plugins-c-pep}
1093 msalle 2033 cd ${SOURCE}
1094     get lcmaps_plugins_c_pep && \
1095 msalle 2115 cd ${compo_lcmaps_plugins_c_pep} && \
1096 msalle 2033 ./bootstrap && \
1097 msalle 2155 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1098 msalle 2156 ${lcmaps_prefix_flag} ${lcmaps_includes_flag} ${lcmaps_libdir_flag} \
1099     ${pep_api_prefix_flag} ${pep_api_libdir_flag} && \
1100 msalle 2033 make && \
1101 msalle 2156 make ${DESTDIR_flag} install && \
1102     make_dist || return $RC_FAILED
1103 msalle 2033 return $RC_SUCCESS
1104     }
1105    
1106 msalle 2156 # 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 msalle 2160 ${globus_prefix_flag} ${globus_flavor_flag} && \
1133 msalle 2156 make && \
1134     make ${DESTDIR_flag} install && \
1135     make_dist || return $RC_FAILED
1136     return $RC_SUCCESS
1137     }
1138    
1139 msalle 2033 # SAML2XACML2 LIB:
1140     saml2_xacml2_c_lib() {
1141 msalle 2160 compo_saml2_xacml2_c_lib=${compo_saml2_xacml2_c_lib:-saml2-xacml2-c-lib}
1142 msalle 2155 gsoap_prefix=${myDESTDIR}/${myprefix:-$GNU_DEF_PFX}
1143 msalle 2160 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 msalle 2033 cd ${SOURCE}
1151 msalle 2092 export CXXFLAGS="-fPIC ${CXXFLAGS}"
1152 msalle 2033 get saml2_xacml2_c_lib && \
1153 msalle 2115 cd ${compo_saml2_xacml2_c_lib} && \
1154 msalle 2052 # 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 msalle 2033 cd gsoap-2.7 && \
1160 msalle 2160 ./configure --prefix=${gsoap_prefix} ${mygsoaplibdir_flag} && \
1161 msalle 2033 make && \
1162     make install && \
1163     cd ../xacml-1.0 && \
1164 msalle 2155 ./bootstrap && \
1165     ./configure ${prefix_flag} ${libdir_flag} \
1166     --with-gsoap=${gsoap_prefix} && \
1167 msalle 2033 make && \
1168 msalle 2156 make ${DESTDIR_flag} install && \
1169     make_dist || return $RC_FAILED
1170     set_def_compo_flags xacml prefix
1171 msalle 2033 return $RC_SUCCESS
1172     }
1173    
1174     # LCMAPS PLUGINS SCAS CLIENT:
1175     lcmaps_plugins_scas_client() {
1176 msalle 2155 compo_lcmaps_plugins_scas_client=${compo_lcmaps_plugins_scas_client:-lcmaps-plugins-scas-client}
1177 msalle 2033 cd ${SOURCE}
1178     get lcmaps_plugins_scas_client && \
1179 msalle 2115 cd ${compo_lcmaps_plugins_scas_client} && \
1180 msalle 2033 ./bootstrap && \
1181 msalle 2155 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1182 msalle 2156 ${lcmaps_prefix_flag} ${lcmaps_includes_flag} ${lcmaps_libdir_flag} \
1183     ${xacml_prefix_flag} ${xacml_libdir_flag} && \
1184 msalle 2033 make && \
1185 msalle 2156 make ${DESTDIR_flag} install && \
1186     make_dist || return $RC_FAILED
1187 msalle 2033 return $RC_SUCCESS
1188     }
1189    
1190     # SCAS
1191     scas() {
1192 msalle 2155 compo_scas=${compo_scas:-scas}
1193 msalle 2033 cd ${SOURCE}
1194     get scas && \
1195 msalle 2115 cd ${compo_scas} && \
1196 msalle 2033 ./bootstrap && \
1197 msalle 2155 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1198 msalle 2156 ${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 msalle 2160 ${globus_prefix_flag} ${globus_flavor_flag} && \
1202 msalle 2033 make && \
1203 msalle 2156 make ${DESTDIR_flag} install && \
1204     make_dist || return $RC_FAILED
1205 msalle 2033 return $RC_SUCCESS
1206     }
1207    
1208     # EES
1209     ees() {
1210     compo_ees=${compo_ees:-ees}
1211 msalle 2052 # If no svn root is given, use the defaults, depending on tag
1212     if [ -z "$svnroot_ees" ];then
1213 msalle 2155 svnroot_ees=https://ndpfsvn.nikhef.nl/repos/pdpsoft/
1214 msalle 2052 fi
1215 msalle 2155 if [ -z "$tag_ees" -o "$tag_ees" = "HEAD" ];then # develop version
1216     tag_ees=trunk/grid-mw-security/ees
1217     fi
1218 msalle 2033 cd ${SOURCE}
1219 msalle 2115 get ees && \
1220     cd ${compo_ees} && \
1221 msalle 2155 ./bootstrap && \
1222     ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1223 msalle 2156 ${xacml_prefix_flag} ${xacml_libdir_flag} && \
1224 msalle 2033 make && \
1225 msalle 2156 make ${DESTDIR_flag} install && \
1226     make_dist || return $RC_FAILED
1227 msalle 2033 return $RC_SUCCESS
1228     }
1229    
1230     # LCAS PLUGINS BASIC:
1231     lcas_plugins_basic() {
1232 msalle 2155 compo_lcas_plugins_basic=${compo_lcas_plugins_basic:-lcas-plugins-basic}
1233 msalle 2033 cd ${SOURCE}
1234     get lcas_plugins_basic && \
1235 msalle 2115 cd ${compo_lcas_plugins_basic} && \
1236 msalle 2033 ./bootstrap && \
1237 msalle 2155 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1238 msalle 2156 ${lcas_prefix_flag} ${lcas_includes_flag} ${lcas_libdir_flag} \
1239 msalle 2160 ${globus_prefix_flag} ${globus_flavor_flag} && \
1240 msalle 2033 make && \
1241 msalle 2156 make ${DESTDIR_flag} install && \
1242     make_dist || return $RC_FAILED
1243 msalle 2033 return $RC_SUCCESS
1244     }
1245    
1246     # LCAS PLUGINS CHECK-EXECUTABLE:
1247     lcas_plugins_check_executable() {
1248 msalle 2155 compo_lcas_plugins_check_executable=${compo_lcas_plugins_check_executable:-lcas-plugins-check-executable}
1249 msalle 2033 cd ${SOURCE}
1250     get lcas_plugins_check_executable && \
1251 msalle 2115 cd ${compo_lcas_plugins_check_executable} && \
1252 msalle 2033 ./bootstrap && \
1253 msalle 2155 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1254 msalle 2156 ${lcas_prefix_flag} ${lcas_includes_flag} ${lcas_libdir_flag} \
1255 msalle 2160 ${globus_prefix_flag} ${globus_flavor_flag} && \
1256 msalle 2033 make && \
1257 msalle 2156 make ${DESTDIR_flag} install && \
1258     make_dist || return $RC_FAILED
1259 msalle 2033 return $RC_SUCCESS
1260     }
1261    
1262     # GRIDSITE CORE:
1263 msalle 2160 gridsite() {
1264     compo_gridsite=${compo_gridsite:-org.gridsite.core}
1265     cvsrootweb_gridsite=${cvsrootweb_gridsite:-$webcvs}
1266 msalle 2156 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 msalle 2033 cd ${SOURCE}
1277 msalle 2160 get gridsite && \
1278     cd ${compo_gridsite}/src && \
1279 msalle 2156 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 msalle 2033 return $RC_SUCCESS
1289     }
1290    
1291     # LCAS PLUGINS VOMS:
1292     lcas_plugins_voms() {
1293 msalle 2155 compo_lcas_plugins_voms=${compo_lcas_plugins_voms:-lcas-plugins-voms}
1294 msalle 2033 cd ${SOURCE}
1295     get lcas_plugins_voms && \
1296 msalle 2115 cd ${compo_lcas_plugins_voms} && \
1297 msalle 2033 ./bootstrap && \
1298 msalle 2155 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1299 msalle 2156 ${lcas_prefix_flag} ${lcas_includes_flag} ${lcas_libdir_flag} \
1300 msalle 2160 ${globus_prefix_flag} ${globus_flavor_flag} \
1301 msalle 2156 ${voms_prefix_flag} ${voms_includes_flag} ${voms_libdir_flag} \
1302     ${gridsite_prefix_flag} &&
1303 msalle 2033 make && \
1304 msalle 2156 make ${DESTDIR_flag} install && \
1305     make_dist || return $RC_FAILED
1306 msalle 2033 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 msalle 2155 compo_lcas_lcmaps_gt4_interface=${compo_lcas_lcmaps_gt4_interface:-lcas-lcmaps-gt4-interface}
1314 msalle 2033 cd ${SOURCE}
1315     get lcas_lcmaps_gt4_interface && \
1316 msalle 2115 cd ${compo_lcas_lcmaps_gt4_interface} && \
1317 msalle 2033 ./bootstrap && \
1318 msalle 2155 ./configure ${prefix_flag} ${libdir_flag} ${sysconfdir_flag} \
1319 msalle 2156 ${lcas_prefix_flag} ${lcas_includes_flag} ${lcas_libdir_flag} \
1320     ${lcmaps_prefix_flag} ${lcmaps_includes_flag} ${lcmaps_libdir_flag} \
1321 msalle 2160 ${globus_prefix_flag} ${globus_flavor_flag} && \
1322 msalle 2033 make && \
1323 msalle 2156 make ${DESTDIR_flag} install && \
1324     make_dist || return $RC_FAILED
1325 msalle 2033 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 msalle 2155 # LCMAPS: depends globus, voms
1342 msalle 2114 setdeps lcmaps globus voms
1343 msalle 2033
1344 msalle 2155 # LCMAPS-INTERFACE: no dependencies
1345 msalle 2114 setdeps lcmaps_interface
1346 msalle 2033
1347 msalle 2155 # LCAS: depends globus
1348     setdeps lcas globus
1349 msalle 2033
1350 msalle 2155 # LCAS-INTERFACE: no dependencies
1351     setdeps lcas_interface
1352 msalle 2038
1353 msalle 2155 # GLEXEC: depends lcmaps_interface
1354     setdeps glexec lcmaps_interface
1355 msalle 2033
1356 msalle 2155 # LCMAPS PLUGINS BASIC: depends lcmaps-interface
1357     setdeps lcmaps_plugins_basic lcmaps-interface
1358 msalle 2033
1359 msalle 2155 # LCMAPS PLUGINS VERIFY-PROXY: depends lcmaps-interface
1360     setdeps lcmaps_plugins_verify_proxy lcmaps_interface
1361 msalle 2033
1362 msalle 2155 # LCMAPS PLUGINS VOMS: depends globus, voms, lcmaps-interface
1363     setdeps lcmaps_plugins_voms globus voms lcmaps_interface
1364 msalle 2033
1365 msalle 2155 # LCMAPS PLUGINS AFS: depends lcmaps-interface
1366     setdeps lcmaps_plugins_afs globus lcmaps_interface
1367 msalle 2033
1368 msalle 2155 # LCMAPS PLUGINS GUMS: depends lcmaps-interface
1369     setdeps lcmaps_plugins_gums lcmaps_interface
1370 msalle 2033
1371 msalle 2155 # PEP-C LIB: no dependencies
1372     setdeps pep_api
1373 msalle 2033
1374 msalle 2155 # LCMAPS PLUGINS C-PEP: depends pep-c lib, lcmaps-interface
1375     setdeps lcmaps_plugins_c_pep pep_api lcmaps_interface
1376 msalle 2033
1377 msalle 2156 # 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 msalle 2155 # SAML2XACML2 LIB: no dependencies
1384     setdeps saml2_xacml2_c_lib
1385 msalle 2033
1386 msalle 2155 # LCMAPS PLUGINS SCAS CLIENT: depends saml2-xacml2-c-lib, lcmaps-interface
1387     setdeps lcmaps_plugins_scas_client saml2_xacml2_c_lib lcmaps_interface
1388 msalle 2033
1389 msalle 2155 # SCAS: depends saml2-xacml2-c-lib, lcmaps, lcas
1390     setdeps scas saml2_xacml2_c_lib lcmaps lcas
1391 msalle 2033
1392 msalle 2155 # EES: depends saml2-xacml2-c-lib
1393     setdeps ees saml2_xacml2_c_lib
1394 msalle 2033
1395 msalle 2155 # LCAS PLUGINS BASIC: depends globus, lcas-interface
1396     setdeps lcas_plugins_basic globus lcas_interface
1397 msalle 2033
1398 msalle 2155 # LCAS PLUGINS CHECK-EXECUTABLE: depends globus, lcas-interface
1399     setdeps lcas_plugins_check_executable globus lcas_interface
1400 msalle 2033
1401     # GRIDSITE Core:
1402 msalle 2160 setdeps gridsite
1403 msalle 2033
1404 msalle 2155 # LCAS PLUGINS VOMS: depends globus, voms, gridsite-core, lcas-interface
1405 msalle 2160 setdeps lcas_plugins_voms globus voms gridsite lcas_interface
1406 msalle 2033
1407     # LCAS-LCMAPS GT4 interface: depends globus, lcmaps, common-cpp, lcas, lcas-interface
1408 msalle 2155 setdeps lcas_lcmaps_gt4_interface globus lcmaps lcas
1409 msalle 2033
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 msalle 2156 myexit 0
1420 msalle 2033 fi
1421    
1422 msalle 2048 # If we just wanted platform help, print it now
1423     if [ "$PLATFORM" = "help" ];then
1424     globus_etics_platform
1425 msalle 2156 myexit 0
1426 msalle 2048 fi
1427    
1428 msalle 2156 # Check source directory...
1429     if [ "`echo $SOURCE|cut -c1`" != "/" ];then
1430     SOURCE="`pwd`/$SOURCE"
1431     warning "Making source directory absolute: $SOURCE"
1432 msalle 2155 fi
1433    
1434 msalle 2156 # When using a file: get targets also from there (instead of only using $*)
1435     TARGETS=""
1436     if [ -n "$TARGETFILE" ];then
1437 msalle 2155 # remove everything starting with # (better not # in names...)
1438 msalle 2156 TARGETS="`sed 's/#.*$//' $TARGETFILE`"
1439 msalle 2155 fi
1440     # If we put something in it:
1441 msalle 2156 if [ -n "$TARGETS" ];then
1442     TARGETS="$TARGETS $*"
1443 msalle 2155 else
1444 msalle 2156 TARGETS="$*"
1445 msalle 2155 fi
1446    
1447 msalle 2048 # Check if anything needs doing...
1448 msalle 2156 if [ -z "$TARGETS" ];then
1449 msalle 2048 echo "No targets specified, nothing to be done."
1450 msalle 2156 myexit 0
1451 msalle 2048 fi
1452    
1453 msalle 2155 # Setup file to save the failed targets into.
1454 msalle 2156 if [ -z "$NEWTARGETFILE" ];then
1455     NEWTARGETFILE=$SOURCE/$NEWTARGETFILE_DEFAULT
1456 msalle 2155 fi
1457    
1458 msalle 2156 # 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 msalle 2155 # Setup configure flags specified in file
1466 msalle 2156 if [ -n "$FLAGFILE" ];then
1467     lines=`cat $FLAGFILE|wc -l`
1468 msalle 2155 lineno=0
1469     while [ $lineno -lt $lines ];do
1470     lineno=`expr $lineno + 1`
1471 msalle 2156 line=`sed -n ${lineno}p $FLAGFILE|sed 's/#.*$//'`
1472 msalle 2155 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 msalle 2156 for i in `echo "$FLAGS"`;do
1481 msalle 2155 parse_flag $i
1482     done
1483     fi
1484    
1485 msalle 2156 # Setup file to save the failed targets into.
1486     if [ -z "$NEWFLAGFILE" ];then
1487     NEWFLAGFILE=$SOURCE/$NEWFLAGFILE_DEFAULT
1488 msalle 2155 fi
1489    
1490 msalle 2033 # Find suitable download command
1491     get_download_cmd
1492    
1493 msalle 2156 # Parse the config options
1494     parse_config
1495 msalle 2033
1496 msalle 2156 # 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 msalle 2155
1503 msalle 2156 # loop over all known targets and pick out the requested ones
1504 msalle 2033 build_targets=""
1505 msalle 2156 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 msalle 2033 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 msalle 2052 mkdir -p ${SOURCE} || error "Creating of ${SOURCE} FAILED"
1524 msalle 2033
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 msalle 2156 myexit `expr $MISSING + $FAILED`

Properties

Name Value
svn:executable *

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