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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2419 - (hide annotations) (download) (as text)
Tue Sep 6 10:29:46 2011 UTC (11 years, 1 month ago) by msalle
File MIME type: application/x-shellscript
File size: 52192 byte(s)
Use latest stable GT5 by default.

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

Properties

Name Value
svn:executable *

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