From a5dde84f51abd4fad2e91a425e21c9ef0cfbe073 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zden=C4=9Bk=20=C5=A0ustr?= Date: Tue, 18 Jan 2011 13:25:37 +0000 Subject: [PATCH] Merge branch_2_1 to HEAD, round 2. --- org.glite.jobid.api-c/configure | 306 ++++++++++++++++----- org.glite.jobid.api-cpp/configure | 306 ++++++++++++++++----- org.glite.jobid.api-java/configure | 306 ++++++++++++++++----- org.glite.lb.client-java/configure | 306 ++++++++++++++++----- org.glite.lb.client-java/project/ChangeLog | 9 + .../project/version.properties | 4 +- org.glite.lb.client/Makefile | 84 ++++-- org.glite.lb.client/configure | 306 ++++++++++++++++----- org.glite.lb.client/examples/job_status_threaded.c | 146 ++++++++++ org.glite.lb.client/examples/stats.c | 25 -- org.glite.lb.client/examples/user_jobs_threaded.c | 2 +- org.glite.lb.client/m4/glite_lb.m4 | 141 +++++++--- org.glite.lb.client/project/ChangeLog | 21 ++ org.glite.lb.client/project/version.properties | 4 +- org.glite.lb.client/src/args.c.T | 15 + org.glite.lb.client/src/logevent.c.T | 36 ++- org.glite.lb.client/src/notification.c | 2 - org.glite.lb.client/src/notify.c | 1 + org.glite.lb.client/src/producer.c | 2 +- org.glite.lb.client/src/uiwrap.T | 9 +- org.glite.lb.client/src/uiwrap.c.T | 1 + org.glite.lb.client/test/api_test.cpp.T | 99 +++++++ org.glite.lb.common/Makefile | 85 +++--- org.glite.lb.common/configure | 306 ++++++++++++++++----- org.glite.lb.common/interface/ulm_parse.h | 8 + org.glite.lb.common/project/ChangeLog | 18 ++ org.glite.lb.common/project/version.properties | 4 +- org.glite.lb.common/src/connpool.c | 3 +- org.glite.lb.common/src/il_log.c | 2 +- org.glite.lb.common/src/log_msg.c | 1 + org.glite.lb.doc/configure | 306 ++++++++++++++++----- org.glite.lb.doc/project/ChangeLog | 9 + org.glite.lb.doc/project/version.properties | 4 +- org.glite.lb.doc/src/LBTP-Tests.tex | 30 +- org.glite.lb.harvester/Makefile | 22 +- org.glite.lb.harvester/configure | 306 ++++++++++++++++----- org.glite.lb.harvester/project/ChangeLog | 13 + org.glite.lb.harvester/project/version.properties | 2 +- org.glite.lb.logger-msg/configure | 306 ++++++++++++++++----- org.glite.lb.logger/Makefile | 43 +-- org.glite.lb.logger/config/startup | 52 +++- org.glite.lb.logger/configure | 306 ++++++++++++++++----- org.glite.lb.logger/project/ChangeLog | 16 ++ org.glite.lb.logger/project/version.properties | 4 +- org.glite.lb.logger/src/event_queue.c | 2 +- org.glite.lb.logger/src/event_store.c | 10 +- org.glite.lb.logger/src/il_master.c | 2 +- org.glite.lb.logger/src/logd.c | 3 +- org.glite.lb.logger/src/logd_proto.c | 6 +- org.glite.lb.logger/src/queue_thread.c | 2 +- org.glite.lb.logger/src/send_event.c | 2 +- org.glite.lb.server/Makefile | 136 +++++---- org.glite.lb.server/config/startup | 42 ++- org.glite.lb.server/configure | 306 ++++++++++++++++----- org.glite.lb.server/interface/lb_authz.h | 2 +- org.glite.lb.server/project/ChangeLog | 20 ++ org.glite.lb.server/project/version.properties | 4 +- org.glite.lb.server/src/bkserverd.c | 12 +- org.glite.lb.server/src/db_calls.c | 4 +- org.glite.lb.server/src/dump.c | 2 +- org.glite.lb.server/src/get_events.c.T | 6 +- org.glite.lb.server/src/jobstat.c | 26 +- org.glite.lb.server/src/lb_authz.c | 19 +- org.glite.lb.server/src/lb_proto.c | 4 +- org.glite.lb.server/src/lcas_lb.c | 6 +- org.glite.lb.server/src/load.c | 2 +- org.glite.lb.server/src/notif_match.c | 6 +- org.glite.lb.server/src/notification.c | 36 +-- org.glite.lb.server/src/query.c | 6 +- org.glite.lb.server/src/seqcode.c | 2 +- org.glite.lb.server/src/server_state.c | 6 +- org.glite.lb.server/src/srv_purge.c | 27 +- org.glite.lb.server/src/stats.c | 74 +++-- org.glite.lb.server/src/store.c.T | 38 +-- org.glite.lb.server/src/stored_master.c | 8 +- org.glite.lb.server/src/userjobs.c | 4 +- org.glite.lb.state-machine/Makefile | 29 +- org.glite.lb.state-machine/configure | 306 ++++++++++++++++----- org.glite.lb.state-machine/project/ChangeLog | 12 + .../project/version.properties | 2 +- org.glite.lb.types/configure | 306 ++++++++++++++++----- org.glite.lb.types/project/ChangeLog | 9 + org.glite.lb.types/project/version.properties | 4 +- org.glite.lb.types/types.T | 1 - org.glite.lb.utils/Makefile | 26 +- org.glite.lb.utils/configure | 306 ++++++++++++++++----- org.glite.lb.utils/project/ChangeLog | 9 + org.glite.lb.utils/project/version.properties | 2 +- org.glite.lb.ws-interface/configure | 306 ++++++++++++++++----- org.glite.lb.ws-interface/project/ChangeLog | 6 + .../project/version.properties | 2 +- org.glite.lb.ws-test/Makefile | 16 +- org.glite.lb.ws-test/configure | 306 ++++++++++++++++----- org.glite.lb.ws-test/project/ChangeLog | 12 + org.glite.lb.ws-test/project/version.properties | 2 +- org.glite.lb/configure | 306 ++++++++++++++++----- org.glite.lb/etics-tag-with-subsystems.pl | 29 +- org.glite.lb/etics-tag.pl | 35 ++- org.glite.lb/project/version.properties | 4 +- org.glite.lbjp-common.db/configure | 306 ++++++++++++++++----- org.glite.lbjp-common.db/project/ChangeLog | 3 + .../project/version.properties | 2 +- org.glite.lbjp-common.db/src/db-mysql.c | 4 +- org.glite.lbjp-common.db/src/db-pg.c | 6 +- org.glite.lbjp-common.db/src/db.c | 2 +- org.glite.lbjp-common.gsoap-plugin/configure | 140 ++++++---- org.glite.lbjp-common.gss/configure | 140 ++++++---- org.glite.lbjp-common.jp-interface/Makefile | 32 ++- org.glite.lbjp-common.jp-interface/configure | 306 ++++++++++++++++----- .../project/ChangeLog | 3 + .../project/version.properties | 4 +- org.glite.lbjp-common.log/Makefile | 8 +- org.glite.lbjp-common.log/config/log4crc | 14 +- org.glite.lbjp-common.log/config/log4crc.debugging | 11 +- org.glite.lbjp-common.log/configure | 306 ++++++++++++++++----- org.glite.lbjp-common.log/project/ChangeLog | 3 + .../project/version.properties | 4 +- org.glite.lbjp-common.log/src/log.c | 2 +- org.glite.lbjp-common.log/src/log.h | 2 +- org.glite.lbjp-common.log/tests/log4crc | 17 ++ org.glite.lbjp-common.log/tests/test.c | 32 +++ org.glite.lbjp-common.maildir/configure | 306 ++++++++++++++++----- org.glite.lbjp-common.maildir/project/ChangeLog | 3 + .../project/version.properties | 4 +- org.glite.lbjp-common.server-bones/configure | 306 ++++++++++++++++----- .../project/ChangeLog | 4 + .../project/version.properties | 4 +- org.glite.lbjp-common.server-bones/src/srvbones.c | 4 +- org.glite.lbjp-common.trio/configure | 306 ++++++++++++++++----- org.glite.lbjp-common.trio/project/ChangeLog | 3 + .../project/version.properties | 4 +- 131 files changed, 6736 insertions(+), 2393 deletions(-) create mode 100644 org.glite.lb.client/examples/job_status_threaded.c create mode 100644 org.glite.lb.client/test/api_test.cpp.T create mode 100644 org.glite.lbjp-common.log/tests/log4crc create mode 100644 org.glite.lbjp-common.log/tests/test.c diff --git a/org.glite.jobid.api-c/configure b/org.glite.jobid.api-c/configure index 0d662fe..76e67f9 100755 --- a/org.glite.jobid.api-c/configure +++ b/org.glite.jobid.api-c/configure @@ -41,39 +41,104 @@ my $output; my $lb_tag = ''; my $lbjp_tag = ''; my $jp_tag = ''; -my $sec_tag = ''; my $jobid_tag = ''; my $libdir = getlibdir(); +my $projectname; + my @nodes = qw/client server logger logger-msg utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; my %enable_nodes; my %disable_nodes; -my %extern_prefix = ( - cares => '/opt/c-ares', - classads => '/opt/classads', - cppunit => '/usr', - expat => '/usr', - globus => '/opt/globus', - myproxy => '/opt/myproxy', - gsoap => '/usr', - mysql => '/usr', - 'mysql-devel' => '', - 'mysql-server' => '', - voms => '/opt/glite', - gridsite => '/opt/glite', - lcas => '/opt/glite', - trustmanager => '/opt/glite', - utiljava => '/opt/glite', - ant => '/usr', - jdk => '/usr', - libtar => '/usr', - axis => '/usr', - log4c => '/usr', - postgresql => '/usr', - activemq => '/opt/activemq-cpp-library', - apr => '/opt/apr', - aprutil => '/opt/apr-util' +my %externs = ( + cares => { + prefix => '/opt/c-ares', + pkg => 'libcares' + }, + classads => { + prefix=> '/usr', + pkg => 'classads' + }, + cppunit => { + prefix=> '/usr', + pkg => 'cppunit' + }, + expat => { + prefix=> '/usr', + pkg => 'expat' + }, + globus => { + prefix=> '/opt/globus', + pkg => 'globus-gssapi-gsi' + }, + 'myproxy-essentials' => { + prefix=> '/opt/globus', + pkg => 'myproxy' + }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, + gsoap => { + prefix=> '/usr', + pkg => 'gsoap' + }, + mysql => { + prefix=> '/usr' + }, + 'mysql-devel' => { + prefix=> '' + }, + 'mysql-server' => { + prefix => '' + }, + voms => { + prefix => '/opt/glite', + pkg => 'voms-1.0' + }, + gridsite => { + prefix => '/opt/glite' + }, + lcas => { + prefix => '/opt/glite' + }, + trustmanager => { + prefix => '/opt/glite' + }, + utiljava => { + prefix=> '/opt/glite' + }, + ant => { + prefix=> '/usr' + }, + jdk => { + prefix=> '/usr' + }, + libtar => { + prefix=> '/usr' + }, + axis => { + prefix=> '/usr' + }, + log4c => { + prefix=> '/usr' + }, + postgresql => { + prefix=> '/usr' + } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -91,14 +156,15 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger logger-msg server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/proxyrenewal/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], 'gridsite' => [ qw/apache shared commands core/ ], + 'px' => [ qw/proxyrenewal glite-PX myproxy-yaim myproxy-config/ ], ); @@ -106,8 +172,8 @@ my @opts = ( 'prefix=s' => \$prefix, 'staged=s' => \$staged, 'module=s' => \$module, - 'thrflavour=s' => \$thrflavour, - 'nothrflavour=s' => \$nothrflavour, + 'thrflavour:s' => \$thrflavour, + 'nothrflavour:s' => \$nothrflavour, 'mode=s' => \$mode, 'listmodules=s' => \$listmodules, 'version=s' => \$version, @@ -117,10 +183,10 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, + 'emi' => \$emi, ); for (@nodes) { @@ -131,20 +197,26 @@ for (@nodes) { push @opts,"enable-$_",\$enable_nodes{$_}; } -push @opts,"with-$_=s",\$extern_prefix{$_} for keys %extern_prefix; +push @opts,"with-$_=s",\$externs{$_}{withprefix} for keys %externs; push @opts,"with-$_=s",\$jar{$_} for keys %jar; my @keeparg = @ARGV; GetOptions @opts or die "Errors parsing command line\n"; -$extern_prefix{'mysql-devel'}=$extern_prefix{mysql} if $extern_prefix{'mysql-devel'} eq ''; -$extern_prefix{'mysql-server'}=$extern_prefix{mysql} if $extern_prefix{'mysql-server'} eq ''; +$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; +$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -164,7 +236,33 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; + +if ($mode eq 'build') { for my $ext (keys %externs) { + if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } + elsif (defined $externs{$ext}{pkg}) { + my ($prefix, $flag); + my $pkg = $externs{$ext}{pkg}; + my $flagname = uc $externs{$ext}{pkg}; + $flagname =~ s/-[0-9\.]*$//; + $flagname =~ s/-/_/g; + + print "Checking $pkg ... "; + `pkg-config "$pkg" --exists >/dev/null`; + if ($? == 0) { + $externs{$ext}{prefix}=`pkg-config $pkg --variable=prefix`; + chomp $externs{$ext}{prefix}; + print "$externs{$ext}{prefix}\n"; + + $flag=`pkg-config $pkg --cflags`; + $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag); + $flag=`pkg-config $pkg --libs`; + $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); + } else { + print "(using default $externs{$ext}{prefix})\n"; + } + } +} } if ($dis) { for (@nodes) { @@ -181,7 +279,7 @@ $stagedir = $prefix unless $stagedir; if ($mode eq 'build') { print "Writing config.status\n"; open CONF,">config.status" or die "config.status: $!\n"; - print CONF "$0 @keeparg\n"; + print CONF "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH} $0 @keeparg\n"; close CONF; } @@ -227,8 +325,9 @@ sub mode_build { @myjars = keys %aux; print "\nRequired externals:\n"; - print "\t$_: $extern_prefix{$_}\n" for @ext; + print "\t$_: $externs{$_}{prefix}\n" for @ext; print "\t$_: $jar{$_}\n" for @myjars; + for (@ext) { if (defined($externs{$_}{flags})) { print "$externs{$_}{flags}"; } }; print "\nThis is a poor-man configure, it's up to you to have sources and externals there\n\n"; mkinc($_) for @modules; @@ -295,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -343,7 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.proxyrenewal' => [ qw/voms globus:B myproxy/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -354,6 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], + 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -435,7 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.proxyrenewal' => [ qw// ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -467,6 +561,11 @@ for my $jar (keys %need_jars) { 'jp.ws-interface' => [ qw// ], 'gridsite.core' => [ qw/build.common-cpp:B/ ], + + 'px.proxyrenewal' => [ qw// ], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], + 'px.myproxy-config' => [], ); for my $ext (keys %deps_aux) { @@ -491,6 +590,9 @@ for my $ext (keys %deps_aux) { %obsoletes = ( 'lb.yaim' => [ qq/glite-yaim-lb/ ], + 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], + 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -501,7 +603,7 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', + 'px' => 'org.glite', ); %conf_prefix = ( @@ -510,7 +612,16 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', + 'px' => 'glite-', +); + +%emi_conf_prefix = ( + 'lb' => 'emi-', + 'jp' => 'emi-', + 'jobid' => 'emi-', + 'lbjp-common' => 'emi-', + 'gridsite' => '', + 'px' => 'emi-', ); my @k = keys %deps_aux; @@ -536,8 +647,9 @@ sub mkinc lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java -lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface +lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface +px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config /; @aux{@m} = (1) x ($#m+1); @@ -574,7 +686,8 @@ libdir = $libdir }; for (@{$need_externs{$short}}) { - print MKINC "${_}_prefix = $extern_prefix{$_}\n" + print MKINC "${_}_prefix = $externs{$_}{prefix}\n"; + print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags}; } for (@{$need_jars{$short}}) { @@ -589,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -615,10 +728,20 @@ BEGIN{ apr=>'apr-dev', aprutil=>'aprutil-dev', ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' + ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -666,30 +789,48 @@ sub mode_etics { for (@{$need_externs{"$subsys.$module"}}) { if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + if ($emi) { + if ($ge{$_} and not defined $externs{$_}{pkg}) { + push @copts, "--with-$_=\${stageDir}"; + } + } else { + push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + } } } for (@{$need_jars{"$subsys.$module"}}) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,"--with-$_ \${$eext.location}/usr/share/java/$_*.jar"; + push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (not $emi); } my $conf; my $conftag; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; + + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; + if ($branch) { - $conf = "$conf_prefix{$subsys}${subsys}-${module}_$branch"; + $conf = "$confprefix${subsys}-${module}_$branch"; $conftag = $branch; # forced low age number $age = $branch eq 'HEAD' ? '0head' : '0dev'; } else { - $conf = "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; + $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; # XXX: gridsite hack - $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : $conf; } + $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : + "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; } + if ($emi) { + $age = "${age}emi"; + } + my $file = $output ? $output : "$conf.ini"; open C,">$file" or die "$file: $!\n"; @@ -728,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -738,8 +885,13 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor} --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; $cmd{compile} = 'make'; $cmd{test} = 'make check'; $cmd{install} = 'make install'; @@ -751,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -800,8 +949,9 @@ $buildroot aprSuffix = 0 package.RPMSLocation = \${moduleDir}/RPMTMP/RPMS package.SRPMSLocation = \${moduleDir}/RPMTMP/SRPMS -$package_description$package_summary$defprops -}; +package.preserve.libtool = false +$package_description$package_summary$defprops}; + for (@{$obsoletes{"$subsys.$module"}}) { print C "package.obsoletes = $_\n"; print C "package.replaces = $_\n"; @@ -828,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -839,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -848,12 +1001,13 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS sub gsoap_version { local $_; my $gsoap_version; - open S,"$extern_prefix{gsoap}/bin/soapcpp2 -v 2>&1 |" or die "$extern_prefix{gsoap}/bin/soapcpp2: $!\n"; + open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n"; while ($_ = ) { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -910,7 +1064,7 @@ sub getlibdir { } sub usage { - my @ext = keys %extern_prefix; + my @ext = keys %externs; my @myjars, keys %jar; print STDERR qq{ @@ -925,6 +1079,7 @@ General options (defaults in []): --version=maj.min.rev-age specify version here instead of reading version.properties --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...) --libdir=libdir typically [lib,lib64] postfix + --emi generate configurations with emi flavor in mode 'etics' Mode of operation: --mode={checkout|build|etics} what to do [build] @@ -932,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.jobid.api-cpp/configure b/org.glite.jobid.api-cpp/configure index 0d662fe..76e67f9 100755 --- a/org.glite.jobid.api-cpp/configure +++ b/org.glite.jobid.api-cpp/configure @@ -41,39 +41,104 @@ my $output; my $lb_tag = ''; my $lbjp_tag = ''; my $jp_tag = ''; -my $sec_tag = ''; my $jobid_tag = ''; my $libdir = getlibdir(); +my $projectname; + my @nodes = qw/client server logger logger-msg utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; my %enable_nodes; my %disable_nodes; -my %extern_prefix = ( - cares => '/opt/c-ares', - classads => '/opt/classads', - cppunit => '/usr', - expat => '/usr', - globus => '/opt/globus', - myproxy => '/opt/myproxy', - gsoap => '/usr', - mysql => '/usr', - 'mysql-devel' => '', - 'mysql-server' => '', - voms => '/opt/glite', - gridsite => '/opt/glite', - lcas => '/opt/glite', - trustmanager => '/opt/glite', - utiljava => '/opt/glite', - ant => '/usr', - jdk => '/usr', - libtar => '/usr', - axis => '/usr', - log4c => '/usr', - postgresql => '/usr', - activemq => '/opt/activemq-cpp-library', - apr => '/opt/apr', - aprutil => '/opt/apr-util' +my %externs = ( + cares => { + prefix => '/opt/c-ares', + pkg => 'libcares' + }, + classads => { + prefix=> '/usr', + pkg => 'classads' + }, + cppunit => { + prefix=> '/usr', + pkg => 'cppunit' + }, + expat => { + prefix=> '/usr', + pkg => 'expat' + }, + globus => { + prefix=> '/opt/globus', + pkg => 'globus-gssapi-gsi' + }, + 'myproxy-essentials' => { + prefix=> '/opt/globus', + pkg => 'myproxy' + }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, + gsoap => { + prefix=> '/usr', + pkg => 'gsoap' + }, + mysql => { + prefix=> '/usr' + }, + 'mysql-devel' => { + prefix=> '' + }, + 'mysql-server' => { + prefix => '' + }, + voms => { + prefix => '/opt/glite', + pkg => 'voms-1.0' + }, + gridsite => { + prefix => '/opt/glite' + }, + lcas => { + prefix => '/opt/glite' + }, + trustmanager => { + prefix => '/opt/glite' + }, + utiljava => { + prefix=> '/opt/glite' + }, + ant => { + prefix=> '/usr' + }, + jdk => { + prefix=> '/usr' + }, + libtar => { + prefix=> '/usr' + }, + axis => { + prefix=> '/usr' + }, + log4c => { + prefix=> '/usr' + }, + postgresql => { + prefix=> '/usr' + } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -91,14 +156,15 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger logger-msg server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/proxyrenewal/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], 'gridsite' => [ qw/apache shared commands core/ ], + 'px' => [ qw/proxyrenewal glite-PX myproxy-yaim myproxy-config/ ], ); @@ -106,8 +172,8 @@ my @opts = ( 'prefix=s' => \$prefix, 'staged=s' => \$staged, 'module=s' => \$module, - 'thrflavour=s' => \$thrflavour, - 'nothrflavour=s' => \$nothrflavour, + 'thrflavour:s' => \$thrflavour, + 'nothrflavour:s' => \$nothrflavour, 'mode=s' => \$mode, 'listmodules=s' => \$listmodules, 'version=s' => \$version, @@ -117,10 +183,10 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, + 'emi' => \$emi, ); for (@nodes) { @@ -131,20 +197,26 @@ for (@nodes) { push @opts,"enable-$_",\$enable_nodes{$_}; } -push @opts,"with-$_=s",\$extern_prefix{$_} for keys %extern_prefix; +push @opts,"with-$_=s",\$externs{$_}{withprefix} for keys %externs; push @opts,"with-$_=s",\$jar{$_} for keys %jar; my @keeparg = @ARGV; GetOptions @opts or die "Errors parsing command line\n"; -$extern_prefix{'mysql-devel'}=$extern_prefix{mysql} if $extern_prefix{'mysql-devel'} eq ''; -$extern_prefix{'mysql-server'}=$extern_prefix{mysql} if $extern_prefix{'mysql-server'} eq ''; +$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; +$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -164,7 +236,33 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; + +if ($mode eq 'build') { for my $ext (keys %externs) { + if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } + elsif (defined $externs{$ext}{pkg}) { + my ($prefix, $flag); + my $pkg = $externs{$ext}{pkg}; + my $flagname = uc $externs{$ext}{pkg}; + $flagname =~ s/-[0-9\.]*$//; + $flagname =~ s/-/_/g; + + print "Checking $pkg ... "; + `pkg-config "$pkg" --exists >/dev/null`; + if ($? == 0) { + $externs{$ext}{prefix}=`pkg-config $pkg --variable=prefix`; + chomp $externs{$ext}{prefix}; + print "$externs{$ext}{prefix}\n"; + + $flag=`pkg-config $pkg --cflags`; + $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag); + $flag=`pkg-config $pkg --libs`; + $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); + } else { + print "(using default $externs{$ext}{prefix})\n"; + } + } +} } if ($dis) { for (@nodes) { @@ -181,7 +279,7 @@ $stagedir = $prefix unless $stagedir; if ($mode eq 'build') { print "Writing config.status\n"; open CONF,">config.status" or die "config.status: $!\n"; - print CONF "$0 @keeparg\n"; + print CONF "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH} $0 @keeparg\n"; close CONF; } @@ -227,8 +325,9 @@ sub mode_build { @myjars = keys %aux; print "\nRequired externals:\n"; - print "\t$_: $extern_prefix{$_}\n" for @ext; + print "\t$_: $externs{$_}{prefix}\n" for @ext; print "\t$_: $jar{$_}\n" for @myjars; + for (@ext) { if (defined($externs{$_}{flags})) { print "$externs{$_}{flags}"; } }; print "\nThis is a poor-man configure, it's up to you to have sources and externals there\n\n"; mkinc($_) for @modules; @@ -295,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -343,7 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.proxyrenewal' => [ qw/voms globus:B myproxy/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -354,6 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], + 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -435,7 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.proxyrenewal' => [ qw// ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -467,6 +561,11 @@ for my $jar (keys %need_jars) { 'jp.ws-interface' => [ qw// ], 'gridsite.core' => [ qw/build.common-cpp:B/ ], + + 'px.proxyrenewal' => [ qw// ], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], + 'px.myproxy-config' => [], ); for my $ext (keys %deps_aux) { @@ -491,6 +590,9 @@ for my $ext (keys %deps_aux) { %obsoletes = ( 'lb.yaim' => [ qq/glite-yaim-lb/ ], + 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], + 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -501,7 +603,7 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', + 'px' => 'org.glite', ); %conf_prefix = ( @@ -510,7 +612,16 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', + 'px' => 'glite-', +); + +%emi_conf_prefix = ( + 'lb' => 'emi-', + 'jp' => 'emi-', + 'jobid' => 'emi-', + 'lbjp-common' => 'emi-', + 'gridsite' => '', + 'px' => 'emi-', ); my @k = keys %deps_aux; @@ -536,8 +647,9 @@ sub mkinc lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java -lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface +lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface +px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config /; @aux{@m} = (1) x ($#m+1); @@ -574,7 +686,8 @@ libdir = $libdir }; for (@{$need_externs{$short}}) { - print MKINC "${_}_prefix = $extern_prefix{$_}\n" + print MKINC "${_}_prefix = $externs{$_}{prefix}\n"; + print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags}; } for (@{$need_jars{$short}}) { @@ -589,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -615,10 +728,20 @@ BEGIN{ apr=>'apr-dev', aprutil=>'aprutil-dev', ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' + ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -666,30 +789,48 @@ sub mode_etics { for (@{$need_externs{"$subsys.$module"}}) { if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + if ($emi) { + if ($ge{$_} and not defined $externs{$_}{pkg}) { + push @copts, "--with-$_=\${stageDir}"; + } + } else { + push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + } } } for (@{$need_jars{"$subsys.$module"}}) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,"--with-$_ \${$eext.location}/usr/share/java/$_*.jar"; + push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (not $emi); } my $conf; my $conftag; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; + + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; + if ($branch) { - $conf = "$conf_prefix{$subsys}${subsys}-${module}_$branch"; + $conf = "$confprefix${subsys}-${module}_$branch"; $conftag = $branch; # forced low age number $age = $branch eq 'HEAD' ? '0head' : '0dev'; } else { - $conf = "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; + $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; # XXX: gridsite hack - $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : $conf; } + $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : + "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; } + if ($emi) { + $age = "${age}emi"; + } + my $file = $output ? $output : "$conf.ini"; open C,">$file" or die "$file: $!\n"; @@ -728,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -738,8 +885,13 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor} --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; $cmd{compile} = 'make'; $cmd{test} = 'make check'; $cmd{install} = 'make install'; @@ -751,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -800,8 +949,9 @@ $buildroot aprSuffix = 0 package.RPMSLocation = \${moduleDir}/RPMTMP/RPMS package.SRPMSLocation = \${moduleDir}/RPMTMP/SRPMS -$package_description$package_summary$defprops -}; +package.preserve.libtool = false +$package_description$package_summary$defprops}; + for (@{$obsoletes{"$subsys.$module"}}) { print C "package.obsoletes = $_\n"; print C "package.replaces = $_\n"; @@ -828,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -839,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -848,12 +1001,13 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS sub gsoap_version { local $_; my $gsoap_version; - open S,"$extern_prefix{gsoap}/bin/soapcpp2 -v 2>&1 |" or die "$extern_prefix{gsoap}/bin/soapcpp2: $!\n"; + open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n"; while ($_ = ) { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -910,7 +1064,7 @@ sub getlibdir { } sub usage { - my @ext = keys %extern_prefix; + my @ext = keys %externs; my @myjars, keys %jar; print STDERR qq{ @@ -925,6 +1079,7 @@ General options (defaults in []): --version=maj.min.rev-age specify version here instead of reading version.properties --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...) --libdir=libdir typically [lib,lib64] postfix + --emi generate configurations with emi flavor in mode 'etics' Mode of operation: --mode={checkout|build|etics} what to do [build] @@ -932,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.jobid.api-java/configure b/org.glite.jobid.api-java/configure index 0d662fe..76e67f9 100755 --- a/org.glite.jobid.api-java/configure +++ b/org.glite.jobid.api-java/configure @@ -41,39 +41,104 @@ my $output; my $lb_tag = ''; my $lbjp_tag = ''; my $jp_tag = ''; -my $sec_tag = ''; my $jobid_tag = ''; my $libdir = getlibdir(); +my $projectname; + my @nodes = qw/client server logger logger-msg utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; my %enable_nodes; my %disable_nodes; -my %extern_prefix = ( - cares => '/opt/c-ares', - classads => '/opt/classads', - cppunit => '/usr', - expat => '/usr', - globus => '/opt/globus', - myproxy => '/opt/myproxy', - gsoap => '/usr', - mysql => '/usr', - 'mysql-devel' => '', - 'mysql-server' => '', - voms => '/opt/glite', - gridsite => '/opt/glite', - lcas => '/opt/glite', - trustmanager => '/opt/glite', - utiljava => '/opt/glite', - ant => '/usr', - jdk => '/usr', - libtar => '/usr', - axis => '/usr', - log4c => '/usr', - postgresql => '/usr', - activemq => '/opt/activemq-cpp-library', - apr => '/opt/apr', - aprutil => '/opt/apr-util' +my %externs = ( + cares => { + prefix => '/opt/c-ares', + pkg => 'libcares' + }, + classads => { + prefix=> '/usr', + pkg => 'classads' + }, + cppunit => { + prefix=> '/usr', + pkg => 'cppunit' + }, + expat => { + prefix=> '/usr', + pkg => 'expat' + }, + globus => { + prefix=> '/opt/globus', + pkg => 'globus-gssapi-gsi' + }, + 'myproxy-essentials' => { + prefix=> '/opt/globus', + pkg => 'myproxy' + }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, + gsoap => { + prefix=> '/usr', + pkg => 'gsoap' + }, + mysql => { + prefix=> '/usr' + }, + 'mysql-devel' => { + prefix=> '' + }, + 'mysql-server' => { + prefix => '' + }, + voms => { + prefix => '/opt/glite', + pkg => 'voms-1.0' + }, + gridsite => { + prefix => '/opt/glite' + }, + lcas => { + prefix => '/opt/glite' + }, + trustmanager => { + prefix => '/opt/glite' + }, + utiljava => { + prefix=> '/opt/glite' + }, + ant => { + prefix=> '/usr' + }, + jdk => { + prefix=> '/usr' + }, + libtar => { + prefix=> '/usr' + }, + axis => { + prefix=> '/usr' + }, + log4c => { + prefix=> '/usr' + }, + postgresql => { + prefix=> '/usr' + } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -91,14 +156,15 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger logger-msg server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/proxyrenewal/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], 'gridsite' => [ qw/apache shared commands core/ ], + 'px' => [ qw/proxyrenewal glite-PX myproxy-yaim myproxy-config/ ], ); @@ -106,8 +172,8 @@ my @opts = ( 'prefix=s' => \$prefix, 'staged=s' => \$staged, 'module=s' => \$module, - 'thrflavour=s' => \$thrflavour, - 'nothrflavour=s' => \$nothrflavour, + 'thrflavour:s' => \$thrflavour, + 'nothrflavour:s' => \$nothrflavour, 'mode=s' => \$mode, 'listmodules=s' => \$listmodules, 'version=s' => \$version, @@ -117,10 +183,10 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, + 'emi' => \$emi, ); for (@nodes) { @@ -131,20 +197,26 @@ for (@nodes) { push @opts,"enable-$_",\$enable_nodes{$_}; } -push @opts,"with-$_=s",\$extern_prefix{$_} for keys %extern_prefix; +push @opts,"with-$_=s",\$externs{$_}{withprefix} for keys %externs; push @opts,"with-$_=s",\$jar{$_} for keys %jar; my @keeparg = @ARGV; GetOptions @opts or die "Errors parsing command line\n"; -$extern_prefix{'mysql-devel'}=$extern_prefix{mysql} if $extern_prefix{'mysql-devel'} eq ''; -$extern_prefix{'mysql-server'}=$extern_prefix{mysql} if $extern_prefix{'mysql-server'} eq ''; +$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; +$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -164,7 +236,33 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; + +if ($mode eq 'build') { for my $ext (keys %externs) { + if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } + elsif (defined $externs{$ext}{pkg}) { + my ($prefix, $flag); + my $pkg = $externs{$ext}{pkg}; + my $flagname = uc $externs{$ext}{pkg}; + $flagname =~ s/-[0-9\.]*$//; + $flagname =~ s/-/_/g; + + print "Checking $pkg ... "; + `pkg-config "$pkg" --exists >/dev/null`; + if ($? == 0) { + $externs{$ext}{prefix}=`pkg-config $pkg --variable=prefix`; + chomp $externs{$ext}{prefix}; + print "$externs{$ext}{prefix}\n"; + + $flag=`pkg-config $pkg --cflags`; + $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag); + $flag=`pkg-config $pkg --libs`; + $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); + } else { + print "(using default $externs{$ext}{prefix})\n"; + } + } +} } if ($dis) { for (@nodes) { @@ -181,7 +279,7 @@ $stagedir = $prefix unless $stagedir; if ($mode eq 'build') { print "Writing config.status\n"; open CONF,">config.status" or die "config.status: $!\n"; - print CONF "$0 @keeparg\n"; + print CONF "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH} $0 @keeparg\n"; close CONF; } @@ -227,8 +325,9 @@ sub mode_build { @myjars = keys %aux; print "\nRequired externals:\n"; - print "\t$_: $extern_prefix{$_}\n" for @ext; + print "\t$_: $externs{$_}{prefix}\n" for @ext; print "\t$_: $jar{$_}\n" for @myjars; + for (@ext) { if (defined($externs{$_}{flags})) { print "$externs{$_}{flags}"; } }; print "\nThis is a poor-man configure, it's up to you to have sources and externals there\n\n"; mkinc($_) for @modules; @@ -295,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -343,7 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.proxyrenewal' => [ qw/voms globus:B myproxy/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -354,6 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], + 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -435,7 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.proxyrenewal' => [ qw// ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -467,6 +561,11 @@ for my $jar (keys %need_jars) { 'jp.ws-interface' => [ qw// ], 'gridsite.core' => [ qw/build.common-cpp:B/ ], + + 'px.proxyrenewal' => [ qw// ], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], + 'px.myproxy-config' => [], ); for my $ext (keys %deps_aux) { @@ -491,6 +590,9 @@ for my $ext (keys %deps_aux) { %obsoletes = ( 'lb.yaim' => [ qq/glite-yaim-lb/ ], + 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], + 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -501,7 +603,7 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', + 'px' => 'org.glite', ); %conf_prefix = ( @@ -510,7 +612,16 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', + 'px' => 'glite-', +); + +%emi_conf_prefix = ( + 'lb' => 'emi-', + 'jp' => 'emi-', + 'jobid' => 'emi-', + 'lbjp-common' => 'emi-', + 'gridsite' => '', + 'px' => 'emi-', ); my @k = keys %deps_aux; @@ -536,8 +647,9 @@ sub mkinc lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java -lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface +lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface +px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config /; @aux{@m} = (1) x ($#m+1); @@ -574,7 +686,8 @@ libdir = $libdir }; for (@{$need_externs{$short}}) { - print MKINC "${_}_prefix = $extern_prefix{$_}\n" + print MKINC "${_}_prefix = $externs{$_}{prefix}\n"; + print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags}; } for (@{$need_jars{$short}}) { @@ -589,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -615,10 +728,20 @@ BEGIN{ apr=>'apr-dev', aprutil=>'aprutil-dev', ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' + ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -666,30 +789,48 @@ sub mode_etics { for (@{$need_externs{"$subsys.$module"}}) { if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + if ($emi) { + if ($ge{$_} and not defined $externs{$_}{pkg}) { + push @copts, "--with-$_=\${stageDir}"; + } + } else { + push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + } } } for (@{$need_jars{"$subsys.$module"}}) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,"--with-$_ \${$eext.location}/usr/share/java/$_*.jar"; + push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (not $emi); } my $conf; my $conftag; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; + + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; + if ($branch) { - $conf = "$conf_prefix{$subsys}${subsys}-${module}_$branch"; + $conf = "$confprefix${subsys}-${module}_$branch"; $conftag = $branch; # forced low age number $age = $branch eq 'HEAD' ? '0head' : '0dev'; } else { - $conf = "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; + $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; # XXX: gridsite hack - $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : $conf; } + $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : + "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; } + if ($emi) { + $age = "${age}emi"; + } + my $file = $output ? $output : "$conf.ini"; open C,">$file" or die "$file: $!\n"; @@ -728,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -738,8 +885,13 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor} --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; $cmd{compile} = 'make'; $cmd{test} = 'make check'; $cmd{install} = 'make install'; @@ -751,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -800,8 +949,9 @@ $buildroot aprSuffix = 0 package.RPMSLocation = \${moduleDir}/RPMTMP/RPMS package.SRPMSLocation = \${moduleDir}/RPMTMP/SRPMS -$package_description$package_summary$defprops -}; +package.preserve.libtool = false +$package_description$package_summary$defprops}; + for (@{$obsoletes{"$subsys.$module"}}) { print C "package.obsoletes = $_\n"; print C "package.replaces = $_\n"; @@ -828,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -839,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -848,12 +1001,13 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS sub gsoap_version { local $_; my $gsoap_version; - open S,"$extern_prefix{gsoap}/bin/soapcpp2 -v 2>&1 |" or die "$extern_prefix{gsoap}/bin/soapcpp2: $!\n"; + open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n"; while ($_ = ) { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -910,7 +1064,7 @@ sub getlibdir { } sub usage { - my @ext = keys %extern_prefix; + my @ext = keys %externs; my @myjars, keys %jar; print STDERR qq{ @@ -925,6 +1079,7 @@ General options (defaults in []): --version=maj.min.rev-age specify version here instead of reading version.properties --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...) --libdir=libdir typically [lib,lib64] postfix + --emi generate configurations with emi flavor in mode 'etics' Mode of operation: --mode={checkout|build|etics} what to do [build] @@ -932,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.lb.client-java/configure b/org.glite.lb.client-java/configure index 0d662fe..76e67f9 100755 --- a/org.glite.lb.client-java/configure +++ b/org.glite.lb.client-java/configure @@ -41,39 +41,104 @@ my $output; my $lb_tag = ''; my $lbjp_tag = ''; my $jp_tag = ''; -my $sec_tag = ''; my $jobid_tag = ''; my $libdir = getlibdir(); +my $projectname; + my @nodes = qw/client server logger logger-msg utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; my %enable_nodes; my %disable_nodes; -my %extern_prefix = ( - cares => '/opt/c-ares', - classads => '/opt/classads', - cppunit => '/usr', - expat => '/usr', - globus => '/opt/globus', - myproxy => '/opt/myproxy', - gsoap => '/usr', - mysql => '/usr', - 'mysql-devel' => '', - 'mysql-server' => '', - voms => '/opt/glite', - gridsite => '/opt/glite', - lcas => '/opt/glite', - trustmanager => '/opt/glite', - utiljava => '/opt/glite', - ant => '/usr', - jdk => '/usr', - libtar => '/usr', - axis => '/usr', - log4c => '/usr', - postgresql => '/usr', - activemq => '/opt/activemq-cpp-library', - apr => '/opt/apr', - aprutil => '/opt/apr-util' +my %externs = ( + cares => { + prefix => '/opt/c-ares', + pkg => 'libcares' + }, + classads => { + prefix=> '/usr', + pkg => 'classads' + }, + cppunit => { + prefix=> '/usr', + pkg => 'cppunit' + }, + expat => { + prefix=> '/usr', + pkg => 'expat' + }, + globus => { + prefix=> '/opt/globus', + pkg => 'globus-gssapi-gsi' + }, + 'myproxy-essentials' => { + prefix=> '/opt/globus', + pkg => 'myproxy' + }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, + gsoap => { + prefix=> '/usr', + pkg => 'gsoap' + }, + mysql => { + prefix=> '/usr' + }, + 'mysql-devel' => { + prefix=> '' + }, + 'mysql-server' => { + prefix => '' + }, + voms => { + prefix => '/opt/glite', + pkg => 'voms-1.0' + }, + gridsite => { + prefix => '/opt/glite' + }, + lcas => { + prefix => '/opt/glite' + }, + trustmanager => { + prefix => '/opt/glite' + }, + utiljava => { + prefix=> '/opt/glite' + }, + ant => { + prefix=> '/usr' + }, + jdk => { + prefix=> '/usr' + }, + libtar => { + prefix=> '/usr' + }, + axis => { + prefix=> '/usr' + }, + log4c => { + prefix=> '/usr' + }, + postgresql => { + prefix=> '/usr' + } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -91,14 +156,15 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger logger-msg server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/proxyrenewal/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], 'gridsite' => [ qw/apache shared commands core/ ], + 'px' => [ qw/proxyrenewal glite-PX myproxy-yaim myproxy-config/ ], ); @@ -106,8 +172,8 @@ my @opts = ( 'prefix=s' => \$prefix, 'staged=s' => \$staged, 'module=s' => \$module, - 'thrflavour=s' => \$thrflavour, - 'nothrflavour=s' => \$nothrflavour, + 'thrflavour:s' => \$thrflavour, + 'nothrflavour:s' => \$nothrflavour, 'mode=s' => \$mode, 'listmodules=s' => \$listmodules, 'version=s' => \$version, @@ -117,10 +183,10 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, + 'emi' => \$emi, ); for (@nodes) { @@ -131,20 +197,26 @@ for (@nodes) { push @opts,"enable-$_",\$enable_nodes{$_}; } -push @opts,"with-$_=s",\$extern_prefix{$_} for keys %extern_prefix; +push @opts,"with-$_=s",\$externs{$_}{withprefix} for keys %externs; push @opts,"with-$_=s",\$jar{$_} for keys %jar; my @keeparg = @ARGV; GetOptions @opts or die "Errors parsing command line\n"; -$extern_prefix{'mysql-devel'}=$extern_prefix{mysql} if $extern_prefix{'mysql-devel'} eq ''; -$extern_prefix{'mysql-server'}=$extern_prefix{mysql} if $extern_prefix{'mysql-server'} eq ''; +$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; +$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -164,7 +236,33 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; + +if ($mode eq 'build') { for my $ext (keys %externs) { + if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } + elsif (defined $externs{$ext}{pkg}) { + my ($prefix, $flag); + my $pkg = $externs{$ext}{pkg}; + my $flagname = uc $externs{$ext}{pkg}; + $flagname =~ s/-[0-9\.]*$//; + $flagname =~ s/-/_/g; + + print "Checking $pkg ... "; + `pkg-config "$pkg" --exists >/dev/null`; + if ($? == 0) { + $externs{$ext}{prefix}=`pkg-config $pkg --variable=prefix`; + chomp $externs{$ext}{prefix}; + print "$externs{$ext}{prefix}\n"; + + $flag=`pkg-config $pkg --cflags`; + $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag); + $flag=`pkg-config $pkg --libs`; + $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); + } else { + print "(using default $externs{$ext}{prefix})\n"; + } + } +} } if ($dis) { for (@nodes) { @@ -181,7 +279,7 @@ $stagedir = $prefix unless $stagedir; if ($mode eq 'build') { print "Writing config.status\n"; open CONF,">config.status" or die "config.status: $!\n"; - print CONF "$0 @keeparg\n"; + print CONF "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH} $0 @keeparg\n"; close CONF; } @@ -227,8 +325,9 @@ sub mode_build { @myjars = keys %aux; print "\nRequired externals:\n"; - print "\t$_: $extern_prefix{$_}\n" for @ext; + print "\t$_: $externs{$_}{prefix}\n" for @ext; print "\t$_: $jar{$_}\n" for @myjars; + for (@ext) { if (defined($externs{$_}{flags})) { print "$externs{$_}{flags}"; } }; print "\nThis is a poor-man configure, it's up to you to have sources and externals there\n\n"; mkinc($_) for @modules; @@ -295,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -343,7 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.proxyrenewal' => [ qw/voms globus:B myproxy/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -354,6 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], + 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -435,7 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.proxyrenewal' => [ qw// ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -467,6 +561,11 @@ for my $jar (keys %need_jars) { 'jp.ws-interface' => [ qw// ], 'gridsite.core' => [ qw/build.common-cpp:B/ ], + + 'px.proxyrenewal' => [ qw// ], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], + 'px.myproxy-config' => [], ); for my $ext (keys %deps_aux) { @@ -491,6 +590,9 @@ for my $ext (keys %deps_aux) { %obsoletes = ( 'lb.yaim' => [ qq/glite-yaim-lb/ ], + 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], + 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -501,7 +603,7 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', + 'px' => 'org.glite', ); %conf_prefix = ( @@ -510,7 +612,16 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', + 'px' => 'glite-', +); + +%emi_conf_prefix = ( + 'lb' => 'emi-', + 'jp' => 'emi-', + 'jobid' => 'emi-', + 'lbjp-common' => 'emi-', + 'gridsite' => '', + 'px' => 'emi-', ); my @k = keys %deps_aux; @@ -536,8 +647,9 @@ sub mkinc lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java -lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface +lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface +px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config /; @aux{@m} = (1) x ($#m+1); @@ -574,7 +686,8 @@ libdir = $libdir }; for (@{$need_externs{$short}}) { - print MKINC "${_}_prefix = $extern_prefix{$_}\n" + print MKINC "${_}_prefix = $externs{$_}{prefix}\n"; + print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags}; } for (@{$need_jars{$short}}) { @@ -589,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -615,10 +728,20 @@ BEGIN{ apr=>'apr-dev', aprutil=>'aprutil-dev', ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' + ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -666,30 +789,48 @@ sub mode_etics { for (@{$need_externs{"$subsys.$module"}}) { if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + if ($emi) { + if ($ge{$_} and not defined $externs{$_}{pkg}) { + push @copts, "--with-$_=\${stageDir}"; + } + } else { + push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + } } } for (@{$need_jars{"$subsys.$module"}}) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,"--with-$_ \${$eext.location}/usr/share/java/$_*.jar"; + push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (not $emi); } my $conf; my $conftag; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; + + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; + if ($branch) { - $conf = "$conf_prefix{$subsys}${subsys}-${module}_$branch"; + $conf = "$confprefix${subsys}-${module}_$branch"; $conftag = $branch; # forced low age number $age = $branch eq 'HEAD' ? '0head' : '0dev'; } else { - $conf = "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; + $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; # XXX: gridsite hack - $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : $conf; } + $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : + "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; } + if ($emi) { + $age = "${age}emi"; + } + my $file = $output ? $output : "$conf.ini"; open C,">$file" or die "$file: $!\n"; @@ -728,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -738,8 +885,13 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor} --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; $cmd{compile} = 'make'; $cmd{test} = 'make check'; $cmd{install} = 'make install'; @@ -751,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -800,8 +949,9 @@ $buildroot aprSuffix = 0 package.RPMSLocation = \${moduleDir}/RPMTMP/RPMS package.SRPMSLocation = \${moduleDir}/RPMTMP/SRPMS -$package_description$package_summary$defprops -}; +package.preserve.libtool = false +$package_description$package_summary$defprops}; + for (@{$obsoletes{"$subsys.$module"}}) { print C "package.obsoletes = $_\n"; print C "package.replaces = $_\n"; @@ -828,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -839,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -848,12 +1001,13 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS sub gsoap_version { local $_; my $gsoap_version; - open S,"$extern_prefix{gsoap}/bin/soapcpp2 -v 2>&1 |" or die "$extern_prefix{gsoap}/bin/soapcpp2: $!\n"; + open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n"; while ($_ = ) { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -910,7 +1064,7 @@ sub getlibdir { } sub usage { - my @ext = keys %extern_prefix; + my @ext = keys %externs; my @myjars, keys %jar; print STDERR qq{ @@ -925,6 +1079,7 @@ General options (defaults in []): --version=maj.min.rev-age specify version here instead of reading version.properties --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...) --libdir=libdir typically [lib,lib64] postfix + --emi generate configurations with emi flavor in mode 'etics' Mode of operation: --mode={checkout|build|etics} what to do [build] @@ -932,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.lb.client-java/project/ChangeLog b/org.glite.lb.client-java/project/ChangeLog index 39665e6..335b845 100644 --- a/org.glite.lb.client-java/project/ChangeLog +++ b/org.glite.lb.client-java/project/ChangeLog @@ -14,3 +14,12 @@ 1.0.4-2 - Module rebuilt +1.0.5-1 +- Makefile fix for use of jakarta-commons-* external modules + +1.0.5-2 +- Module rebuilt + +1.0.5-3 +- Module rebuilt + diff --git a/org.glite.lb.client-java/project/version.properties b/org.glite.lb.client-java/project/version.properties index e03d52b..09d5c40 100644 --- a/org.glite.lb.client-java/project/version.properties +++ b/org.glite.lb.client-java/project/version.properties @@ -1,3 +1,3 @@ # $Header$ -module.version=1.0.4 -module.age=2 +module.version=1.0.5 +module.age=3 diff --git a/org.glite.lb.client/Makefile b/org.glite.lb.client/Makefile index 700e01f..2dd1577 100644 --- a/org.glite.lb.client/Makefile +++ b/org.glite.lb.client/Makefile @@ -6,9 +6,6 @@ lbprefix=lb package=glite-lb-client version=0.0.0 -nothrflavour=gcc32 -thrflavour=gcc32pthr - CC:=gcc CXX:=g++ @@ -89,8 +86,9 @@ ifdef LB_PERF LB_PERF_FLAGS:=-DLB_PERF LB_PERF_TOOLS:=perftest_logjobs perftest_jobreg endif -COMMON_LIB:=-lglite_lb_common_${nothrflavour} +COMMON_LIB_NOTHR:=-lglite_lb_common_${nothrflavour} COMMON_LIB_THR:=-lglite_lb_common_${thrflavour} +COMMON_LIB:=-lglite_lb_common TRIO_LIB:=-lglite_lbu_trio CFLAGS:=${CFLAGS} ${DEBUG} \ @@ -105,8 +103,8 @@ CXXFLAGS:=${CFLAGS} EXT_LIB:= -TEST_LIBS:=-L${cppunit_prefix}/${libdir} -lcppunit -TEST_INC:=-I${cppunit_prefix}/include +CPPUNIT_LIBS?=-L${cppunit_prefix}/${libdir} -lcppunit +CPPUNIT_CFLAGS?=-I${cppunit_prefix}/include LDFLAGS:=${LDFLAGS} -L${stagedir}/${libdir} ${COVERAGE_FLAGS} @@ -133,11 +131,30 @@ PLUSTHROBJS:=${PLUSOBJS:.o=.thr.o} PLUSLOBJS:=${PLUSOBJS:.o=.lo} PLUSTHRLOBJS:=${PLUSOBJS:.o=.thr.lo} -LIB:=libglite_lb_client_${nothrflavour}.la +NOTHRLIB:=libglite_lb_client_${nothrflavour}.la THRLIB:=libglite_lb_client_${thrflavour}.la - -PLUSLIB:=libglite_lb_clientpp_${nothrflavour}.la +LIB:=libglite_lb_client.la +NOTHRPLUSLIB:=libglite_lb_clientpp_${nothrflavour}.la THRPLUSLIB:=libglite_lb_clientpp_${thrflavour}.la +PLUSLIB:=libglite_lb_clientpp.la +ifeq (${thrflavour},) +c_LIBRARIES=${LIB} +plus_LIBRARIES=${PLUSLIB} +default_clientlib=${LIB} +default_clientpluslib=${PLUSLIB} +default_commonlib=${COMMON_LIB} +default_clientlib_thr=${LIB} +default_commonlib_thr=${COMMON_LIB} +else +c_LIBRARIES=${NOTHRLIB} ${THRLIB} +plus_LIBRARIES=${NOTHRPLUSLIB} ${THRPLUSLIB} +default_clientlib=${NOTHRLIB} +default_clientpluslib=${NOTHRPLUSLIB} +default_commonlib=${COMMON_LIB_NOTHR} +default_clientlib_thr=${THRLIB} +default_commonlib_thr=${COMMON_LIB_THR} +endif +lib_LTLIBRARIES=${c_LIBRARIES} ${plus_LIBRARIES} TOOLS:=${LB_PERF_TOOLS} EXAMPLES_SRC:=log_usertag_proxy.c job_log.c job_reg.c feed_shark.c query_ext.c query_seq_code.c stats.c stats-duration-fromto.c abort_job.c change_acl.c stresslog.c flood_proxy.c dagids.c stress_context.c parse_eventsfile.c test_changed_jdl.c done_failed_events.c @@ -150,7 +167,7 @@ EXAMPLES:=${EXAMPLES_SRC:.c=} EXAMPLES_CL_SRC:=user_jobs.c job_status.c multiple_user_jobs.c EXAMPLES_CL:=${EXAMPLES_CL_SRC:.c=} -EXAMPLES_CL_THR_SRC:=user_jobs_threaded.c +EXAMPLES_CL_THR_SRC:=user_jobs_threaded.c job_status_threaded.c EXAMPLES_CL_THR:=${EXAMPLES_CL_THR_SRC:.c=} MAN_GZ:=glite-lb-logevent.1.gz glite-lb-notify.1.gz @@ -170,18 +187,27 @@ version_info:=-version-info ${shell \ perl -e '$$,=":"; @F=split "\\.","${version}"; print $$F[0]+$$F[1]+${offset},$$F[2],$$F[1]' } ifdef LB_STANDALONE -compile all: generate ${LIB} ${THRLIB} ${TOOLS} logevent notify register_sandbox examples ${MAN_GZ} ${MAN8_GZ} +compile all: generate ${c_LIBRARIES} ${TOOLS} logevent notify register_sandbox examples ${MAN_GZ} ${MAN8_GZ} else -compile all: check_version generate ${LIB} ${THRLIB} ${PLUSLIB} ${THRPLUSLIB} ${TOOLS} logevent notify register_sandbox examples ${MAN_GZ} ${MAN8_GZ} +compile all: check_version generate ${lib_LTLIBRARIES} ${TOOLS} logevent notify register_sandbox examples ${MAN_GZ} ${MAN8_GZ} endif generate: ${GEN_HDRS} default: all +ifeq (${thrflavour},) ${LIB}: ${LIBOBJS} ${LINK} ${version_info} -o $@ ${LIBLOBJS} -rpath ${PREFIX}/${libdir} \ ${COMMON_LIB} ${TRIO_LIB} \ + -lglite_security_gss + +${PLUSLIB}: ${PLUSOBJS} ${LIB} + ${LINKXX} ${version_info} -o $@ ${PLUSLOBJS} -rpath ${PREFIX}/${libdir} ${LIB} ${PLUS_EXTRA_LIB} +else +${NOTHRLIB}: ${LIBOBJS} + ${LINK} ${version_info} -o $@ ${LIBLOBJS} -rpath ${PREFIX}/${libdir} \ + ${COMMON_LIB_NOTHR} ${TRIO_LIB} \ -lglite_security_gss_${nothrflavour} ${THRLIB}: ${LIBTHROBJS} @@ -189,31 +215,32 @@ ${THRLIB}: ${LIBTHROBJS} ${COMMON_LIB_THR} ${TRIO_LIB} \ -lglite_security_gss_${thrflavour} -${PLUSLIB}: ${PLUSOBJS} ${LIB} - ${LINKXX} ${version_info} -o $@ ${PLUSLOBJS} -rpath ${PREFIX}/${libdir} ${LIB} ${PLUS_EXTRA_LIB} +${NOTHRPLUSLIB}: ${PLUSOBJS} ${NOTHRLIB} + ${LINKXX} ${version_info} -o $@ ${PLUSLOBJS} -rpath ${PREFIX}/${libdir} ${NOTHRLIB} ${PLUS_EXTRA_LIB} ${THRPLUSLIB}: ${PLUSTHROBJS} ${THRLIB} ${LINKXX} ${version_info} -o $@ ${PLUSTHRLOBJS} -rpath ${PREFIX}/${libdir} ${THRLIB} ${PLUS_EXTRA_LIB} +endif logevent: logevent.o args.o - ${LINK} -o $@ logevent.o args.o ${LIB} ${EXT_LIB} + ${LINK} -o $@ logevent.o args.o ${default_clientlib} ${EXT_LIB} notify: notify.o - ${LINKXX} -o $@ notify.o ${PLUSLIB} ${EXT_LIB} ${PLUS_EXTRA_LIB} + ${LINKXX} -o $@ notify.o ${default_clientpluslib} ${EXT_LIB} ${PLUS_EXTRA_LIB} register_sandbox: %: %.o - ${LINK} -o $@ $@.o ${LIB} ${EXT_LIB} + ${LINK} -o $@ $@.o ${default_clientlib} ${EXT_LIB} ${TOOLS} ${EXAMPLES}: %: %.o - ${LINK} -o $@ $< ${LIB} ${EXT_LIB} + ${LINK} -o $@ $< ${default_clientlib} ${EXT_LIB} ${EXAMPLES_CL}: %: %.o - ${LINK} -o $@ $< ${LIB} ${COMMON_LIB} ${EXT_LIB} + ${LINK} -o $@ $< ${default_clientlib} ${default_commonlib} ${EXT_LIB} ${EXAMPLES_CL_THR}: %: %.o - ${LINK} -o $@ $< ${THRLIB} ${COMMON_LIB_THR} ${EXT_LIB} + ${LINK} -o $@ $< ${default_clientlib_thr} ${default_commonlib_thr} ${EXT_LIB} -${TOOLS}: ${LIB} +${TOOLS}: ${default_clientlib} ${PLUSOBJS}: %.o: %.cpp ${CXXCOMPILE} -c $< @@ -221,10 +248,10 @@ ${PLUSOBJS}: %.o: %.cpp ${PLUSTHROBJS}: %.thr.o: %.cpp ${CXXCOMPILE} -o $@ -c $< -${EXAMPLES_PLUS}: ${PLUSLIB} +${EXAMPLES_PLUS}: ${default_clientpluslib} ${EXAMPLES_PLUS}: %: %.o - ${LINKXX} -o $@ $< ${PLUSLIB} + ${LINKXX} -o $@ $< ${default_clientpluslib} ${LIBOBJS}: %.o: %.c ${COMPILE} -c $< @@ -281,10 +308,10 @@ check.producer: producer_test ./producer_test producer_test: producer_test.o prod_proto_test.o - ${LINKXX} -o $@ ${LIB} ${TEST_LIBS} $+ ${EXT_LIB} + ${LINKXX} -o $@ ${default_clientlib} ${CPPUNIT_LIBS} $+ ${EXT_LIB} producer_test.o: %.o: %.cpp - ${CXX} -c ${CXXFLAGS} ${TEST_INC} $< + ${CXX} -c ${CXXFLAGS} ${CPPUNIT_CFLAGS} $< man: ${MAN_GZ} ${MAN8_GZ} @@ -312,10 +339,9 @@ install: mkdir -p ${PREFIX}/share/man/man8 mkdir -p ${PREFIX}/share/build/m4 ifdef LB_STANDALONE - ${INSTALL} -m 644 ${LIB} ${THRLIB} ${PREFIX}/${libdir} + ${INSTALL} -m 644 ${c_LIBRARIES} ${PREFIX}/${libdir} else - ${INSTALL} -m 644 ${LIB} ${THRLIB} ${PLUSLIB} ${THRPLUSLIB} ${PREFIX}/${libdir} - ${INSTALL} -m 644 ${LIB} ${THRLIB} ${PREFIX}/${libdir} + ${INSTALL} -m 644 ${lib_LTLIBRARIES} ${PREFIX}/${libdir} endif ${INSTALL} -m 644 ${top_srcdir}/LICENSE ${PREFIX}/share/doc/${package}-${version} ( cd ${top_srcdir}/project && ${INSTALL} -m 644 ChangeLog package.description package.summary ${PREFIX}/share/doc/${package}-${version} ) @@ -350,7 +376,7 @@ endif clean: rm -rvf *.o *.lo .libs lib* *.c *.cpp *.h *.dox producer_test notify C/ CPP/ - rm -rvf ${LIB} ${THRLIB} ${TOOLS} logevent register_sandbox ${PLUSLIB} ${THRPLUSLIB} ${MAN_GZ} ${MAN8_GZ} + rm -rvf ${lib_LTLIBRARIES} ${TOOLS} logevent register_sandbox ${MAN_GZ} ${MAN8_GZ} rm -rvf ${EXAMPLES} ${EXAMPLES_CL} ${EXAMPLES_CL_THR} ${sh_PROGS} rm -f EventAttrNames.pl rm -rvf log.xml project/ rpmbuild/ RPMS/ tgz/ debian/ diff --git a/org.glite.lb.client/configure b/org.glite.lb.client/configure index 0d662fe..76e67f9 100755 --- a/org.glite.lb.client/configure +++ b/org.glite.lb.client/configure @@ -41,39 +41,104 @@ my $output; my $lb_tag = ''; my $lbjp_tag = ''; my $jp_tag = ''; -my $sec_tag = ''; my $jobid_tag = ''; my $libdir = getlibdir(); +my $projectname; + my @nodes = qw/client server logger logger-msg utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; my %enable_nodes; my %disable_nodes; -my %extern_prefix = ( - cares => '/opt/c-ares', - classads => '/opt/classads', - cppunit => '/usr', - expat => '/usr', - globus => '/opt/globus', - myproxy => '/opt/myproxy', - gsoap => '/usr', - mysql => '/usr', - 'mysql-devel' => '', - 'mysql-server' => '', - voms => '/opt/glite', - gridsite => '/opt/glite', - lcas => '/opt/glite', - trustmanager => '/opt/glite', - utiljava => '/opt/glite', - ant => '/usr', - jdk => '/usr', - libtar => '/usr', - axis => '/usr', - log4c => '/usr', - postgresql => '/usr', - activemq => '/opt/activemq-cpp-library', - apr => '/opt/apr', - aprutil => '/opt/apr-util' +my %externs = ( + cares => { + prefix => '/opt/c-ares', + pkg => 'libcares' + }, + classads => { + prefix=> '/usr', + pkg => 'classads' + }, + cppunit => { + prefix=> '/usr', + pkg => 'cppunit' + }, + expat => { + prefix=> '/usr', + pkg => 'expat' + }, + globus => { + prefix=> '/opt/globus', + pkg => 'globus-gssapi-gsi' + }, + 'myproxy-essentials' => { + prefix=> '/opt/globus', + pkg => 'myproxy' + }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, + gsoap => { + prefix=> '/usr', + pkg => 'gsoap' + }, + mysql => { + prefix=> '/usr' + }, + 'mysql-devel' => { + prefix=> '' + }, + 'mysql-server' => { + prefix => '' + }, + voms => { + prefix => '/opt/glite', + pkg => 'voms-1.0' + }, + gridsite => { + prefix => '/opt/glite' + }, + lcas => { + prefix => '/opt/glite' + }, + trustmanager => { + prefix => '/opt/glite' + }, + utiljava => { + prefix=> '/opt/glite' + }, + ant => { + prefix=> '/usr' + }, + jdk => { + prefix=> '/usr' + }, + libtar => { + prefix=> '/usr' + }, + axis => { + prefix=> '/usr' + }, + log4c => { + prefix=> '/usr' + }, + postgresql => { + prefix=> '/usr' + } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -91,14 +156,15 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger logger-msg server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/proxyrenewal/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], 'gridsite' => [ qw/apache shared commands core/ ], + 'px' => [ qw/proxyrenewal glite-PX myproxy-yaim myproxy-config/ ], ); @@ -106,8 +172,8 @@ my @opts = ( 'prefix=s' => \$prefix, 'staged=s' => \$staged, 'module=s' => \$module, - 'thrflavour=s' => \$thrflavour, - 'nothrflavour=s' => \$nothrflavour, + 'thrflavour:s' => \$thrflavour, + 'nothrflavour:s' => \$nothrflavour, 'mode=s' => \$mode, 'listmodules=s' => \$listmodules, 'version=s' => \$version, @@ -117,10 +183,10 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, + 'emi' => \$emi, ); for (@nodes) { @@ -131,20 +197,26 @@ for (@nodes) { push @opts,"enable-$_",\$enable_nodes{$_}; } -push @opts,"with-$_=s",\$extern_prefix{$_} for keys %extern_prefix; +push @opts,"with-$_=s",\$externs{$_}{withprefix} for keys %externs; push @opts,"with-$_=s",\$jar{$_} for keys %jar; my @keeparg = @ARGV; GetOptions @opts or die "Errors parsing command line\n"; -$extern_prefix{'mysql-devel'}=$extern_prefix{mysql} if $extern_prefix{'mysql-devel'} eq ''; -$extern_prefix{'mysql-server'}=$extern_prefix{mysql} if $extern_prefix{'mysql-server'} eq ''; +$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; +$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -164,7 +236,33 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; + +if ($mode eq 'build') { for my $ext (keys %externs) { + if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } + elsif (defined $externs{$ext}{pkg}) { + my ($prefix, $flag); + my $pkg = $externs{$ext}{pkg}; + my $flagname = uc $externs{$ext}{pkg}; + $flagname =~ s/-[0-9\.]*$//; + $flagname =~ s/-/_/g; + + print "Checking $pkg ... "; + `pkg-config "$pkg" --exists >/dev/null`; + if ($? == 0) { + $externs{$ext}{prefix}=`pkg-config $pkg --variable=prefix`; + chomp $externs{$ext}{prefix}; + print "$externs{$ext}{prefix}\n"; + + $flag=`pkg-config $pkg --cflags`; + $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag); + $flag=`pkg-config $pkg --libs`; + $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); + } else { + print "(using default $externs{$ext}{prefix})\n"; + } + } +} } if ($dis) { for (@nodes) { @@ -181,7 +279,7 @@ $stagedir = $prefix unless $stagedir; if ($mode eq 'build') { print "Writing config.status\n"; open CONF,">config.status" or die "config.status: $!\n"; - print CONF "$0 @keeparg\n"; + print CONF "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH} $0 @keeparg\n"; close CONF; } @@ -227,8 +325,9 @@ sub mode_build { @myjars = keys %aux; print "\nRequired externals:\n"; - print "\t$_: $extern_prefix{$_}\n" for @ext; + print "\t$_: $externs{$_}{prefix}\n" for @ext; print "\t$_: $jar{$_}\n" for @myjars; + for (@ext) { if (defined($externs{$_}{flags})) { print "$externs{$_}{flags}"; } }; print "\nThis is a poor-man configure, it's up to you to have sources and externals there\n\n"; mkinc($_) for @modules; @@ -295,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -343,7 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.proxyrenewal' => [ qw/voms globus:B myproxy/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -354,6 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], + 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -435,7 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.proxyrenewal' => [ qw// ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -467,6 +561,11 @@ for my $jar (keys %need_jars) { 'jp.ws-interface' => [ qw// ], 'gridsite.core' => [ qw/build.common-cpp:B/ ], + + 'px.proxyrenewal' => [ qw// ], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], + 'px.myproxy-config' => [], ); for my $ext (keys %deps_aux) { @@ -491,6 +590,9 @@ for my $ext (keys %deps_aux) { %obsoletes = ( 'lb.yaim' => [ qq/glite-yaim-lb/ ], + 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], + 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -501,7 +603,7 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', + 'px' => 'org.glite', ); %conf_prefix = ( @@ -510,7 +612,16 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', + 'px' => 'glite-', +); + +%emi_conf_prefix = ( + 'lb' => 'emi-', + 'jp' => 'emi-', + 'jobid' => 'emi-', + 'lbjp-common' => 'emi-', + 'gridsite' => '', + 'px' => 'emi-', ); my @k = keys %deps_aux; @@ -536,8 +647,9 @@ sub mkinc lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java -lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface +lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface +px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config /; @aux{@m} = (1) x ($#m+1); @@ -574,7 +686,8 @@ libdir = $libdir }; for (@{$need_externs{$short}}) { - print MKINC "${_}_prefix = $extern_prefix{$_}\n" + print MKINC "${_}_prefix = $externs{$_}{prefix}\n"; + print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags}; } for (@{$need_jars{$short}}) { @@ -589,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -615,10 +728,20 @@ BEGIN{ apr=>'apr-dev', aprutil=>'aprutil-dev', ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' + ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -666,30 +789,48 @@ sub mode_etics { for (@{$need_externs{"$subsys.$module"}}) { if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + if ($emi) { + if ($ge{$_} and not defined $externs{$_}{pkg}) { + push @copts, "--with-$_=\${stageDir}"; + } + } else { + push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + } } } for (@{$need_jars{"$subsys.$module"}}) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,"--with-$_ \${$eext.location}/usr/share/java/$_*.jar"; + push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (not $emi); } my $conf; my $conftag; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; + + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; + if ($branch) { - $conf = "$conf_prefix{$subsys}${subsys}-${module}_$branch"; + $conf = "$confprefix${subsys}-${module}_$branch"; $conftag = $branch; # forced low age number $age = $branch eq 'HEAD' ? '0head' : '0dev'; } else { - $conf = "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; + $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; # XXX: gridsite hack - $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : $conf; } + $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : + "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; } + if ($emi) { + $age = "${age}emi"; + } + my $file = $output ? $output : "$conf.ini"; open C,">$file" or die "$file: $!\n"; @@ -728,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -738,8 +885,13 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor} --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; $cmd{compile} = 'make'; $cmd{test} = 'make check'; $cmd{install} = 'make install'; @@ -751,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -800,8 +949,9 @@ $buildroot aprSuffix = 0 package.RPMSLocation = \${moduleDir}/RPMTMP/RPMS package.SRPMSLocation = \${moduleDir}/RPMTMP/SRPMS -$package_description$package_summary$defprops -}; +package.preserve.libtool = false +$package_description$package_summary$defprops}; + for (@{$obsoletes{"$subsys.$module"}}) { print C "package.obsoletes = $_\n"; print C "package.replaces = $_\n"; @@ -828,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -839,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -848,12 +1001,13 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS sub gsoap_version { local $_; my $gsoap_version; - open S,"$extern_prefix{gsoap}/bin/soapcpp2 -v 2>&1 |" or die "$extern_prefix{gsoap}/bin/soapcpp2: $!\n"; + open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n"; while ($_ = ) { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -910,7 +1064,7 @@ sub getlibdir { } sub usage { - my @ext = keys %extern_prefix; + my @ext = keys %externs; my @myjars, keys %jar; print STDERR qq{ @@ -925,6 +1079,7 @@ General options (defaults in []): --version=maj.min.rev-age specify version here instead of reading version.properties --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...) --libdir=libdir typically [lib,lib64] postfix + --emi generate configurations with emi flavor in mode 'etics' Mode of operation: --mode={checkout|build|etics} what to do [build] @@ -932,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.lb.client/examples/job_status_threaded.c b/org.glite.lb.client/examples/job_status_threaded.c new file mode 100644 index 0000000..66aec08 --- /dev/null +++ b/org.glite.lb.client/examples/job_status_threaded.c @@ -0,0 +1,146 @@ +#ident "$Header$" +/* +Copyright (c) Members of the EGEE Collaboration. 2004-2010. +See http://www.eu-egee.org/partners for details on the copyright holders. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + + +#include +#include +#include +#include +#include +#include +#include + +#include "glite/lb/context-int.h" +#ifdef BUILDING_LB_CLIENT +#include "consumer.h" +#else +#include "glite/lb/consumer.h" +#endif +#include "glite/lb/xml_conversions.h" +#include "glite/lb/jobstat.h" + +static void dgerr(edg_wll_Context,char *); +static void printstat_oneline(edg_wll_JobStat,int); + +static char *myname; + +void *thread_meat(char *jobid) { + edg_wll_Context ctx; + int result=0, retries; + + if ( edg_wll_InitContext(&ctx) ) { + fprintf(stderr,"cannot initialize edg_wll_Context\n"); + exit(1); + } + + char *bserver; + edg_wlc_JobId job; + edg_wll_JobStat status; + + memset(&status,0,sizeof status); + + if (edg_wlc_JobIdParse(jobid,&job)) { + fprintf(stderr,"%s: %s: cannot parse jobId\n", myname,jobid); goto cleanup; + } + bserver = edg_wlc_JobIdGetServer(job); + if (!bserver) { + fprintf(stderr,"%s: %s: cannot extract bookkeeping server address\n", myname,jobid); + edg_wlc_JobIdFree(job); goto cleanup; + } + else free(bserver); + + for (retries = 6; retries > 0; retries--) { + if (edg_wll_JobStatus(ctx, job, EDG_WLL_STAT_CLASSADS | EDG_WLL_STAT_CHILDREN | EDG_WLL_STAT_CHILDSTAT, &status)) { + dgerr(ctx,"edg_wll_JobStatus"); result = 1; + } else { + printstat_oneline(status,0); + break; + } + sleep(3); + } + + if (job) edg_wlc_JobIdFree(job); +// if (status.state) edg_wll_FreeStatus(&status); + + cleanup: + + edg_wll_FreeContext(ctx); +} + +static void +usage(char *name) { + fprintf(stderr,"Usage: %s [job_id [...]]\n", name); +} + +static void +dgerr(edg_wll_Context ctx,char *where) { + char *etxt,*edsc; + + edg_wll_Error(ctx,&etxt,&edsc); + fprintf(stderr,"%s: %s: %s",myname,where,etxt); + if (edsc) fprintf(stderr," (%s)",edsc); + putc('\n',stderr); + free(etxt); free(edsc); +} + +static void printstat_oneline(edg_wll_JobStat stat, int level) { + char *s, *j1; + + s = edg_wll_StatToString(stat.state); + j1 = edg_wlc_JobIdUnparse(stat.jobId); + printf("%s\t%s\n", j1, s); + + free(j1); free(s); +} + +int main(int argc,char *argv[]) { + int i, rc; + pthread_t *threads; + pthread_attr_t attr; + + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); + + void *jobid_arg; + + myname = argv[0]; + if ( argc < 2 || strcmp(argv[1],"--help") == 0 ) { usage(argv[0]); return 0; } + + threads=(pthread_t*)calloc(sizeof(pthread_t), argc+1); + + for ( i = 1; i < argc; i++ ) { + jobid_arg = (void *)argv[i]; + + rc = pthread_create(&(threads[i-1]), &attr, (void*)thread_meat, (void *)jobid_arg); + if (rc) { + printf("ERROR; return code from pthread_create() is %d\n", rc); + exit(-1); + } + } + + pthread_attr_destroy(&attr); + + for ( i = 1; i < argc; i++ ) { + pthread_join(threads[i-1],NULL); + } + + free(threads); + + return 0; +} + diff --git a/org.glite.lb.client/examples/stats.c b/org.glite.lb.client/examples/stats.c index 32eeef1..7e0bd05 100644 --- a/org.glite.lb.client/examples/stats.c +++ b/org.glite.lb.client/examples/stats.c @@ -70,31 +70,6 @@ int main(int argc,char **argv) to = now; from = now - (time_t)era; -/* not implemented yet - if (edg_wll_StateDuration(ctx,group,EDG_WLL_JOB_SCHEDULED,0, - &from,&to,&val,&from_res,&to_res)) - { - char *et,*ed; - edg_wll_Error(ctx,&et,&ed); - fprintf(stderr,"edg_wll_StateDuration(): %s, %s\n",et,ed); - return 1; - } - - cfrom = strdup(ctime(&from)); - cto = strdup(ctime(&to)); - cfrom[strlen(cfrom)-1] = 0; - cto[strlen(cto)-1] = 0; - - printf("Average queue traversal time at \"%s\": %f s\n" - " Measuered from %s to %s\n" - " With resolution from %d to %d s\n", - argv[CEidx],val,cfrom,cto,from_res,to_res); - -*/ - - to = now; - from = now - 60; - if (edg_wll_StateRates(ctx,group,atoi(argv[MAJidx]),argc >= (argOK+1) ? atoi(argv[MINidx]) : 0, &from,&to,&vals,&groups,&from_res,&to_res)) { diff --git a/org.glite.lb.client/examples/user_jobs_threaded.c b/org.glite.lb.client/examples/user_jobs_threaded.c index 14800e0..8885dcd 100644 --- a/org.glite.lb.client/examples/user_jobs_threaded.c +++ b/org.glite.lb.client/examples/user_jobs_threaded.c @@ -178,7 +178,7 @@ int main(int argc,char **argv) { thread_code_args arguments = { NULL, 0, 0, 1, 1,NULL }; int i,rc,status,opt; - int thr_num = 10; // default + int thr_num = 10; while ((opt = getopt_long(argc,argv,get_opt_string,opts,NULL)) != EOF) switch (opt) { diff --git a/org.glite.lb.client/m4/glite_lb.m4 b/org.glite.lb.client/m4/glite_lb.m4 index daf7791..4c89b14 100644 --- a/org.glite.lb.client/m4/glite_lb.m4 +++ b/org.glite.lb.client/m4/glite_lb.m4 @@ -18,17 +18,28 @@ AC_LANG_CONFTEST( )] ) -LIBS="-lglite_lb_common_$GLOBUS_THR_FLAVOR $LIBS" +LIBS="-lglite_lb_common $save_LIBS" AC_LINK_IFELSE([], - [AC_SUBST([GLITE_LB_COMMON_THR_LIBS], [-lglite_lb_common_$GLOBUS_THR_FLAVOR])], - [AC_MSG_ERROR([cannot find org.glite.lb.common ($GLOBUS_THR_FLAVOR)])] -) -LIBS=$save_LIBS - -LIBS="-lglite_lb_common_$GLOBUS_NOTHR_FLAVOR $LIBS" -AC_LINK_IFELSE([], - [AC_SUBST([GLITE_LB_COMMON_NOTHR_LIBS], [-lglite_lb_common_$GLOBUS_NOTHR_FLAVOR])], - [AC_MSG_ERROR([cannot find org.glite.lb.common (GLOBUS_NOTHR_FLAVOR)])] + [ + AC_SUBST([GLITE_LB_COMMON_LIBS], [-lglite_lb_common]) + AC_SUBST([GLITE_LB_COMMON_THR_LIBS], [-lglite_lb_common]) + AC_SUBST([GLITE_LB_COMMON_NOTHR_LIBS], []) + ], + [ + LIBS="-lglite_lb_common_$GLOBUS_THR_FLAVOR $save_LIBS" + AC_LINK_IFELSE([], + [AC_SUBST([GLITE_LB_COMMON_THR_LIBS], [-lglite_lb_common_$GLOBUS_THR_FLAVOR])], + [AC_MSG_ERROR([cannot find org.glite.lb.common ($GLOBUS_THR_FLAVOR)])] + ) + + LIBS="-lglite_lb_common_$GLOBUS_NOTHR_FLAVOR $save_LIBS" + AC_LINK_IFELSE([], + [AC_SUBST([GLITE_LB_COMMON_NOTHR_LIBS], [-lglite_lb_common_$GLOBUS_NOTHR_FLAVOR])], + [AC_MSG_ERROR([cannot find org.glite.lb.common ($GLOBUS_NOTHR_FLAVOR)])] + ) + + AC_SUBST([GLITE_LB_COMMON_LIBS], [-lglite_lb_common_$GLOBUS_THR_FLAVOR]) + ] ) LIBS=$save_LIBS @@ -43,12 +54,17 @@ AC_MSG_RESULT([yes]) dnl Usage: dnl AC_GLITE_LB +dnl - GLITE_LB_CLIENT_LIBS +dnl - GLITE_LB_CLIENTPP_LIBS +dnl - GLITE_LB_COMMON_LIBS +dnl dnl - GLITE_LB_THR_CLIENT_LIBS dnl - GLITE_LB_THR_CLIENTPP_LIBS dnl - GLITE_LB_THR_COMMON_LIBS dnl - GLITE_LB_NOTHR_CLIENT_LIBS dnl - GLITE_LB_NOTHR_CLIENTPP_LIBS dnl - GLITE_LB_NOTHR_COMMON_LIBS +dnl dnl - GLITE_STATIC_LB_NOTHR_CLIENT_LIBS dnl - GLITE_STATIC_LB_NOTHR_COMMON_LIBS @@ -87,6 +103,23 @@ AC_DEFUN([AC_GLITE_LB], GLITE_LB_NOTHR_COMMON_LIBS="$ac_glite_lb_lib -lglite_lb_common_$GLOBUS_NOTHR_FLAVOR $SEC_GSOAP_PLUGIN_GSS_NOTHR_LIBS" GLITE_STATIC_LB_NOTHR_CLIENT_LIBS="$ac_glite_lb_prefix/$ac_glite_lb_libdir/libglite_lb_client_$GLOBUS_NOTHR_FLAVOR.a" GLITE_STATIC_LB_NOTHR_COMMON_LIBS="$ac_glite_lb_prefix/$ac_glite_lb_libdir/libglite_lb_common_$GLOBUS_NOTHR_FLAVOR.a $SEC_GSOAP_PLUGIN_GSS_STATIC_NOTHR_LIBS" + dnl default flavour + GLITE_LB_CLIENT_LIBS="$GLITE_LB_THR_CLIENT_LIBS" + GLITE_LB_CLIENTPP_LIBS="$GLITE_LB_THR_CLIENTPP_LIBS" + GLITE_LB_COMMON_LIBS="$GLITE_LB_THR_COMMON_LIBS" + + dnl the flavoured ones not found + if ! test -f "$GLITE_STATIC_LB_NOTHR_CLIENT_LIBS"; then + GLITE_LB_CLIENT_LIBS="$ac_glite_lb_lib -lglite_lb_client" + GLITE_LB_CLIENTPP_LIBS="$ac_glite_lb_lib -lglite_lb_clientpp" + GLITE_LB_COMMON_LIBS="$ac_glite_lb_lib -lglite_lb_common $SEC_GSOAP_PLUGIN_GSS_THR_LIBS" + GLITE_LB_THR_CLIENT_LIBS="$ac_glite_lb_lib -lglite_lb_client" + GLITE_LB_THR_CLIENTPP_LIBS="$ac_glite_lb_lib -lglite_lb_clientpp" + GLITE_LB_THR_COMMON_LIBS="$ac_glite_lb_lib -lglite_lb_common $SEC_GSOAP_PLUGIN_GSS_THR_LIBS" + GLITE_LB_NOTHR_CLIENT_LIBS="" + GLITE_LB_NOTHR_CLIENTPP_LIBS="" + GLITE_LB_NOTHR_COMMON_LIBS="" + fi ifelse([$2], , :, [$2]) else GLITE_LB_THR_CLIENT_LIBS="" @@ -97,6 +130,9 @@ AC_DEFUN([AC_GLITE_LB], GLITE_LB_NOTHR_COMMON_LIBS="" GLITE_STATIC_LB_NOTHR_CLIENT_LIBS="" GLITE_STATIC_LB_NOTHR_COMMON_LIBS="" + GLITE_LB_CLIENT_LIBS="" + GLITE_LB_CLIENTPP_LIBS="" + GLITE_LB_COMMON_LIBS="" ifelse([$3], , :, [$3]) fi @@ -108,18 +144,22 @@ AC_DEFUN([AC_GLITE_LB], AC_SUBST(GLITE_LB_NOTHR_COMMON_LIBS) AC_SUBST(GLITE_STATIC_LB_NOTHR_CLIENT_LIBS) AC_SUBST(GLITE_STATIC_LB_NOTHR_COMMON_LIBS) + dnl default flavour + AC_SUBST(GLITE_LB_CLIENT_LIBS) + AC_SUBST(GLITE_LB_CLIENTPP_LIBS) + AC_SUBST(GLITE_LB_COMMON_LIBS) ]) AC_DEFUN([GLITE_CHECK_LB_CLIENT], -[AC_MSG_CHECKING([for org.glite.lb.client]) -save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $GLITE_CPPFLAGS" -save_LDFLAGS=$LDFLAGS -LDFLAGS="$LDFLAGS $GLITE_LDFLAGS -L$GLOBUS_LOCATION/lib" -save_LIBS=$LIBS +[AC_REQUIRE([AC_GLITE]) +AC_MSG_CHECKING([for org.glite.lb.client]) AC_LANG_PUSH([C]) +CPPFLAGS="$CPPFLAGS $GLITE_CPPFLAGS" +CFLAGS="$CFLAGS $GLITE_CFLAGS" +LDFLAGS="$LDFLAGS $GLITE_LDFLAGS -L$GLOBUS_LOCATION/lib" + # prepare the test program, to link against the different combinations # of globus flavours @@ -135,24 +175,37 @@ AC_LANG_CONFTEST( )] ) -LIBS="-lglite_lb_client_$GLOBUS_THR_FLAVOR $LIBS" -AC_LINK_IFELSE([], - [AC_SUBST([GLITE_LB_CLIENT_THR_LIBS], [-lglite_lb_client_$GLOBUS_THR_FLAVOR])], - [AC_MSG_ERROR([cannot find org.glite.lb.client ($GLOBUS_THR_FLAVOR)])] -) -LIBS=$save_LIBS - -LIBS="-lglite_lb_client_$GLOBUS_NOTHR_FLAVOR $LIBS" +LIBS="-lglite_lb_client $save_LIBS" AC_LINK_IFELSE([], - [AC_SUBST([GLITE_LB_CLIENT_NOTHR_LIBS], [-lglite_lb_client_$GLOBUS_NOTHR_FLAVOR])], - [AC_MSG_ERROR([cannot find org.glite.lb.client ($GLOBUS_NOTHR_FLAVOR)])] + [AC_SUBST([GLITE_LB_CLIENT_LIBS], [-lglite_lb_client]) + AC_SUBST([GLITE_LB_CLIENT_THR_LIBS], [-lglite_lb_client]) + AC_SUBST([GLITE_LB_CLIENT_NOTHR_LIBS], []) + ], + [ + LIBS="-lglite_lb_client_$GLOBUS_THR_FLAVOR $save_LIBS" + AC_LINK_IFELSE([], + [AC_SUBST([GLITE_LB_CLIENT_THR_LIBS], [-lglite_lb_client_$GLOBUS_THR_FLAVOR])], + [AC_MSG_ERROR([cannot find org.glite.lb.client ($GLOBUS_THR_FLAVOR)])] + ) + + LIBS="-lglite_lb_client_$GLOBUS_NOTHR_FLAVOR $save_LIBS" + AC_LINK_IFELSE([], + [AC_SUBST([GLITE_LB_CLIENT_NOTHR_LIBS], [-lglite_lb_client_$GLOBUS_NOTHR_FLAVOR])], + [AC_MSG_ERROR([cannot find org.glite.lb.client ($GLOBUS_NOTHR_FLAVOR)])] + ) + + AC_SUBST([GLITE_LB_CLIENT_LIBS], [-lglite_lb_client_$GLOBUS_THR_FLAVOR]) + ] ) -LIBS=$save_LIBS AC_LANG_POP([C]) AC_LANG_PUSH([C++]) +CPPFLAGS="$CPPFLAGS $GLITE_CPPFLAGS" +CXXFLAGS="$CXXFLAGS $GLITE_CFLAGS" +LDFLAGS="$LDFLAGS $GLITE_LDFLAGS -L$GLOBUS_LOCATION/lib" + # prepare the test program, to link against the different combinations # of globus flavours @@ -163,26 +216,30 @@ AC_LANG_CONFTEST( )] ) -save_LIBS=$LIBS -LIBS="-lglite_lb_clientpp_$GLOBUS_THR_FLAVOR $LIBS" -AC_LINK_IFELSE([], - [AC_SUBST([GLITE_LB_CLIENTPP_THR_LIBS], [-lglite_lb_clientpp_$GLOBUS_THR_FLAVOR])], - [AC_MSG_ERROR([cannot find org.glite.lb.client (C++ - $GLOBUS_THR_FLAVOR)])] -) -LIBS=$save_LIBS - -LIBS="-lglite_lb_clientpp_$GLOBUS_NOTHR_FLAVOR $LIBS" +LIBS="-lglite_lb_clientpp $save_LIBS" AC_LINK_IFELSE([], - [AC_SUBST([GLITE_LB_CLIENTPP_NOTHR_LIBS], [-lglite_lb_clientpp_$GLOBUS_NOTHR_FLAVOR])], - [AC_MSG_ERROR([cannot find org.glite.lb.client (C++ - $GLOBUS_NOTHR_FLAVOR)])] + [AC_SUBST([GLITE_LB_CLIENTPP_LIBS], [-lglite_lb_clientpp]) + AC_SUBST([GLITE_LB_CLIENTPP_THR_LIBS], [-lglite_lb_clientpp]) + AC_SUBST([GLITE_LB_CLIENTPP_NOTHR_LIBS], [])], + [ + LIBS="-lglite_lb_clientpp_$GLOBUS_THR_FLAVOR $save_LIBS" + AC_LINK_IFELSE([], + [AC_SUBST([GLITE_LB_CLIENTPP_THR_LIBS], [-lglite_lb_clientpp_$GLOBUS_THR_FLAVOR])], + [AC_MSG_ERROR([cannot find org.glite.lb.client (C++ - $GLOBUS_THR_FLAVOR)])] + ) + + LIBS="-lglite_lb_clientpp_$GLOBUS_NOTHR_FLAVOR $save_LIBS" + AC_LINK_IFELSE([], + [AC_SUBST([GLITE_LB_CLIENTPP_NOTHR_LIBS], [-lglite_lb_clientpp_$GLOBUS_NOTHR_FLAVOR])], + [AC_MSG_ERROR([cannot find org.glite.lb.client (C++ - $GLOBUS_NOTHR_FLAVOR)])] + ) + + AC_SUBST([GLITE_LB_CLIENTPP_LIBS], [-lglite_lb_clientpp_$GLOBUS_THR_FLAVOR]) + ] ) -LIBS=$save_LIBS AC_LANG_POP([C++]) -LDFLAGS="$save_LDFLAGS" -CPPFLAGS=$save_CPPFLAGS - AC_MSG_RESULT([yes]) ]) diff --git a/org.glite.lb.client/project/ChangeLog b/org.glite.lb.client/project/ChangeLog index 9ef289c..945463d 100644 --- a/org.glite.lb.client/project/ChangeLog +++ b/org.glite.lb.client/project/ChangeLog @@ -96,3 +96,24 @@ 4.1.3-1 - Hostname parsing adjusted to handle IPv6 addresses +4.1.4-1 +- Memory handling fixes + +4.1.5-1 +- revision of the perl code generator (fixed jobid, notifid and timeval types, mainly in logging functions) +- fixed toString perl method for logsrc (duplicated line) +- new client API test (simple run for SEGV check) +- Statistics example extended +- Support for jobid type options in logevent +- General code polishing + +4.1.5-2 +- Module rebuilt + +4.1.6-1 +- Makefile a configuration updated to work across org.glite & EMI +- libdir detection introduced to glite.m4 + +4.1.6-2 +- Module rebuilt + diff --git a/org.glite.lb.client/project/version.properties b/org.glite.lb.client/project/version.properties index 64a5aab..ee82baa 100644 --- a/org.glite.lb.client/project/version.properties +++ b/org.glite.lb.client/project/version.properties @@ -1,3 +1,3 @@ # $Header$ -module.version=4.1.3 -module.age=1 +module.version=4.1.6 +module.age=2 diff --git a/org.glite.lb.client/src/args.c.T b/org.glite.lb.client/src/args.c.T index 72daeb2..88eddcf 100644 --- a/org.glite.lb.client/src/args.c.T +++ b/org.glite.lb.client/src/args.c.T @@ -321,6 +321,18 @@ static void read_timeval(const edg_wll_Args* o, char* arg, char* par) *(int*)o->value = v; } +static void read_jobid(const edg_wll_Args* o, char* arg, char* par) +{ + glite_jobid_t jobid = NULL; + + if (glite_jobid_parse(par, &jobid) != 0) { + fprintf(stderr, "ERROR %s can't parse %s: %s\n", arg, par, strerror(errno)); + exit(1); + } + if (o->value) *(glite_jobid_t *)o->value = jobid; + else glite_jobid_free(jobid); +} + static void show_help(const edg_wll_Args* o, int prefix) { unsigned max = 0; @@ -542,6 +554,9 @@ static int findOpt(opt_ctx_t* ctx, int olong) case EDG_WLL_ARGS_TIMEVAL: read_timeval(o, arg, par); break; + case EDG_WLL_ARGS_JOBID: + read_jobid(o, arg, par); + break; default: printf("FIXME: unhandle option type %d\n", o->type); break; diff --git a/org.glite.lb.client/src/logevent.c.T b/org.glite.lb.client/src/logevent.c.T index ba16d90..ed7c22c 100644 --- a/org.glite.lb.client/src/logevent.c.T +++ b/org.glite.lb.client/src/logevent.c.T @@ -36,6 +36,7 @@ limitations under the License. #include "glite/lb/events.h" #include "glite/lb/context.h" #include "glite/lb/context-int.h" +#include "glite/lb/ulm_parse.h" #include "producer.h" #include "args.h" @@ -272,30 +273,35 @@ $indent = "\t"; $event->getTypes) { my $tu = uc $t; - gen $indent."case EDG_WLL_EVENT_$tu :\n"; + gen $indent."case EDG_WLL_EVENT_${tu}: {\n"; selectType $event $t; my $argl = ""; + my $values = ""; + my $frees = ""; for ($event->getFieldsOrdered) { my $f = selectField $event $_; my $fn = $f->getName; - my $ft; - -# gen { $fn $f->{codes} }; - if ($f->{codes}) { -# $ft = "enum edg_wll\_$t" . ucfirst $fn; - $ft = "char *"; + my $fdecl = $f->{codes} ? 'char *' : $f->getType; + my $ft = $f->{type}; + + if ($ft eq 'timeval') { +gen "\t char s_${fn}[ULM_DATE_STRING_LENGTH + 1];\n"; + $values .= "\n\t ".$f->toString($fn, "s_${fn}"); + $argl .= ", s_${fn}"; + } elsif ($ft eq 'jobid' or $ft eq 'notifid' or $ULMasString{$ft}) { +gen "\t char *s_${fn};\n"; + $values .= "\n\t ".$f->toString($fn, "s_${fn}"); + $frees .= "\n\t free(s_$fn);"; + $argl .= ", s_${fn}"; } else { - $ft = $f->getType; + $argl .= ", $fn"; } - - $fn = $f->getType()."ToString($fn)" if $ULMasString{$f->{type}}; - - $argl = $argl . ", "; - $argl = $argl . $fn; } -gen qq{\t //edg_wll_Log$t(); -\t err |= logev(ctx, EDG_WLL_EVENT_$tu, EDG_WLL_FORMAT_${tu}$argl); +gen qq{$values +\t //edg_wll_Log$t(); +\t err |= logev(ctx, EDG_WLL_EVENT_$tu, EDG_WLL_FORMAT_${tu}$argl);$frees +\t \} \t break; }; } diff --git a/org.glite.lb.client/src/notification.c b/org.glite.lb.client/src/notification.c index f243aac..a1427f6 100644 --- a/org.glite.lb.client/src/notification.c +++ b/org.glite.lb.client/src/notification.c @@ -208,8 +208,6 @@ static int get_client_address( goto err; } - free(name); - e = getnameinfo ((struct sockaddr *) ai->ai_addr, ai->ai_addrlen, hostnum, sizeof(hostnum), NULL, 0, NI_NUMERICHOST ); if (e) { diff --git a/org.glite.lb.client/src/notify.c b/org.glite.lb.client/src/notify.c index fb41afa..8cd78ac 100644 --- a/org.glite.lb.client/src/notify.c +++ b/org.glite.lb.client/src/notify.c @@ -26,6 +26,7 @@ limitations under the License. #include "glite/security/glite_gss.h" #include "glite/lb/context.h" +#include "glite/lb/connpool.h" #include "notification.h" #include "stat_fields.h" diff --git a/org.glite.lb.client/src/producer.c b/org.glite.lb.client/src/producer.c index b9616cd..47d2d04 100644 --- a/org.glite.lb.client/src/producer.c +++ b/org.glite.lb.client/src/producer.c @@ -870,7 +870,7 @@ static int edg_wll_RegisterJobMaster( /* send the RegJob event message */ if ((err = edg_wll_LogEventMaster(ctx,flags, EDG_WLL_EVENT_REGJOB, EDG_WLL_FORMAT_REGJOB, - (char *)jdl,ns,parent,type_s,num_subjobs,seed,wms_dn_s)) != 0 ) { + (char *)jdl,ns,parent_s,type_s,num_subjobs,seed,wms_dn_s)) != 0 ) { edg_wll_UpdateError(ctx,EINVAL,"edg_wll_RegisterJobMaster(): unable to register job"); goto edg_wll_registerjobmaster_end; } diff --git a/org.glite.lb.client/src/uiwrap.T b/org.glite.lb.client/src/uiwrap.T index c6c85ca..9edc9c0 100644 --- a/org.glite.lb.client/src/uiwrap.T +++ b/org.glite.lb.client/src/uiwrap.T @@ -27,9 +27,12 @@ for my $t (sort { $event->{order}->{$a} <=> $event->{order}->{$b} } my $sfn = $fn; my $ft = "const "; my $fc = $f->getComment; - if ($ULMasString{$f->{type}}) { - $decl .= "\tchar *s_$fn = ".$f->getType()."ToString($fn);\n"; - $free .= "\tif (s_$fn) free(s_$fn);\n"; + if ($f->{type} eq 'timeval') { + $decl .= "\tchar s_$fn".'[ULM_DATE_STRING_LENGTH + 1]; '.$f->toString($fn, "s_$fn")."\n"; + $sfn = "s_$fn"; + } elsif ($f->{type} eq 'jobid' or $f->{type} eq 'notifid' or $ULMasString{$f->{type}}) { + $decl .= "\tchar *s_$fn; ".$f->toString($fn, "s_$fn")."\n"; + $free .= "\tfree(s_$fn);\n"; $sfn = "s_$fn"; } if ($f->{codes}) { diff --git a/org.glite.lb.client/src/uiwrap.c.T b/org.glite.lb.client/src/uiwrap.c.T index edf9da6..db32145 100644 --- a/org.glite.lb.client/src/uiwrap.c.T +++ b/org.glite.lb.client/src/uiwrap.c.T @@ -24,6 +24,7 @@ limitations under the License. #include #include "glite/jobid/cjobid.h" #include "producer.h" +#include "glite/lb/ulm_parse.h" @@@{ $PRINTPROTOTYPESONLY = 0; diff --git a/org.glite.lb.client/test/api_test.cpp.T b/org.glite.lb.client/test/api_test.cpp.T new file mode 100644 index 0000000..e664161 --- /dev/null +++ b/org.glite.lb.client/test/api_test.cpp.T @@ -0,0 +1,99 @@ +/* +Copyright (c) Members of the EGEE Collaboration. 2004-2010. +See http://www.eu-egee.org/partners for details on the copyright holders. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +@@@LANG: C + +#include +#include +#include + +#include "glite/lbu/trio.h" +#include "producer.h" +#include "glite/lb/ulm_parse.h" + +#define edg_wll_LogEvent edg_wll_LogEventTest +#define edg_wll_LogEventProxy edg_wll_LogEventTest + +int edg_wll_LogEventTest(edg_wll_Context context, edg_wll_EventCode event, char *fmt, ...) { + va_list fmt_args; + int ret; + + va_start(fmt_args, fmt); + ret = trio_vprintf(fmt,fmt_args); + printf("\n"); + va_end(fmt_args); + return ret; +} + +@@@{ +use strict; +require '../src/uiwrap.T'; +@@@} + +int main() { + edg_wll_Context ctx; + +@@@{ + +#use strict; + +for my $e ($event->getTypesOrdered) { + my $E = uc $e; + my $func = "edg_wll_Log$e"; # name of generated function + my $funcproxy = $func . "Proxy"; + my $p = "ctx"; + my $values = ""; + my $frees = ""; + +gen "// $e\n{\n"; + + selectType $event $e; + for ($event->getFieldsOrdered) { + my $f = selectField $event $_; + my $fn = $f->getName; + my $fdecl = $f->getType; + my $ft = $f->{type}; + my $value = undef; + my $free = "free($fn);"; + + if ($f->{codes}) { + $fdecl = "char *"; + $value = "$fn = edg_wll_$e".ucfirst($fn)."ToString(EDG_WLL_${E}_$f->{codes}->[0]->{name});"; + } elsif (($ft eq "int") || ($ft eq "port")) { $value = "$fn = 654;"; $free = ""; } + elsif (($ft eq "float") || ($ft eq "double")) { $value = "$fn = 3.14159265358979323846264;"; $free = ""; } + elsif ($ft eq "string") { $value = "$fn = strdup(\"teststring\");"; } + elsif ($ft eq "logsrc") { $value = "$fn = EDG_WLL_SOURCE_APPLICATION;"; $free = ""; } + elsif ($ft eq "jobid") { $value = "glite_jobid_parse(\"https://some.host:1234/x67qr549qc\",&$fn);"; $free = "glite_jobid_free($fn);"; } + elsif ($ft eq "notifid") { $value = "edg_wll_NotifIdParse(\"https://some.host:1234/NOTIF:x67qr549qc\",&$fn);"; $free = "edg_wll_NotifIdFree($fn);"; } + elsif ($ft eq "timeval") { $value = "$fn.tv_sec = 274492800; $fn.tv_usec = 1; //tpb rox! :-)"; $free = ""; } + else { +gen "% FIXME: unknown type $ft for $fn \n"; + } + $p .= ", $fn"; + $values .= "\n\t$value"; + if ($free) { $frees .= "\n\t$free"; } + +gen "\t$fdecl $fn;\n"; + } +gen "$values\n\tprintf(\"%s: \", \"$e\");\n\tedg_wll_Log$e($p);\n\t$frees\n"; +gen "}\n\n"; +} + + +@@@} + edg_wll_LogSandboxOUTPUT(ctx, "tj", "cj"); +} diff --git a/org.glite.lb.common/Makefile b/org.glite.lb.common/Makefile index 4c90e7c..781df9f 100644 --- a/org.glite.lb.common/Makefile +++ b/org.glite.lb.common/Makefile @@ -8,8 +8,6 @@ package=glite-lb-common version=0.0.0 PREFIX=/opt/glite -nothrflavour=gcc32 -thrflavour=gcc32pthr expat_prefix=/opt/expat -include Makefile.inc @@ -39,39 +37,36 @@ TRIO_LIB:=-lglite_lbu_trio PERF_HDRS:=lb_perftest.h PERF_OBJS:=lb_perftest.o -CFLAGS:=${CFLAGS} ${DEBUG} -I${top_srcdir}/src -I${top_srcdir}/interface \ - -I. \ - -I${top_srcdir}/test \ - -I${stagedir}/include \ - -I${expat_prefix}/include \ - -I${classads_prefix}/include \ - -I${classads_prefix}/include/classad \ - ${COVERAGE_FLAGS} \ - -D_GNU_SOURCE \ - -DDATAGRID_EXTENSION ${LB_STANDALONE_FLAGS} \ - -DBUILDING_LB_COMMON ifneq (${expat_prefix},/usr) - EXPAT_LIBS:=-L${expat_prefix}/${libdir} -L${expat_prefix}/lib + expatlib := -L${expat_prefix}/${libdir} -L${expat_prefix}/lib endif - -EXPAT_LIBS:=${EXPAT_LIBS} -lexpat - ifneq (${classads_prefix},/usr) classadslib := -L${classads_prefix}/${libdir} -L${classads_prefix}/lib endif -classadslib := ${classadslib} -lclassad +CPPUNIT_LIBS?=-L${cppunit_prefix}/${libdir} -lcppunit +CPPUNIT_CFLAGS?=-I${cppunit_prefix}/include +EXPAT_CFLAGS?=-I${expat_prefix}/include +EXPAT_LIBS?=${expatlib} -lexpat +CLASSADS_CFLAGS?=-I${classads_prefix}/include -I${classads_prefix}/include/classad +CLASSADS_LIBS?=${classadslib} -lclassad +CFLAGS:=${CFLAGS} ${DEBUG} -I${top_srcdir}/src -I${top_srcdir}/interface \ + -I. \ + -I${top_srcdir}/test \ + -I${stagedir}/include \ + ${EXPAT_CFLAGS} \ + ${CLASSADS_CFLAGS} \ + ${COVERAGE_FLAGS} \ + -D_GNU_SOURCE \ + -DDATAGRID_EXTENSION ${LB_STANDALONE_FLAGS} \ + -DBUILDING_LB_COMMON LDFLAGS:=${LDFLAGS} -L${stagedir}/${libdir} -L${stagedir}/lib \ ${COVERAGE_FLAGS} -EXT_LIBS:= ${EXPAT_LIBS} ${JOBID_LIB} ${TRIO_LIB} ${classadslib} -EXT_THRLIBS:= ${EXPAT_LIBS} ${JOBID_LIB} ${TRIO_LIB} ${classadslib} - -TEST_LIBS:=-L${cppunit_prefix}/${libdir} -lcppunit -TEST_INC:=-I${cppunit_prefix}/include +EXT_LIBS:= ${EXPAT_LIBS} ${JOBID_LIB} ${TRIO_LIB} ${CLASSADS_LIBS} ifdef LB_PROF CFLAGS:= ${CFLAGS} -pg -g @@ -99,13 +94,25 @@ HDRS:=context.h context-int.h lb_plain_io.h mini_http.h authz.h xml_parse.h \ query_rec.h timeouts.h LoggingExceptions.h CountRef.h ${PERF_HDRS} GEN_HDRS:=events.h jobstat.h common_version.h -STATICLIB:=libglite_lb_common_${nothrflavour}.a +NOTHRSTATICLIB:=libglite_lb_common_${nothrflavour}.a THRSTATICLIB:=libglite_lb_common_${thrflavour}.a -LTLIB:=libglite_lb_common_${nothrflavour}.la +STATICLIB:=libglite_lb_common.a +NOTHRLTLIB:=libglite_lb_common_${nothrflavour}.la THRLTLIB:=libglite_lb_common_${thrflavour}.la +LTLIB:=libglite_lb_common.la REPORTS:=${top_srcdir}/reports +ifeq (${thrflavour},) +lib_LTLIBRARIES=${LTLIB} +lib_LIBRARIES=${STATICLIB} +default_commonlib=${LTLIB} +else +lib_LTLIBRARIES=${NOTHRLTLIB} ${THRLTLIB} +lib_LIBRARIES=${NOTHRSTATICLIB} ${THRSTATICLIB} +default_commonlib=${NOTHRLTLIB} +endif + ifdef LB_PERF STAGE_PERFTEST=mkdir -p ${PREFIX}/examples/perftest; \ ${INSTALL} -m 644 ${top_srcdir}/examples/*.log ${PREFIX}/examples/perftest; \ @@ -121,7 +128,7 @@ generate: ${GEN_HDRS} common_version.h: ${top_srcdir}/project/version.properties echo "#define GLITE_LB_COMMON_VERSION \"${version}\"" >$@ -all compile: generate ${STATICLIB} ${LTLIB} ${THRSTATICLIB} ${THRLTLIB} +all compile: generate ${lib_LTLIBRARIES} ${lib_LIBRARIES} # In order to use libtool versioning correcty, we must have: # @@ -138,15 +145,26 @@ offset=2 version_info:=-version-info ${shell \ perl -e '$$,=":"; @F=split "\\.","${version}"; print $$F[0]+$$F[1]+${offset},$$F[2],$$F[1]' } +ifeq (${thrflavour},) ${STATICLIB}: ${OBJS} ar crv $@ ${OBJS} ranlib $@ +${LTLIB}: ${OBJS} + ${LINKXX} ${version_info} -o $@ ${LOBJS} \ + -lglite_security_gss \ + ${EXT_LIBS} \ + -lm +else +${NOTHRSTATICLIB}: ${OBJS} + ar crv $@ ${OBJS} + ranlib $@ + ${THRSTATICLIB}: ${THROBJS} ar crv $@ ${THROBJS} ranlib $@ -${LTLIB}: ${OBJS} +${NOTHRLTLIB}: ${OBJS} ${LINKXX} ${version_info} -o $@ ${LOBJS} \ -lglite_security_gss_${nothrflavour} \ ${EXT_LIBS} \ @@ -155,8 +173,9 @@ ${LTLIB}: ${OBJS} ${THRLTLIB}: ${THROBJS} ${LINKXX} ${version_info} -o $@ ${THRLOBJS} \ -lglite_security_gss_${thrflavour} \ - ${EXT_THRLIBS} \ + ${EXT_LIBS} \ -lm +endif stage: compile $(MAKE) install PREFIX=${stagedir} DOSTAGE=yes @@ -170,13 +189,13 @@ check.parse: test_parse LD_LIBRARY_PATH=${cares_prefix}/${libdir}:${classads_prefix}/${libdir}:${LD_LIBRARY_PATH} ./test_parse ${REPORTS}/parse.xml test_parse: parse.o test_main.cpp - ${LINKXX} -o test_parse parse.o ${LTLIB} ${TEST_LIBS} ${EXT_LIBS} + ${LINKXX} -o test_parse parse.o ${default_commonlib} ${CPPUNIT_LIBS} ${EXT_LIBS} check.il: il_test LD_LIBRARY_PATH=${cares_prefix}/${libdir}:${classads_prefix}/${libdir}:${LD_LIBRARY_PATH} ./il_test ${REPORTS}/il.xml il_test: il_test.o il_int_test.o il_string_test.o il_msg_test.o - ${LINKXX} -o $@ $+ ${LTLIB} ${TEST_LIBS} ${EXT_LIBS} + ${LINKXX} -o $@ $+ ${default_commonlib} ${CPPUNIT_LIBS} ${EXT_LIBS} test_coverage: -mkdir coverage @@ -203,14 +222,14 @@ olddoc: generate events.tex status.tex install: mkdir -p ${PREFIX}/${libdir} mkdir -p ${PREFIX}/share/doc/${package}-${version}/examples - ${INSTALL} -m 644 ${LTLIB} ${THRLTLIB} ${MAILDIR_LIB} ${PREFIX}/${libdir} + ${INSTALL} -m 644 ${lib_LTLIBRARIES} ${PREFIX}/${libdir} ${INSTALL} -m 644 ${top_srcdir}/LICENSE ${PREFIX}/share/doc/${package}-${version} ( cd ${top_srcdir}/project && ${INSTALL} -m 644 ChangeLog package.description package.summary ${PREFIX}/share/doc/${package}-${version} ) # cp -r C CPP ${PREFIX}/share/doc/${package}-${version} mkdir -p ${PREFIX}/include/${globalprefix}/${lbprefix} ; (cd ${top_srcdir}/interface && ${INSTALL} -m 644 ${HDRS} ${PREFIX}/include/${globalprefix}/${lbprefix}) ; ${INSTALL} -m 644 ${GEN_HDRS} ${PREFIX}/include/${globalprefix}/${lbprefix} ; - ${INSTALL} -m 644 ${STATICLIB} ${THRSTATICLIB} ${PREFIX}/${libdir}; + ${INSTALL} -m 644 ${lib_LIBRARIES} ${PREFIX}/${libdir}; if [ x${LB_STANDALONE} = xyes ]; then \ mkdir -p ${PREFIX}/include/glite/wmsutils/jobid ; \ ${INSTALL} -m 644 glite/wmsutils/jobid/*.h ${PREFIX}/include/glite/wmsutils/jobid/ ; \ @@ -225,7 +244,7 @@ clean: ${COMPILE} ${CFLAGS} -c $< il_int_test.o il_string_test.o il_test.o il_msg_test.o parse.o: %.o: %.cpp test_main.cpp - ${CXX} -c ${CFLAGS} ${TEST_INC} $< + ${CXX} -c ${CFLAGS} ${CPPUNIT_CFLAGS} $< %.thr.o: %.c ${COMPILE} ${CFLAGS} -D_REENTRANT -DGLITE_LB_THREADED -o $@ -c $< diff --git a/org.glite.lb.common/configure b/org.glite.lb.common/configure index 0d662fe..76e67f9 100755 --- a/org.glite.lb.common/configure +++ b/org.glite.lb.common/configure @@ -41,39 +41,104 @@ my $output; my $lb_tag = ''; my $lbjp_tag = ''; my $jp_tag = ''; -my $sec_tag = ''; my $jobid_tag = ''; my $libdir = getlibdir(); +my $projectname; + my @nodes = qw/client server logger logger-msg utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; my %enable_nodes; my %disable_nodes; -my %extern_prefix = ( - cares => '/opt/c-ares', - classads => '/opt/classads', - cppunit => '/usr', - expat => '/usr', - globus => '/opt/globus', - myproxy => '/opt/myproxy', - gsoap => '/usr', - mysql => '/usr', - 'mysql-devel' => '', - 'mysql-server' => '', - voms => '/opt/glite', - gridsite => '/opt/glite', - lcas => '/opt/glite', - trustmanager => '/opt/glite', - utiljava => '/opt/glite', - ant => '/usr', - jdk => '/usr', - libtar => '/usr', - axis => '/usr', - log4c => '/usr', - postgresql => '/usr', - activemq => '/opt/activemq-cpp-library', - apr => '/opt/apr', - aprutil => '/opt/apr-util' +my %externs = ( + cares => { + prefix => '/opt/c-ares', + pkg => 'libcares' + }, + classads => { + prefix=> '/usr', + pkg => 'classads' + }, + cppunit => { + prefix=> '/usr', + pkg => 'cppunit' + }, + expat => { + prefix=> '/usr', + pkg => 'expat' + }, + globus => { + prefix=> '/opt/globus', + pkg => 'globus-gssapi-gsi' + }, + 'myproxy-essentials' => { + prefix=> '/opt/globus', + pkg => 'myproxy' + }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, + gsoap => { + prefix=> '/usr', + pkg => 'gsoap' + }, + mysql => { + prefix=> '/usr' + }, + 'mysql-devel' => { + prefix=> '' + }, + 'mysql-server' => { + prefix => '' + }, + voms => { + prefix => '/opt/glite', + pkg => 'voms-1.0' + }, + gridsite => { + prefix => '/opt/glite' + }, + lcas => { + prefix => '/opt/glite' + }, + trustmanager => { + prefix => '/opt/glite' + }, + utiljava => { + prefix=> '/opt/glite' + }, + ant => { + prefix=> '/usr' + }, + jdk => { + prefix=> '/usr' + }, + libtar => { + prefix=> '/usr' + }, + axis => { + prefix=> '/usr' + }, + log4c => { + prefix=> '/usr' + }, + postgresql => { + prefix=> '/usr' + } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -91,14 +156,15 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger logger-msg server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/proxyrenewal/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], 'gridsite' => [ qw/apache shared commands core/ ], + 'px' => [ qw/proxyrenewal glite-PX myproxy-yaim myproxy-config/ ], ); @@ -106,8 +172,8 @@ my @opts = ( 'prefix=s' => \$prefix, 'staged=s' => \$staged, 'module=s' => \$module, - 'thrflavour=s' => \$thrflavour, - 'nothrflavour=s' => \$nothrflavour, + 'thrflavour:s' => \$thrflavour, + 'nothrflavour:s' => \$nothrflavour, 'mode=s' => \$mode, 'listmodules=s' => \$listmodules, 'version=s' => \$version, @@ -117,10 +183,10 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, + 'emi' => \$emi, ); for (@nodes) { @@ -131,20 +197,26 @@ for (@nodes) { push @opts,"enable-$_",\$enable_nodes{$_}; } -push @opts,"with-$_=s",\$extern_prefix{$_} for keys %extern_prefix; +push @opts,"with-$_=s",\$externs{$_}{withprefix} for keys %externs; push @opts,"with-$_=s",\$jar{$_} for keys %jar; my @keeparg = @ARGV; GetOptions @opts or die "Errors parsing command line\n"; -$extern_prefix{'mysql-devel'}=$extern_prefix{mysql} if $extern_prefix{'mysql-devel'} eq ''; -$extern_prefix{'mysql-server'}=$extern_prefix{mysql} if $extern_prefix{'mysql-server'} eq ''; +$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; +$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -164,7 +236,33 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; + +if ($mode eq 'build') { for my $ext (keys %externs) { + if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } + elsif (defined $externs{$ext}{pkg}) { + my ($prefix, $flag); + my $pkg = $externs{$ext}{pkg}; + my $flagname = uc $externs{$ext}{pkg}; + $flagname =~ s/-[0-9\.]*$//; + $flagname =~ s/-/_/g; + + print "Checking $pkg ... "; + `pkg-config "$pkg" --exists >/dev/null`; + if ($? == 0) { + $externs{$ext}{prefix}=`pkg-config $pkg --variable=prefix`; + chomp $externs{$ext}{prefix}; + print "$externs{$ext}{prefix}\n"; + + $flag=`pkg-config $pkg --cflags`; + $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag); + $flag=`pkg-config $pkg --libs`; + $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); + } else { + print "(using default $externs{$ext}{prefix})\n"; + } + } +} } if ($dis) { for (@nodes) { @@ -181,7 +279,7 @@ $stagedir = $prefix unless $stagedir; if ($mode eq 'build') { print "Writing config.status\n"; open CONF,">config.status" or die "config.status: $!\n"; - print CONF "$0 @keeparg\n"; + print CONF "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH} $0 @keeparg\n"; close CONF; } @@ -227,8 +325,9 @@ sub mode_build { @myjars = keys %aux; print "\nRequired externals:\n"; - print "\t$_: $extern_prefix{$_}\n" for @ext; + print "\t$_: $externs{$_}{prefix}\n" for @ext; print "\t$_: $jar{$_}\n" for @myjars; + for (@ext) { if (defined($externs{$_}{flags})) { print "$externs{$_}{flags}"; } }; print "\nThis is a poor-man configure, it's up to you to have sources and externals there\n\n"; mkinc($_) for @modules; @@ -295,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -343,7 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.proxyrenewal' => [ qw/voms globus:B myproxy/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -354,6 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], + 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -435,7 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.proxyrenewal' => [ qw// ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -467,6 +561,11 @@ for my $jar (keys %need_jars) { 'jp.ws-interface' => [ qw// ], 'gridsite.core' => [ qw/build.common-cpp:B/ ], + + 'px.proxyrenewal' => [ qw// ], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], + 'px.myproxy-config' => [], ); for my $ext (keys %deps_aux) { @@ -491,6 +590,9 @@ for my $ext (keys %deps_aux) { %obsoletes = ( 'lb.yaim' => [ qq/glite-yaim-lb/ ], + 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], + 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -501,7 +603,7 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', + 'px' => 'org.glite', ); %conf_prefix = ( @@ -510,7 +612,16 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', + 'px' => 'glite-', +); + +%emi_conf_prefix = ( + 'lb' => 'emi-', + 'jp' => 'emi-', + 'jobid' => 'emi-', + 'lbjp-common' => 'emi-', + 'gridsite' => '', + 'px' => 'emi-', ); my @k = keys %deps_aux; @@ -536,8 +647,9 @@ sub mkinc lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java -lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface +lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface +px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config /; @aux{@m} = (1) x ($#m+1); @@ -574,7 +686,8 @@ libdir = $libdir }; for (@{$need_externs{$short}}) { - print MKINC "${_}_prefix = $extern_prefix{$_}\n" + print MKINC "${_}_prefix = $externs{$_}{prefix}\n"; + print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags}; } for (@{$need_jars{$short}}) { @@ -589,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -615,10 +728,20 @@ BEGIN{ apr=>'apr-dev', aprutil=>'aprutil-dev', ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' + ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -666,30 +789,48 @@ sub mode_etics { for (@{$need_externs{"$subsys.$module"}}) { if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + if ($emi) { + if ($ge{$_} and not defined $externs{$_}{pkg}) { + push @copts, "--with-$_=\${stageDir}"; + } + } else { + push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + } } } for (@{$need_jars{"$subsys.$module"}}) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,"--with-$_ \${$eext.location}/usr/share/java/$_*.jar"; + push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (not $emi); } my $conf; my $conftag; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; + + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; + if ($branch) { - $conf = "$conf_prefix{$subsys}${subsys}-${module}_$branch"; + $conf = "$confprefix${subsys}-${module}_$branch"; $conftag = $branch; # forced low age number $age = $branch eq 'HEAD' ? '0head' : '0dev'; } else { - $conf = "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; + $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; # XXX: gridsite hack - $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : $conf; } + $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : + "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; } + if ($emi) { + $age = "${age}emi"; + } + my $file = $output ? $output : "$conf.ini"; open C,">$file" or die "$file: $!\n"; @@ -728,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -738,8 +885,13 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor} --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; $cmd{compile} = 'make'; $cmd{test} = 'make check'; $cmd{install} = 'make install'; @@ -751,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -800,8 +949,9 @@ $buildroot aprSuffix = 0 package.RPMSLocation = \${moduleDir}/RPMTMP/RPMS package.SRPMSLocation = \${moduleDir}/RPMTMP/SRPMS -$package_description$package_summary$defprops -}; +package.preserve.libtool = false +$package_description$package_summary$defprops}; + for (@{$obsoletes{"$subsys.$module"}}) { print C "package.obsoletes = $_\n"; print C "package.replaces = $_\n"; @@ -828,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -839,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -848,12 +1001,13 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS sub gsoap_version { local $_; my $gsoap_version; - open S,"$extern_prefix{gsoap}/bin/soapcpp2 -v 2>&1 |" or die "$extern_prefix{gsoap}/bin/soapcpp2: $!\n"; + open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n"; while ($_ = ) { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -910,7 +1064,7 @@ sub getlibdir { } sub usage { - my @ext = keys %extern_prefix; + my @ext = keys %externs; my @myjars, keys %jar; print STDERR qq{ @@ -925,6 +1079,7 @@ General options (defaults in []): --version=maj.min.rev-age specify version here instead of reading version.properties --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...) --libdir=libdir typically [lib,lib64] postfix + --emi generate configurations with emi flavor in mode 'etics' Mode of operation: --mode={checkout|build|etics} what to do [build] @@ -932,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.lb.common/interface/ulm_parse.h b/org.glite.lb.common/interface/ulm_parse.h index 2fbff02..e4e09f4 100644 --- a/org.glite.lb.common/interface/ulm_parse.h +++ b/org.glite.lb.common/interface/ulm_parse.h @@ -23,6 +23,10 @@ limitations under the License. #include /* for ULCconvertDate */ #include +#ifdef __cplusplus +extern "C" { +#endif + /*========= DATA =====================================================*/ #define ULM_DATE_STRING_LENGTH 21 @@ -61,4 +65,8 @@ extern double edg_wll_ULMDateToDouble( const char *s ); void edg_wll_ULMDateToTimeval( const char *s, struct timeval *tv ); extern int edg_wll_ULMTimevalToDate( long sec, long usec, char *dstr ); +#ifdef __cplusplus +} +#endif + #endif /* GLITE_LB_ULM_PARSE_H */ diff --git a/org.glite.lb.common/project/ChangeLog b/org.glite.lb.common/project/ChangeLog index 374385c..6517934 100644 --- a/org.glite.lb.common/project/ChangeLog +++ b/org.glite.lb.common/project/ChangeLog @@ -78,3 +78,21 @@ 7.1.4-1 - Hostname parsing adjusted to handle IPv6 addresses +7.1.5-1 +- Makefile adopts compilation and linking flags from the environment + +7.1.6-1 +- revision of the perl code generator (fixed jobid, notifid and timeval types, mainly in logging functions) +- fixed toString perl method for logsrc (duplicated line) +- new client API test (simple run for SEGV check) + +7.1.6-2 +- Module rebuilt + +7.1.7-1 +- Makefile a configuration updated to work across org.glite & EMI +- Connection pool initialization fixed for multi-threaded apps. (fix for bug #76175) + +7.1.7-2 +- Module rebuilt + diff --git a/org.glite.lb.common/project/version.properties b/org.glite.lb.common/project/version.properties index 536a807..ddd48c9 100644 --- a/org.glite.lb.common/project/version.properties +++ b/org.glite.lb.common/project/version.properties @@ -1,3 +1,3 @@ # $Header$ -module.version=7.1.4 -module.age=1 +module.version=7.1.7 +module.age=2 diff --git a/org.glite.lb.common/src/connpool.c b/org.glite.lb.common/src/connpool.c index c39c410..35fb2bc 100644 --- a/org.glite.lb.common/src/connpool.c +++ b/org.glite.lb.common/src/connpool.c @@ -276,9 +276,10 @@ edg_wll_Connections* edg_wll_initConnections() { #ifdef GLITE_LB_THREADED printf("Thread %d ",pthread_self()); #endif - printf("Initializng connections AND THE CONNECTION POOL\n"); + printf("Initializing connections AND THE CONNECTION POOL\n"); #endif + edg_wll_gss_initialize(); connectionsHandle.connPool = (edg_wll_ConnPool *) calloc(connectionsHandle.poolSize, sizeof(edg_wll_ConnPool)); for (i=0; i #include #include +#include #include "context-int.h" diff --git a/org.glite.lb.doc/configure b/org.glite.lb.doc/configure index 0d662fe..76e67f9 100755 --- a/org.glite.lb.doc/configure +++ b/org.glite.lb.doc/configure @@ -41,39 +41,104 @@ my $output; my $lb_tag = ''; my $lbjp_tag = ''; my $jp_tag = ''; -my $sec_tag = ''; my $jobid_tag = ''; my $libdir = getlibdir(); +my $projectname; + my @nodes = qw/client server logger logger-msg utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; my %enable_nodes; my %disable_nodes; -my %extern_prefix = ( - cares => '/opt/c-ares', - classads => '/opt/classads', - cppunit => '/usr', - expat => '/usr', - globus => '/opt/globus', - myproxy => '/opt/myproxy', - gsoap => '/usr', - mysql => '/usr', - 'mysql-devel' => '', - 'mysql-server' => '', - voms => '/opt/glite', - gridsite => '/opt/glite', - lcas => '/opt/glite', - trustmanager => '/opt/glite', - utiljava => '/opt/glite', - ant => '/usr', - jdk => '/usr', - libtar => '/usr', - axis => '/usr', - log4c => '/usr', - postgresql => '/usr', - activemq => '/opt/activemq-cpp-library', - apr => '/opt/apr', - aprutil => '/opt/apr-util' +my %externs = ( + cares => { + prefix => '/opt/c-ares', + pkg => 'libcares' + }, + classads => { + prefix=> '/usr', + pkg => 'classads' + }, + cppunit => { + prefix=> '/usr', + pkg => 'cppunit' + }, + expat => { + prefix=> '/usr', + pkg => 'expat' + }, + globus => { + prefix=> '/opt/globus', + pkg => 'globus-gssapi-gsi' + }, + 'myproxy-essentials' => { + prefix=> '/opt/globus', + pkg => 'myproxy' + }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, + gsoap => { + prefix=> '/usr', + pkg => 'gsoap' + }, + mysql => { + prefix=> '/usr' + }, + 'mysql-devel' => { + prefix=> '' + }, + 'mysql-server' => { + prefix => '' + }, + voms => { + prefix => '/opt/glite', + pkg => 'voms-1.0' + }, + gridsite => { + prefix => '/opt/glite' + }, + lcas => { + prefix => '/opt/glite' + }, + trustmanager => { + prefix => '/opt/glite' + }, + utiljava => { + prefix=> '/opt/glite' + }, + ant => { + prefix=> '/usr' + }, + jdk => { + prefix=> '/usr' + }, + libtar => { + prefix=> '/usr' + }, + axis => { + prefix=> '/usr' + }, + log4c => { + prefix=> '/usr' + }, + postgresql => { + prefix=> '/usr' + } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -91,14 +156,15 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger logger-msg server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/proxyrenewal/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], 'gridsite' => [ qw/apache shared commands core/ ], + 'px' => [ qw/proxyrenewal glite-PX myproxy-yaim myproxy-config/ ], ); @@ -106,8 +172,8 @@ my @opts = ( 'prefix=s' => \$prefix, 'staged=s' => \$staged, 'module=s' => \$module, - 'thrflavour=s' => \$thrflavour, - 'nothrflavour=s' => \$nothrflavour, + 'thrflavour:s' => \$thrflavour, + 'nothrflavour:s' => \$nothrflavour, 'mode=s' => \$mode, 'listmodules=s' => \$listmodules, 'version=s' => \$version, @@ -117,10 +183,10 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, + 'emi' => \$emi, ); for (@nodes) { @@ -131,20 +197,26 @@ for (@nodes) { push @opts,"enable-$_",\$enable_nodes{$_}; } -push @opts,"with-$_=s",\$extern_prefix{$_} for keys %extern_prefix; +push @opts,"with-$_=s",\$externs{$_}{withprefix} for keys %externs; push @opts,"with-$_=s",\$jar{$_} for keys %jar; my @keeparg = @ARGV; GetOptions @opts or die "Errors parsing command line\n"; -$extern_prefix{'mysql-devel'}=$extern_prefix{mysql} if $extern_prefix{'mysql-devel'} eq ''; -$extern_prefix{'mysql-server'}=$extern_prefix{mysql} if $extern_prefix{'mysql-server'} eq ''; +$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; +$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -164,7 +236,33 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; + +if ($mode eq 'build') { for my $ext (keys %externs) { + if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } + elsif (defined $externs{$ext}{pkg}) { + my ($prefix, $flag); + my $pkg = $externs{$ext}{pkg}; + my $flagname = uc $externs{$ext}{pkg}; + $flagname =~ s/-[0-9\.]*$//; + $flagname =~ s/-/_/g; + + print "Checking $pkg ... "; + `pkg-config "$pkg" --exists >/dev/null`; + if ($? == 0) { + $externs{$ext}{prefix}=`pkg-config $pkg --variable=prefix`; + chomp $externs{$ext}{prefix}; + print "$externs{$ext}{prefix}\n"; + + $flag=`pkg-config $pkg --cflags`; + $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag); + $flag=`pkg-config $pkg --libs`; + $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); + } else { + print "(using default $externs{$ext}{prefix})\n"; + } + } +} } if ($dis) { for (@nodes) { @@ -181,7 +279,7 @@ $stagedir = $prefix unless $stagedir; if ($mode eq 'build') { print "Writing config.status\n"; open CONF,">config.status" or die "config.status: $!\n"; - print CONF "$0 @keeparg\n"; + print CONF "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH} $0 @keeparg\n"; close CONF; } @@ -227,8 +325,9 @@ sub mode_build { @myjars = keys %aux; print "\nRequired externals:\n"; - print "\t$_: $extern_prefix{$_}\n" for @ext; + print "\t$_: $externs{$_}{prefix}\n" for @ext; print "\t$_: $jar{$_}\n" for @myjars; + for (@ext) { if (defined($externs{$_}{flags})) { print "$externs{$_}{flags}"; } }; print "\nThis is a poor-man configure, it's up to you to have sources and externals there\n\n"; mkinc($_) for @modules; @@ -295,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -343,7 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.proxyrenewal' => [ qw/voms globus:B myproxy/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -354,6 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], + 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -435,7 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.proxyrenewal' => [ qw// ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -467,6 +561,11 @@ for my $jar (keys %need_jars) { 'jp.ws-interface' => [ qw// ], 'gridsite.core' => [ qw/build.common-cpp:B/ ], + + 'px.proxyrenewal' => [ qw// ], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], + 'px.myproxy-config' => [], ); for my $ext (keys %deps_aux) { @@ -491,6 +590,9 @@ for my $ext (keys %deps_aux) { %obsoletes = ( 'lb.yaim' => [ qq/glite-yaim-lb/ ], + 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], + 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -501,7 +603,7 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', + 'px' => 'org.glite', ); %conf_prefix = ( @@ -510,7 +612,16 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', + 'px' => 'glite-', +); + +%emi_conf_prefix = ( + 'lb' => 'emi-', + 'jp' => 'emi-', + 'jobid' => 'emi-', + 'lbjp-common' => 'emi-', + 'gridsite' => '', + 'px' => 'emi-', ); my @k = keys %deps_aux; @@ -536,8 +647,9 @@ sub mkinc lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java -lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface +lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface +px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config /; @aux{@m} = (1) x ($#m+1); @@ -574,7 +686,8 @@ libdir = $libdir }; for (@{$need_externs{$short}}) { - print MKINC "${_}_prefix = $extern_prefix{$_}\n" + print MKINC "${_}_prefix = $externs{$_}{prefix}\n"; + print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags}; } for (@{$need_jars{$short}}) { @@ -589,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -615,10 +728,20 @@ BEGIN{ apr=>'apr-dev', aprutil=>'aprutil-dev', ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' + ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -666,30 +789,48 @@ sub mode_etics { for (@{$need_externs{"$subsys.$module"}}) { if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + if ($emi) { + if ($ge{$_} and not defined $externs{$_}{pkg}) { + push @copts, "--with-$_=\${stageDir}"; + } + } else { + push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + } } } for (@{$need_jars{"$subsys.$module"}}) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,"--with-$_ \${$eext.location}/usr/share/java/$_*.jar"; + push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (not $emi); } my $conf; my $conftag; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; + + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; + if ($branch) { - $conf = "$conf_prefix{$subsys}${subsys}-${module}_$branch"; + $conf = "$confprefix${subsys}-${module}_$branch"; $conftag = $branch; # forced low age number $age = $branch eq 'HEAD' ? '0head' : '0dev'; } else { - $conf = "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; + $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; # XXX: gridsite hack - $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : $conf; } + $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : + "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; } + if ($emi) { + $age = "${age}emi"; + } + my $file = $output ? $output : "$conf.ini"; open C,">$file" or die "$file: $!\n"; @@ -728,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -738,8 +885,13 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor} --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; $cmd{compile} = 'make'; $cmd{test} = 'make check'; $cmd{install} = 'make install'; @@ -751,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -800,8 +949,9 @@ $buildroot aprSuffix = 0 package.RPMSLocation = \${moduleDir}/RPMTMP/RPMS package.SRPMSLocation = \${moduleDir}/RPMTMP/SRPMS -$package_description$package_summary$defprops -}; +package.preserve.libtool = false +$package_description$package_summary$defprops}; + for (@{$obsoletes{"$subsys.$module"}}) { print C "package.obsoletes = $_\n"; print C "package.replaces = $_\n"; @@ -828,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -839,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -848,12 +1001,13 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS sub gsoap_version { local $_; my $gsoap_version; - open S,"$extern_prefix{gsoap}/bin/soapcpp2 -v 2>&1 |" or die "$extern_prefix{gsoap}/bin/soapcpp2: $!\n"; + open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n"; while ($_ = ) { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -910,7 +1064,7 @@ sub getlibdir { } sub usage { - my @ext = keys %extern_prefix; + my @ext = keys %externs; my @myjars, keys %jar; print STDERR qq{ @@ -925,6 +1079,7 @@ General options (defaults in []): --version=maj.min.rev-age specify version here instead of reading version.properties --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...) --libdir=libdir typically [lib,lib64] postfix + --emi generate configurations with emi flavor in mode 'etics' Mode of operation: --mode={checkout|build|etics} what to do [build] @@ -932,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.lb.doc/project/ChangeLog b/org.glite.lb.doc/project/ChangeLog index 24f0c84..22c76ad 100644 --- a/org.glite.lb.doc/project/ChangeLog +++ b/org.glite.lb.doc/project/ChangeLog @@ -60,3 +60,12 @@ 1.1.9-2 - Module rebuilt +1.1.10-1 +- TestPlan tests documentation updated. + +1.1.10-2 +- Module rebuilt + +1.1.10-3 +- Module rebuilt + diff --git a/org.glite.lb.doc/project/version.properties b/org.glite.lb.doc/project/version.properties index 4abe227..a2dd2f4 100644 --- a/org.glite.lb.doc/project/version.properties +++ b/org.glite.lb.doc/project/version.properties @@ -1,3 +1,3 @@ # $Header$ -module.version=1.1.9 -module.age=2 +module.version=1.1.10 +module.age=3 diff --git a/org.glite.lb.doc/src/LBTP-Tests.tex b/org.glite.lb.doc/src/LBTP-Tests.tex index 7565e47..24d0dc2 100644 --- a/org.glite.lb.doc/src/LBTP-Tests.tex +++ b/org.glite.lb.doc/src/LBTP-Tests.tex @@ -67,6 +67,8 @@ Besides pure System Functionality Tests, this list also includes In-the-Wild tes \hline {\tt lb-test-statistics.sh} & Implemented & Test statistic functions provided by \LB \\ \hline +{\tt lb-test-threaded.sh} & Implemented & Rudimentary test for threaded clients \LB \\ +\hline \end{tabularx} \subsubsection{Event logging examples} @@ -88,6 +90,7 @@ There is an {\tt examples} subdirectory in {\tt GLITE\_LOCATION}. It holds vario \item Register jobs with \code{edg\_wll\_RegisterJob} \item Log reasonable sequences of events with \code{edg\_wll\_Log*}, both through logger and/or proxy \item Check with \code{edg\_wll\_JobLog} that the events got delivered afterwards (approx. 10s). +\item Also check delivery and processing of events related to collections. \end{enumerate} \how\ \ctblb{lb-test-event-delivery.sh} @@ -102,16 +105,10 @@ There is an {\tt examples} subdirectory in {\tt GLITE\_LOCATION}. It holds vario % - rename the script, tidy it % - create some meaningful sequence of events for logEvents -\note\ The test includes artificial delays. Takes approx. 25\,s to finish. +\note\ The test includes artificial delays. Takes approx. 60\,s to finish. \result\ All sub tests (API calls) should return 0. The same events that were logged must be returned. -\begin{hints} -There is approx. 1 min time window in which the local logger files exist. -They can be grabbed and used for comparing the events later in~\ref{recover}. -\end{hints} - - \subsubsection{Job registration only} \label{reg} @@ -217,7 +214,7 @@ events (e.g. destination computing element) wrt. the values reported in the job \what\ Register jobs with \code{edg\_wll\_RegisterJobProxy}, log events using \code{edg\_wll\_LogEventProxy} and check the job states against both lbproxy (using \code{edg\_wll\_JobStatusProxy}) and bkserver -(using \code{edg\_wll\_JobStatus}). Pay special attention to job reaching final +(using \code{edg\_wll\_JobStatus}). Also test job collections and registration, including registration of subjobs. Pay special attention to job reaching final job status and to the automatic purge from proxy. % - check the timeouts. - ??tam byly nejaky timeouty??? @@ -243,6 +240,7 @@ job status and to the automatic purge from proxy. lbproxy and probably with a small delay also at the bkserver. Jobs that reach the final job state are really purged from the proxy. +\note\ The test includes artificial delays. Takes approx. 50\,s to finish. \subsection{WS interface} @@ -485,6 +483,22 @@ including the checks. \result\ Meaningful values should be returned by both tests. +\subsubsection{Multi-Threaded Operation} + +\req\ \LB\ server running + +\what\ +\begin{enumerate} +\item Register a series of jobs. +\item Run a client using multiple threads to query the server simultaneously. +\item Check if all threads finished OK. +\end{enumerate} + +\how\ \ctblb{lb-test-threaded.sh} + +\note\ The is not a thorough test. It is not capable of discovering rare or improbable problems but it will check the essentials of multi-threaded opration. + +\result\ The test must not hang. Meaningful results (albeit errors) must be returned by all threads. \section{LB ``In the Wild''---Real-World WMS Test} diff --git a/org.glite.lb.harvester/Makefile b/org.glite.lb.harvester/Makefile index 07c4434..6f753c9 100644 --- a/org.glite.lb.harvester/Makefile +++ b/org.glite.lb.harvester/Makefile @@ -4,14 +4,7 @@ package=glite-lb-harvester module.version=0.0.0 PREFIX=/opt/glite globus_prefix=/opt/globus - -archlib:=lib -thrflavour:=gcc32dbgpthr -host_cpu:=${shell uname -m} -ifeq (${host_cpu},x86_64) - archlib:=lib64 - thrflavour:=gcc64dbgpthr -endif +libdir=lib -include Makefile.inc -include ${top_srcdir}/project/version.properties @@ -20,21 +13,28 @@ version:=${module.version} CC=gcc VPATH=${top_srcdir}/src:${top_srcdir}/doc -GLOBUS_CPPFLAGS:=-I${globus_prefix}/include/${thrflavour} CPPFLAGS:=-I${stagedir}/include -D_GNU_SOURCE -D_REENTRANT ${CPPFLAGS} CFLAGS:=-W -Wall -g -O2 ${CFLAGS} LDFLAGS:=${LDFLAGS} -LIBS:=-L${stagedir}/${archlib} -L${stagedir}/lib \ +ifeq (${thrflavour},) +LIBS:=-L${stagedir}/${libdir} \ + -lglite_lb_common \ + -lglite_lb_client \ + -lpthread -lglite_security_gss +else +LIBS:=-L${stagedir}/${libdir} -L${stagedir}/lib \ -lglite_lb_common_${thrflavour} \ -lglite_lb_client_${thrflavour} \ -lpthread -lglite_security_gss_${thrflavour} +endif ifneq ($(GLITE_LB_HARVESTER_WITH_LBU_DB),no) CPPFLAGS:=$(CPPFLAGS) -DWITH_LBU_DB=1 LIBS:=$(LIBS) -lglite_lbu_db endif ifeq ($(GLITE_LB_HARVESTER_WITH_OLD_LB),yes) -CPPFLAGS:=${GLOBUS_CPPFLAGS} $(CPPFLAGS) -DWITH_OLD_LB=1 +GLOBUS_GSSAPI_GSI_CFLAGS?=-I${globus_prefix}/include/${thrflavour} +CPPFLAGS:=${GLOBUS_GSSAPI_GSI_CFLAGS} $(CPPFLAGS) -DWITH_OLD_LB=1 LIBS:=$(LIBS) -lglite_wmsutils_cjobid else LIBS:=$(LIBS) -lglite_jobid -lglite_lbu_trio -lglite_lbu_log diff --git a/org.glite.lb.harvester/configure b/org.glite.lb.harvester/configure index 0d662fe..76e67f9 100755 --- a/org.glite.lb.harvester/configure +++ b/org.glite.lb.harvester/configure @@ -41,39 +41,104 @@ my $output; my $lb_tag = ''; my $lbjp_tag = ''; my $jp_tag = ''; -my $sec_tag = ''; my $jobid_tag = ''; my $libdir = getlibdir(); +my $projectname; + my @nodes = qw/client server logger logger-msg utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; my %enable_nodes; my %disable_nodes; -my %extern_prefix = ( - cares => '/opt/c-ares', - classads => '/opt/classads', - cppunit => '/usr', - expat => '/usr', - globus => '/opt/globus', - myproxy => '/opt/myproxy', - gsoap => '/usr', - mysql => '/usr', - 'mysql-devel' => '', - 'mysql-server' => '', - voms => '/opt/glite', - gridsite => '/opt/glite', - lcas => '/opt/glite', - trustmanager => '/opt/glite', - utiljava => '/opt/glite', - ant => '/usr', - jdk => '/usr', - libtar => '/usr', - axis => '/usr', - log4c => '/usr', - postgresql => '/usr', - activemq => '/opt/activemq-cpp-library', - apr => '/opt/apr', - aprutil => '/opt/apr-util' +my %externs = ( + cares => { + prefix => '/opt/c-ares', + pkg => 'libcares' + }, + classads => { + prefix=> '/usr', + pkg => 'classads' + }, + cppunit => { + prefix=> '/usr', + pkg => 'cppunit' + }, + expat => { + prefix=> '/usr', + pkg => 'expat' + }, + globus => { + prefix=> '/opt/globus', + pkg => 'globus-gssapi-gsi' + }, + 'myproxy-essentials' => { + prefix=> '/opt/globus', + pkg => 'myproxy' + }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, + gsoap => { + prefix=> '/usr', + pkg => 'gsoap' + }, + mysql => { + prefix=> '/usr' + }, + 'mysql-devel' => { + prefix=> '' + }, + 'mysql-server' => { + prefix => '' + }, + voms => { + prefix => '/opt/glite', + pkg => 'voms-1.0' + }, + gridsite => { + prefix => '/opt/glite' + }, + lcas => { + prefix => '/opt/glite' + }, + trustmanager => { + prefix => '/opt/glite' + }, + utiljava => { + prefix=> '/opt/glite' + }, + ant => { + prefix=> '/usr' + }, + jdk => { + prefix=> '/usr' + }, + libtar => { + prefix=> '/usr' + }, + axis => { + prefix=> '/usr' + }, + log4c => { + prefix=> '/usr' + }, + postgresql => { + prefix=> '/usr' + } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -91,14 +156,15 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger logger-msg server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/proxyrenewal/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], 'gridsite' => [ qw/apache shared commands core/ ], + 'px' => [ qw/proxyrenewal glite-PX myproxy-yaim myproxy-config/ ], ); @@ -106,8 +172,8 @@ my @opts = ( 'prefix=s' => \$prefix, 'staged=s' => \$staged, 'module=s' => \$module, - 'thrflavour=s' => \$thrflavour, - 'nothrflavour=s' => \$nothrflavour, + 'thrflavour:s' => \$thrflavour, + 'nothrflavour:s' => \$nothrflavour, 'mode=s' => \$mode, 'listmodules=s' => \$listmodules, 'version=s' => \$version, @@ -117,10 +183,10 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, + 'emi' => \$emi, ); for (@nodes) { @@ -131,20 +197,26 @@ for (@nodes) { push @opts,"enable-$_",\$enable_nodes{$_}; } -push @opts,"with-$_=s",\$extern_prefix{$_} for keys %extern_prefix; +push @opts,"with-$_=s",\$externs{$_}{withprefix} for keys %externs; push @opts,"with-$_=s",\$jar{$_} for keys %jar; my @keeparg = @ARGV; GetOptions @opts or die "Errors parsing command line\n"; -$extern_prefix{'mysql-devel'}=$extern_prefix{mysql} if $extern_prefix{'mysql-devel'} eq ''; -$extern_prefix{'mysql-server'}=$extern_prefix{mysql} if $extern_prefix{'mysql-server'} eq ''; +$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; +$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -164,7 +236,33 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; + +if ($mode eq 'build') { for my $ext (keys %externs) { + if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } + elsif (defined $externs{$ext}{pkg}) { + my ($prefix, $flag); + my $pkg = $externs{$ext}{pkg}; + my $flagname = uc $externs{$ext}{pkg}; + $flagname =~ s/-[0-9\.]*$//; + $flagname =~ s/-/_/g; + + print "Checking $pkg ... "; + `pkg-config "$pkg" --exists >/dev/null`; + if ($? == 0) { + $externs{$ext}{prefix}=`pkg-config $pkg --variable=prefix`; + chomp $externs{$ext}{prefix}; + print "$externs{$ext}{prefix}\n"; + + $flag=`pkg-config $pkg --cflags`; + $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag); + $flag=`pkg-config $pkg --libs`; + $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); + } else { + print "(using default $externs{$ext}{prefix})\n"; + } + } +} } if ($dis) { for (@nodes) { @@ -181,7 +279,7 @@ $stagedir = $prefix unless $stagedir; if ($mode eq 'build') { print "Writing config.status\n"; open CONF,">config.status" or die "config.status: $!\n"; - print CONF "$0 @keeparg\n"; + print CONF "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH} $0 @keeparg\n"; close CONF; } @@ -227,8 +325,9 @@ sub mode_build { @myjars = keys %aux; print "\nRequired externals:\n"; - print "\t$_: $extern_prefix{$_}\n" for @ext; + print "\t$_: $externs{$_}{prefix}\n" for @ext; print "\t$_: $jar{$_}\n" for @myjars; + for (@ext) { if (defined($externs{$_}{flags})) { print "$externs{$_}{flags}"; } }; print "\nThis is a poor-man configure, it's up to you to have sources and externals there\n\n"; mkinc($_) for @modules; @@ -295,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -343,7 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.proxyrenewal' => [ qw/voms globus:B myproxy/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -354,6 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], + 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -435,7 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.proxyrenewal' => [ qw// ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -467,6 +561,11 @@ for my $jar (keys %need_jars) { 'jp.ws-interface' => [ qw// ], 'gridsite.core' => [ qw/build.common-cpp:B/ ], + + 'px.proxyrenewal' => [ qw// ], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], + 'px.myproxy-config' => [], ); for my $ext (keys %deps_aux) { @@ -491,6 +590,9 @@ for my $ext (keys %deps_aux) { %obsoletes = ( 'lb.yaim' => [ qq/glite-yaim-lb/ ], + 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], + 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -501,7 +603,7 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', + 'px' => 'org.glite', ); %conf_prefix = ( @@ -510,7 +612,16 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', + 'px' => 'glite-', +); + +%emi_conf_prefix = ( + 'lb' => 'emi-', + 'jp' => 'emi-', + 'jobid' => 'emi-', + 'lbjp-common' => 'emi-', + 'gridsite' => '', + 'px' => 'emi-', ); my @k = keys %deps_aux; @@ -536,8 +647,9 @@ sub mkinc lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java -lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface +lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface +px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config /; @aux{@m} = (1) x ($#m+1); @@ -574,7 +686,8 @@ libdir = $libdir }; for (@{$need_externs{$short}}) { - print MKINC "${_}_prefix = $extern_prefix{$_}\n" + print MKINC "${_}_prefix = $externs{$_}{prefix}\n"; + print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags}; } for (@{$need_jars{$short}}) { @@ -589,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -615,10 +728,20 @@ BEGIN{ apr=>'apr-dev', aprutil=>'aprutil-dev', ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' + ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -666,30 +789,48 @@ sub mode_etics { for (@{$need_externs{"$subsys.$module"}}) { if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + if ($emi) { + if ($ge{$_} and not defined $externs{$_}{pkg}) { + push @copts, "--with-$_=\${stageDir}"; + } + } else { + push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + } } } for (@{$need_jars{"$subsys.$module"}}) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,"--with-$_ \${$eext.location}/usr/share/java/$_*.jar"; + push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (not $emi); } my $conf; my $conftag; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; + + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; + if ($branch) { - $conf = "$conf_prefix{$subsys}${subsys}-${module}_$branch"; + $conf = "$confprefix${subsys}-${module}_$branch"; $conftag = $branch; # forced low age number $age = $branch eq 'HEAD' ? '0head' : '0dev'; } else { - $conf = "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; + $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; # XXX: gridsite hack - $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : $conf; } + $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : + "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; } + if ($emi) { + $age = "${age}emi"; + } + my $file = $output ? $output : "$conf.ini"; open C,">$file" or die "$file: $!\n"; @@ -728,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -738,8 +885,13 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor} --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; $cmd{compile} = 'make'; $cmd{test} = 'make check'; $cmd{install} = 'make install'; @@ -751,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -800,8 +949,9 @@ $buildroot aprSuffix = 0 package.RPMSLocation = \${moduleDir}/RPMTMP/RPMS package.SRPMSLocation = \${moduleDir}/RPMTMP/SRPMS -$package_description$package_summary$defprops -}; +package.preserve.libtool = false +$package_description$package_summary$defprops}; + for (@{$obsoletes{"$subsys.$module"}}) { print C "package.obsoletes = $_\n"; print C "package.replaces = $_\n"; @@ -828,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -839,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -848,12 +1001,13 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS sub gsoap_version { local $_; my $gsoap_version; - open S,"$extern_prefix{gsoap}/bin/soapcpp2 -v 2>&1 |" or die "$extern_prefix{gsoap}/bin/soapcpp2: $!\n"; + open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n"; while ($_ = ) { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -910,7 +1064,7 @@ sub getlibdir { } sub usage { - my @ext = keys %extern_prefix; + my @ext = keys %externs; my @myjars, keys %jar; print STDERR qq{ @@ -925,6 +1079,7 @@ General options (defaults in []): --version=maj.min.rev-age specify version here instead of reading version.properties --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...) --libdir=libdir typically [lib,lib64] postfix + --emi generate configurations with emi flavor in mode 'etics' Mode of operation: --mode={checkout|build|etics} what to do [build] @@ -932,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.lb.harvester/project/ChangeLog b/org.glite.lb.harvester/project/ChangeLog index 195a847..d5d8e8a 100644 --- a/org.glite.lb.harvester/project/ChangeLog +++ b/org.glite.lb.harvester/project/ChangeLog @@ -41,3 +41,16 @@ 1.0.8-2 - Module rebuilt +1.0.9-1 +- Separated start-up script for L&B harvester. + +1.0.9-2 +- Module rebuilt + +1.0.10-1 +- Makefile a configuration updated to work across org.glite & EMI +- BDII status reporting fixed + +1.0.10-2 +- Module rebuilt + diff --git a/org.glite.lb.harvester/project/version.properties b/org.glite.lb.harvester/project/version.properties index ad11c61..676bf0d 100644 --- a/org.glite.lb.harvester/project/version.properties +++ b/org.glite.lb.harvester/project/version.properties @@ -1,2 +1,2 @@ -module.version=1.0.8 +module.version=1.0.10 module.age=2 diff --git a/org.glite.lb.logger-msg/configure b/org.glite.lb.logger-msg/configure index 0d662fe..76e67f9 100755 --- a/org.glite.lb.logger-msg/configure +++ b/org.glite.lb.logger-msg/configure @@ -41,39 +41,104 @@ my $output; my $lb_tag = ''; my $lbjp_tag = ''; my $jp_tag = ''; -my $sec_tag = ''; my $jobid_tag = ''; my $libdir = getlibdir(); +my $projectname; + my @nodes = qw/client server logger logger-msg utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; my %enable_nodes; my %disable_nodes; -my %extern_prefix = ( - cares => '/opt/c-ares', - classads => '/opt/classads', - cppunit => '/usr', - expat => '/usr', - globus => '/opt/globus', - myproxy => '/opt/myproxy', - gsoap => '/usr', - mysql => '/usr', - 'mysql-devel' => '', - 'mysql-server' => '', - voms => '/opt/glite', - gridsite => '/opt/glite', - lcas => '/opt/glite', - trustmanager => '/opt/glite', - utiljava => '/opt/glite', - ant => '/usr', - jdk => '/usr', - libtar => '/usr', - axis => '/usr', - log4c => '/usr', - postgresql => '/usr', - activemq => '/opt/activemq-cpp-library', - apr => '/opt/apr', - aprutil => '/opt/apr-util' +my %externs = ( + cares => { + prefix => '/opt/c-ares', + pkg => 'libcares' + }, + classads => { + prefix=> '/usr', + pkg => 'classads' + }, + cppunit => { + prefix=> '/usr', + pkg => 'cppunit' + }, + expat => { + prefix=> '/usr', + pkg => 'expat' + }, + globus => { + prefix=> '/opt/globus', + pkg => 'globus-gssapi-gsi' + }, + 'myproxy-essentials' => { + prefix=> '/opt/globus', + pkg => 'myproxy' + }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, + gsoap => { + prefix=> '/usr', + pkg => 'gsoap' + }, + mysql => { + prefix=> '/usr' + }, + 'mysql-devel' => { + prefix=> '' + }, + 'mysql-server' => { + prefix => '' + }, + voms => { + prefix => '/opt/glite', + pkg => 'voms-1.0' + }, + gridsite => { + prefix => '/opt/glite' + }, + lcas => { + prefix => '/opt/glite' + }, + trustmanager => { + prefix => '/opt/glite' + }, + utiljava => { + prefix=> '/opt/glite' + }, + ant => { + prefix=> '/usr' + }, + jdk => { + prefix=> '/usr' + }, + libtar => { + prefix=> '/usr' + }, + axis => { + prefix=> '/usr' + }, + log4c => { + prefix=> '/usr' + }, + postgresql => { + prefix=> '/usr' + } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -91,14 +156,15 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger logger-msg server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/proxyrenewal/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], 'gridsite' => [ qw/apache shared commands core/ ], + 'px' => [ qw/proxyrenewal glite-PX myproxy-yaim myproxy-config/ ], ); @@ -106,8 +172,8 @@ my @opts = ( 'prefix=s' => \$prefix, 'staged=s' => \$staged, 'module=s' => \$module, - 'thrflavour=s' => \$thrflavour, - 'nothrflavour=s' => \$nothrflavour, + 'thrflavour:s' => \$thrflavour, + 'nothrflavour:s' => \$nothrflavour, 'mode=s' => \$mode, 'listmodules=s' => \$listmodules, 'version=s' => \$version, @@ -117,10 +183,10 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, + 'emi' => \$emi, ); for (@nodes) { @@ -131,20 +197,26 @@ for (@nodes) { push @opts,"enable-$_",\$enable_nodes{$_}; } -push @opts,"with-$_=s",\$extern_prefix{$_} for keys %extern_prefix; +push @opts,"with-$_=s",\$externs{$_}{withprefix} for keys %externs; push @opts,"with-$_=s",\$jar{$_} for keys %jar; my @keeparg = @ARGV; GetOptions @opts or die "Errors parsing command line\n"; -$extern_prefix{'mysql-devel'}=$extern_prefix{mysql} if $extern_prefix{'mysql-devel'} eq ''; -$extern_prefix{'mysql-server'}=$extern_prefix{mysql} if $extern_prefix{'mysql-server'} eq ''; +$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; +$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -164,7 +236,33 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; + +if ($mode eq 'build') { for my $ext (keys %externs) { + if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } + elsif (defined $externs{$ext}{pkg}) { + my ($prefix, $flag); + my $pkg = $externs{$ext}{pkg}; + my $flagname = uc $externs{$ext}{pkg}; + $flagname =~ s/-[0-9\.]*$//; + $flagname =~ s/-/_/g; + + print "Checking $pkg ... "; + `pkg-config "$pkg" --exists >/dev/null`; + if ($? == 0) { + $externs{$ext}{prefix}=`pkg-config $pkg --variable=prefix`; + chomp $externs{$ext}{prefix}; + print "$externs{$ext}{prefix}\n"; + + $flag=`pkg-config $pkg --cflags`; + $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag); + $flag=`pkg-config $pkg --libs`; + $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); + } else { + print "(using default $externs{$ext}{prefix})\n"; + } + } +} } if ($dis) { for (@nodes) { @@ -181,7 +279,7 @@ $stagedir = $prefix unless $stagedir; if ($mode eq 'build') { print "Writing config.status\n"; open CONF,">config.status" or die "config.status: $!\n"; - print CONF "$0 @keeparg\n"; + print CONF "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH} $0 @keeparg\n"; close CONF; } @@ -227,8 +325,9 @@ sub mode_build { @myjars = keys %aux; print "\nRequired externals:\n"; - print "\t$_: $extern_prefix{$_}\n" for @ext; + print "\t$_: $externs{$_}{prefix}\n" for @ext; print "\t$_: $jar{$_}\n" for @myjars; + for (@ext) { if (defined($externs{$_}{flags})) { print "$externs{$_}{flags}"; } }; print "\nThis is a poor-man configure, it's up to you to have sources and externals there\n\n"; mkinc($_) for @modules; @@ -295,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -343,7 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.proxyrenewal' => [ qw/voms globus:B myproxy/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -354,6 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], + 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -435,7 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.proxyrenewal' => [ qw// ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -467,6 +561,11 @@ for my $jar (keys %need_jars) { 'jp.ws-interface' => [ qw// ], 'gridsite.core' => [ qw/build.common-cpp:B/ ], + + 'px.proxyrenewal' => [ qw// ], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], + 'px.myproxy-config' => [], ); for my $ext (keys %deps_aux) { @@ -491,6 +590,9 @@ for my $ext (keys %deps_aux) { %obsoletes = ( 'lb.yaim' => [ qq/glite-yaim-lb/ ], + 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], + 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -501,7 +603,7 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', + 'px' => 'org.glite', ); %conf_prefix = ( @@ -510,7 +612,16 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', + 'px' => 'glite-', +); + +%emi_conf_prefix = ( + 'lb' => 'emi-', + 'jp' => 'emi-', + 'jobid' => 'emi-', + 'lbjp-common' => 'emi-', + 'gridsite' => '', + 'px' => 'emi-', ); my @k = keys %deps_aux; @@ -536,8 +647,9 @@ sub mkinc lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java -lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface +lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface +px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config /; @aux{@m} = (1) x ($#m+1); @@ -574,7 +686,8 @@ libdir = $libdir }; for (@{$need_externs{$short}}) { - print MKINC "${_}_prefix = $extern_prefix{$_}\n" + print MKINC "${_}_prefix = $externs{$_}{prefix}\n"; + print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags}; } for (@{$need_jars{$short}}) { @@ -589,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -615,10 +728,20 @@ BEGIN{ apr=>'apr-dev', aprutil=>'aprutil-dev', ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' + ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -666,30 +789,48 @@ sub mode_etics { for (@{$need_externs{"$subsys.$module"}}) { if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + if ($emi) { + if ($ge{$_} and not defined $externs{$_}{pkg}) { + push @copts, "--with-$_=\${stageDir}"; + } + } else { + push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + } } } for (@{$need_jars{"$subsys.$module"}}) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,"--with-$_ \${$eext.location}/usr/share/java/$_*.jar"; + push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (not $emi); } my $conf; my $conftag; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; + + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; + if ($branch) { - $conf = "$conf_prefix{$subsys}${subsys}-${module}_$branch"; + $conf = "$confprefix${subsys}-${module}_$branch"; $conftag = $branch; # forced low age number $age = $branch eq 'HEAD' ? '0head' : '0dev'; } else { - $conf = "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; + $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; # XXX: gridsite hack - $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : $conf; } + $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : + "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; } + if ($emi) { + $age = "${age}emi"; + } + my $file = $output ? $output : "$conf.ini"; open C,">$file" or die "$file: $!\n"; @@ -728,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -738,8 +885,13 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor} --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; $cmd{compile} = 'make'; $cmd{test} = 'make check'; $cmd{install} = 'make install'; @@ -751,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -800,8 +949,9 @@ $buildroot aprSuffix = 0 package.RPMSLocation = \${moduleDir}/RPMTMP/RPMS package.SRPMSLocation = \${moduleDir}/RPMTMP/SRPMS -$package_description$package_summary$defprops -}; +package.preserve.libtool = false +$package_description$package_summary$defprops}; + for (@{$obsoletes{"$subsys.$module"}}) { print C "package.obsoletes = $_\n"; print C "package.replaces = $_\n"; @@ -828,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -839,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -848,12 +1001,13 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS sub gsoap_version { local $_; my $gsoap_version; - open S,"$extern_prefix{gsoap}/bin/soapcpp2 -v 2>&1 |" or die "$extern_prefix{gsoap}/bin/soapcpp2: $!\n"; + open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n"; while ($_ = ) { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -910,7 +1064,7 @@ sub getlibdir { } sub usage { - my @ext = keys %extern_prefix; + my @ext = keys %externs; my @myjars, keys %jar; print STDERR qq{ @@ -925,6 +1079,7 @@ General options (defaults in []): --version=maj.min.rev-age specify version here instead of reading version.properties --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...) --libdir=libdir typically [lib,lib64] postfix + --emi generate configurations with emi flavor in mode 'etics' Mode of operation: --mode={checkout|build|etics} what to do [build] @@ -932,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.lb.logger/Makefile b/org.glite.lb.logger/Makefile index 22fbfff..c988528 100644 --- a/org.glite.lb.logger/Makefile +++ b/org.glite.lb.logger/Makefile @@ -7,9 +7,6 @@ package=glite-lb-client version=0.0.0 PREFIX=/opt/glite -nothrflavour=gcc32 -thrflavour=gcc32pthr - -include Makefile.inc -include ../project/version.properties @@ -41,6 +38,14 @@ else WS_INTERLOGD:=glite-lb-ws-interlogd endif +ifeq (${thrflavour},) +default_thrflavour= +default_nothrflavour= +else +default_thrflavour=_${thrflavour} +default_nothrflavour=_${nothrflavour} +endif + DEBUG:=-g -O0 CFLAGS:=${CFLAGS} ${DEBUG} \ -I${stagedir}/include -I${top_srcdir}/src -I${top_srcdir}/interface \ @@ -71,8 +76,8 @@ EXT_LIB:=-lglite_lbu_trio -lglite_lbu_log GLITE_GSS_LIB:=-lglite_security_gss -TEST_LIBS:=-L${cppunit_prefix}/lib -lcppunit -TEST_INC:=-I${cppunit_prefix}/include +CPPUNIT_LIBS?=-L${cppunit_prefix}/${libdir} -lcppunit +CPPUNIT_CFLAGS?=-I${cppunit_prefix}/include LOGD_OBJS:= logd_proto.o logd.o @@ -120,35 +125,35 @@ default: all all compile: $(LOGD) $(INTERLOGD) $(NOTIF_INTERLOGD) ${MAN_GZ} glite-lb-logd: ${LOGD_OBJS} - ${LINK} -o $@ ${LOGD_OBJS} ${COMMON_LIB}_${nothrflavour} ${EXT_LIB} + ${LINK} -o $@ ${LOGD_OBJS} ${COMMON_LIB}${default_nothrflavour} ${EXT_LIB} glite-lb-logd-perf: ${LOGD_OBJS} - ${LINK} -o $@ ${LOGD_OBJS} ${COMMON_LIB}_${nothrflavour} ${EXT_LIB} + ${LINK} -o $@ ${LOGD_OBJS} ${COMMON_LIB}${default_nothrflavour} ${EXT_LIB} glite-lb-logd-nofile: ${LOGD_NOBJS} - ${LINK} -o $@ ${LOGD_NOBJS} ${COMMON_LIB}_${nothrflavour} ${EXT_LIB} + ${LINK} -o $@ ${LOGD_NOBJS} ${COMMON_LIB}${default_nothrflavour} ${EXT_LIB} glite-lb-logd-perf-nofile: ${LOGD_NOBJS} - ${LINK} -o $@ ${LOGD_NOBJS} ${COMMON_LIB}_${nothrflavour} ${EXT_LIB} + ${LINK} -o $@ ${LOGD_NOBJS} ${COMMON_LIB}${default_nothrflavour} ${EXT_LIB} glite-lb-interlogd: ${INTERLOG_OBJS} - ${LINK} -o $@ ${INTERLOG_OBJS} ${COMMON_LIB}_${thrflavour} ${EXT_LIB} + ${LINK} -o $@ ${INTERLOG_OBJS} ${COMMON_LIB}${default_thrflavour} ${EXT_LIB} glite-lb-notif-interlogd: ${INTERLOG_NOTIF_OBJS} - ${LINK} -export-dynamic -o $@ ${INTERLOG_NOTIF_OBJS} ${COMMON_LIB}_${thrflavour} ${EXT_LIB} + ${LINK} -export-dynamic -o $@ ${INTERLOG_NOTIF_OBJS} ${COMMON_LIB}${default_thrflavour} ${EXT_LIB} glite-lb-interlogd-perf: ${INTERLOG_PERF_OBJS} - ${LINK} -o $@ ${INTERLOG_PERF_OBJS} ${COMMON_LIB}_${thrflavour} ${EXT_LIB} + ${LINK} -o $@ ${INTERLOG_PERF_OBJS} ${COMMON_LIB}${default_thrflavour} ${EXT_LIB} glite-lb-interlogd-perf-empty: ${INTERLOG_EMPTY_OBJS} - ${LINK} -o $@ ${INTERLOG_EMPTY_OBJS} ${COMMON_LIB}_${thrflavour} ${EXT_LIB} + ${LINK} -o $@ ${INTERLOG_EMPTY_OBJS} ${COMMON_LIB}${default_thrflavour} ${EXT_LIB} glite-lb-ws-interlogd: ${INTERLOG_WS_OBJS} - ${LINK} -o $@ ${INTERLOG_WS_OBJS} ${COMMON_LIB}_${thrflavour} ${EXT_LIB} + ${LINK} -o $@ ${INTERLOG_WS_OBJS} ${COMMON_LIB}${default_thrflavour} ${EXT_LIB} #glite-lb-interlogd-perf-inline-empty: ${INTERLOG_INLINE_EMPTY_OBJS} # ${LINK} -o $@ ${INTERLOG_INLINE_EMPTY_OBJS} \ -# ${COMMON_LIB}_${thrflavour} +# ${COMMON_LIB}${default_thrflavour} ${MAN_GZ}: ${MAN} rm -f ${MAN_GZ} ${MAN} @@ -165,14 +170,14 @@ check: # check.ll check.il #check.ll: logd_proto_test.o ll_test.o -# ${LINKXX} -o $@ ${COMMON_LIB}_${nothrflavour} ${EXT_LIBS} ${TEST_LIBS} $+ +# ${LINKXX} -o $@ ${COMMON_LIB}${default_nothrflavour} ${EXT_LIBS} ${CPPUNIT_LIBS} $+ # ./check.ll check.ll: -echo commented out -- fix needed check.il: ${INTERLOG_TEST_OBJS} - ${LINKXX} -o $@ ${COMMON_LIB}_${thrflavour} ${TEST_LIBS} ${EXT_LIB} -lpthread $+ + ${LINKXX} -o $@ ${COMMON_LIB}${default_thrflavour} ${CPPUNIT_LIBS} ${EXT_LIB} -lpthread $+ install: -mkdir -p ${PREFIX}/bin @@ -222,10 +227,10 @@ logd_proto_test.o: %.o: %.c ${CC} ${CFLAGS} -c $< -o $@ ll_test.o: %.o: %.cpp - ${CXX} ${CFLAGS} ${TEST_INC} -c $< -o $@ + ${CXX} ${CFLAGS} ${CPPUNIT_CFLAGS} -c $< -o $@ il_test.o IlTestBase.o server_msgTest.o event_queueTest.o input_queue_socketTest.o event_storeTest.o: %.o: %.cpp - ${CXX} ${CFLAGS} ${TEST_INC} -c $< -o $@ + ${CXX} ${CFLAGS} ${CPPUNIT_CFLAGS} -c $< -o $@ clean: rm -rvf .libs/ *.o *.lo *.no ${LOGD} ${INTERLOGD} ${NOTIF_INTERLOGD} ${MAN_GZ} diff --git a/org.glite.lb.logger/config/startup b/org.glite.lb.logger/config/startup index 1454c9f..5c3139d 100755 --- a/org.glite.lb.logger/config/startup +++ b/org.glite.lb.logger/config/startup @@ -40,7 +40,7 @@ start_daemon() local cmd="$3" if [ -f "$pidfile" ]; then - if kill -0 `cat $pidfile`; then + if ps p `cat $pidfile` >/dev/null 2>&1; then return 0 fi echo -n "Warning: stalled $pidfile for $name" @@ -50,6 +50,35 @@ start_daemon() su - $GLITE_USER -c "$log4c $cmd" && echo " done" || echo " FAILED" } +status_daemon() +{ + local name="$1" + local pidfile="$2" + + if [ -f "$pidfile" ]; then + pid=`cat "$pidfile"` + if ps p $pid >/dev/null 2>&1; then + echo "$name running as $pid" + else + echo "$name not running (stalled pidfile)" + return 1 + fi + else + case "$GLITE_LB_TYPE" in + proxy) + echo "$name not running (disabled)" + return 0 + ;; + *) + echo "$name not running" + return 1 + ;; + esac + fi + + return 0 +} + start() { case "$GLITE_LB_TYPE" in @@ -118,7 +147,7 @@ stop() # for L&B <= 2.0 LC_ALL=C - if netstat -an --inet | grep "^tcp .* 0.0.0.0:${GLITE_LB_LOGGER_PORT:-9002} .*LISTEN" >/dev/null 2>&1 ;then + if netstat -an --inet --inet6 | grep "^tcp .* \(::\|0.0.0.0\):${GLITE_LB_LOGGER_PORT:-9002} .*LISTEN" >/dev/null 2>&1 ;then killall -9 glite-lb-logd fi if netstat -an --unix | grep "^unix .* LISTEN.* ${GLITE_LB_IL_SOCK:-/tmp/interlogger.sock}$" >/dev/null 2>&1 ;then @@ -128,19 +157,12 @@ stop() status() { - LC_ALL=C - if netstat -an --inet | grep "^tcp .* 0.0.0.0:${GLITE_LB_LOGGER_PORT:-9002} .*LISTEN" >/dev/null 2>&1 ;then - echo glite-lb-logd running - else - echo glite-lb-logd not running - return 1 - fi - if netstat -an --unix | grep "^unix .* LISTEN.* ${GLITE_LB_IL_SOCK:-/tmp/interlogger.sock}$" >/dev/null 2>&1 ;then - echo glite-lb-interlogd running - else - echo glite-lb-interlogd not running - return 1 - fi + retval=0 + + status_daemon "glite-lb-logd" "$LL_PIDFILE" || retval=1 + status_daemon "glite-lb-interlogd" "$LL_PIDFILE" || retval=1 + + return $retval } case x$1 in diff --git a/org.glite.lb.logger/configure b/org.glite.lb.logger/configure index 0d662fe..76e67f9 100755 --- a/org.glite.lb.logger/configure +++ b/org.glite.lb.logger/configure @@ -41,39 +41,104 @@ my $output; my $lb_tag = ''; my $lbjp_tag = ''; my $jp_tag = ''; -my $sec_tag = ''; my $jobid_tag = ''; my $libdir = getlibdir(); +my $projectname; + my @nodes = qw/client server logger logger-msg utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; my %enable_nodes; my %disable_nodes; -my %extern_prefix = ( - cares => '/opt/c-ares', - classads => '/opt/classads', - cppunit => '/usr', - expat => '/usr', - globus => '/opt/globus', - myproxy => '/opt/myproxy', - gsoap => '/usr', - mysql => '/usr', - 'mysql-devel' => '', - 'mysql-server' => '', - voms => '/opt/glite', - gridsite => '/opt/glite', - lcas => '/opt/glite', - trustmanager => '/opt/glite', - utiljava => '/opt/glite', - ant => '/usr', - jdk => '/usr', - libtar => '/usr', - axis => '/usr', - log4c => '/usr', - postgresql => '/usr', - activemq => '/opt/activemq-cpp-library', - apr => '/opt/apr', - aprutil => '/opt/apr-util' +my %externs = ( + cares => { + prefix => '/opt/c-ares', + pkg => 'libcares' + }, + classads => { + prefix=> '/usr', + pkg => 'classads' + }, + cppunit => { + prefix=> '/usr', + pkg => 'cppunit' + }, + expat => { + prefix=> '/usr', + pkg => 'expat' + }, + globus => { + prefix=> '/opt/globus', + pkg => 'globus-gssapi-gsi' + }, + 'myproxy-essentials' => { + prefix=> '/opt/globus', + pkg => 'myproxy' + }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, + gsoap => { + prefix=> '/usr', + pkg => 'gsoap' + }, + mysql => { + prefix=> '/usr' + }, + 'mysql-devel' => { + prefix=> '' + }, + 'mysql-server' => { + prefix => '' + }, + voms => { + prefix => '/opt/glite', + pkg => 'voms-1.0' + }, + gridsite => { + prefix => '/opt/glite' + }, + lcas => { + prefix => '/opt/glite' + }, + trustmanager => { + prefix => '/opt/glite' + }, + utiljava => { + prefix=> '/opt/glite' + }, + ant => { + prefix=> '/usr' + }, + jdk => { + prefix=> '/usr' + }, + libtar => { + prefix=> '/usr' + }, + axis => { + prefix=> '/usr' + }, + log4c => { + prefix=> '/usr' + }, + postgresql => { + prefix=> '/usr' + } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -91,14 +156,15 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger logger-msg server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/proxyrenewal/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], 'gridsite' => [ qw/apache shared commands core/ ], + 'px' => [ qw/proxyrenewal glite-PX myproxy-yaim myproxy-config/ ], ); @@ -106,8 +172,8 @@ my @opts = ( 'prefix=s' => \$prefix, 'staged=s' => \$staged, 'module=s' => \$module, - 'thrflavour=s' => \$thrflavour, - 'nothrflavour=s' => \$nothrflavour, + 'thrflavour:s' => \$thrflavour, + 'nothrflavour:s' => \$nothrflavour, 'mode=s' => \$mode, 'listmodules=s' => \$listmodules, 'version=s' => \$version, @@ -117,10 +183,10 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, + 'emi' => \$emi, ); for (@nodes) { @@ -131,20 +197,26 @@ for (@nodes) { push @opts,"enable-$_",\$enable_nodes{$_}; } -push @opts,"with-$_=s",\$extern_prefix{$_} for keys %extern_prefix; +push @opts,"with-$_=s",\$externs{$_}{withprefix} for keys %externs; push @opts,"with-$_=s",\$jar{$_} for keys %jar; my @keeparg = @ARGV; GetOptions @opts or die "Errors parsing command line\n"; -$extern_prefix{'mysql-devel'}=$extern_prefix{mysql} if $extern_prefix{'mysql-devel'} eq ''; -$extern_prefix{'mysql-server'}=$extern_prefix{mysql} if $extern_prefix{'mysql-server'} eq ''; +$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; +$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -164,7 +236,33 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; + +if ($mode eq 'build') { for my $ext (keys %externs) { + if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } + elsif (defined $externs{$ext}{pkg}) { + my ($prefix, $flag); + my $pkg = $externs{$ext}{pkg}; + my $flagname = uc $externs{$ext}{pkg}; + $flagname =~ s/-[0-9\.]*$//; + $flagname =~ s/-/_/g; + + print "Checking $pkg ... "; + `pkg-config "$pkg" --exists >/dev/null`; + if ($? == 0) { + $externs{$ext}{prefix}=`pkg-config $pkg --variable=prefix`; + chomp $externs{$ext}{prefix}; + print "$externs{$ext}{prefix}\n"; + + $flag=`pkg-config $pkg --cflags`; + $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag); + $flag=`pkg-config $pkg --libs`; + $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); + } else { + print "(using default $externs{$ext}{prefix})\n"; + } + } +} } if ($dis) { for (@nodes) { @@ -181,7 +279,7 @@ $stagedir = $prefix unless $stagedir; if ($mode eq 'build') { print "Writing config.status\n"; open CONF,">config.status" or die "config.status: $!\n"; - print CONF "$0 @keeparg\n"; + print CONF "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH} $0 @keeparg\n"; close CONF; } @@ -227,8 +325,9 @@ sub mode_build { @myjars = keys %aux; print "\nRequired externals:\n"; - print "\t$_: $extern_prefix{$_}\n" for @ext; + print "\t$_: $externs{$_}{prefix}\n" for @ext; print "\t$_: $jar{$_}\n" for @myjars; + for (@ext) { if (defined($externs{$_}{flags})) { print "$externs{$_}{flags}"; } }; print "\nThis is a poor-man configure, it's up to you to have sources and externals there\n\n"; mkinc($_) for @modules; @@ -295,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -343,7 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.proxyrenewal' => [ qw/voms globus:B myproxy/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -354,6 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], + 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -435,7 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.proxyrenewal' => [ qw// ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -467,6 +561,11 @@ for my $jar (keys %need_jars) { 'jp.ws-interface' => [ qw// ], 'gridsite.core' => [ qw/build.common-cpp:B/ ], + + 'px.proxyrenewal' => [ qw// ], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], + 'px.myproxy-config' => [], ); for my $ext (keys %deps_aux) { @@ -491,6 +590,9 @@ for my $ext (keys %deps_aux) { %obsoletes = ( 'lb.yaim' => [ qq/glite-yaim-lb/ ], + 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], + 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -501,7 +603,7 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', + 'px' => 'org.glite', ); %conf_prefix = ( @@ -510,7 +612,16 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', + 'px' => 'glite-', +); + +%emi_conf_prefix = ( + 'lb' => 'emi-', + 'jp' => 'emi-', + 'jobid' => 'emi-', + 'lbjp-common' => 'emi-', + 'gridsite' => '', + 'px' => 'emi-', ); my @k = keys %deps_aux; @@ -536,8 +647,9 @@ sub mkinc lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java -lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface +lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface +px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config /; @aux{@m} = (1) x ($#m+1); @@ -574,7 +686,8 @@ libdir = $libdir }; for (@{$need_externs{$short}}) { - print MKINC "${_}_prefix = $extern_prefix{$_}\n" + print MKINC "${_}_prefix = $externs{$_}{prefix}\n"; + print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags}; } for (@{$need_jars{$short}}) { @@ -589,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -615,10 +728,20 @@ BEGIN{ apr=>'apr-dev', aprutil=>'aprutil-dev', ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' + ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -666,30 +789,48 @@ sub mode_etics { for (@{$need_externs{"$subsys.$module"}}) { if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + if ($emi) { + if ($ge{$_} and not defined $externs{$_}{pkg}) { + push @copts, "--with-$_=\${stageDir}"; + } + } else { + push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + } } } for (@{$need_jars{"$subsys.$module"}}) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,"--with-$_ \${$eext.location}/usr/share/java/$_*.jar"; + push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (not $emi); } my $conf; my $conftag; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; + + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; + if ($branch) { - $conf = "$conf_prefix{$subsys}${subsys}-${module}_$branch"; + $conf = "$confprefix${subsys}-${module}_$branch"; $conftag = $branch; # forced low age number $age = $branch eq 'HEAD' ? '0head' : '0dev'; } else { - $conf = "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; + $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; # XXX: gridsite hack - $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : $conf; } + $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : + "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; } + if ($emi) { + $age = "${age}emi"; + } + my $file = $output ? $output : "$conf.ini"; open C,">$file" or die "$file: $!\n"; @@ -728,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -738,8 +885,13 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor} --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; $cmd{compile} = 'make'; $cmd{test} = 'make check'; $cmd{install} = 'make install'; @@ -751,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -800,8 +949,9 @@ $buildroot aprSuffix = 0 package.RPMSLocation = \${moduleDir}/RPMTMP/RPMS package.SRPMSLocation = \${moduleDir}/RPMTMP/SRPMS -$package_description$package_summary$defprops -}; +package.preserve.libtool = false +$package_description$package_summary$defprops}; + for (@{$obsoletes{"$subsys.$module"}}) { print C "package.obsoletes = $_\n"; print C "package.replaces = $_\n"; @@ -828,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -839,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -848,12 +1001,13 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS sub gsoap_version { local $_; my $gsoap_version; - open S,"$extern_prefix{gsoap}/bin/soapcpp2 -v 2>&1 |" or die "$extern_prefix{gsoap}/bin/soapcpp2: $!\n"; + open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n"; while ($_ = ) { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -910,7 +1064,7 @@ sub getlibdir { } sub usage { - my @ext = keys %extern_prefix; + my @ext = keys %externs; my @myjars, keys %jar; print STDERR qq{ @@ -925,6 +1079,7 @@ General options (defaults in []): --version=maj.min.rev-age specify version here instead of reading version.properties --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...) --libdir=libdir typically [lib,lib64] postfix + --emi generate configurations with emi flavor in mode 'etics' Mode of operation: --mode={checkout|build|etics} what to do [build] @@ -932,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.lb.logger/project/ChangeLog b/org.glite.lb.logger/project/ChangeLog index a320850..8567a31 100644 --- a/org.glite.lb.logger/project/ChangeLog +++ b/org.glite.lb.logger/project/ChangeLog @@ -98,3 +98,19 @@ 2.1.8-1 - Fixed propagation of error messages +2.1.9-1 +- Makefile adopts compilation and linking flags from the environment. + +2.1.10-1 +- Use pidfiles for checking status of daemons rather than port scanning. + +2.1.10-2 +- Module rebuilt + +2.1.11-1 +- Makefile a configuration updated to work across org.glite & EMI +- BDII status reporting fixed (ggus #62737) + +2.1.11-2 +- Module rebuilt + diff --git a/org.glite.lb.logger/project/version.properties b/org.glite.lb.logger/project/version.properties index a93955f..bace89d 100644 --- a/org.glite.lb.logger/project/version.properties +++ b/org.glite.lb.logger/project/version.properties @@ -1,3 +1,3 @@ # $Header$ -module.version=2.1.8 -module.age=1 +module.version=2.1.11 +module.age=2 diff --git a/org.glite.lb.logger/src/event_queue.c b/org.glite.lb.logger/src/event_queue.c index ccc0a9f..bd66fd5 100644 --- a/org.glite.lb.logger/src/event_queue.c +++ b/org.glite.lb.logger/src/event_queue.c @@ -495,7 +495,7 @@ event_queue_move_events(struct event_queue *eq_s, while(p) { if((*cmp_func)(p->msg, data)) { glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, - " moving event at offset %d(%d) from %s:%d to %s:%d", + " moving event at offset %ld(%d) from %s:%d to %s:%d", p->msg->offset, p->msg->generation, eq_s->dest_name, eq_s->dest_port, eq_d ? eq_d->dest_name : "trash", eq_d ? eq_d->dest_port : -1); /* il_log(LOG_DEBUG, " current: %x, next: %x\n", p, p->prev); */ diff --git a/org.glite.lb.logger/src/event_store.c b/org.glite.lb.logger/src/event_store.c index 98f7755..1813f35 100644 --- a/org.glite.lb.logger/src/event_store.c +++ b/org.glite.lb.logger/src/event_store.c @@ -649,9 +649,9 @@ event_store_recover(struct event_store *es) glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, " setting starting file position to %ld", last); glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, - " bytes sent to logging server: %d", es->last_committed_ls); + " bytes sent to logging server: %ld", es->last_committed_ls); glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, - " bytes sent to bookkeeping server: %d", es->last_committed_bs); + " bytes sent to bookkeeping server: %ld", es->last_committed_bs); if(last > 0) { int c; @@ -996,9 +996,9 @@ event_store_clean(struct event_store *es) glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, " trying to cleanup event store %s", es->job_id_s); glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, - " bytes sent to logging server: %d", es->last_committed_ls); + " bytes sent to logging server: %ld", es->last_committed_ls); glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, - " bytes sent to bookkeeping server: %d", es->last_committed_bs); + " bytes sent to bookkeeping server: %ld", es->last_committed_bs); /* preliminary check to avoid opening event file */ /* if the positions differ, some events still have to be sent */ @@ -1063,7 +1063,7 @@ event_store_clean(struct event_store *es) last = ftell(ef); glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, - " total bytes in file: %d", last); + " total bytes in file: %ld", last); if(es->last_committed_ls < last) { fclose(ef); diff --git a/org.glite.lb.logger/src/il_master.c b/org.glite.lb.logger/src/il_master.c index 16079d6..d99d0c1 100644 --- a/org.glite.lb.logger/src/il_master.c +++ b/org.glite.lb.logger/src/il_master.c @@ -334,7 +334,7 @@ handle_msg(il_octet_string_t *event, long offset) if((msg = server_msg_create(event, offset)) == NULL) { glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_WARN, " handle_msg: error parsing event '%s': %s", - event, error_get_msg()); + event->data, error_get_msg()); return(0); } diff --git a/org.glite.lb.logger/src/logd.c b/org.glite.lb.logger/src/logd.c index d2aaf76..e93c577 100644 --- a/org.glite.lb.logger/src/logd.c +++ b/org.glite.lb.logger/src/logd.c @@ -561,8 +561,7 @@ This is LocalLogger, part of Workload Management System in EU DataGrid & EGEE.\n if (childpid == 0) { ret = doit(client_fd,cred,prefix,noIPC,noParse); if (client_fd) close(client_fd); - glite_common_log(LOG_CATEGORY_CONTROL,LOG_PRIORITY_DEBUG,"Exiting.\n", - CONNECTION_TIMEOUT); + glite_common_log(LOG_CATEGORY_CONTROL,LOG_PRIORITY_DEBUG,"Exiting.\n"); exit(0); } if (childpid > 0) { diff --git a/org.glite.lb.logger/src/logd_proto.c b/org.glite.lb.logger/src/logd_proto.c index 3e766d6..9ef2793 100644 --- a/org.glite.lb.logger/src/logd_proto.c +++ b/org.glite.lb.logger/src/logd_proto.c @@ -97,7 +97,7 @@ static int handle_gss_failures(int code, edg_wll_GssStatus *gss_code, const char break; } default: - glite_common_log(LOG_CATEGORY_SECURITY,LOG_PRIORITY_ERROR,"%s: %s, unknown error occured\n"); + glite_common_log(LOG_CATEGORY_SECURITY,LOG_PRIORITY_ERROR,"%s: %s, unknown error occured\n", func, text); break; } return ret; @@ -381,7 +381,7 @@ int edg_wll_log_proto_server(edg_wll_GssConnection *con, struct timeval *timeout } } if (!unique) { - glite_common_log(LOG_CATEGORY_ACCESS,LOG_PRIORITY_ERROR,"Cannot determine the unique long local-logger id (LLLID)!\n",lllid); + glite_common_log(LOG_CATEGORY_ACCESS,LOG_PRIORITY_ERROR,"Cannot determine the unique long local-logger id (LLLID %ld)!\n",lllid); return EAGAIN; } glite_common_log(LOG_CATEGORY_ACCESS,LOG_PRIORITY_INFO,"Long local-logger id (LLLID): %ld ... [ok]\n",lllid); @@ -598,7 +598,7 @@ int edg_wll_log_proto_server(edg_wll_GssConnection *con, struct timeval *timeout goto edg_wll_log_proto_server_end_1; } else glite_common_log(LOG_CATEGORY_ACCESS,LOG_PRIORITY_DEBUG, "Sending via IPC (UNIX socket \"%s\")\n\t" - "the message position %ld (%d bytes)... [ok]", + "the message position %ld (%ld bytes)... [ok]", socket_path, filepos, sizeof(filepos)); if (event->any.priority & (EDG_WLL_LOGFLAG_SYNC|EDG_WLL_LOGFLAG_SYNC_COMPAT)) { diff --git a/org.glite.lb.logger/src/queue_thread.c b/org.glite.lb.logger/src/queue_thread.c index 0aa0f87..a8e4c4a 100644 --- a/org.glite.lb.logger/src/queue_thread.c +++ b/org.glite.lb.logger/src/queue_thread.c @@ -33,7 +33,7 @@ queue_thread_cleanup(void *q) pthread_t my_id = pthread_self(); int me; - glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_WARN, "thread %d exits", my_id); + glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_WARN, "thread %p exits", my_id); /* unlock all held locks */ /* FIXME: check that the thread always exits when holding these locks; diff --git a/org.glite.lb.logger/src/send_event.c b/org.glite.lb.logger/src/send_event.c index 979962c..1bb7e9b 100644 --- a/org.glite.lb.logger/src/send_event.c +++ b/org.glite.lb.logger/src/send_event.c @@ -301,7 +301,7 @@ event_queue_send(struct event_queue *eq, struct queue_thread *me) return(1); glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, - " trying to deliver event at offset %d for job %s", + " trying to deliver event at offset %ld for job %s", msg->offset, msg->job_id_s); #ifdef LB_PERF diff --git a/org.glite.lb.server/Makefile b/org.glite.lb.server/Makefile index 7a88202..c377a8a 100644 --- a/org.glite.lb.server/Makefile +++ b/org.glite.lb.server/Makefile @@ -9,8 +9,6 @@ PREFIX=/opt/glite # gridsite requires openssl libraries, we want to include the ones from globus globus_prefix=/opt/globus -nothrflavour=gcc32 -thrflavour=gcc32pthr expat_prefix=/opt/expat cares_prefix=/opt/c-ares gsoap_prefix=/opt/gsoap @@ -64,37 +62,74 @@ SUFFIXES = .T DEBUG:=-g -O0 -Wall -GRIDSITE_CFLAGS = -I${gridsite_prefix}/include `xml2-config --cflags` -GRIDSITE_LIBS = -L${gridsite_prefix}/${libdir} -L${gridsite_prefix}/lib -lgridsite_globus `xml2-config --libs` +ifeq (${thrflavour},) +default_flavour= +vomsflavour:= +else +default_flavour=_${nothrflavour} +vomsflavour:=_${nothrflavour} +ifeq (${nothrflavour},gcc32) + vomsflavour := +endif +ifeq (${nothrflavour},gcc32dbg) + vomsflavour := +endif +endif -LCAS_CFLAGS=-I${lcas_prefix}/include +GRIDSITE_CFLAGS?=-I${gridsite_prefix}/include `xml2-config --cflags` +GRIDSITE_LIBS?=-L${gridsite_prefix}/${libdir} -L${gridsite_prefix}/lib -lgridsite_globus `xml2-config --libs` + +LCAS_CFLAGS?=-I${lcas_prefix}/include -I${lcas_prefix}/include/glite/security +LCAS_LIBS?=-L${lcas_prefix}/${libdir} -llcas + +ifneq (${classads_prefix},/usr) + classads_libs := -L${classads_prefix}/${libdir} -L${classads_prefix}/lib +endif +CLASSADS_CFLAGS?=-I${classads_prefix}/include -I${classads_prefix}/include/classad +CLASSADS_LIBS?=${classads_libs} -lclassad + +ifneq (${cares_prefix},/usr) + cares_libs := -L${cares_prefix}/${libdir} -L${cares_prefix}/lib +endif +LIBCARES_CFLAGS?=-I${cares_prefix}/include +LIBCARES_LIBS?=${cares_libs} -lcares + +GSOAP_CFLAGS?=-I${gsoap_prefix}/include -I${gsoap_prefix}/ +EXPAT_CFLAGS?=-I${expat_prefix}/include +GLOBUS_GSSAPI_GSI_CFLAGS?=-I${globus_prefix}/include/${nothrflavour} + +CPPUNIT_LIBS?=-L${cppunit_prefix}/${libdir} -lcppunit +CPPUNIT_CFLAGS?=-I${cppunit_prefix}/include + +VOMS_CFLAGS?=-I${voms_prefix}/include -I${voms_prefix}/include/glite/security +VOMS_LIBS?=-L${voms_prefix}/${libdir} -lvomsapi${vomsflavour} CFLAGS:= ${CFLAGS} \ + ${GLOBUS_GSSAPI_GSI_CFLAGS} \ ${WS_CFLAGS} ${DEBUG} \ -DVERSION=\"${version}\" \ - -I${gsoap_prefix}/include -I${gsoap_prefix}/ \ + ${GSOAP_CFLAGS} \ -I${stagedir}/include -I${top_srcdir}/src -I. \ -I${top_srcdir}/interface \ - -I${expat_prefix}/include \ - -I${cares_prefix}/include \ - -I${classads_prefix}/include -I${classads_prefix}/include/classad \ - -I${voms_prefix}/include \ + ${EXPAT_CFLAGS} \ + ${LIBCARES_CFLAGS} \ + ${CLASSADS_CFLAGS} \ + ${VOMS_CFLAGS} \ ${COVERAGE_FLAGS} \ $(GRIDSITE_CFLAGS) ${LCAS_CFLAGS} \ - -D_GNU_SOURCE ${LB_STANDALONE_FLAGS} ${LB_PERF_FLAGS} -DLB_EVENTS_BLOB \ - -I${globus_prefix}/include/${nothrflavour} #gridsite needs this + -D_GNU_SOURCE ${LB_STANDALONE_FLAGS} ${LB_PERF_FLAGS} -DLB_EVENTS_BLOB CXXFLAGS:=${CFLAGS} ifdef LB_PROF SRVBONES_LIB:= ${stagedir}/${libdir}/libglite_lbu_server_bones.la - LB_COMMON_LIB:=${stagedir}/${libdir}/libglite_lb_common_${nothrflavour}.la + LB_COMMON_LIB:=${stagedir}/${libdir}/libglite_lb_common${default_flavour}.la LB_UTILS_DB_LIB:=${stagedir}/${libdir}/libglite_lbu_db.la CFLAGS:=${CFLAGS} -pg -g LDFLAGS:=${LDFLAGS} -pg else SRVBONES_LIB:= -L${stagedir}/${libdir} -lglite_lbu_server_bones - LB_COMMON_LIB:=-L${stagedir}/${libdir} -lglite_lb_common_${nothrflavour} + LB_COMMON_LIB:=-L${stagedir}/${libdir} -lglite_lb_common${default_flavour} LB_UTILS_DB_LIB:=-L${stagedir}/${libdir} -lglite_lbu_db LDFLAGS:=${LDFLAGS} -L${stagedir}/${libdir} endif @@ -106,64 +141,25 @@ ifdef LBS_DB_PROFILE CFLAGS:=${CFLAGS} -DLBS_DB_PROFILE endif -TEST_LIBS:=-L${cppunit_prefix}/${libdir} -lcppunit -TEST_INC:=-I${cppunit_prefix}/include - COMPILE:=libtool --mode=compile ${CC} ${CFLAGS} CXXCOMPILE:=libtool --mode=compile ${CXX} ${CXXFLAGS} LINK:=libtool --mode=link ${CC} -rpath ${stagedir}/${libdir} ${LDFLAGS} SOLINK:=libtool --mode=link ${CC} -module ${LDFLAGS} -rpath ${stagedir}/${libdir} -# XXX: not used? LINKXX:=libtool --mode=link ${CXX} ${LDFLAGS} INSTALL:=libtool --mode=install install LINKXX:=libtool --mode=link ${CXX} -rpath ${stagedir}/${libdir} ${LDFLAGS} XSLTPROC:=xsltproc --novalid -#ifeq ($(shell ls ${gsoap_prefix}/bin/soapcpp2),${gsoap_prefix}/bin/soapcpp2) -# gsoap_bin_prefix := ${gsoap_prefix}/bin -#else -# gsoap_bin_prefix := ${gsoap_prefix} -#endif - gsoap_bin_prefix:=${shell if [ -x ${gsoap_prefix}/bin/soapcpp2 ]; then echo ${gsoap_prefix}/bin; else echo ${gsoap_prefix}; fi } -ifneq (${expat_prefix},/usr) - expatlib := -L${expat_prefix}/${libdir} -L${expat_prefix}/lib -endif - -vomsflavour := _${nothrflavour} -ifeq (${nothrflavour},gcc32) - vomsflavour := -endif -ifeq (${nothrflavour},gcc32dbg) - vomsflavour := -endif -VOMS_LIBS:=-L${voms_prefix}/${libdir} -lvomsapi${vomsflavour} -LCAS_LIBS:=-L${lcas_prefix}/${libdir} -llcas - -#EXT_LIBS:= \ -# ${expatlib} -lexpat \ -# ${GRIDSITE_LIBS} \ -# -lvomsc${vomsflavour} \ - -ifneq (${classads_prefix},/usr) - CLASSADS_LIBS := -L${classads_prefix}/${libdir} -L${classads_prefix}/lib -endif -CLASSADS_LIBS := ${CLASSADS_LIBS} -lclassad - -ifneq (${cares_prefix},/usr) - CARES_LIBS := -L${cares_prefix}/${libdir} -L${cares_prefix}/lib -endif -CARES_LIBS := ${CARES_LIBS} -lcares - EXT_LIBS:= \ -lz \ ${GRIDSITE_LIBS} \ ${CLASSADS_LIBS} \ - ${CARES_LIBS} \ + ${LIBCARES_LIBS} \ ${LCAS_LIBS} \ ${VOMS_LIBS} -COMMON_LIBS:= -L${stagedir}/${libdir} -lglite_lb_common_${nothrflavour} -lglite_security_gss_${nothrflavour} -lglite_lbu_trio -lglite_lbu_maildir -lglite_lbu_log +COMMON_LIBS:= -L${stagedir}/${libdir} -lglite_lb_common${default_flavour} -lglite_security_gss${default_flavour} -lglite_lbu_trio -lglite_lbu_maildir -lglite_lbu_log BKSERVER_BASE_OBJS:= \ bkserverd.o il_lbproxy.o get_events.o index.o jobstat.o jobstat_supp.o \ @@ -177,10 +173,10 @@ BKSERVER_BASE_OBJS:= \ gsoap_version ?= ${gsoap_default_version} dotless_gsoap_ver:=${shell echo ${gsoap_version} | tr -d . } -ifeq ($(shell test -f ${stagedir}/${libdir}/libglite_security_gsoap_plugin_${dotless_gsoap_ver}_${nothrflavour}_c.so && echo ok),ok) +ifeq ($(shell test -f ${stagedir}/${libdir}/libglite_security_gsoap_plugin_${dotless_gsoap_ver}${default_flavour}_c.so && echo ok),ok) langflavour:=_c endif -GSOAP_LIB:=-L${stagedir}/${libdir} -lglite_security_gsoap_plugin_${dotless_gsoap_ver}_${nothrflavour}${langflavour} +GSOAP_LIB:=-L${stagedir}/${libdir} -lglite_security_gsoap_plugin_${dotless_gsoap_ver}${default_flavour}${langflavour} ifeq ($(GLITE_LB_SERVER_WITH_WS),yes) BKSERVER_OBJS:= \ @@ -206,7 +202,7 @@ else ${LB_COMMON_LIB} \ ${LB_MACHINE_LIB} \ ${LB_UTILS_DB_LIB} \ - -lglite_security_gss_${nothrflavour} \ + -lglite_security_gss${default_flavour} \ ${EXT_LIBS} \ ${classadslib} \ -lglite_lbu_maildir \ @@ -221,16 +217,8 @@ INDEX_OBJS:= index.o index_parse.o jobstat_supp.o openserver.o \ INDEX_LIBS:= ${SRVBONES_LIB} ${COMMON_LIBS} ${LB_MACHINE_LIB} ${EXT_LIBS} ${LB_UTILS_DB_LIB} WS_CLIENT_OBJS:= $(GSOAP_FILES_PREFIX)C.o $(GSOAP_FILES_PREFIX)Client.o ws_fault.o ws_typeref.o -WS_CLIENT_LIBS:= ${GSOAP_LIB} -lglite_lb_common_${nothrflavour} \ - -lglite_lb_common_${nothrflavour} - -# WS_CLIENT_LIBS:= -L${stagedir}/${libdir} \ -# -lglite_lb_client_${nothrflavour} \ -# -lglite_lb_common_${nothrflavour} \ -# -L${gsoap_prefix}/${libdir} -lgsoap \ -# -lglite_security_gsoap_plugin_${nothrflavour} \ -# ${EXT_LIBS} -# +WS_CLIENT_LIBS:= ${GSOAP_LIB} -lglite_lb_common${default_flavour} \ + -lglite_lb_common${default_flavour} HDRS=index.h lb_authz.h store.h @@ -299,8 +287,8 @@ test.xml: test_xml LD_LIBRARY_PATH=${cares_prefix}/${libdir}:${classads_prefix}/${libdir}:${LD_LIBRARY_PATH} ./test_xml test_xml: test_xml.cpp - ${CXX} -c ${CFLAGS} ${TEST_INC} $< - ${LINKXX} -o $@ test_xml.o lb_xml_parse.o ${LB_COMMON_LIB} ${TEST_LIBS} + ${CXX} -c ${CFLAGS} ${CPPUNIT_CFLAGS} $< + ${LINKXX} -o $@ test_xml.o lb_xml_parse.o ${LB_COMMON_LIB} ${CPPUNIT_LIBS} test.query: test_query_events # XXX coredumps ./test_query_events @@ -311,14 +299,14 @@ query_events_objs := test_query_events.o query.o get_events.o jobstat_supp.o ind test_query_events: ${query_events_objs} ${LINKXX} -o $@ ${query_events_objs} \ - ${TEST_LIBS} ${LB_COMMON_LIB} ${LB_MACHINE_LIB} ${classadslib} -lglite_lbu_log + ${CPPUNIT_LIBS} ${LB_COMMON_LIB} ${LB_MACHINE_LIB} ${classadslib} -lglite_lbu_log test.soapconv: test_soap_conv LD_LIBRARY_PATH=${cares_prefix}/${libdir}:${classads_prefix}/${libdir}:${LD_LIBRARY_PATH} ./test_soap_conv test_soap_conv: test_soap_conv.cpp ${WS_CLIENT_OBJS} - ${CXX} -c ${CFLAGS} ${TEST_INC} $< - ${LINKXX} -o $@ test_soap_conv.o ${WS_CLIENT_OBJS} ${WS_CLIENT_LIBS} ${TEST_LIBS} + ${CXX} -c ${CFLAGS} ${CPPUNIT_CFLAGS} $< + ${LINKXX} -o $@ test_soap_conv.o ${WS_CLIENT_OBJS} ${WS_CLIENT_LIBS} ${CPPUNIT_LIBS} examples: ${EXAMPLES} @@ -403,7 +391,7 @@ clean: ${CXXCOMPILE} -c $< test_query_events.o: %.o: %.cpp - ${CXX} -c ${CFLAGS} ${TEST_INC} $< + ${CXX} -c ${CFLAGS} ${CPPUNIT_CFLAGS} $< %.lo: %.c diff --git a/org.glite.lb.server/config/startup b/org.glite.lb.server/config/startup index d0a6ce9..a47cb8a 100755 --- a/org.glite.lb.server/config/startup +++ b/org.glite.lb.server/config/startup @@ -51,7 +51,7 @@ start_daemon() local cmd="$3" if [ -f "$pidfile" ]; then - if kill -0 `cat $pidfile`; then + if ps p `cat $pidfile` >/dev/null 2>&2; then return 0 fi echo -n "Warning: stalled $pidfile for $name" @@ -71,7 +71,7 @@ stop_daemon() echo -n Stopping $name \($pid\) ... kill $pid try=0 - while kill -0 $pid >/dev/null 2>&1; do + while ps p $pid >/dev/null 2>&1; do sleep 1; try=`expr $try + 1` if [ $try = 20 ]; then @@ -92,18 +92,24 @@ status_daemon() { local name="$1" local pidfile="$2" + local enabled="$3" if [ -f "$pidfile" ]; then pid=`cat "$pidfile"` - if kill -0 $pid >/dev/null 2>&1; then - echo $name running as $pid + if ps p $pid >/dev/null 2>&1; then + echo "$name running as $pid" else - echo $name not running + echo "$name not running (stalled pidfile)" return 1 fi else - echo $name not running - return 1 + if test -n "$enabled" -a x"$enabled" = x"0"; then + echo "$name not running (disabled)" + return 0 + else + echo "$name not running" + return 1 + fi fi return 0 @@ -256,14 +262,20 @@ stop() status() { retval=0 - - status_daemon "glite-lb-notif-interlogd" "$NOTIF_IL_PIDFILE" || retval=1 - status_daemon "glite-lb-interlogd for proxy" "$PROXY_IL_PIDFILE" || retval=1 - - status_daemon "glite-lb-bkserverd" "$BK_PIDFILE" || retval=1 - if test x"$GLITE_LB_EXPORT_ENABLED" = x"true"; then - status_daemon "glite-jp-importer" "$jp_importer_pidfile" || retval=1 - fi + proxy=0 + jp=0 + test x"$GLITE_LB_TYPE" = x"proxy" -o x"$GLITE_LB_TYPE" = x"both" \ + && proxy=1 + test x"$GLITE_LB_EXPORT_ENABLED" = x"true" && jp=1 + + status_daemon "glite-lb-notif-interlogd" "$NOTIF_IL_PIDFILE" \ + || retval=1 + status_daemon "glite-lb-interlogd for proxy" "$PROXY_IL_PIDFILE" \ + $proxy || retval=1 + status_daemon "glite-lb-bkserverd" "$BK_PIDFILE" \ + || retval=1 + status_daemon "glite-jp-importer" "$jp_importer_pidfile" $jp \ + || retval=1 return $retval } diff --git a/org.glite.lb.server/configure b/org.glite.lb.server/configure index 0d662fe..76e67f9 100755 --- a/org.glite.lb.server/configure +++ b/org.glite.lb.server/configure @@ -41,39 +41,104 @@ my $output; my $lb_tag = ''; my $lbjp_tag = ''; my $jp_tag = ''; -my $sec_tag = ''; my $jobid_tag = ''; my $libdir = getlibdir(); +my $projectname; + my @nodes = qw/client server logger logger-msg utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; my %enable_nodes; my %disable_nodes; -my %extern_prefix = ( - cares => '/opt/c-ares', - classads => '/opt/classads', - cppunit => '/usr', - expat => '/usr', - globus => '/opt/globus', - myproxy => '/opt/myproxy', - gsoap => '/usr', - mysql => '/usr', - 'mysql-devel' => '', - 'mysql-server' => '', - voms => '/opt/glite', - gridsite => '/opt/glite', - lcas => '/opt/glite', - trustmanager => '/opt/glite', - utiljava => '/opt/glite', - ant => '/usr', - jdk => '/usr', - libtar => '/usr', - axis => '/usr', - log4c => '/usr', - postgresql => '/usr', - activemq => '/opt/activemq-cpp-library', - apr => '/opt/apr', - aprutil => '/opt/apr-util' +my %externs = ( + cares => { + prefix => '/opt/c-ares', + pkg => 'libcares' + }, + classads => { + prefix=> '/usr', + pkg => 'classads' + }, + cppunit => { + prefix=> '/usr', + pkg => 'cppunit' + }, + expat => { + prefix=> '/usr', + pkg => 'expat' + }, + globus => { + prefix=> '/opt/globus', + pkg => 'globus-gssapi-gsi' + }, + 'myproxy-essentials' => { + prefix=> '/opt/globus', + pkg => 'myproxy' + }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, + gsoap => { + prefix=> '/usr', + pkg => 'gsoap' + }, + mysql => { + prefix=> '/usr' + }, + 'mysql-devel' => { + prefix=> '' + }, + 'mysql-server' => { + prefix => '' + }, + voms => { + prefix => '/opt/glite', + pkg => 'voms-1.0' + }, + gridsite => { + prefix => '/opt/glite' + }, + lcas => { + prefix => '/opt/glite' + }, + trustmanager => { + prefix => '/opt/glite' + }, + utiljava => { + prefix=> '/opt/glite' + }, + ant => { + prefix=> '/usr' + }, + jdk => { + prefix=> '/usr' + }, + libtar => { + prefix=> '/usr' + }, + axis => { + prefix=> '/usr' + }, + log4c => { + prefix=> '/usr' + }, + postgresql => { + prefix=> '/usr' + } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -91,14 +156,15 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger logger-msg server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/proxyrenewal/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], 'gridsite' => [ qw/apache shared commands core/ ], + 'px' => [ qw/proxyrenewal glite-PX myproxy-yaim myproxy-config/ ], ); @@ -106,8 +172,8 @@ my @opts = ( 'prefix=s' => \$prefix, 'staged=s' => \$staged, 'module=s' => \$module, - 'thrflavour=s' => \$thrflavour, - 'nothrflavour=s' => \$nothrflavour, + 'thrflavour:s' => \$thrflavour, + 'nothrflavour:s' => \$nothrflavour, 'mode=s' => \$mode, 'listmodules=s' => \$listmodules, 'version=s' => \$version, @@ -117,10 +183,10 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, + 'emi' => \$emi, ); for (@nodes) { @@ -131,20 +197,26 @@ for (@nodes) { push @opts,"enable-$_",\$enable_nodes{$_}; } -push @opts,"with-$_=s",\$extern_prefix{$_} for keys %extern_prefix; +push @opts,"with-$_=s",\$externs{$_}{withprefix} for keys %externs; push @opts,"with-$_=s",\$jar{$_} for keys %jar; my @keeparg = @ARGV; GetOptions @opts or die "Errors parsing command line\n"; -$extern_prefix{'mysql-devel'}=$extern_prefix{mysql} if $extern_prefix{'mysql-devel'} eq ''; -$extern_prefix{'mysql-server'}=$extern_prefix{mysql} if $extern_prefix{'mysql-server'} eq ''; +$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; +$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -164,7 +236,33 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; + +if ($mode eq 'build') { for my $ext (keys %externs) { + if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } + elsif (defined $externs{$ext}{pkg}) { + my ($prefix, $flag); + my $pkg = $externs{$ext}{pkg}; + my $flagname = uc $externs{$ext}{pkg}; + $flagname =~ s/-[0-9\.]*$//; + $flagname =~ s/-/_/g; + + print "Checking $pkg ... "; + `pkg-config "$pkg" --exists >/dev/null`; + if ($? == 0) { + $externs{$ext}{prefix}=`pkg-config $pkg --variable=prefix`; + chomp $externs{$ext}{prefix}; + print "$externs{$ext}{prefix}\n"; + + $flag=`pkg-config $pkg --cflags`; + $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag); + $flag=`pkg-config $pkg --libs`; + $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); + } else { + print "(using default $externs{$ext}{prefix})\n"; + } + } +} } if ($dis) { for (@nodes) { @@ -181,7 +279,7 @@ $stagedir = $prefix unless $stagedir; if ($mode eq 'build') { print "Writing config.status\n"; open CONF,">config.status" or die "config.status: $!\n"; - print CONF "$0 @keeparg\n"; + print CONF "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH} $0 @keeparg\n"; close CONF; } @@ -227,8 +325,9 @@ sub mode_build { @myjars = keys %aux; print "\nRequired externals:\n"; - print "\t$_: $extern_prefix{$_}\n" for @ext; + print "\t$_: $externs{$_}{prefix}\n" for @ext; print "\t$_: $jar{$_}\n" for @myjars; + for (@ext) { if (defined($externs{$_}{flags})) { print "$externs{$_}{flags}"; } }; print "\nThis is a poor-man configure, it's up to you to have sources and externals there\n\n"; mkinc($_) for @modules; @@ -295,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -343,7 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.proxyrenewal' => [ qw/voms globus:B myproxy/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -354,6 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], + 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -435,7 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.proxyrenewal' => [ qw// ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -467,6 +561,11 @@ for my $jar (keys %need_jars) { 'jp.ws-interface' => [ qw// ], 'gridsite.core' => [ qw/build.common-cpp:B/ ], + + 'px.proxyrenewal' => [ qw// ], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], + 'px.myproxy-config' => [], ); for my $ext (keys %deps_aux) { @@ -491,6 +590,9 @@ for my $ext (keys %deps_aux) { %obsoletes = ( 'lb.yaim' => [ qq/glite-yaim-lb/ ], + 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], + 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -501,7 +603,7 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', + 'px' => 'org.glite', ); %conf_prefix = ( @@ -510,7 +612,16 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', + 'px' => 'glite-', +); + +%emi_conf_prefix = ( + 'lb' => 'emi-', + 'jp' => 'emi-', + 'jobid' => 'emi-', + 'lbjp-common' => 'emi-', + 'gridsite' => '', + 'px' => 'emi-', ); my @k = keys %deps_aux; @@ -536,8 +647,9 @@ sub mkinc lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java -lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface +lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface +px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config /; @aux{@m} = (1) x ($#m+1); @@ -574,7 +686,8 @@ libdir = $libdir }; for (@{$need_externs{$short}}) { - print MKINC "${_}_prefix = $extern_prefix{$_}\n" + print MKINC "${_}_prefix = $externs{$_}{prefix}\n"; + print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags}; } for (@{$need_jars{$short}}) { @@ -589,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -615,10 +728,20 @@ BEGIN{ apr=>'apr-dev', aprutil=>'aprutil-dev', ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' + ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -666,30 +789,48 @@ sub mode_etics { for (@{$need_externs{"$subsys.$module"}}) { if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + if ($emi) { + if ($ge{$_} and not defined $externs{$_}{pkg}) { + push @copts, "--with-$_=\${stageDir}"; + } + } else { + push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + } } } for (@{$need_jars{"$subsys.$module"}}) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,"--with-$_ \${$eext.location}/usr/share/java/$_*.jar"; + push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (not $emi); } my $conf; my $conftag; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; + + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; + if ($branch) { - $conf = "$conf_prefix{$subsys}${subsys}-${module}_$branch"; + $conf = "$confprefix${subsys}-${module}_$branch"; $conftag = $branch; # forced low age number $age = $branch eq 'HEAD' ? '0head' : '0dev'; } else { - $conf = "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; + $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; # XXX: gridsite hack - $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : $conf; } + $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : + "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; } + if ($emi) { + $age = "${age}emi"; + } + my $file = $output ? $output : "$conf.ini"; open C,">$file" or die "$file: $!\n"; @@ -728,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -738,8 +885,13 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor} --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; $cmd{compile} = 'make'; $cmd{test} = 'make check'; $cmd{install} = 'make install'; @@ -751,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -800,8 +949,9 @@ $buildroot aprSuffix = 0 package.RPMSLocation = \${moduleDir}/RPMTMP/RPMS package.SRPMSLocation = \${moduleDir}/RPMTMP/SRPMS -$package_description$package_summary$defprops -}; +package.preserve.libtool = false +$package_description$package_summary$defprops}; + for (@{$obsoletes{"$subsys.$module"}}) { print C "package.obsoletes = $_\n"; print C "package.replaces = $_\n"; @@ -828,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -839,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -848,12 +1001,13 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS sub gsoap_version { local $_; my $gsoap_version; - open S,"$extern_prefix{gsoap}/bin/soapcpp2 -v 2>&1 |" or die "$extern_prefix{gsoap}/bin/soapcpp2: $!\n"; + open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n"; while ($_ = ) { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -910,7 +1064,7 @@ sub getlibdir { } sub usage { - my @ext = keys %extern_prefix; + my @ext = keys %externs; my @myjars, keys %jar; print STDERR qq{ @@ -925,6 +1079,7 @@ General options (defaults in []): --version=maj.min.rev-age specify version here instead of reading version.properties --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...) --libdir=libdir typically [lib,lib64] postfix + --emi generate configurations with emi flavor in mode 'etics' Mode of operation: --mode={checkout|build|etics} what to do [build] @@ -932,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.lb.server/interface/lb_authz.h b/org.glite.lb.server/interface/lb_authz.h index 9691526..9bd85e3 100644 --- a/org.glite.lb.server/interface/lb_authz.h +++ b/org.glite.lb.server/interface/lb_authz.h @@ -27,7 +27,7 @@ extern "C" { #ifndef NO_GACL #include #endif -#include +#include typedef struct _edg_wll_Acl { #ifndef NO_GACL diff --git a/org.glite.lb.server/project/ChangeLog b/org.glite.lb.server/project/ChangeLog index 2466f7a..0156e99 100644 --- a/org.glite.lb.server/project/ChangeLog +++ b/org.glite.lb.server/project/ChangeLog @@ -185,3 +185,23 @@ 2.1.10-1 - Fixed precedence in selecting IPv6/IPv4 +2.1.11-1 +- Makefile adopts compilation and linking flags from the environment. +- Memory handling fixes +- stateEnterTime initialization for collection jobs (fix for bug #71913). + +2.1.12-1 +- Fixed status reporting in the startup script +- General code polishing +- Fixes in statistics + +2.1.12-2 +- Module rebuilt + +2.1.13-1 +- Makefile, configuration and header includes updated to work across org.glite & EMI +- BDII status reporting fixed (ggus #62737) + +2.1.13-2 +- Module rebuilt + diff --git a/org.glite.lb.server/project/version.properties b/org.glite.lb.server/project/version.properties index 40504a9..65a5bd2 100644 --- a/org.glite.lb.server/project/version.properties +++ b/org.glite.lb.server/project/version.properties @@ -1,3 +1,3 @@ # : /cvs/jra1mw/org.glite.lb.server/project/version.properties,v 1.185 2008/06/25 13:12:58 akrenek Exp $ -module.version=2.1.10 -module.age=1 +module.version=2.1.13 +module.age=2 diff --git a/org.glite.lb.server/src/bkserverd.c b/org.glite.lb.server/src/bkserverd.c index 8360096..7b49fa6 100644 --- a/org.glite.lb.server/src/bkserverd.c +++ b/org.glite.lb.server/src/bkserverd.c @@ -414,10 +414,6 @@ int main(int argc, char *argv[]) name = strrchr(argv[0],'/'); if (name) name++; else name = argv[0]; - memset(host, 0, sizeof host); - edg_wll_gss_gethostname(host,sizeof host); - host[sizeof host - 1] = 0; - asprintf(&port, "%d", GLITE_JOBID_DEFAULT_PORT); #ifdef GLITE_LB_SERVER_WITH_WS asprintf(&ws_port, "%d", GLITE_JOBID_DEFAULT_PORT+3); @@ -434,6 +430,10 @@ int main(int argc, char *argv[]) exit(1); } + memset(host, 0, sizeof host); + edg_wll_gss_gethostname(host,sizeof host); + host[sizeof host - 1] = 0; + while ((opt = getopt_long(argc,argv,get_opt_string,opts,NULL)) != EOF) switch (opt) { case 'A': enable_lcas = 1; break; case 'a': fake_host = strdup(optarg); break; @@ -480,7 +480,7 @@ int main(int argc, char *argv[]) case 'i': strcpy(pidfile,optarg); pidfile_forced = 1; break; case 'R': add_root(ctx, optarg, ADMIN_ACCESS); break; case 'F': glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_FATAL, - "%s: Option --super-users-file is deprecated, specify policy using --policy instead"); + "%s: Option --super-users-file is deprecated, specify policy using --policy instead", argv[0]); return 1; case 'x': noIndex = atoi(optarg); if (noIndex < 0 || noIndex > 2) { usage(name); return 1; } @@ -1064,7 +1064,7 @@ int bk_handle_connection(int conn, struct timeval *timeout, void *data) edg_wll_gss_release_cred(&mycred, NULL); mycred = newcred; } else { - glite_common_log(LOG_CATEGORY_SECURITY, LOG_PRIORITY_WARN, "[%d] reloading credentials failed, using old ones"); + glite_common_log(LOG_CATEGORY_SECURITY, LOG_PRIORITY_WARN, "[%d] reloading credentials failed, using old ones", getpid()); } break; case -1: diff --git a/org.glite.lb.server/src/db_calls.c b/org.glite.lb.server/src/db_calls.c index 0f47539..fce548e 100644 --- a/org.glite.lb.server/src/db_calls.c +++ b/org.glite.lb.server/src/db_calls.c @@ -44,7 +44,7 @@ int edg_wll_jobMembership(edg_wll_Context ctx, glite_jobid_const_t job) dbjob = edg_wlc_JobIdGetUnique(job); trio_asprintf(&stmt,"select proxy,server from jobs where jobid = '%|Ss' for update",dbjob); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); ret = edg_wll_ExecSQL(ctx,stmt,&q); if (ret <= 0) { if (ret == 0) { @@ -93,7 +93,7 @@ int edg_wll_LockJobRow(edg_wll_Context ctx, const char *job, int lock_mode) else trio_asprintf(&stmt, "select * from jobs where jobid='%|Ss' lock in share mode", job); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if ((nr = edg_wll_ExecSQL(ctx,stmt,&sh)) < 0) goto cleanup; if (nr == 0) { char *err; diff --git a/org.glite.lb.server/src/dump.c b/org.glite.lb.server/src/dump.c index 34ae9e4..ff785bd 100644 --- a/org.glite.lb.server/src/dump.c +++ b/org.glite.lb.server/src/dump.c @@ -85,7 +85,7 @@ int edg_wll_DumpEventsServer(edg_wll_Context ctx,const edg_wll_DumpRequest *req, "order by arrived", ctx->srvName,ctx->srvPort, from_s,to_s); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&q) < 0) goto clean; diff --git a/org.glite.lb.server/src/get_events.c.T b/org.glite.lb.server/src/get_events.c.T index 3f51578..4ff6ca5 100644 --- a/org.glite.lb.server/src/get_events.c.T +++ b/org.glite.lb.server/src/get_events.c.T @@ -56,7 +56,7 @@ int edg_wll_get_event_flesh(edg_wll_Context ctx,int n,edg_wll_Event *e) edg_wll_ResetError(ctx); trio_asprintf(&q, "select ulm from events_flesh where jobid = '%|Ss' and event = %d", jobid, n); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if ((ret=edg_wll_ExecSQL(ctx,q,&sh)) < 0) goto cleanup; if (edg_wll_FetchRow(ctx,sh,1,NULL,&nameval[0]) == 1) { @@ -81,8 +81,8 @@ int edg_wll_get_event_flesh(edg_wll_Context ctx,int n,edg_wll_Event *e) trio_asprintf(&q,"select name,value from %s " "where jobid = '%|Ss' and event = %d ", tables[t],jobid,n); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, - q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, + LOG_PRIORITY_DEBUG, q); if ((ret=edg_wll_ExecSQL(ctx,q,&sh)) < 0) goto cleanup; diff --git a/org.glite.lb.server/src/jobstat.c b/org.glite.lb.server/src/jobstat.c index fa75a56..67fe561 100644 --- a/org.glite.lb.server/src/jobstat.c +++ b/org.glite.lb.server/src/jobstat.c @@ -210,7 +210,7 @@ int edg_wll_JobStatusServer( trio_asprintf(&stmt, "SELECT version,int_status,jobid FROM states WHERE parent_job='%|Ss'", md5_jobid); if (stmt != NULL) { - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); num_sub = edg_wll_ExecSQL(ctx, stmt, &sh); if (num_sub >=0 ) { i = 0; @@ -298,7 +298,7 @@ int edg_wll_JobStatusServer( // Get child states from the database trio_asprintf(&stmt, "SELECT version,status,jobid FROM states WHERE parent_job='%|Ss'", md5_jobid); if (stmt != NULL) { - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); num_sub = edg_wll_ExecSQL(ctx, stmt, &sh); if (num_sub >=0 ) { while ((num_f = edg_wll_FetchRow(ctx, sh, sizeof(out_stat)/sizeof(out_stat[0]), NULL, out_stat)) == 3 ) { @@ -379,7 +379,7 @@ int edg_wll_JobStatusServer( "WHERE s.parent_job='%|Ss' AND s.jobid=j.jobid", md5_jobid); if (stmt != NULL) { - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); num_sub = edg_wll_ExecSQL(ctx, stmt, &sh); if (num_sub >=0 ) { while ((num_f = edg_wll_FetchRow(ctx, sh, sizeof(out)/sizeof(out[0]), NULL, out)) == 1 ) { @@ -674,7 +674,7 @@ static char *job_owner(edg_wll_Context ctx,char *md5_jobid) edg_wll_SetError(ctx,ENOMEM, NULL); return NULL; } - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&sh) >= 0) { f=edg_wll_FetchRow(ctx,sh,1,NULL,&out); if (f == 0) { @@ -706,7 +706,7 @@ static edg_wll_ErrorCode get_job_parent(edg_wll_Context ctx, glite_jobid_const_t edg_wll_SetError(ctx,ENOMEM, NULL); goto err; } - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&sh) < 0) goto err; @@ -823,7 +823,7 @@ edg_wll_ErrorCode edg_wll_StoreIntState(edg_wll_Context ctx, "(jobid,seq,name,value) values " "('%|Ss',%d,'%|Ss','%|Ss')", jobid_md5, seq, (*tagp).tag, (*tagp).value); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) { @@ -857,7 +857,7 @@ edg_wll_ErrorCode edg_wll_StoreIntState(edg_wll_Context ctx, parent_md5, icvalues, jobid_md5); free(icvalues); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if ((dbret = edg_wll_ExecSQL(ctx,stmt,NULL)) < 0) goto cleanup; free(stmt); stmt = NULL; @@ -874,7 +874,7 @@ edg_wll_ErrorCode edg_wll_StoreIntState(edg_wll_Context ctx, INTSTAT_VERSION, parent_md5, icvalues); free(icnames); free(icvalues); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) goto cleanup; free(stmt); stmt = NULL; @@ -890,7 +890,7 @@ edg_wll_ErrorCode edg_wll_StoreIntState(edg_wll_Context ctx, if (update) { trio_asprintf(&stmt, "delete from status_tags " "where jobid ='%|Ss' and seq<%d", jobid_md5, seq); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) goto cleanup; free(stmt); stmt = NULL; @@ -921,7 +921,7 @@ edg_wll_ErrorCode edg_wll_StoreIntStateEmbryonic(edg_wll_Context ctx, ",parent_job%s) " "values (%s)", icnames, values); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) goto cleanup; @@ -971,7 +971,7 @@ edg_wll_ErrorCode edg_wll_LoadIntState(edg_wll_Context ctx, if (stmt == NULL) { return edg_wll_SetError(ctx, ENOMEM, NULL); } - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if ((nstates = edg_wll_ExecSQL(ctx,stmt,&sh)) < 0) goto cleanup; if (nstates == 0) { @@ -1338,7 +1338,7 @@ edg_wll_ErrorCode edg_wll_GetSubjobHistogram(edg_wll_Context ctx, glite_jobid_co if (stmt==NULL) { return edg_wll_SetError(ctx,ENOMEM, NULL); } - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&sh) >= 0) { f=edg_wll_FetchRow(ctx,sh,1,NULL,&out); @@ -1390,7 +1390,7 @@ edg_wll_ErrorCode edg_wll_StoreSubjobHistogram(edg_wll_Context ctx, glite_jobid_ } //printf ("\n\n\n Would like to run SQL statament: %s\n\n\n\n", stmt); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if ((dbret = edg_wll_ExecSQL(ctx,stmt,NULL)) < 0) goto cleanup; diff --git a/org.glite.lb.server/src/lb_authz.c b/org.glite.lb.server/src/lb_authz.c index 88e1605..6a786e0 100644 --- a/org.glite.lb.server/src/lb_authz.c +++ b/org.glite.lb.server/src/lb_authz.c @@ -21,8 +21,9 @@ limitations under the License. #include #include -#include -#include "glite/security/voms/voms_apic.h" +#include +#include "lcas/lcas_pem.h" +#include "voms/voms_apic.h" #include "glite/lb/context-int.h" #include "lb_authz.h" #include "glite/lbu/log.h" @@ -665,7 +666,7 @@ edg_wll_HandleCounterACL(edg_wll_Context ctx, edg_wll_Acl acl, for ( ; ; ) { - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q1); if ( edg_wll_ExecSQL(ctx, q1, NULL) > 0 ) goto end; @@ -681,7 +682,7 @@ edg_wll_HandleCounterACL(edg_wll_Context ctx, edg_wll_Acl acl, "update acls set refcnt = refcnt+%d " "where aclid = '%|Ss'", incr, aclid); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q2); if ( edg_wll_ExecSQL(ctx, q2, NULL) < 0 ) continue; @@ -696,7 +697,7 @@ edg_wll_HandleCounterACL(edg_wll_Context ctx, edg_wll_Acl acl, "where aclid='%|Ss' and refcnt>=%d", -incr, aclid, -incr); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q1); if ( edg_wll_ExecSQL(ctx, q1, NULL) > 0 ) { @@ -704,7 +705,7 @@ edg_wll_HandleCounterACL(edg_wll_Context ctx, edg_wll_Acl acl, "delete from acls " "where aclid='%|Ss' and refcnt=0", aclid); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q2); edg_wll_ExecSQL(ctx, q2, NULL); } @@ -786,7 +787,7 @@ edg_wll_UpdateACL(edg_wll_Context ctx, glite_jobid_const_t job, trio_asprintf(&stmt, "update jobs set aclid='%|Ss' where jobid='%|Ss' and ISNULL(aclid)", new_aclid, md5_jobid); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); updated = edg_wll_ExecSQL(ctx, stmt, NULL); free(stmt); stmt = NULL; @@ -832,7 +833,7 @@ int edg_wll_GetACL(edg_wll_Context ctx, glite_jobid_const_t jobid, edg_wll_Acl * trio_asprintf(&q, "select aclid from jobs where jobid = '%|Ss'", jobstr); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if (edg_wll_ExecSQL(ctx, q, &stmt) < 0 || edg_wll_FetchRow(ctx, stmt, 1, NULL, &acl_id) < 0) { @@ -850,7 +851,7 @@ int edg_wll_GetACL(edg_wll_Context ctx, glite_jobid_const_t jobid, edg_wll_Acl * trio_asprintf(&q, "select value from acls where aclid = '%|Ss'", acl_id); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if (edg_wll_ExecSQL(ctx, q, &stmt) < 0 || edg_wll_FetchRow(ctx, stmt, 1, NULL, &acl_str) < 0) { diff --git a/org.glite.lb.server/src/lb_proto.c b/org.glite.lb.server/src/lb_proto.c index 3116d8d..4519b06 100644 --- a/org.glite.lb.server/src/lb_proto.c +++ b/org.glite.lb.server/src/lb_proto.c @@ -231,7 +231,7 @@ static int getUserNotifications(edg_wll_Context ctx, char *user, char ***notifid "from notif_registrations " "where userid='%s'", user); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if (edg_wll_ExecSQL(ctx, q, ¬ifs) < 0) goto err; free(q); q = NULL; @@ -263,7 +263,7 @@ static int getNotifInfo(edg_wll_Context ctx, char *notifId, notifInfo *ni){ "from notif_registrations " "where notifid='%s'", notifId); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if (edg_wll_ExecSQL(ctx, q, ¬if) < 0) goto err; free(q); q = NULL; diff --git a/org.glite.lb.server/src/lcas_lb.c b/org.glite.lb.server/src/lcas_lb.c index 16e63da..9101d30 100644 --- a/org.glite.lb.server/src/lcas_lb.c +++ b/org.glite.lb.server/src/lcas_lb.c @@ -22,9 +22,9 @@ limitations under the License. #include #include -#include -#include -#include +#include "lcas/lcas_modules.h" +#include "lcas/lcas_utils.h" +#include "voms/voms_apic.h" #include #include "authz_policy.h" #include "lb_authz.h" diff --git a/org.glite.lb.server/src/load.c b/org.glite.lb.server/src/load.c index e1d5ca1..19ad4e5 100644 --- a/org.glite.lb.server/src/load.c +++ b/org.glite.lb.server/src/load.c @@ -87,7 +87,7 @@ int edg_wll_LoadEventsServer(edg_wll_Context ctx,const edg_wll_LoadRequest *req, sprintf(errs, "Error parsing event at line %d", i); if ( !edg_wll_Error(ctx,NULL,NULL) ) edg_wll_SetError(ctx, EINVAL, errs); - fprintf(stderr, errs); + fprintf(stderr, "%s", errs); continue; } edg_wll_ULMDateToTimeval(buff, &(event->any.arrived)); diff --git a/org.glite.lb.server/src/notif_match.c b/org.glite.lb.server/src/notif_match.c index 762e206..3afeafb 100644 --- a/org.glite.lb.server/src/notif_match.c +++ b/org.glite.lb.server/src/notif_match.c @@ -106,7 +106,7 @@ int edg_wll_NotifMatch(edg_wll_Context ctx, const edg_wll_JobStat *oldstat, cons ju = edg_wlc_JobIdGetUnique(stat->jobId),NOTIF_ALL_JOBS,cond_where ? cond_where : "",cond_and_where ? cond_and_where : ""); free(ju); ju = NULL; - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, jobq); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, jobq); if (edg_wll_ExecSQL(ctx,jobq,&jobs) < 0) goto err; @@ -159,8 +159,8 @@ int edg_wll_NotifExpired(edg_wll_Context ctx,const char *notif) trio_asprintf(&dn,"delete from notif_registrations where notifid='%|Ss'",notif); trio_asprintf(&dj,"delete from notif_jobs where notifid='%|Ss'",notif); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, dn); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, dj); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, dn); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, dj); if (edg_wll_ExecSQL(ctx,dn,NULL) < 0 || edg_wll_ExecSQL(ctx,dj,NULL) < 0) diff --git a/org.glite.lb.server/src/notification.c b/org.glite.lb.server/src/notification.c index c64b401..fb7b813 100644 --- a/org.glite.lb.server/src/notification.c +++ b/org.glite.lb.server/src/notification.c @@ -121,7 +121,7 @@ int edg_wll_NotifNewServer( if ( !(aux = strrchr(address_override, ':')) ) { - edg_wll_SetError(ctx, EINVAL, "Addres overrirde not in format host:port"); + edg_wll_SetError(ctx, EINVAL, "Addres override not in format host:port"); goto cleanup; } if ( !strncmp(address_override, "0.0.0.0", aux-address_override) || @@ -140,7 +140,7 @@ int edg_wll_NotifNewServer( "values ('%|Ss','%|Ss',%s,'%|Ss', '%|Ss', '%d')", nid_s, addr_s? addr_s: address_override, time_s, owner, xml_conds, flags); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if ( edg_wll_ExecSQL(ctx, q, NULL) < 0 ) goto rollback; @@ -156,7 +156,7 @@ int edg_wll_NotifNewServer( trio_asprintf(&q, "insert into notif_jobs(notifid,jobid) values ('%|Ss','%|Ss')", nid_s, jobs[i]); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if ( edg_wll_ExecSQL(ctx, q, NULL) < 0 ) goto rollback; @@ -164,7 +164,7 @@ int edg_wll_NotifNewServer( else { trio_asprintf(&q,"insert into notif_jobs(notifid,jobid) values ('%|Ss','%|Ss')", nid_s,NOTIF_ALL_JOBS); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if ( edg_wll_ExecSQL(ctx, q, NULL) < 0 ) goto rollback; @@ -245,7 +245,7 @@ int edg_wll_NotifBindServer( if ( !(aux = strrchr(address_override, ':')) ) { - edg_wll_SetError(ctx, EINVAL, "Addres overrirde not in format host:port"); + edg_wll_SetError(ctx, EINVAL, "Addres override not in format host:port"); goto rollback; } if ( !strncmp(address_override, "0.0.0.0", aux-address_override) || @@ -330,7 +330,7 @@ int edg_wll_NotifChangeServer( /* Format DB insert statement */ trio_asprintf(&q, "delete from notif_jobs where notifid='%|Ss'", nid_s); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if ( edg_wll_ExecSQL(ctx, q, NULL) < 0 ) goto rollback; @@ -341,7 +341,7 @@ int edg_wll_NotifChangeServer( trio_asprintf(&q, "insert into notif_jobs(notifid,jobid) values ('%|Ss','%|Ss')", nid_s, jobs[i]); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if ( edg_wll_ExecSQL(ctx, q, NULL) < 0 ) { /* XXX: Remove uncoplete registration? @@ -349,11 +349,11 @@ int edg_wll_NotifChangeServer( */ free(q); trio_asprintf(&q, "delete from notif_jobs where notifid='%|Ss'", nid_s); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); edg_wll_ExecSQL(ctx, q, NULL); free(q); trio_asprintf(&q,"delete from notif_registrations where notifid='%|Ss'", nid_s); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); edg_wll_ExecSQL(ctx, q, NULL); goto rollback; } @@ -467,7 +467,7 @@ static char *get_user(edg_wll_Context ctx, int create) } can_peername = edg_wll_gss_normalize_subj(ctx->peerName, 0); trio_asprintf(&q, "select userid from users where cert_subj='%|Ss'", can_peername); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if ( edg_wll_ExecSQL(ctx, q, &stmt) < 0 ) goto cleanup; @@ -487,7 +487,7 @@ static char *get_user(edg_wll_Context ctx, int create) free(q); trio_asprintf(&q, "insert into users(userid,cert_subj) values ('%|Ss','%|Ss')", userid, can_peername); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if ( edg_wll_ExecSQL(ctx, q, NULL) < 0 ) { if ( edg_wll_Error(ctx,NULL,NULL) != EEXIST ) @@ -536,7 +536,7 @@ static int check_notif_request( "select destination from notif_registrations " "where notifid='%|Ss' and userid='%|Ss' FOR UPDATE", nid_s, user); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if ( (ret = edg_wll_ExecSQL(ctx, stmt, &s)) < 0 ) goto cleanup; @@ -545,7 +545,7 @@ static int check_notif_request( free(stmt); trio_asprintf(&stmt, "select notifid from notif_registrations where notifid='%|Ss'", nid_s); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); ret = edg_wll_ExecSQL(ctx, stmt, NULL); if ( ret == 0 ) @@ -691,7 +691,7 @@ static int update_notif( trio_asprintf(&aux, "%s where notifid='%|Ss'", stmt, nid_s); free(stmt); stmt = aux; - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if ( (ret = edg_wll_ExecSQL(ctx, stmt, NULL)) < 0 ) goto cleanup; @@ -700,7 +700,7 @@ static int update_notif( free(stmt); trio_asprintf(&stmt, "select notifid from notif_registrations where notifid='%|Ss'", nid_s); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); ret = edg_wll_ExecSQL(ctx, stmt, NULL); if ( ret == 0 ) edg_wll_SetError(ctx, ENOENT, "Unknown notification ID"); @@ -811,12 +811,12 @@ static int drop_notif_request(edg_wll_Context ctx, const edg_wll_NotifId nid) { goto rollback; trio_asprintf(&stmt, "delete from notif_registrations where notifid='%|Ss'", nid_s); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if ( edg_wll_ExecSQL(ctx, stmt, NULL) < 0 ) goto rollback; free(stmt); trio_asprintf(&stmt, "delete from notif_jobs where notifid='%|Ss'", nid_s); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if ( edg_wll_ExecSQL(ctx, stmt, NULL) < 0 ) goto rollback; edg_wll_NotifCancelRegId(ctx, nid); @@ -862,7 +862,7 @@ static int check_notif_age(edg_wll_Context ctx, const edg_wll_NotifId nid) { } trio_asprintf(&q, "select notifid from notif_registrations WHERE notifid='%|Ss' AND valid < %s", nid_s, time_s); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if ( (ret = edg_wll_ExecSQL(ctx, q, NULL)) < 0 ) goto cleanup; diff --git a/org.glite.lb.server/src/query.c b/org.glite.lb.server/src/query.c index 132e9f4..648bfea 100644 --- a/org.glite.lb.server/src/query.c +++ b/org.glite.lb.server/src/query.c @@ -161,7 +161,7 @@ int edg_wll_QueryEventsServer( else if ( !q ) q = qbase; - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); ret = edg_wll_ExecSQL(ctx, q, &sh); if ( limit ) @@ -512,7 +512,7 @@ int edg_wll_QueryJobsServerStream( else if ( !q ) q = qbase; - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); ret = edg_wll_ExecSQL(ctx, q, &sh); if ( limit ) @@ -649,7 +649,7 @@ limit_cycle_cleanup: "(s.suffix_id = j.suffix_id) AND (p.prefix_id = j.prefix_id)) AS result " "WHERE %s", zomb_where); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, zquery); j = edg_wll_ExecSQL(ctx,zquery,&sh); diff --git a/org.glite.lb.server/src/seqcode.c b/org.glite.lb.server/src/seqcode.c index 0ef16d6..d5d0c1a 100644 --- a/org.glite.lb.server/src/seqcode.c +++ b/org.glite.lb.server/src/seqcode.c @@ -54,7 +54,7 @@ int edg_wll_QuerySequenceCodeServer(edg_wll_Context ctx, edg_wlc_JobId jobid, co if ( stmt == NULL ) return edg_wll_SetError(ctx, ENOMEM, NULL); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if ( (nstates = edg_wll_ExecSQL(ctx, stmt, &sh)) < 0 ) goto cleanup; if ( nstates == 0 ) { diff --git a/org.glite.lb.server/src/server_state.c b/org.glite.lb.server/src/server_state.c index d61007d..a95610e 100644 --- a/org.glite.lb.server/src/server_state.c +++ b/org.glite.lb.server/src/server_state.c @@ -35,7 +35,7 @@ int edg_wll_GetServerState(edg_wll_Context ctx,const char *name,char **val) trio_asprintf(&stmt,"select value from server_state " "where prefix = 'https://%|Ss:%d' and name = '%|Ss'", ctx->srvName,ctx->srvPort,name); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); switch (edg_wll_ExecSQL(ctx,stmt,&q)) { case 0: edg_wll_SetError(ctx,ENOENT,name); break; @@ -55,7 +55,7 @@ int edg_wll_SetServerState(edg_wll_Context ctx,const char *name,const char *val) trio_asprintf(&stmt,"insert into server_state (prefix,name,value) " "values ('https://%|Ss:%d','%|Ss','%|Ss')", ctx->srvName,ctx->srvPort,name,val); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); switch(edg_wll_ExecSQL(ctx,stmt,NULL)) { case 1: break; @@ -65,7 +65,7 @@ int edg_wll_SetServerState(edg_wll_Context ctx,const char *name,const char *val) "where prefix = 'https://%|Ss:%d' " "and name = '%|Ss'", val,ctx->srvName,ctx->srvPort,name); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); edg_wll_ExecSQL(ctx,stmt,NULL); } diff --git a/org.glite.lb.server/src/srv_purge.c b/org.glite.lb.server/src/srv_purge.c index bbc2de7..ee917e5 100644 --- a/org.glite.lb.server/src/srv_purge.c +++ b/org.glite.lb.server/src/srv_purge.c @@ -250,6 +250,7 @@ int edg_wll_PurgeServer(edg_wll_Context ctx,const edg_wll_PurgeRequest *request, purge_ctx_t prg; struct _edg_wll_GssPrincipal_data princ; + memset(&princ, 0, sizeof princ); princ.name = ctx->peerName; princ.fqans = ctx->fqans; @@ -795,17 +796,17 @@ int purge_one(edg_wll_Context ctx,edg_wll_JobStat *stat,int dump, int purge, int if ( purge ) { trio_asprintf(&stmt,"delete from jobs where jobid = '%|Ss'",dbjob); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) goto rollback; free(stmt); stmt = NULL; trio_asprintf(&stmt,"delete from states where jobid = '%|Ss'",dbjob); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) goto rollback; free(stmt); stmt = NULL; trio_asprintf(&stmt,"delete from status_tags where jobid = '%|Ss'",dbjob); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) goto rollback; free(stmt); stmt = NULL; } @@ -816,7 +817,7 @@ int purge_one(edg_wll_Context ctx,edg_wll_JobStat *stat,int dump, int purge, int // See if that prefix is already stored in the database trio_asprintf(&stmt,"select prefix_id from zombie_prefixes where prefix = '%|Ss'", prefix); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); sql_retval = edg_wll_ExecSQL(ctx,stmt,&q); free(stmt); stmt = NULL; @@ -827,7 +828,7 @@ int purge_one(edg_wll_Context ctx,edg_wll_JobStat *stat,int dump, int purge, int glite_lbu_FreeStmt(&q); trio_asprintf(&stmt,"insert into zombie_prefixes (prefix) VALUES ('%|Ss')", prefix); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&q) <= 0) goto rollback; @@ -836,7 +837,7 @@ int purge_one(edg_wll_Context ctx,edg_wll_JobStat *stat,int dump, int purge, int // The record should exist now, however we need to look up the prefix_id trio_asprintf(&stmt,"select prefix_id from zombie_prefixes where prefix = '%|Ss'", prefix); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&q) <= 0) goto rollback; free(stmt); stmt = NULL; @@ -849,7 +850,7 @@ int purge_one(edg_wll_Context ctx,edg_wll_JobStat *stat,int dump, int purge, int // See if that suffix is already stored in the database trio_asprintf(&stmt,"select suffix_id from zombie_suffixes where suffix = '%|Ss'", suffix); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); sql_retval = edg_wll_ExecSQL(ctx,stmt,&q); free(stmt); stmt = NULL; @@ -860,7 +861,7 @@ int purge_one(edg_wll_Context ctx,edg_wll_JobStat *stat,int dump, int purge, int glite_lbu_FreeStmt(&q); trio_asprintf(&stmt,"insert into zombie_suffixes (suffix) VALUES ('%|Ss')", suffix); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&q) <= 0) goto rollback; @@ -869,7 +870,7 @@ int purge_one(edg_wll_Context ctx,edg_wll_JobStat *stat,int dump, int purge, int // The record should exist now, however we need to look up the suffix_id trio_asprintf(&stmt,"select suffix_id from zombie_suffixes where suffix = '%|Ss'", suffix); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&q) <= 0) goto rollback; free(stmt); stmt = NULL; @@ -882,7 +883,7 @@ int purge_one(edg_wll_Context ctx,edg_wll_JobStat *stat,int dump, int purge, int trio_asprintf(&stmt,"insert into zombie_jobs (jobid, prefix_id, suffix_id)" " VALUES ('%|Ss', '%|Ss', '%|Ss')", root, prefix_id, suffix_id); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&q) < 0) { if (edg_wll_Error(ctx, NULL, NULL) == EEXIST) { @@ -926,7 +927,7 @@ int purge_one(edg_wll_Context ctx,edg_wll_JobStat *stat,int dump, int purge, int "where jobid='%|Ss' " "order by event", dbjob); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&q) < 0) goto rollback; free(stmt); stmt = NULL; @@ -980,7 +981,7 @@ int unset_proxy_flag(edg_wll_Context ctx, glite_jobid_const_t job) dbjob = glite_jobid_getUnique(job); trio_asprintf(&stmt,"update jobs set proxy='0' where jobid='%|Ss'", dbjob); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); free(dbjob); return(edg_wll_ExecSQL(ctx,stmt,NULL)); @@ -996,7 +997,7 @@ int unset_server_flag(edg_wll_Context ctx, glite_jobid_const_t job) dbjob = glite_jobid_getUnique(job); trio_asprintf(&stmt,"update jobs set server='0' where jobid='%|Ss'", dbjob); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); free(dbjob); return(edg_wll_ExecSQL(ctx,stmt,NULL)); diff --git a/org.glite.lb.server/src/stats.c b/org.glite.lb.server/src/stats.c index 34f4e05..6c4ac4a 100644 --- a/org.glite.lb.server/src/stats.c +++ b/org.glite.lb.server/src/stats.c @@ -49,6 +49,7 @@ static struct _edg_wll_StatsArchive default_archives[] = { { 10, 60 }, { 60, 30 }, { 900, 12 }, + { 3600, 168 }, { 0, 0 } }; @@ -68,6 +69,7 @@ static edg_wll_Stats default_stats[] = { { STATS_DURATION_FROMTO, default_group, EDG_WLL_JOB_SUBMITTED, EDG_WLL_JOB_RUNNING, 0, default_archives }, { STATS_DURATION_FROMTO, default_group, EDG_WLL_JOB_SUBMITTED, EDG_WLL_JOB_DONE, EDG_WLL_STAT_OK, default_archives }, { STATS_DURATION_FROMTO, default_group, EDG_WLL_JOB_SUBMITTED, EDG_WLL_JOB_DONE, EDG_WLL_STAT_FAILED, default_archives }, + { STATS_DURATION_FROMTO, default_group, EDG_WLL_JOB_SCHEDULED, EDG_WLL_JOB_RUNNING, 0, default_archives }, { STATS_DURATION_FROMTO, default_group, EDG_WLL_JOB_RUNNING, EDG_WLL_JOB_DONE, EDG_WLL_STAT_OK, default_archives }, { STATS_DURATION_FROMTO, default_group, EDG_WLL_JOB_RUNNING, EDG_WLL_JOB_DONE, EDG_WLL_STAT_FAILED, default_archives }, { STATS_UNDEF, } @@ -190,7 +192,7 @@ static int stats_double_htable(edg_wll_Stats *stats){ ((char *) stats->map) + stats->grpsize * i ); search.key = strdup(g->sig); - search.data = (void*)g; + search.data = (void*)((long)i); if (! hsearch_r(search, ENTER, &found, stats->htab)){ glite_common_log(LOG_CATEGORY_LB_SERVER, LOG_PRIORITY_WARN, @@ -241,7 +243,7 @@ static int stats_remap(edg_wll_Stats *stats) g = (struct edg_wll_stats_group *) ( ((char *) stats->map) + stats->grpsize * i ); search.key = strdup(g->sig); - search.data = (void*)g; + search.data = (void*)((long)i); if (!hsearch_r(search, ENTER, &found, stats->htab)){ /* This should never happen */ glite_common_log(LOG_CATEGORY_LB_SERVER, @@ -268,7 +270,8 @@ static void stats_search_existing_group(edg_wll_Stats *stats, struct edg_wll_sta search.key = sig; hsearch_r(search, FIND, &found, stats->htab); if (found && strcmp(sig, found->key) == 0) - *g = (struct edg_wll_stats_group*)found->data; + *g = (struct edg_wll_stats_group *) ( + ((char *) stats->map) + stats->grpsize * (long)found->data); else *g = NULL; } @@ -291,6 +294,7 @@ static int stats_search_group(edg_wll_Context ctx, const edg_wll_JobStat *jobsta struct edg_wll_stats_archive *a; ENTRY search, *found; + //asprintf(&(jobstat->destination), "fake destination %i", rand()%10); sig = str2md5base64(jobstat->destination); stats_search_existing_group(stats, g, sig); @@ -337,7 +341,7 @@ static int stats_search_group(edg_wll_Context ctx, const edg_wll_JobStat *jobsta stats_double_htable(stats); if (stats->htab){ search.key = strdup(sig); - search.data = (void*)(*g); + search.data = (void*)((long)(stats->grpno-1)); if (!hsearch_r(search, ENTER, &found, stats->htab)){ /* This should never happen */ glite_common_log(LOG_CATEGORY_LB_SERVER, @@ -486,7 +490,7 @@ static int stats_record_duration_fromto( time_t base = to->stateEnterTimes[stats->base_state+1]; time_t final = to->stateEnterTimes[stats->final_state+1]; time_t timedif = final-base; - if (base && final){ /* final should be always not null*/ + if (base && final && (final > base)){ /* final should be always not null*/ a = g->archive; for (i=0; stats->archives[i].interval; i++) { @@ -664,6 +668,8 @@ static int stateRateRequest( glite_common_log(LOG_CATEGORY_LB_SERVER, LOG_PRIORITY_DEBUG, "search %ld in %ld, %ld", *from, afrom, afrom+i); + diff = 0.0f; + // (from, to) is inside (afrom, afrom+i) if (*from >= afrom && *to < afrom+i) { diff = *to - *from; @@ -684,7 +690,7 @@ static int stateRateRequest( *rate += c->cnt * (float)diff/i; if (*to >= afrom && *to < afrom+i) { - glite_common_log(LOG_CATEGORY_LB_SERVER, LOG_PRIORITY_DEBUG, "matched to: match %d, rate %f", match, *rate); + glite_common_log(LOG_CATEGORY_LB_SERVER, LOG_PRIORITY_DEBUG, "matched to: match %ld, rate %f", match, *rate); break; } } @@ -711,7 +717,7 @@ int edg_wll_StateRateServer( { edg_wll_Stats *stats = default_stats; /* XXX: hardcoded */ struct edg_wll_stats_group *g; - int i; + int i, shift; char *sig = NULL; int err; @@ -753,8 +759,8 @@ int edg_wll_StateRateServer( } if ((err = stateRateRequest(ctx, stats, g, from, to, &((*rates)[0]), res_from, res_to))){ - free(*rates); - free(*groups); + free(*rates); *rates = NULL; + free(*groups); *groups = NULL; goto cleanup; } (*groups)[0] = strdup(g->destination); @@ -763,21 +769,27 @@ int edg_wll_StateRateServer( /* all groups */ *rates = (float*)malloc(stats->grpno * sizeof((*rates)[0])); *groups = (char**)malloc((stats->grpno+1) * sizeof((*groups)[0])); + shift = 0; for (i=0, g=stats->map; igrpno; i++) { - (*rates)[i] = 0; - (*groups)[i] = NULL; - if ((err = stateRateRequest(ctx, stats, g, from, to, &((*rates)[i]), res_from, res_to))) - continue; //TODO in fact breaks results here - (*groups)[i] = strdup(g->destination); + (*rates)[i-shift] = 0; + (*groups)[i-shift] = NULL; + if ((err = stateRateRequest(ctx, stats, g, from, to, &((*rates)[i-shift]), res_from, res_to))){ + shift++; + g = (struct edg_wll_stats_group *) (((char *) g) + stats->grpsize); + continue; + } + (*groups)[i-shift] = strdup(g->destination); g = (struct edg_wll_stats_group *) (((char *) g) + stats->grpsize); } - (*groups)[i] = NULL; + (*groups)[i-shift] = NULL; if (i == 0){ edg_wll_SetError(ctx,ENOENT,"no matching group"); free(*rates); *rates = NULL; free(*groups); *groups = NULL; goto cleanup; } + else + edg_wll_ResetError(ctx); // reset error comming from stateDurationFromToRequest, some of them has worked } cleanup: @@ -885,6 +897,8 @@ static int stateDurationFromToRequest( glite_common_log(LOG_CATEGORY_LB_SERVER, LOG_PRIORITY_DEBUG, "search %ld in %ld, %ld", *from, afrom, afrom+i); + diff = 0.0f; + // (from, to) is inside (afrom, afrom+i) if (*from >= afrom && *to < afrom+i) { diff = *to - *from; @@ -908,7 +922,7 @@ static int stateDurationFromToRequest( *dispersion += (float)diff * c->value2; if (*to >= afrom && *to < afrom+i) { - glite_common_log(LOG_CATEGORY_LB_SERVER, LOG_PRIORITY_DEBUG, "matched to: match %d, duration %f, dispersion %f", match, *duration, *dispersion); + glite_common_log(LOG_CATEGORY_LB_SERVER, LOG_PRIORITY_DEBUG, "matched to: match %ld, duration %f, dispersion %f", match, *duration, *dispersion); break; } } @@ -945,7 +959,7 @@ int edg_wll_StateDurationFromToServer( struct edg_wll_stats_group *g; char *sig = NULL; int err; - int i; + int i, shift; edg_wll_ResetError(ctx); *durations = NULL; @@ -986,9 +1000,9 @@ int edg_wll_StateDurationFromToServer( } if ((err = stateDurationFromToRequest(ctx, stats, g, from, to, &((*durations)[0]), &((*dispersions)[0]), res_from, res_to))){ - free(*durations); - free(*dispersions); - free(*groups); + free(*durations); *durations = NULL; + free(*dispersions); *dispersions = NULL; + free(*groups); *groups = NULL; goto cleanup; } (*groups)[0] = strdup(g->destination); @@ -998,17 +1012,21 @@ int edg_wll_StateDurationFromToServer( *durations = (float*)malloc(stats->grpno * sizeof((*durations)[0])); *dispersions = (float*)malloc(stats->grpno * sizeof((*dispersions)[0])); *groups = (char**)malloc((stats->grpno+1) * sizeof((*groups)[0])); + shift = 0; for (i=0, g=stats->map; igrpno; i++) { - (*durations)[i] = 0; - (*dispersions)[i] = 0; - (*groups)[i] = NULL; - if ((err = stateDurationFromToRequest(ctx, stats, g, from, to, &((*durations)[i]), &((*dispersions)[i]), res_from, res_to))) - continue; //TODO in fact breaks results here - (*groups)[i] = strdup(g->destination); + (*durations)[i-shift] = 0; + (*dispersions)[i-shift] = 0; + (*groups)[i-shift] = NULL; + if ((err = stateDurationFromToRequest(ctx, stats, g, from, to, &((*durations)[i-shift]), &((*dispersions)[i-shift]), res_from, res_to))){ + shift++; + g = (struct edg_wll_stats_group *) (((char *) g) + stats->grpsize); + continue; + } + (*groups)[i-shift] = strdup(g->destination); g = (struct edg_wll_stats_group *) (((char *) g) + stats->grpsize); } - (*groups)[i] = NULL; + (*groups)[i-shift] = NULL; if (i == 0){ edg_wll_SetError(ctx,ENOENT,"no matching group"); free(*durations); *durations = NULL; @@ -1016,6 +1034,8 @@ int edg_wll_StateDurationFromToServer( free(*groups); *groups = NULL; goto cleanup; } + else + edg_wll_ResetError(ctx); // reset error comming from stateDurationFromToRequest, some of them has worked } cleanup: diff --git a/org.glite.lb.server/src/store.c.T b/org.glite.lb.server/src/store.c.T index cfbc7a5..8c3ea00 100644 --- a/org.glite.lb.server/src/store.c.T +++ b/org.glite.lb.server/src/store.c.T @@ -100,7 +100,7 @@ int edg_wll_StoreEvent(edg_wll_Context ctx,edg_wll_Event *e,const char *ulm,int } trio_asprintf(&stmt,"select userid from jobs where jobid='%|Ss'", jobid); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&sh) < 0 || edg_wll_FetchRow(ctx,sh,1,NULL,&userid) < 0) goto clean; if (sh) glite_lbu_FreeStmt(&sh); @@ -116,7 +116,7 @@ int edg_wll_StoreEvent(edg_wll_Context ctx,edg_wll_Event *e,const char *ulm,int ssrc,e->any.host, stamp,e->any.timestamp.tv_usec, e->any.level,userid, e->any.seqcode); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&sh) < 0) goto clean; nr = edg_wll_FetchRow(ctx,sh,1,NULL,&dummy); @@ -138,7 +138,7 @@ int edg_wll_StoreEvent(edg_wll_Context ctx,edg_wll_Event *e,const char *ulm,int trio_asprintf(&stmt, "select nevents from jobs " "where jobid = '%|Ss'",jobid); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&sh) < 0 || edg_wll_FetchRow(ctx,sh,1,NULL,&max) < 0) goto clean; @@ -158,7 +158,7 @@ int edg_wll_StoreEvent(edg_wll_Context ctx,edg_wll_Event *e,const char *ulm,int ssrc,e->any.host, stamp,e->any.timestamp.tv_usec, now_s, e->any.level,userid, e->any.seqcode); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) goto clean; free(stmt); stmt = NULL; @@ -167,7 +167,7 @@ int edg_wll_StoreEvent(edg_wll_Context ctx,edg_wll_Event *e,const char *ulm,int trio_asprintf(&stmt, "update jobs set nevents='%d'" "where jobid = '%|Ss'", next+1, jobid); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) goto clean; free(stmt); stmt = NULL; @@ -194,7 +194,7 @@ static int store_user(edg_wll_Context ctx,const char *userid,const char *subj) trio_asprintf(&stmt,"insert into users(userid,cert_subj) " "values ('%|Ss','%|Ss')",userid,subj); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) { if (edg_wll_Error(ctx,NULL,NULL) == EEXIST) @@ -244,7 +244,7 @@ static int store_job(edg_wll_Context ctx,glite_jobid_const_t job,const char *use trio_asprintf(&stmt,"insert into jobs(jobid,dg_jobid,userid,proxy,server,grey) " "values ('%|Ss','%|Ss','%|Ss', '%|Sd', '%|Sd', '%|Sd')",jobid,jobstr,userid,proxy,server,grey); } - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) { if (edg_wll_Error(ctx,NULL,NULL) == EEXIST && !update) @@ -297,7 +297,7 @@ int store_job_server_proxy(edg_wll_Context ctx, edg_wll_Event *event, int *regis trio_asprintf(&q,"select proxy,server,grey from jobs where jobid='%|Ss' for update", unique); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); nar = edg_wll_ExecSQL(ctx,q,&stmt); free(q); q = NULL; @@ -393,7 +393,7 @@ int store_job_server_proxy(edg_wll_Context ctx, edg_wll_Event *event, int *regis { trio_asprintf(&q,"select u.cert_subj from jobs j, users u " "where j.jobid='%|Ss' and u.userid=j.userid",unique); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if (edg_wll_ExecSQL(ctx,q,&stmt) < 0 || edg_wll_FetchRow(ctx,stmt,1,NULL,&owner) < 0 @@ -415,7 +415,7 @@ int store_job_server_proxy(edg_wll_Context ctx, edg_wll_Event *event, int *regis if ( (!strcmp(res[0],"0") && ctx->isProxy) || (!strcmp(res[1],"0") && !ctx->isProxy) ) { trio_asprintf(&q,"update jobs set server='1', proxy='1' where jobid='%|Ss'", unique); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if (edg_wll_ExecSQL(ctx,q,NULL) < 0) goto err; free(q); q = NULL; } @@ -508,7 +508,7 @@ static int store_flesh(edg_wll_Context ctx,edg_wll_Event *e,const char *ulm,char "values ('%|Ss',%d,'%|Ss','%|Ss')", strlen(f[i].val) <= SHORT_LEN ? "short_fields" : "long_fields", jobid,no,f[i].key,f[i].val); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) err = edg_wll_Error(ctx,NULL,NULL); free(stmt); @@ -520,7 +520,7 @@ static int store_flesh(edg_wll_Context ctx,edg_wll_Event *e,const char *ulm,char trio_asprintf(&stmt,"insert into short_fields(jobid,event,name,value) " "values ('%|Ss',%d,'SRC_INSTANCE','%|Ss')", jobid,no,e->any.src_instance); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) err = edg_wll_Error(ctx,NULL,NULL); free(stmt); @@ -528,7 +528,7 @@ static int store_flesh(edg_wll_Context ctx,edg_wll_Event *e,const char *ulm,char #else if (!ulm) ulm = edg_wll_UnparseEvent(ctx, e); trio_asprintf(&stmt, "insert into events_flesh (jobid, event, ulm) values ('%|Ss', %d, '%|Ss')", jobid, no, ulm); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) err = edg_wll_Error(ctx,NULL,NULL); #endif @@ -617,7 +617,7 @@ static int check_auth(edg_wll_Context ctx,edg_wll_Event *e) trio_asprintf(&q,"select u.cert_subj from jobs j, users u " "where j.jobid='%|Ss' and u.userid=j.userid",jobid); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if (edg_wll_ExecSQL(ctx,q,&stmt) < 0 || edg_wll_FetchRow(ctx,stmt,1,NULL,&owner) < 0 @@ -751,7 +751,7 @@ int register_subjobs_embryonic(edg_wll_Context ctx,const edg_wll_RegJobEvent *e) /* get userid of parent job */ jobid = edg_wlc_JobIdGetUnique(e->jobId); trio_asprintf(&stmt,"select userid from jobs where jobid='%|Ss'", jobid); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&sh) < 0 || edg_wll_FetchRow(ctx,sh,1,NULL,&userid) < 0) goto err; @@ -817,7 +817,7 @@ int edg_wll_delete_event(edg_wll_Context ctx,const char *jobid,int event) trio_asprintf(&stmt, "delete from short_fields where jobid='%|Ss' and event=%d", jobid,event); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); edg_wll_ExecSQL(ctx,stmt,NULL); free(stmt); @@ -825,7 +825,7 @@ int edg_wll_delete_event(edg_wll_Context ctx,const char *jobid,int event) trio_asprintf(&stmt, "delete from long_fields where jobid='%|Ss' and event=%d", jobid,event); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); edg_wll_ExecSQL(ctx,stmt,NULL); free(stmt); @@ -833,7 +833,7 @@ int edg_wll_delete_event(edg_wll_Context ctx,const char *jobid,int event) trio_asprintf(&stmt, "delete from events_flesh where jobid='%|Ss' and event=%d", jobid,event); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); edg_wll_ExecSQL(ctx,stmt,NULL); free(stmt); @@ -841,7 +841,7 @@ int edg_wll_delete_event(edg_wll_Context ctx,const char *jobid,int event) trio_asprintf(&stmt, "delete from events where jobid='%|Ss' and event=%d", jobid,event); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); edg_wll_ExecSQL(ctx,stmt,NULL); free (stmt); diff --git a/org.glite.lb.server/src/stored_master.c b/org.glite.lb.server/src/stored_master.c index 3cf02c0..54dd5e5 100644 --- a/org.glite.lb.server/src/stored_master.c +++ b/org.glite.lb.server/src/stored_master.c @@ -121,10 +121,10 @@ int edg_wll_StoreProto(edg_wll_Context ctx) if (sink_mode == GLITE_LB_SINK_PARSE) glite_wll_perftest_consumeEventIlMsg(buf); else #endif - { - glite_common_log(LOG_CATEGORY_LB_SERVER_REQUEST, LOG_PRIORITY_DEBUG,buf); - handle_il_message(ctx, buf); - } + { + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_REQUEST, LOG_PRIORITY_DEBUG, buf); + handle_il_message(ctx, buf); + } free(buf); if ( (len = create_reply(ctx, &buf)) > 0 ) { diff --git a/org.glite.lb.server/src/userjobs.c b/org.glite.lb.server/src/userjobs.c index 4fd24b9..dc87a86 100644 --- a/org.glite.lb.server/src/userjobs.c +++ b/org.glite.lb.server/src/userjobs.c @@ -60,7 +60,7 @@ int edg_wll_UserJobsServer( free(can_peername); trio_asprintf(&stmt,"select cert_subj from users where userid = '%|Ss'",userid); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); switch (edg_wll_ExecSQL(ctx,stmt,&sth)) { case 0: edg_wll_SetError(ctx,ENOENT,ctx->peerName); @@ -78,7 +78,7 @@ int edg_wll_UserJobsServer( free(res); res = NULL; trio_asprintf(&stmt,"select dg_jobid from jobs where userid = '%|Ss' and grey='0'",userid); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); switch (njobs = edg_wll_ExecSQL(ctx,stmt,&sth)) { case 0: edg_wll_SetError(ctx,ENOENT,ctx->peerName); case -1: goto err; diff --git a/org.glite.lb.state-machine/Makefile b/org.glite.lb.state-machine/Makefile index de3b47d..f289364 100644 --- a/org.glite.lb.state-machine/Makefile +++ b/org.glite.lb.state-machine/Makefile @@ -20,11 +20,22 @@ AT3=${stagedir}/sbin/glite-lb-at3 SUFFIXES = .T +ifneq (${classads_prefix},/usr) + classadslib := -L${classads_prefix}/${libdir} -L${classads_prefix}/lib +endif +ifneq (${expat_prefix},/usr) + expatlib := -L${expat_prefix}/${libdir} -L${expat_prefix}/lib +endif +CLASSADS_CFLAGS?=-I${classads_prefix}/include -I${classads_prefix}/include/classad +CLASSADS_LIBS?=${classadslib} -lclassad +EXPAT_CFLAGS?= +EXPAT_LIBS?=${expatlib} -lexpat + DEBUG:=-g -O0 -Wall CFLAGS:= ${CFLAGS} \ ${DEBUG} \ - -I${classads_prefix}/include -I${classads_prefix}/include/classad \ + ${CLASSADS_CFLAGS} \ -I${stagedir}/include -I${top_srcdir}/src -I. \ -I${top_srcdir}/interface @@ -36,16 +47,14 @@ INSTALL:=libtool --mode=install install LINKXX:=libtool --mode=link ${CXX} -rpath ${stagedir}/${libdir} ${LDFLAGS} XSLTPROC:=xsltproc --novalid -ifneq (${classads_prefix},/usr) - classadslib := -L${classads_prefix}/${libdir} -L${classads_prefix}/lib +ifeq (${thrflavour},) +default_flavour= +else +default_flavour=_${nothrflavour} endif - -classadslib := ${classadslib} -lclassad - -EXT_LIBS:= -COMMON_LIBS:= -L${stagedir}/${libdir} -lglite_lb_common_${nothrflavour} -lglite_security_gss_${nothrflavour} -PLUGIN_LIBS:= -L${stagedir}/${libdir} -lglite_lb_common_${nothrflavour}\ - ${classadslib} -lstdc++ ${expatlib} -lexpat\ +COMMON_LIBS:= -L${stagedir}/${libdir} -lglite_lb_common${default_flavour} -lglite_security_gss${defaultflavour} +PLUGIN_LIBS:= -L${stagedir}/${libdir} -lglite_lb_common${default_flavour} \ + ${CLASSADS_LIBS} -lstdc++ ${EXPAT_LIBS} PLUGIN_LOBJS:=seqcode_aux.lo process_event.lo process_event_pbs.lo process_event_condor.lo process_event_cream.lo lb_plugin.lo process_event_file_transfer.lo process_event_file_transfer_collection.lo MACHINE_OBJS:=seqcode_aux.o process_event.o process_event_pbs.o process_event_condor.o process_event_cream.o process_event_file_transfer.o process_event_file_transfer_collection.o diff --git a/org.glite.lb.state-machine/configure b/org.glite.lb.state-machine/configure index 0d662fe..76e67f9 100755 --- a/org.glite.lb.state-machine/configure +++ b/org.glite.lb.state-machine/configure @@ -41,39 +41,104 @@ my $output; my $lb_tag = ''; my $lbjp_tag = ''; my $jp_tag = ''; -my $sec_tag = ''; my $jobid_tag = ''; my $libdir = getlibdir(); +my $projectname; + my @nodes = qw/client server logger logger-msg utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; my %enable_nodes; my %disable_nodes; -my %extern_prefix = ( - cares => '/opt/c-ares', - classads => '/opt/classads', - cppunit => '/usr', - expat => '/usr', - globus => '/opt/globus', - myproxy => '/opt/myproxy', - gsoap => '/usr', - mysql => '/usr', - 'mysql-devel' => '', - 'mysql-server' => '', - voms => '/opt/glite', - gridsite => '/opt/glite', - lcas => '/opt/glite', - trustmanager => '/opt/glite', - utiljava => '/opt/glite', - ant => '/usr', - jdk => '/usr', - libtar => '/usr', - axis => '/usr', - log4c => '/usr', - postgresql => '/usr', - activemq => '/opt/activemq-cpp-library', - apr => '/opt/apr', - aprutil => '/opt/apr-util' +my %externs = ( + cares => { + prefix => '/opt/c-ares', + pkg => 'libcares' + }, + classads => { + prefix=> '/usr', + pkg => 'classads' + }, + cppunit => { + prefix=> '/usr', + pkg => 'cppunit' + }, + expat => { + prefix=> '/usr', + pkg => 'expat' + }, + globus => { + prefix=> '/opt/globus', + pkg => 'globus-gssapi-gsi' + }, + 'myproxy-essentials' => { + prefix=> '/opt/globus', + pkg => 'myproxy' + }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, + gsoap => { + prefix=> '/usr', + pkg => 'gsoap' + }, + mysql => { + prefix=> '/usr' + }, + 'mysql-devel' => { + prefix=> '' + }, + 'mysql-server' => { + prefix => '' + }, + voms => { + prefix => '/opt/glite', + pkg => 'voms-1.0' + }, + gridsite => { + prefix => '/opt/glite' + }, + lcas => { + prefix => '/opt/glite' + }, + trustmanager => { + prefix => '/opt/glite' + }, + utiljava => { + prefix=> '/opt/glite' + }, + ant => { + prefix=> '/usr' + }, + jdk => { + prefix=> '/usr' + }, + libtar => { + prefix=> '/usr' + }, + axis => { + prefix=> '/usr' + }, + log4c => { + prefix=> '/usr' + }, + postgresql => { + prefix=> '/usr' + } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -91,14 +156,15 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger logger-msg server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/proxyrenewal/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], 'gridsite' => [ qw/apache shared commands core/ ], + 'px' => [ qw/proxyrenewal glite-PX myproxy-yaim myproxy-config/ ], ); @@ -106,8 +172,8 @@ my @opts = ( 'prefix=s' => \$prefix, 'staged=s' => \$staged, 'module=s' => \$module, - 'thrflavour=s' => \$thrflavour, - 'nothrflavour=s' => \$nothrflavour, + 'thrflavour:s' => \$thrflavour, + 'nothrflavour:s' => \$nothrflavour, 'mode=s' => \$mode, 'listmodules=s' => \$listmodules, 'version=s' => \$version, @@ -117,10 +183,10 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, + 'emi' => \$emi, ); for (@nodes) { @@ -131,20 +197,26 @@ for (@nodes) { push @opts,"enable-$_",\$enable_nodes{$_}; } -push @opts,"with-$_=s",\$extern_prefix{$_} for keys %extern_prefix; +push @opts,"with-$_=s",\$externs{$_}{withprefix} for keys %externs; push @opts,"with-$_=s",\$jar{$_} for keys %jar; my @keeparg = @ARGV; GetOptions @opts or die "Errors parsing command line\n"; -$extern_prefix{'mysql-devel'}=$extern_prefix{mysql} if $extern_prefix{'mysql-devel'} eq ''; -$extern_prefix{'mysql-server'}=$extern_prefix{mysql} if $extern_prefix{'mysql-server'} eq ''; +$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; +$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -164,7 +236,33 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; + +if ($mode eq 'build') { for my $ext (keys %externs) { + if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } + elsif (defined $externs{$ext}{pkg}) { + my ($prefix, $flag); + my $pkg = $externs{$ext}{pkg}; + my $flagname = uc $externs{$ext}{pkg}; + $flagname =~ s/-[0-9\.]*$//; + $flagname =~ s/-/_/g; + + print "Checking $pkg ... "; + `pkg-config "$pkg" --exists >/dev/null`; + if ($? == 0) { + $externs{$ext}{prefix}=`pkg-config $pkg --variable=prefix`; + chomp $externs{$ext}{prefix}; + print "$externs{$ext}{prefix}\n"; + + $flag=`pkg-config $pkg --cflags`; + $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag); + $flag=`pkg-config $pkg --libs`; + $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); + } else { + print "(using default $externs{$ext}{prefix})\n"; + } + } +} } if ($dis) { for (@nodes) { @@ -181,7 +279,7 @@ $stagedir = $prefix unless $stagedir; if ($mode eq 'build') { print "Writing config.status\n"; open CONF,">config.status" or die "config.status: $!\n"; - print CONF "$0 @keeparg\n"; + print CONF "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH} $0 @keeparg\n"; close CONF; } @@ -227,8 +325,9 @@ sub mode_build { @myjars = keys %aux; print "\nRequired externals:\n"; - print "\t$_: $extern_prefix{$_}\n" for @ext; + print "\t$_: $externs{$_}{prefix}\n" for @ext; print "\t$_: $jar{$_}\n" for @myjars; + for (@ext) { if (defined($externs{$_}{flags})) { print "$externs{$_}{flags}"; } }; print "\nThis is a poor-man configure, it's up to you to have sources and externals there\n\n"; mkinc($_) for @modules; @@ -295,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -343,7 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.proxyrenewal' => [ qw/voms globus:B myproxy/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -354,6 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], + 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -435,7 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.proxyrenewal' => [ qw// ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -467,6 +561,11 @@ for my $jar (keys %need_jars) { 'jp.ws-interface' => [ qw// ], 'gridsite.core' => [ qw/build.common-cpp:B/ ], + + 'px.proxyrenewal' => [ qw// ], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], + 'px.myproxy-config' => [], ); for my $ext (keys %deps_aux) { @@ -491,6 +590,9 @@ for my $ext (keys %deps_aux) { %obsoletes = ( 'lb.yaim' => [ qq/glite-yaim-lb/ ], + 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], + 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -501,7 +603,7 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', + 'px' => 'org.glite', ); %conf_prefix = ( @@ -510,7 +612,16 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', + 'px' => 'glite-', +); + +%emi_conf_prefix = ( + 'lb' => 'emi-', + 'jp' => 'emi-', + 'jobid' => 'emi-', + 'lbjp-common' => 'emi-', + 'gridsite' => '', + 'px' => 'emi-', ); my @k = keys %deps_aux; @@ -536,8 +647,9 @@ sub mkinc lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java -lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface +lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface +px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config /; @aux{@m} = (1) x ($#m+1); @@ -574,7 +686,8 @@ libdir = $libdir }; for (@{$need_externs{$short}}) { - print MKINC "${_}_prefix = $extern_prefix{$_}\n" + print MKINC "${_}_prefix = $externs{$_}{prefix}\n"; + print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags}; } for (@{$need_jars{$short}}) { @@ -589,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -615,10 +728,20 @@ BEGIN{ apr=>'apr-dev', aprutil=>'aprutil-dev', ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' + ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -666,30 +789,48 @@ sub mode_etics { for (@{$need_externs{"$subsys.$module"}}) { if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + if ($emi) { + if ($ge{$_} and not defined $externs{$_}{pkg}) { + push @copts, "--with-$_=\${stageDir}"; + } + } else { + push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + } } } for (@{$need_jars{"$subsys.$module"}}) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,"--with-$_ \${$eext.location}/usr/share/java/$_*.jar"; + push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (not $emi); } my $conf; my $conftag; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; + + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; + if ($branch) { - $conf = "$conf_prefix{$subsys}${subsys}-${module}_$branch"; + $conf = "$confprefix${subsys}-${module}_$branch"; $conftag = $branch; # forced low age number $age = $branch eq 'HEAD' ? '0head' : '0dev'; } else { - $conf = "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; + $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; # XXX: gridsite hack - $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : $conf; } + $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : + "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; } + if ($emi) { + $age = "${age}emi"; + } + my $file = $output ? $output : "$conf.ini"; open C,">$file" or die "$file: $!\n"; @@ -728,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -738,8 +885,13 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor} --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; $cmd{compile} = 'make'; $cmd{test} = 'make check'; $cmd{install} = 'make install'; @@ -751,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -800,8 +949,9 @@ $buildroot aprSuffix = 0 package.RPMSLocation = \${moduleDir}/RPMTMP/RPMS package.SRPMSLocation = \${moduleDir}/RPMTMP/SRPMS -$package_description$package_summary$defprops -}; +package.preserve.libtool = false +$package_description$package_summary$defprops}; + for (@{$obsoletes{"$subsys.$module"}}) { print C "package.obsoletes = $_\n"; print C "package.replaces = $_\n"; @@ -828,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -839,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -848,12 +1001,13 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS sub gsoap_version { local $_; my $gsoap_version; - open S,"$extern_prefix{gsoap}/bin/soapcpp2 -v 2>&1 |" or die "$extern_prefix{gsoap}/bin/soapcpp2: $!\n"; + open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n"; while ($_ = ) { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -910,7 +1064,7 @@ sub getlibdir { } sub usage { - my @ext = keys %extern_prefix; + my @ext = keys %externs; my @myjars, keys %jar; print STDERR qq{ @@ -925,6 +1079,7 @@ General options (defaults in []): --version=maj.min.rev-age specify version here instead of reading version.properties --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...) --libdir=libdir typically [lib,lib64] postfix + --emi generate configurations with emi flavor in mode 'etics' Mode of operation: --mode={checkout|build|etics} what to do [build] @@ -932,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.lb.state-machine/project/ChangeLog b/org.glite.lb.state-machine/project/ChangeLog index d640a5f..91e40d7 100644 --- a/org.glite.lb.state-machine/project/ChangeLog +++ b/org.glite.lb.state-machine/project/ChangeLog @@ -46,3 +46,15 @@ 1.1.2-2 - Module rebuilt +1.1.3-1 +- Makefile adopts compilation and linking flags from the environment. + +1.1.3-2 +- Module rebuilt + +1.1.4-1 +- Makefile, configuration and header includes updated to work across org.glite & EMI + +1.1.4-2 +- Module rebuilt + diff --git a/org.glite.lb.state-machine/project/version.properties b/org.glite.lb.state-machine/project/version.properties index 41326f7..b8e18a0 100644 --- a/org.glite.lb.state-machine/project/version.properties +++ b/org.glite.lb.state-machine/project/version.properties @@ -1,3 +1,3 @@ # $Header$ -module.version=1.1.2 +module.version=1.1.4 module.age=2 diff --git a/org.glite.lb.types/configure b/org.glite.lb.types/configure index 0d662fe..76e67f9 100755 --- a/org.glite.lb.types/configure +++ b/org.glite.lb.types/configure @@ -41,39 +41,104 @@ my $output; my $lb_tag = ''; my $lbjp_tag = ''; my $jp_tag = ''; -my $sec_tag = ''; my $jobid_tag = ''; my $libdir = getlibdir(); +my $projectname; + my @nodes = qw/client server logger logger-msg utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; my %enable_nodes; my %disable_nodes; -my %extern_prefix = ( - cares => '/opt/c-ares', - classads => '/opt/classads', - cppunit => '/usr', - expat => '/usr', - globus => '/opt/globus', - myproxy => '/opt/myproxy', - gsoap => '/usr', - mysql => '/usr', - 'mysql-devel' => '', - 'mysql-server' => '', - voms => '/opt/glite', - gridsite => '/opt/glite', - lcas => '/opt/glite', - trustmanager => '/opt/glite', - utiljava => '/opt/glite', - ant => '/usr', - jdk => '/usr', - libtar => '/usr', - axis => '/usr', - log4c => '/usr', - postgresql => '/usr', - activemq => '/opt/activemq-cpp-library', - apr => '/opt/apr', - aprutil => '/opt/apr-util' +my %externs = ( + cares => { + prefix => '/opt/c-ares', + pkg => 'libcares' + }, + classads => { + prefix=> '/usr', + pkg => 'classads' + }, + cppunit => { + prefix=> '/usr', + pkg => 'cppunit' + }, + expat => { + prefix=> '/usr', + pkg => 'expat' + }, + globus => { + prefix=> '/opt/globus', + pkg => 'globus-gssapi-gsi' + }, + 'myproxy-essentials' => { + prefix=> '/opt/globus', + pkg => 'myproxy' + }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, + gsoap => { + prefix=> '/usr', + pkg => 'gsoap' + }, + mysql => { + prefix=> '/usr' + }, + 'mysql-devel' => { + prefix=> '' + }, + 'mysql-server' => { + prefix => '' + }, + voms => { + prefix => '/opt/glite', + pkg => 'voms-1.0' + }, + gridsite => { + prefix => '/opt/glite' + }, + lcas => { + prefix => '/opt/glite' + }, + trustmanager => { + prefix => '/opt/glite' + }, + utiljava => { + prefix=> '/opt/glite' + }, + ant => { + prefix=> '/usr' + }, + jdk => { + prefix=> '/usr' + }, + libtar => { + prefix=> '/usr' + }, + axis => { + prefix=> '/usr' + }, + log4c => { + prefix=> '/usr' + }, + postgresql => { + prefix=> '/usr' + } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -91,14 +156,15 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger logger-msg server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/proxyrenewal/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], 'gridsite' => [ qw/apache shared commands core/ ], + 'px' => [ qw/proxyrenewal glite-PX myproxy-yaim myproxy-config/ ], ); @@ -106,8 +172,8 @@ my @opts = ( 'prefix=s' => \$prefix, 'staged=s' => \$staged, 'module=s' => \$module, - 'thrflavour=s' => \$thrflavour, - 'nothrflavour=s' => \$nothrflavour, + 'thrflavour:s' => \$thrflavour, + 'nothrflavour:s' => \$nothrflavour, 'mode=s' => \$mode, 'listmodules=s' => \$listmodules, 'version=s' => \$version, @@ -117,10 +183,10 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, + 'emi' => \$emi, ); for (@nodes) { @@ -131,20 +197,26 @@ for (@nodes) { push @opts,"enable-$_",\$enable_nodes{$_}; } -push @opts,"with-$_=s",\$extern_prefix{$_} for keys %extern_prefix; +push @opts,"with-$_=s",\$externs{$_}{withprefix} for keys %externs; push @opts,"with-$_=s",\$jar{$_} for keys %jar; my @keeparg = @ARGV; GetOptions @opts or die "Errors parsing command line\n"; -$extern_prefix{'mysql-devel'}=$extern_prefix{mysql} if $extern_prefix{'mysql-devel'} eq ''; -$extern_prefix{'mysql-server'}=$extern_prefix{mysql} if $extern_prefix{'mysql-server'} eq ''; +$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; +$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -164,7 +236,33 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; + +if ($mode eq 'build') { for my $ext (keys %externs) { + if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } + elsif (defined $externs{$ext}{pkg}) { + my ($prefix, $flag); + my $pkg = $externs{$ext}{pkg}; + my $flagname = uc $externs{$ext}{pkg}; + $flagname =~ s/-[0-9\.]*$//; + $flagname =~ s/-/_/g; + + print "Checking $pkg ... "; + `pkg-config "$pkg" --exists >/dev/null`; + if ($? == 0) { + $externs{$ext}{prefix}=`pkg-config $pkg --variable=prefix`; + chomp $externs{$ext}{prefix}; + print "$externs{$ext}{prefix}\n"; + + $flag=`pkg-config $pkg --cflags`; + $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag); + $flag=`pkg-config $pkg --libs`; + $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); + } else { + print "(using default $externs{$ext}{prefix})\n"; + } + } +} } if ($dis) { for (@nodes) { @@ -181,7 +279,7 @@ $stagedir = $prefix unless $stagedir; if ($mode eq 'build') { print "Writing config.status\n"; open CONF,">config.status" or die "config.status: $!\n"; - print CONF "$0 @keeparg\n"; + print CONF "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH} $0 @keeparg\n"; close CONF; } @@ -227,8 +325,9 @@ sub mode_build { @myjars = keys %aux; print "\nRequired externals:\n"; - print "\t$_: $extern_prefix{$_}\n" for @ext; + print "\t$_: $externs{$_}{prefix}\n" for @ext; print "\t$_: $jar{$_}\n" for @myjars; + for (@ext) { if (defined($externs{$_}{flags})) { print "$externs{$_}{flags}"; } }; print "\nThis is a poor-man configure, it's up to you to have sources and externals there\n\n"; mkinc($_) for @modules; @@ -295,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -343,7 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.proxyrenewal' => [ qw/voms globus:B myproxy/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -354,6 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], + 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -435,7 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.proxyrenewal' => [ qw// ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -467,6 +561,11 @@ for my $jar (keys %need_jars) { 'jp.ws-interface' => [ qw// ], 'gridsite.core' => [ qw/build.common-cpp:B/ ], + + 'px.proxyrenewal' => [ qw// ], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], + 'px.myproxy-config' => [], ); for my $ext (keys %deps_aux) { @@ -491,6 +590,9 @@ for my $ext (keys %deps_aux) { %obsoletes = ( 'lb.yaim' => [ qq/glite-yaim-lb/ ], + 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], + 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -501,7 +603,7 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', + 'px' => 'org.glite', ); %conf_prefix = ( @@ -510,7 +612,16 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', + 'px' => 'glite-', +); + +%emi_conf_prefix = ( + 'lb' => 'emi-', + 'jp' => 'emi-', + 'jobid' => 'emi-', + 'lbjp-common' => 'emi-', + 'gridsite' => '', + 'px' => 'emi-', ); my @k = keys %deps_aux; @@ -536,8 +647,9 @@ sub mkinc lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java -lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface +lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface +px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config /; @aux{@m} = (1) x ($#m+1); @@ -574,7 +686,8 @@ libdir = $libdir }; for (@{$need_externs{$short}}) { - print MKINC "${_}_prefix = $extern_prefix{$_}\n" + print MKINC "${_}_prefix = $externs{$_}{prefix}\n"; + print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags}; } for (@{$need_jars{$short}}) { @@ -589,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -615,10 +728,20 @@ BEGIN{ apr=>'apr-dev', aprutil=>'aprutil-dev', ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' + ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -666,30 +789,48 @@ sub mode_etics { for (@{$need_externs{"$subsys.$module"}}) { if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + if ($emi) { + if ($ge{$_} and not defined $externs{$_}{pkg}) { + push @copts, "--with-$_=\${stageDir}"; + } + } else { + push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + } } } for (@{$need_jars{"$subsys.$module"}}) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,"--with-$_ \${$eext.location}/usr/share/java/$_*.jar"; + push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (not $emi); } my $conf; my $conftag; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; + + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; + if ($branch) { - $conf = "$conf_prefix{$subsys}${subsys}-${module}_$branch"; + $conf = "$confprefix${subsys}-${module}_$branch"; $conftag = $branch; # forced low age number $age = $branch eq 'HEAD' ? '0head' : '0dev'; } else { - $conf = "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; + $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; # XXX: gridsite hack - $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : $conf; } + $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : + "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; } + if ($emi) { + $age = "${age}emi"; + } + my $file = $output ? $output : "$conf.ini"; open C,">$file" or die "$file: $!\n"; @@ -728,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -738,8 +885,13 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor} --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; $cmd{compile} = 'make'; $cmd{test} = 'make check'; $cmd{install} = 'make install'; @@ -751,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -800,8 +949,9 @@ $buildroot aprSuffix = 0 package.RPMSLocation = \${moduleDir}/RPMTMP/RPMS package.SRPMSLocation = \${moduleDir}/RPMTMP/SRPMS -$package_description$package_summary$defprops -}; +package.preserve.libtool = false +$package_description$package_summary$defprops}; + for (@{$obsoletes{"$subsys.$module"}}) { print C "package.obsoletes = $_\n"; print C "package.replaces = $_\n"; @@ -828,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -839,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -848,12 +1001,13 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS sub gsoap_version { local $_; my $gsoap_version; - open S,"$extern_prefix{gsoap}/bin/soapcpp2 -v 2>&1 |" or die "$extern_prefix{gsoap}/bin/soapcpp2: $!\n"; + open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n"; while ($_ = ) { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -910,7 +1064,7 @@ sub getlibdir { } sub usage { - my @ext = keys %extern_prefix; + my @ext = keys %externs; my @myjars, keys %jar; print STDERR qq{ @@ -925,6 +1079,7 @@ General options (defaults in []): --version=maj.min.rev-age specify version here instead of reading version.properties --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...) --libdir=libdir typically [lib,lib64] postfix + --emi generate configurations with emi flavor in mode 'etics' Mode of operation: --mode={checkout|build|etics} what to do [build] @@ -932,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.lb.types/project/ChangeLog b/org.glite.lb.types/project/ChangeLog index b7bcd31..f075658 100644 --- a/org.glite.lb.types/project/ChangeLog +++ b/org.glite.lb.types/project/ChangeLog @@ -31,3 +31,12 @@ 1.1.2-2 - Module rebuilt +1.1.3-1 +- Fixed toString perl method for logsrc (duplicated line) + +1.1.3-2 +- Module rebuilt + +1.1.4-1 +- Configure updated to work across org.glite & EMI + diff --git a/org.glite.lb.types/project/version.properties b/org.glite.lb.types/project/version.properties index 41326f7..6632c7c 100644 --- a/org.glite.lb.types/project/version.properties +++ b/org.glite.lb.types/project/version.properties @@ -1,3 +1,3 @@ # $Header$ -module.version=1.1.2 -module.age=2 +module.version=1.1.4 +module.age=1 diff --git a/org.glite.lb.types/types.T b/org.glite.lb.types/types.T index cfb1629..7b727f5 100644 --- a/org.glite.lb.types/types.T +++ b/org.glite.lb.types/types.T @@ -88,7 +88,6 @@ notifid=>'qq{$dst = edg_wll_NotifIdUnparse($src);}', # level=>'qq{$dst = edg_wll_LevelToString($src);}', logsrc=>'qq{$dst = edg_wll_SourceToString($src);}', - logsrc=>'qq{$dst = edg_wll_StringToSource($src);}', cclassad=>'qq{$dst = NULL;}', # strlist, intlist, stslist are used only in consumer API, they don't need toString method } diff --git a/org.glite.lb.utils/Makefile b/org.glite.lb.utils/Makefile index 6583a49..8bf872c 100644 --- a/org.glite.lb.utils/Makefile +++ b/org.glite.lb.utils/Makefile @@ -7,8 +7,6 @@ package=glite-lb-utils version=0.0.0 PREFIX=/opt/glite -nothrflavour=gcc32 -thrflavour=gcc32pthr expat_prefix=/opt/expat gsoap_prefix=/opt/gsoap @@ -26,13 +24,20 @@ SUFFIXES = .T DEBUG:=-g -O0 -Wall +ifneq (${expat_prefix},/usr) + expatlib := -L${expat_prefix}/${libdir} -L${expat_prefix}/lib +endif +EXPAT_CFLAGS?=-I${expat_prefix}/include +EXPAT_LIB?=${expatlib} -lexpat +GSOAP_CFLAGS?=-I${gsoap_prefix}/include -I${gsoap_prefix}/ + CFLAGS:= ${CFLAGS} \ ${WS_CFLAGS} ${DEBUG} \ -DVERSION=\"${version}\" \ -I${stagedir}/include -I${top_srcdir}/src -I. \ -I${top_srcdir}/interface \ - -I${expat_prefix}/include \ - -I${gsoap_prefix}/include -I${gsoap_prefix}/ \ + ${EXPAT_CFLAGS} \ + ${GSOAP_CFLAGS} \ ${COVERAGE_FLAGS} \ -D_GNU_SOURCE LDFLAGS:=${LDFLAGS} -L${stagedir}/${libdir} @@ -45,16 +50,19 @@ INSTALL:=libtool --mode=install install LINKXX:=libtool --mode=link ${CXX} -rpath ${stagedir}/${libdir} ${LDFLAGS} XSLTPROC:=xsltproc --novalid -ifneq (${expat_prefix},/usr) - expatlib := -L${expat_prefix}/${libdir} -L${expat_prefix}/lib -endif +EXT_LIBS:= ${EXPAT_LIBS} -EXT_LIBS:= \ - ${expatlib} -lexpat +ifeq (${thrflavour},) +COMMON_LIB:=-lglite_lb_common +CLIENT_LIB:=-lglite_lb_client +PLUS_LIB:=-lglite_lb_clientpp +JP_LIBS:=-lglite_jp_common +else COMMON_LIB:=-lglite_lb_common_${nothrflavour} CLIENT_LIB:=-lglite_lb_client_${nothrflavour} PLUS_LIB:=-lglite_lb_clientpp_${nothrflavour} JP_LIBS:=-lglite_jp_common_${nothrflavour} +endif UTILS:=mon purge dump load dump_exporter ALLUTILS:=${UTILS} state_history statistics diff --git a/org.glite.lb.utils/configure b/org.glite.lb.utils/configure index 0d662fe..76e67f9 100755 --- a/org.glite.lb.utils/configure +++ b/org.glite.lb.utils/configure @@ -41,39 +41,104 @@ my $output; my $lb_tag = ''; my $lbjp_tag = ''; my $jp_tag = ''; -my $sec_tag = ''; my $jobid_tag = ''; my $libdir = getlibdir(); +my $projectname; + my @nodes = qw/client server logger logger-msg utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; my %enable_nodes; my %disable_nodes; -my %extern_prefix = ( - cares => '/opt/c-ares', - classads => '/opt/classads', - cppunit => '/usr', - expat => '/usr', - globus => '/opt/globus', - myproxy => '/opt/myproxy', - gsoap => '/usr', - mysql => '/usr', - 'mysql-devel' => '', - 'mysql-server' => '', - voms => '/opt/glite', - gridsite => '/opt/glite', - lcas => '/opt/glite', - trustmanager => '/opt/glite', - utiljava => '/opt/glite', - ant => '/usr', - jdk => '/usr', - libtar => '/usr', - axis => '/usr', - log4c => '/usr', - postgresql => '/usr', - activemq => '/opt/activemq-cpp-library', - apr => '/opt/apr', - aprutil => '/opt/apr-util' +my %externs = ( + cares => { + prefix => '/opt/c-ares', + pkg => 'libcares' + }, + classads => { + prefix=> '/usr', + pkg => 'classads' + }, + cppunit => { + prefix=> '/usr', + pkg => 'cppunit' + }, + expat => { + prefix=> '/usr', + pkg => 'expat' + }, + globus => { + prefix=> '/opt/globus', + pkg => 'globus-gssapi-gsi' + }, + 'myproxy-essentials' => { + prefix=> '/opt/globus', + pkg => 'myproxy' + }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, + gsoap => { + prefix=> '/usr', + pkg => 'gsoap' + }, + mysql => { + prefix=> '/usr' + }, + 'mysql-devel' => { + prefix=> '' + }, + 'mysql-server' => { + prefix => '' + }, + voms => { + prefix => '/opt/glite', + pkg => 'voms-1.0' + }, + gridsite => { + prefix => '/opt/glite' + }, + lcas => { + prefix => '/opt/glite' + }, + trustmanager => { + prefix => '/opt/glite' + }, + utiljava => { + prefix=> '/opt/glite' + }, + ant => { + prefix=> '/usr' + }, + jdk => { + prefix=> '/usr' + }, + libtar => { + prefix=> '/usr' + }, + axis => { + prefix=> '/usr' + }, + log4c => { + prefix=> '/usr' + }, + postgresql => { + prefix=> '/usr' + } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -91,14 +156,15 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger logger-msg server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/proxyrenewal/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], 'gridsite' => [ qw/apache shared commands core/ ], + 'px' => [ qw/proxyrenewal glite-PX myproxy-yaim myproxy-config/ ], ); @@ -106,8 +172,8 @@ my @opts = ( 'prefix=s' => \$prefix, 'staged=s' => \$staged, 'module=s' => \$module, - 'thrflavour=s' => \$thrflavour, - 'nothrflavour=s' => \$nothrflavour, + 'thrflavour:s' => \$thrflavour, + 'nothrflavour:s' => \$nothrflavour, 'mode=s' => \$mode, 'listmodules=s' => \$listmodules, 'version=s' => \$version, @@ -117,10 +183,10 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, + 'emi' => \$emi, ); for (@nodes) { @@ -131,20 +197,26 @@ for (@nodes) { push @opts,"enable-$_",\$enable_nodes{$_}; } -push @opts,"with-$_=s",\$extern_prefix{$_} for keys %extern_prefix; +push @opts,"with-$_=s",\$externs{$_}{withprefix} for keys %externs; push @opts,"with-$_=s",\$jar{$_} for keys %jar; my @keeparg = @ARGV; GetOptions @opts or die "Errors parsing command line\n"; -$extern_prefix{'mysql-devel'}=$extern_prefix{mysql} if $extern_prefix{'mysql-devel'} eq ''; -$extern_prefix{'mysql-server'}=$extern_prefix{mysql} if $extern_prefix{'mysql-server'} eq ''; +$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; +$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -164,7 +236,33 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; + +if ($mode eq 'build') { for my $ext (keys %externs) { + if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } + elsif (defined $externs{$ext}{pkg}) { + my ($prefix, $flag); + my $pkg = $externs{$ext}{pkg}; + my $flagname = uc $externs{$ext}{pkg}; + $flagname =~ s/-[0-9\.]*$//; + $flagname =~ s/-/_/g; + + print "Checking $pkg ... "; + `pkg-config "$pkg" --exists >/dev/null`; + if ($? == 0) { + $externs{$ext}{prefix}=`pkg-config $pkg --variable=prefix`; + chomp $externs{$ext}{prefix}; + print "$externs{$ext}{prefix}\n"; + + $flag=`pkg-config $pkg --cflags`; + $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag); + $flag=`pkg-config $pkg --libs`; + $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); + } else { + print "(using default $externs{$ext}{prefix})\n"; + } + } +} } if ($dis) { for (@nodes) { @@ -181,7 +279,7 @@ $stagedir = $prefix unless $stagedir; if ($mode eq 'build') { print "Writing config.status\n"; open CONF,">config.status" or die "config.status: $!\n"; - print CONF "$0 @keeparg\n"; + print CONF "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH} $0 @keeparg\n"; close CONF; } @@ -227,8 +325,9 @@ sub mode_build { @myjars = keys %aux; print "\nRequired externals:\n"; - print "\t$_: $extern_prefix{$_}\n" for @ext; + print "\t$_: $externs{$_}{prefix}\n" for @ext; print "\t$_: $jar{$_}\n" for @myjars; + for (@ext) { if (defined($externs{$_}{flags})) { print "$externs{$_}{flags}"; } }; print "\nThis is a poor-man configure, it's up to you to have sources and externals there\n\n"; mkinc($_) for @modules; @@ -295,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -343,7 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.proxyrenewal' => [ qw/voms globus:B myproxy/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -354,6 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], + 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -435,7 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.proxyrenewal' => [ qw// ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -467,6 +561,11 @@ for my $jar (keys %need_jars) { 'jp.ws-interface' => [ qw// ], 'gridsite.core' => [ qw/build.common-cpp:B/ ], + + 'px.proxyrenewal' => [ qw// ], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], + 'px.myproxy-config' => [], ); for my $ext (keys %deps_aux) { @@ -491,6 +590,9 @@ for my $ext (keys %deps_aux) { %obsoletes = ( 'lb.yaim' => [ qq/glite-yaim-lb/ ], + 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], + 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -501,7 +603,7 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', + 'px' => 'org.glite', ); %conf_prefix = ( @@ -510,7 +612,16 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', + 'px' => 'glite-', +); + +%emi_conf_prefix = ( + 'lb' => 'emi-', + 'jp' => 'emi-', + 'jobid' => 'emi-', + 'lbjp-common' => 'emi-', + 'gridsite' => '', + 'px' => 'emi-', ); my @k = keys %deps_aux; @@ -536,8 +647,9 @@ sub mkinc lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java -lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface +lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface +px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config /; @aux{@m} = (1) x ($#m+1); @@ -574,7 +686,8 @@ libdir = $libdir }; for (@{$need_externs{$short}}) { - print MKINC "${_}_prefix = $extern_prefix{$_}\n" + print MKINC "${_}_prefix = $externs{$_}{prefix}\n"; + print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags}; } for (@{$need_jars{$short}}) { @@ -589,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -615,10 +728,20 @@ BEGIN{ apr=>'apr-dev', aprutil=>'aprutil-dev', ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' + ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -666,30 +789,48 @@ sub mode_etics { for (@{$need_externs{"$subsys.$module"}}) { if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + if ($emi) { + if ($ge{$_} and not defined $externs{$_}{pkg}) { + push @copts, "--with-$_=\${stageDir}"; + } + } else { + push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + } } } for (@{$need_jars{"$subsys.$module"}}) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,"--with-$_ \${$eext.location}/usr/share/java/$_*.jar"; + push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (not $emi); } my $conf; my $conftag; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; + + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; + if ($branch) { - $conf = "$conf_prefix{$subsys}${subsys}-${module}_$branch"; + $conf = "$confprefix${subsys}-${module}_$branch"; $conftag = $branch; # forced low age number $age = $branch eq 'HEAD' ? '0head' : '0dev'; } else { - $conf = "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; + $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; # XXX: gridsite hack - $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : $conf; } + $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : + "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; } + if ($emi) { + $age = "${age}emi"; + } + my $file = $output ? $output : "$conf.ini"; open C,">$file" or die "$file: $!\n"; @@ -728,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -738,8 +885,13 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor} --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; $cmd{compile} = 'make'; $cmd{test} = 'make check'; $cmd{install} = 'make install'; @@ -751,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -800,8 +949,9 @@ $buildroot aprSuffix = 0 package.RPMSLocation = \${moduleDir}/RPMTMP/RPMS package.SRPMSLocation = \${moduleDir}/RPMTMP/SRPMS -$package_description$package_summary$defprops -}; +package.preserve.libtool = false +$package_description$package_summary$defprops}; + for (@{$obsoletes{"$subsys.$module"}}) { print C "package.obsoletes = $_\n"; print C "package.replaces = $_\n"; @@ -828,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -839,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -848,12 +1001,13 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS sub gsoap_version { local $_; my $gsoap_version; - open S,"$extern_prefix{gsoap}/bin/soapcpp2 -v 2>&1 |" or die "$extern_prefix{gsoap}/bin/soapcpp2: $!\n"; + open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n"; while ($_ = ) { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -910,7 +1064,7 @@ sub getlibdir { } sub usage { - my @ext = keys %extern_prefix; + my @ext = keys %externs; my @myjars, keys %jar; print STDERR qq{ @@ -925,6 +1079,7 @@ General options (defaults in []): --version=maj.min.rev-age specify version here instead of reading version.properties --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...) --libdir=libdir typically [lib,lib64] postfix + --emi generate configurations with emi flavor in mode 'etics' Mode of operation: --mode={checkout|build|etics} what to do [build] @@ -932,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.lb.utils/project/ChangeLog b/org.glite.lb.utils/project/ChangeLog index 55a352c..14c4317 100644 --- a/org.glite.lb.utils/project/ChangeLog +++ b/org.glite.lb.utils/project/ChangeLog @@ -33,3 +33,12 @@ 2.0.6-1 - Hostname parsing adjusted to handle IPv6 addresses +2.0.7-1 +- Makefile adopts compilation and linking flags from the environment. + +2.0.7-2 +- Module rebuilt + +2.0.8-1 +- Makefile a configuration updated to work across org.glite & EMI + diff --git a/org.glite.lb.utils/project/version.properties b/org.glite.lb.utils/project/version.properties index 5aa2b4e..246fb99 100755 --- a/org.glite.lb.utils/project/version.properties +++ b/org.glite.lb.utils/project/version.properties @@ -1,3 +1,3 @@ # $Header$ -module.version=2.0.6 +module.version=2.0.8 module.age=1 diff --git a/org.glite.lb.ws-interface/configure b/org.glite.lb.ws-interface/configure index 0d662fe..76e67f9 100755 --- a/org.glite.lb.ws-interface/configure +++ b/org.glite.lb.ws-interface/configure @@ -41,39 +41,104 @@ my $output; my $lb_tag = ''; my $lbjp_tag = ''; my $jp_tag = ''; -my $sec_tag = ''; my $jobid_tag = ''; my $libdir = getlibdir(); +my $projectname; + my @nodes = qw/client server logger logger-msg utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; my %enable_nodes; my %disable_nodes; -my %extern_prefix = ( - cares => '/opt/c-ares', - classads => '/opt/classads', - cppunit => '/usr', - expat => '/usr', - globus => '/opt/globus', - myproxy => '/opt/myproxy', - gsoap => '/usr', - mysql => '/usr', - 'mysql-devel' => '', - 'mysql-server' => '', - voms => '/opt/glite', - gridsite => '/opt/glite', - lcas => '/opt/glite', - trustmanager => '/opt/glite', - utiljava => '/opt/glite', - ant => '/usr', - jdk => '/usr', - libtar => '/usr', - axis => '/usr', - log4c => '/usr', - postgresql => '/usr', - activemq => '/opt/activemq-cpp-library', - apr => '/opt/apr', - aprutil => '/opt/apr-util' +my %externs = ( + cares => { + prefix => '/opt/c-ares', + pkg => 'libcares' + }, + classads => { + prefix=> '/usr', + pkg => 'classads' + }, + cppunit => { + prefix=> '/usr', + pkg => 'cppunit' + }, + expat => { + prefix=> '/usr', + pkg => 'expat' + }, + globus => { + prefix=> '/opt/globus', + pkg => 'globus-gssapi-gsi' + }, + 'myproxy-essentials' => { + prefix=> '/opt/globus', + pkg => 'myproxy' + }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, + gsoap => { + prefix=> '/usr', + pkg => 'gsoap' + }, + mysql => { + prefix=> '/usr' + }, + 'mysql-devel' => { + prefix=> '' + }, + 'mysql-server' => { + prefix => '' + }, + voms => { + prefix => '/opt/glite', + pkg => 'voms-1.0' + }, + gridsite => { + prefix => '/opt/glite' + }, + lcas => { + prefix => '/opt/glite' + }, + trustmanager => { + prefix => '/opt/glite' + }, + utiljava => { + prefix=> '/opt/glite' + }, + ant => { + prefix=> '/usr' + }, + jdk => { + prefix=> '/usr' + }, + libtar => { + prefix=> '/usr' + }, + axis => { + prefix=> '/usr' + }, + log4c => { + prefix=> '/usr' + }, + postgresql => { + prefix=> '/usr' + } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -91,14 +156,15 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger logger-msg server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/proxyrenewal/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], 'gridsite' => [ qw/apache shared commands core/ ], + 'px' => [ qw/proxyrenewal glite-PX myproxy-yaim myproxy-config/ ], ); @@ -106,8 +172,8 @@ my @opts = ( 'prefix=s' => \$prefix, 'staged=s' => \$staged, 'module=s' => \$module, - 'thrflavour=s' => \$thrflavour, - 'nothrflavour=s' => \$nothrflavour, + 'thrflavour:s' => \$thrflavour, + 'nothrflavour:s' => \$nothrflavour, 'mode=s' => \$mode, 'listmodules=s' => \$listmodules, 'version=s' => \$version, @@ -117,10 +183,10 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, + 'emi' => \$emi, ); for (@nodes) { @@ -131,20 +197,26 @@ for (@nodes) { push @opts,"enable-$_",\$enable_nodes{$_}; } -push @opts,"with-$_=s",\$extern_prefix{$_} for keys %extern_prefix; +push @opts,"with-$_=s",\$externs{$_}{withprefix} for keys %externs; push @opts,"with-$_=s",\$jar{$_} for keys %jar; my @keeparg = @ARGV; GetOptions @opts or die "Errors parsing command line\n"; -$extern_prefix{'mysql-devel'}=$extern_prefix{mysql} if $extern_prefix{'mysql-devel'} eq ''; -$extern_prefix{'mysql-server'}=$extern_prefix{mysql} if $extern_prefix{'mysql-server'} eq ''; +$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; +$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -164,7 +236,33 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; + +if ($mode eq 'build') { for my $ext (keys %externs) { + if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } + elsif (defined $externs{$ext}{pkg}) { + my ($prefix, $flag); + my $pkg = $externs{$ext}{pkg}; + my $flagname = uc $externs{$ext}{pkg}; + $flagname =~ s/-[0-9\.]*$//; + $flagname =~ s/-/_/g; + + print "Checking $pkg ... "; + `pkg-config "$pkg" --exists >/dev/null`; + if ($? == 0) { + $externs{$ext}{prefix}=`pkg-config $pkg --variable=prefix`; + chomp $externs{$ext}{prefix}; + print "$externs{$ext}{prefix}\n"; + + $flag=`pkg-config $pkg --cflags`; + $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag); + $flag=`pkg-config $pkg --libs`; + $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); + } else { + print "(using default $externs{$ext}{prefix})\n"; + } + } +} } if ($dis) { for (@nodes) { @@ -181,7 +279,7 @@ $stagedir = $prefix unless $stagedir; if ($mode eq 'build') { print "Writing config.status\n"; open CONF,">config.status" or die "config.status: $!\n"; - print CONF "$0 @keeparg\n"; + print CONF "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH} $0 @keeparg\n"; close CONF; } @@ -227,8 +325,9 @@ sub mode_build { @myjars = keys %aux; print "\nRequired externals:\n"; - print "\t$_: $extern_prefix{$_}\n" for @ext; + print "\t$_: $externs{$_}{prefix}\n" for @ext; print "\t$_: $jar{$_}\n" for @myjars; + for (@ext) { if (defined($externs{$_}{flags})) { print "$externs{$_}{flags}"; } }; print "\nThis is a poor-man configure, it's up to you to have sources and externals there\n\n"; mkinc($_) for @modules; @@ -295,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -343,7 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.proxyrenewal' => [ qw/voms globus:B myproxy/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -354,6 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], + 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -435,7 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.proxyrenewal' => [ qw// ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -467,6 +561,11 @@ for my $jar (keys %need_jars) { 'jp.ws-interface' => [ qw// ], 'gridsite.core' => [ qw/build.common-cpp:B/ ], + + 'px.proxyrenewal' => [ qw// ], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], + 'px.myproxy-config' => [], ); for my $ext (keys %deps_aux) { @@ -491,6 +590,9 @@ for my $ext (keys %deps_aux) { %obsoletes = ( 'lb.yaim' => [ qq/glite-yaim-lb/ ], + 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], + 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -501,7 +603,7 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', + 'px' => 'org.glite', ); %conf_prefix = ( @@ -510,7 +612,16 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', + 'px' => 'glite-', +); + +%emi_conf_prefix = ( + 'lb' => 'emi-', + 'jp' => 'emi-', + 'jobid' => 'emi-', + 'lbjp-common' => 'emi-', + 'gridsite' => '', + 'px' => 'emi-', ); my @k = keys %deps_aux; @@ -536,8 +647,9 @@ sub mkinc lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java -lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface +lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface +px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config /; @aux{@m} = (1) x ($#m+1); @@ -574,7 +686,8 @@ libdir = $libdir }; for (@{$need_externs{$short}}) { - print MKINC "${_}_prefix = $extern_prefix{$_}\n" + print MKINC "${_}_prefix = $externs{$_}{prefix}\n"; + print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags}; } for (@{$need_jars{$short}}) { @@ -589,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -615,10 +728,20 @@ BEGIN{ apr=>'apr-dev', aprutil=>'aprutil-dev', ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' + ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -666,30 +789,48 @@ sub mode_etics { for (@{$need_externs{"$subsys.$module"}}) { if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + if ($emi) { + if ($ge{$_} and not defined $externs{$_}{pkg}) { + push @copts, "--with-$_=\${stageDir}"; + } + } else { + push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + } } } for (@{$need_jars{"$subsys.$module"}}) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,"--with-$_ \${$eext.location}/usr/share/java/$_*.jar"; + push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (not $emi); } my $conf; my $conftag; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; + + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; + if ($branch) { - $conf = "$conf_prefix{$subsys}${subsys}-${module}_$branch"; + $conf = "$confprefix${subsys}-${module}_$branch"; $conftag = $branch; # forced low age number $age = $branch eq 'HEAD' ? '0head' : '0dev'; } else { - $conf = "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; + $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; # XXX: gridsite hack - $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : $conf; } + $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : + "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; } + if ($emi) { + $age = "${age}emi"; + } + my $file = $output ? $output : "$conf.ini"; open C,">$file" or die "$file: $!\n"; @@ -728,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -738,8 +885,13 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor} --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; $cmd{compile} = 'make'; $cmd{test} = 'make check'; $cmd{install} = 'make install'; @@ -751,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -800,8 +949,9 @@ $buildroot aprSuffix = 0 package.RPMSLocation = \${moduleDir}/RPMTMP/RPMS package.SRPMSLocation = \${moduleDir}/RPMTMP/SRPMS -$package_description$package_summary$defprops -}; +package.preserve.libtool = false +$package_description$package_summary$defprops}; + for (@{$obsoletes{"$subsys.$module"}}) { print C "package.obsoletes = $_\n"; print C "package.replaces = $_\n"; @@ -828,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -839,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -848,12 +1001,13 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS sub gsoap_version { local $_; my $gsoap_version; - open S,"$extern_prefix{gsoap}/bin/soapcpp2 -v 2>&1 |" or die "$extern_prefix{gsoap}/bin/soapcpp2: $!\n"; + open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n"; while ($_ = ) { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -910,7 +1064,7 @@ sub getlibdir { } sub usage { - my @ext = keys %extern_prefix; + my @ext = keys %externs; my @myjars, keys %jar; print STDERR qq{ @@ -925,6 +1079,7 @@ General options (defaults in []): --version=maj.min.rev-age specify version here instead of reading version.properties --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...) --libdir=libdir typically [lib,lib64] postfix + --emi generate configurations with emi flavor in mode 'etics' Mode of operation: --mode={checkout|build|etics} what to do [build] @@ -932,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.lb.ws-interface/project/ChangeLog b/org.glite.lb.ws-interface/project/ChangeLog index 691fcbb..1a02f59 100644 --- a/org.glite.lb.ws-interface/project/ChangeLog +++ b/org.glite.lb.ws-interface/project/ChangeLog @@ -29,3 +29,9 @@ 3.1.2-2 - Module rebuilt +3.1.2-3 +- Module rebuilt + +3.1.2-4 +- Module rebuilt + diff --git a/org.glite.lb.ws-interface/project/version.properties b/org.glite.lb.ws-interface/project/version.properties index d67fab5..2db2c57 100755 --- a/org.glite.lb.ws-interface/project/version.properties +++ b/org.glite.lb.ws-interface/project/version.properties @@ -1,3 +1,3 @@ # $Header$ module.version=3.1.2 -module.age=2 +module.age=4 diff --git a/org.glite.lb.ws-test/Makefile b/org.glite.lb.ws-test/Makefile index e419693..42ed623 100644 --- a/org.glite.lb.ws-test/Makefile +++ b/org.glite.lb.ws-test/Makefile @@ -5,8 +5,6 @@ PREFIX=/opt/glite glite_location=/opt/glite globus_prefix=/opt/globus -nothrflavour=gcc32 -thrflavour=gcc32pthr expat_prefix=/opt/expat cares_prefix=/opt/c-ares gsoap_prefix=/opt/gsoap @@ -23,12 +21,20 @@ CEXAMPLES:=ws_getversion ws_jobstat ws_joblog ws_lb4agu_GetActivityStatus ws_lb4 default all: ${CEXAMPLES} +GLOBUS_GSSAPI_GSI_CFLAGS?=-I${globus_prefix}/include/${nothrflavour} + +ifeq (${thrflavour},) +default_flavour= +else +default_flavour=_${nothrflavour} +endif + VPATH=${top_srcdir}/examples CC=gcc DEBUG:=-g -O0 -Wall CFLAGS:=${CFLAGS} -I${gsoap_prefix}/include -I${gsoap_prefix}/ \ -I${stagedir}/include -I${top_srcdir}/src -I. \ - -I${globus_prefix}/include/${nothrflavour} \ + ${GLOBUS_GSSAPI_GSI_CFLAGS} \ ${DEBUG} COMPILE:=libtool --mode=compile ${CC} ${CFLAGS} @@ -37,10 +43,10 @@ INSTALL:=libtool --mode=install install GSOAP_FILES_PREFIX:= bk_ws_ dotless_gsoap_ver:=${shell echo ${gsoap_default_version} | tr -d . } -ifeq ($(shell test -f ${stagedir}/${libdir}/libglite_security_gsoap_plugin_${dotless_gsoap_ver}_${nothrflavour}_c.so && echo ok),ok) +ifeq ($(shell test -f ${stagedir}/${libdir}/libglite_security_gsoap_plugin_${dotless_gsoap_ver}${default_flavour}_c.so && echo ok),ok) langflavour:=_c endif -GSOAP_LIB:=-L${stagedir}/${libdir} -lglite_security_gsoap_plugin_${dotless_gsoap_ver}_${nothrflavour}${langflavour} +GSOAP_LIB:=-L${stagedir}/${libdir} -lglite_security_gsoap_plugin_${dotless_gsoap_ver}${default_flavour}${langflavour} WS_CLIENT_OBJS:= $(GSOAP_FILES_PREFIX)C.o $(GSOAP_FILES_PREFIX)Client.o ws_fault.o # ws_typeref.o diff --git a/org.glite.lb.ws-test/configure b/org.glite.lb.ws-test/configure index 0d662fe..76e67f9 100755 --- a/org.glite.lb.ws-test/configure +++ b/org.glite.lb.ws-test/configure @@ -41,39 +41,104 @@ my $output; my $lb_tag = ''; my $lbjp_tag = ''; my $jp_tag = ''; -my $sec_tag = ''; my $jobid_tag = ''; my $libdir = getlibdir(); +my $projectname; + my @nodes = qw/client server logger logger-msg utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; my %enable_nodes; my %disable_nodes; -my %extern_prefix = ( - cares => '/opt/c-ares', - classads => '/opt/classads', - cppunit => '/usr', - expat => '/usr', - globus => '/opt/globus', - myproxy => '/opt/myproxy', - gsoap => '/usr', - mysql => '/usr', - 'mysql-devel' => '', - 'mysql-server' => '', - voms => '/opt/glite', - gridsite => '/opt/glite', - lcas => '/opt/glite', - trustmanager => '/opt/glite', - utiljava => '/opt/glite', - ant => '/usr', - jdk => '/usr', - libtar => '/usr', - axis => '/usr', - log4c => '/usr', - postgresql => '/usr', - activemq => '/opt/activemq-cpp-library', - apr => '/opt/apr', - aprutil => '/opt/apr-util' +my %externs = ( + cares => { + prefix => '/opt/c-ares', + pkg => 'libcares' + }, + classads => { + prefix=> '/usr', + pkg => 'classads' + }, + cppunit => { + prefix=> '/usr', + pkg => 'cppunit' + }, + expat => { + prefix=> '/usr', + pkg => 'expat' + }, + globus => { + prefix=> '/opt/globus', + pkg => 'globus-gssapi-gsi' + }, + 'myproxy-essentials' => { + prefix=> '/opt/globus', + pkg => 'myproxy' + }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, + gsoap => { + prefix=> '/usr', + pkg => 'gsoap' + }, + mysql => { + prefix=> '/usr' + }, + 'mysql-devel' => { + prefix=> '' + }, + 'mysql-server' => { + prefix => '' + }, + voms => { + prefix => '/opt/glite', + pkg => 'voms-1.0' + }, + gridsite => { + prefix => '/opt/glite' + }, + lcas => { + prefix => '/opt/glite' + }, + trustmanager => { + prefix => '/opt/glite' + }, + utiljava => { + prefix=> '/opt/glite' + }, + ant => { + prefix=> '/usr' + }, + jdk => { + prefix=> '/usr' + }, + libtar => { + prefix=> '/usr' + }, + axis => { + prefix=> '/usr' + }, + log4c => { + prefix=> '/usr' + }, + postgresql => { + prefix=> '/usr' + } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -91,14 +156,15 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger logger-msg server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/proxyrenewal/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], 'gridsite' => [ qw/apache shared commands core/ ], + 'px' => [ qw/proxyrenewal glite-PX myproxy-yaim myproxy-config/ ], ); @@ -106,8 +172,8 @@ my @opts = ( 'prefix=s' => \$prefix, 'staged=s' => \$staged, 'module=s' => \$module, - 'thrflavour=s' => \$thrflavour, - 'nothrflavour=s' => \$nothrflavour, + 'thrflavour:s' => \$thrflavour, + 'nothrflavour:s' => \$nothrflavour, 'mode=s' => \$mode, 'listmodules=s' => \$listmodules, 'version=s' => \$version, @@ -117,10 +183,10 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, + 'emi' => \$emi, ); for (@nodes) { @@ -131,20 +197,26 @@ for (@nodes) { push @opts,"enable-$_",\$enable_nodes{$_}; } -push @opts,"with-$_=s",\$extern_prefix{$_} for keys %extern_prefix; +push @opts,"with-$_=s",\$externs{$_}{withprefix} for keys %externs; push @opts,"with-$_=s",\$jar{$_} for keys %jar; my @keeparg = @ARGV; GetOptions @opts or die "Errors parsing command line\n"; -$extern_prefix{'mysql-devel'}=$extern_prefix{mysql} if $extern_prefix{'mysql-devel'} eq ''; -$extern_prefix{'mysql-server'}=$extern_prefix{mysql} if $extern_prefix{'mysql-server'} eq ''; +$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; +$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -164,7 +236,33 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; + +if ($mode eq 'build') { for my $ext (keys %externs) { + if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } + elsif (defined $externs{$ext}{pkg}) { + my ($prefix, $flag); + my $pkg = $externs{$ext}{pkg}; + my $flagname = uc $externs{$ext}{pkg}; + $flagname =~ s/-[0-9\.]*$//; + $flagname =~ s/-/_/g; + + print "Checking $pkg ... "; + `pkg-config "$pkg" --exists >/dev/null`; + if ($? == 0) { + $externs{$ext}{prefix}=`pkg-config $pkg --variable=prefix`; + chomp $externs{$ext}{prefix}; + print "$externs{$ext}{prefix}\n"; + + $flag=`pkg-config $pkg --cflags`; + $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag); + $flag=`pkg-config $pkg --libs`; + $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); + } else { + print "(using default $externs{$ext}{prefix})\n"; + } + } +} } if ($dis) { for (@nodes) { @@ -181,7 +279,7 @@ $stagedir = $prefix unless $stagedir; if ($mode eq 'build') { print "Writing config.status\n"; open CONF,">config.status" or die "config.status: $!\n"; - print CONF "$0 @keeparg\n"; + print CONF "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH} $0 @keeparg\n"; close CONF; } @@ -227,8 +325,9 @@ sub mode_build { @myjars = keys %aux; print "\nRequired externals:\n"; - print "\t$_: $extern_prefix{$_}\n" for @ext; + print "\t$_: $externs{$_}{prefix}\n" for @ext; print "\t$_: $jar{$_}\n" for @myjars; + for (@ext) { if (defined($externs{$_}{flags})) { print "$externs{$_}{flags}"; } }; print "\nThis is a poor-man configure, it's up to you to have sources and externals there\n\n"; mkinc($_) for @modules; @@ -295,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -343,7 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.proxyrenewal' => [ qw/voms globus:B myproxy/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -354,6 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], + 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -435,7 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.proxyrenewal' => [ qw// ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -467,6 +561,11 @@ for my $jar (keys %need_jars) { 'jp.ws-interface' => [ qw// ], 'gridsite.core' => [ qw/build.common-cpp:B/ ], + + 'px.proxyrenewal' => [ qw// ], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], + 'px.myproxy-config' => [], ); for my $ext (keys %deps_aux) { @@ -491,6 +590,9 @@ for my $ext (keys %deps_aux) { %obsoletes = ( 'lb.yaim' => [ qq/glite-yaim-lb/ ], + 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], + 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -501,7 +603,7 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', + 'px' => 'org.glite', ); %conf_prefix = ( @@ -510,7 +612,16 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', + 'px' => 'glite-', +); + +%emi_conf_prefix = ( + 'lb' => 'emi-', + 'jp' => 'emi-', + 'jobid' => 'emi-', + 'lbjp-common' => 'emi-', + 'gridsite' => '', + 'px' => 'emi-', ); my @k = keys %deps_aux; @@ -536,8 +647,9 @@ sub mkinc lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java -lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface +lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface +px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config /; @aux{@m} = (1) x ($#m+1); @@ -574,7 +686,8 @@ libdir = $libdir }; for (@{$need_externs{$short}}) { - print MKINC "${_}_prefix = $extern_prefix{$_}\n" + print MKINC "${_}_prefix = $externs{$_}{prefix}\n"; + print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags}; } for (@{$need_jars{$short}}) { @@ -589,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -615,10 +728,20 @@ BEGIN{ apr=>'apr-dev', aprutil=>'aprutil-dev', ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' + ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -666,30 +789,48 @@ sub mode_etics { for (@{$need_externs{"$subsys.$module"}}) { if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + if ($emi) { + if ($ge{$_} and not defined $externs{$_}{pkg}) { + push @copts, "--with-$_=\${stageDir}"; + } + } else { + push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + } } } for (@{$need_jars{"$subsys.$module"}}) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,"--with-$_ \${$eext.location}/usr/share/java/$_*.jar"; + push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (not $emi); } my $conf; my $conftag; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; + + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; + if ($branch) { - $conf = "$conf_prefix{$subsys}${subsys}-${module}_$branch"; + $conf = "$confprefix${subsys}-${module}_$branch"; $conftag = $branch; # forced low age number $age = $branch eq 'HEAD' ? '0head' : '0dev'; } else { - $conf = "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; + $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; # XXX: gridsite hack - $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : $conf; } + $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : + "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; } + if ($emi) { + $age = "${age}emi"; + } + my $file = $output ? $output : "$conf.ini"; open C,">$file" or die "$file: $!\n"; @@ -728,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -738,8 +885,13 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor} --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; $cmd{compile} = 'make'; $cmd{test} = 'make check'; $cmd{install} = 'make install'; @@ -751,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -800,8 +949,9 @@ $buildroot aprSuffix = 0 package.RPMSLocation = \${moduleDir}/RPMTMP/RPMS package.SRPMSLocation = \${moduleDir}/RPMTMP/SRPMS -$package_description$package_summary$defprops -}; +package.preserve.libtool = false +$package_description$package_summary$defprops}; + for (@{$obsoletes{"$subsys.$module"}}) { print C "package.obsoletes = $_\n"; print C "package.replaces = $_\n"; @@ -828,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -839,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -848,12 +1001,13 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS sub gsoap_version { local $_; my $gsoap_version; - open S,"$extern_prefix{gsoap}/bin/soapcpp2 -v 2>&1 |" or die "$extern_prefix{gsoap}/bin/soapcpp2: $!\n"; + open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n"; while ($_ = ) { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -910,7 +1064,7 @@ sub getlibdir { } sub usage { - my @ext = keys %extern_prefix; + my @ext = keys %externs; my @myjars, keys %jar; print STDERR qq{ @@ -925,6 +1079,7 @@ General options (defaults in []): --version=maj.min.rev-age specify version here instead of reading version.properties --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...) --libdir=libdir typically [lib,lib64] postfix + --emi generate configurations with emi flavor in mode 'etics' Mode of operation: --mode={checkout|build|etics} what to do [build] @@ -932,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.lb.ws-test/project/ChangeLog b/org.glite.lb.ws-test/project/ChangeLog index 7ce1441..01e0fed 100644 --- a/org.glite.lb.ws-test/project/ChangeLog +++ b/org.glite.lb.ws-test/project/ChangeLog @@ -39,3 +39,15 @@ 1.1.3-2 - Module rebuilt +1.1.4-1 +- Makefile adopts compilation and linking flags from the environment. + +1.1.4-2 +- Module rebuilt + +1.1.5-1 +- Makefile a configuration updated to work across org.glite & EMI + +1.1.5-2 +- Module rebuilt + diff --git a/org.glite.lb.ws-test/project/version.properties b/org.glite.lb.ws-test/project/version.properties index 5375e4c..262ac6a 100644 --- a/org.glite.lb.ws-test/project/version.properties +++ b/org.glite.lb.ws-test/project/version.properties @@ -1,3 +1,3 @@ # : /cvs/jra1mw/org.glite.lb.ws-test/project/version.properties,v 1.1 2009/01/15 15:49:26 zsustr Exp $ -module.version=1.1.3 +module.version=1.1.5 module.age=2 diff --git a/org.glite.lb/configure b/org.glite.lb/configure index 0d662fe..76e67f9 100755 --- a/org.glite.lb/configure +++ b/org.glite.lb/configure @@ -41,39 +41,104 @@ my $output; my $lb_tag = ''; my $lbjp_tag = ''; my $jp_tag = ''; -my $sec_tag = ''; my $jobid_tag = ''; my $libdir = getlibdir(); +my $projectname; + my @nodes = qw/client server logger logger-msg utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; my %enable_nodes; my %disable_nodes; -my %extern_prefix = ( - cares => '/opt/c-ares', - classads => '/opt/classads', - cppunit => '/usr', - expat => '/usr', - globus => '/opt/globus', - myproxy => '/opt/myproxy', - gsoap => '/usr', - mysql => '/usr', - 'mysql-devel' => '', - 'mysql-server' => '', - voms => '/opt/glite', - gridsite => '/opt/glite', - lcas => '/opt/glite', - trustmanager => '/opt/glite', - utiljava => '/opt/glite', - ant => '/usr', - jdk => '/usr', - libtar => '/usr', - axis => '/usr', - log4c => '/usr', - postgresql => '/usr', - activemq => '/opt/activemq-cpp-library', - apr => '/opt/apr', - aprutil => '/opt/apr-util' +my %externs = ( + cares => { + prefix => '/opt/c-ares', + pkg => 'libcares' + }, + classads => { + prefix=> '/usr', + pkg => 'classads' + }, + cppunit => { + prefix=> '/usr', + pkg => 'cppunit' + }, + expat => { + prefix=> '/usr', + pkg => 'expat' + }, + globus => { + prefix=> '/opt/globus', + pkg => 'globus-gssapi-gsi' + }, + 'myproxy-essentials' => { + prefix=> '/opt/globus', + pkg => 'myproxy' + }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, + gsoap => { + prefix=> '/usr', + pkg => 'gsoap' + }, + mysql => { + prefix=> '/usr' + }, + 'mysql-devel' => { + prefix=> '' + }, + 'mysql-server' => { + prefix => '' + }, + voms => { + prefix => '/opt/glite', + pkg => 'voms-1.0' + }, + gridsite => { + prefix => '/opt/glite' + }, + lcas => { + prefix => '/opt/glite' + }, + trustmanager => { + prefix => '/opt/glite' + }, + utiljava => { + prefix=> '/opt/glite' + }, + ant => { + prefix=> '/usr' + }, + jdk => { + prefix=> '/usr' + }, + libtar => { + prefix=> '/usr' + }, + axis => { + prefix=> '/usr' + }, + log4c => { + prefix=> '/usr' + }, + postgresql => { + prefix=> '/usr' + } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -91,14 +156,15 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger logger-msg server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/proxyrenewal/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], 'gridsite' => [ qw/apache shared commands core/ ], + 'px' => [ qw/proxyrenewal glite-PX myproxy-yaim myproxy-config/ ], ); @@ -106,8 +172,8 @@ my @opts = ( 'prefix=s' => \$prefix, 'staged=s' => \$staged, 'module=s' => \$module, - 'thrflavour=s' => \$thrflavour, - 'nothrflavour=s' => \$nothrflavour, + 'thrflavour:s' => \$thrflavour, + 'nothrflavour:s' => \$nothrflavour, 'mode=s' => \$mode, 'listmodules=s' => \$listmodules, 'version=s' => \$version, @@ -117,10 +183,10 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, + 'emi' => \$emi, ); for (@nodes) { @@ -131,20 +197,26 @@ for (@nodes) { push @opts,"enable-$_",\$enable_nodes{$_}; } -push @opts,"with-$_=s",\$extern_prefix{$_} for keys %extern_prefix; +push @opts,"with-$_=s",\$externs{$_}{withprefix} for keys %externs; push @opts,"with-$_=s",\$jar{$_} for keys %jar; my @keeparg = @ARGV; GetOptions @opts or die "Errors parsing command line\n"; -$extern_prefix{'mysql-devel'}=$extern_prefix{mysql} if $extern_prefix{'mysql-devel'} eq ''; -$extern_prefix{'mysql-server'}=$extern_prefix{mysql} if $extern_prefix{'mysql-server'} eq ''; +$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; +$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -164,7 +236,33 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; + +if ($mode eq 'build') { for my $ext (keys %externs) { + if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } + elsif (defined $externs{$ext}{pkg}) { + my ($prefix, $flag); + my $pkg = $externs{$ext}{pkg}; + my $flagname = uc $externs{$ext}{pkg}; + $flagname =~ s/-[0-9\.]*$//; + $flagname =~ s/-/_/g; + + print "Checking $pkg ... "; + `pkg-config "$pkg" --exists >/dev/null`; + if ($? == 0) { + $externs{$ext}{prefix}=`pkg-config $pkg --variable=prefix`; + chomp $externs{$ext}{prefix}; + print "$externs{$ext}{prefix}\n"; + + $flag=`pkg-config $pkg --cflags`; + $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag); + $flag=`pkg-config $pkg --libs`; + $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); + } else { + print "(using default $externs{$ext}{prefix})\n"; + } + } +} } if ($dis) { for (@nodes) { @@ -181,7 +279,7 @@ $stagedir = $prefix unless $stagedir; if ($mode eq 'build') { print "Writing config.status\n"; open CONF,">config.status" or die "config.status: $!\n"; - print CONF "$0 @keeparg\n"; + print CONF "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH} $0 @keeparg\n"; close CONF; } @@ -227,8 +325,9 @@ sub mode_build { @myjars = keys %aux; print "\nRequired externals:\n"; - print "\t$_: $extern_prefix{$_}\n" for @ext; + print "\t$_: $externs{$_}{prefix}\n" for @ext; print "\t$_: $jar{$_}\n" for @myjars; + for (@ext) { if (defined($externs{$_}{flags})) { print "$externs{$_}{flags}"; } }; print "\nThis is a poor-man configure, it's up to you to have sources and externals there\n\n"; mkinc($_) for @modules; @@ -295,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -343,7 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.proxyrenewal' => [ qw/voms globus:B myproxy/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -354,6 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], + 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -435,7 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.proxyrenewal' => [ qw// ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -467,6 +561,11 @@ for my $jar (keys %need_jars) { 'jp.ws-interface' => [ qw// ], 'gridsite.core' => [ qw/build.common-cpp:B/ ], + + 'px.proxyrenewal' => [ qw// ], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], + 'px.myproxy-config' => [], ); for my $ext (keys %deps_aux) { @@ -491,6 +590,9 @@ for my $ext (keys %deps_aux) { %obsoletes = ( 'lb.yaim' => [ qq/glite-yaim-lb/ ], + 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], + 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -501,7 +603,7 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', + 'px' => 'org.glite', ); %conf_prefix = ( @@ -510,7 +612,16 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', + 'px' => 'glite-', +); + +%emi_conf_prefix = ( + 'lb' => 'emi-', + 'jp' => 'emi-', + 'jobid' => 'emi-', + 'lbjp-common' => 'emi-', + 'gridsite' => '', + 'px' => 'emi-', ); my @k = keys %deps_aux; @@ -536,8 +647,9 @@ sub mkinc lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java -lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface +lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface +px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config /; @aux{@m} = (1) x ($#m+1); @@ -574,7 +686,8 @@ libdir = $libdir }; for (@{$need_externs{$short}}) { - print MKINC "${_}_prefix = $extern_prefix{$_}\n" + print MKINC "${_}_prefix = $externs{$_}{prefix}\n"; + print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags}; } for (@{$need_jars{$short}}) { @@ -589,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -615,10 +728,20 @@ BEGIN{ apr=>'apr-dev', aprutil=>'aprutil-dev', ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' + ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -666,30 +789,48 @@ sub mode_etics { for (@{$need_externs{"$subsys.$module"}}) { if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + if ($emi) { + if ($ge{$_} and not defined $externs{$_}{pkg}) { + push @copts, "--with-$_=\${stageDir}"; + } + } else { + push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + } } } for (@{$need_jars{"$subsys.$module"}}) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,"--with-$_ \${$eext.location}/usr/share/java/$_*.jar"; + push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (not $emi); } my $conf; my $conftag; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; + + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; + if ($branch) { - $conf = "$conf_prefix{$subsys}${subsys}-${module}_$branch"; + $conf = "$confprefix${subsys}-${module}_$branch"; $conftag = $branch; # forced low age number $age = $branch eq 'HEAD' ? '0head' : '0dev'; } else { - $conf = "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; + $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; # XXX: gridsite hack - $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : $conf; } + $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : + "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; } + if ($emi) { + $age = "${age}emi"; + } + my $file = $output ? $output : "$conf.ini"; open C,">$file" or die "$file: $!\n"; @@ -728,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -738,8 +885,13 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor} --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; $cmd{compile} = 'make'; $cmd{test} = 'make check'; $cmd{install} = 'make install'; @@ -751,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -800,8 +949,9 @@ $buildroot aprSuffix = 0 package.RPMSLocation = \${moduleDir}/RPMTMP/RPMS package.SRPMSLocation = \${moduleDir}/RPMTMP/SRPMS -$package_description$package_summary$defprops -}; +package.preserve.libtool = false +$package_description$package_summary$defprops}; + for (@{$obsoletes{"$subsys.$module"}}) { print C "package.obsoletes = $_\n"; print C "package.replaces = $_\n"; @@ -828,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -839,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -848,12 +1001,13 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS sub gsoap_version { local $_; my $gsoap_version; - open S,"$extern_prefix{gsoap}/bin/soapcpp2 -v 2>&1 |" or die "$extern_prefix{gsoap}/bin/soapcpp2: $!\n"; + open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n"; while ($_ = ) { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -910,7 +1064,7 @@ sub getlibdir { } sub usage { - my @ext = keys %extern_prefix; + my @ext = keys %externs; my @myjars, keys %jar; print STDERR qq{ @@ -925,6 +1079,7 @@ General options (defaults in []): --version=maj.min.rev-age specify version here instead of reading version.properties --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...) --libdir=libdir typically [lib,lib64] postfix + --emi generate configurations with emi flavor in mode 'etics' Mode of operation: --mode={checkout|build|etics} what to do [build] @@ -932,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.lb/etics-tag-with-subsystems.pl b/org.glite.lb/etics-tag-with-subsystems.pl index 08ab660..c9e750c 100755 --- a/org.glite.lb/etics-tag-with-subsystems.pl +++ b/org.glite.lb/etics-tag-with-subsystems.pl @@ -23,7 +23,7 @@ $TMPDIR=$ENV{'TMPDIR'}; if ($TMPDIR eq "") {$TMPDIR="/tmp";} -getopts('c:h'); +getopts('c:p:h'); $module = shift; @@ -33,6 +33,7 @@ $usage = qq{ usage: $0 [-c ] module.name -c Use this configuration (\d+\.\d+\.\d+-\S+) rather than parsing version.properties + -p Specify project ("org.glite" / "emi"). Default: autodetect. -h Display this help }; @@ -85,6 +86,26 @@ usage: $0 [-c ] module.name $current_tag="$current_prefix" . "$current_major" . "_$current_minor" . "_$current_revision" . "_$current_age"; } + if (defined $opt_p) { + $project=$opt_p; + if (($project ne "emi")&&($project ne "org.glite")) {die "Only projects \"emi\" or \"org.glite\" are recognized";} + } + else { + system("etics-list-configuration > $TMPDIR/etics-tag-proj_configs.$$.tmp"); + + if ( !system("grep -x \"org.glite.HEAD\" $TMPDIR/etics-tag-proj_configs.$$.tmp > /dev/null") ) { $project = "org.glite"; } + else { + if ( !system("grep -x \"emi.HEAD\" $TMPDIR/etics-tag-proj_configs.$$.tmp > /dev/null") ) { $project = "emi"; } + else { die "Unable to autodetect project. Run from workspace root or specify by -p" } + } + + system("rm $TMPDIR/etics-tag-proj_configs.$$.tmp"); + } + + if ($project eq "emi") { $proj_opt = " --emi"; $proj_suffix = "emi" } + else { $proj_opt = ""; } + + # According to the documentation, symbolic names in the 'cvs log' output are sorted by age so this should be OK #$current_tag=`cvs log -h $module/Makefile | grep \"_R_\" | head -n 1`; #$current_tag=~s/^\s//; @@ -252,13 +273,16 @@ usage: $0 [-c ] module.name $newconfig="$module_$module" . "_R_$major" . "_$minor" . "_$revision" . "_$age"; $newconfig=~s/^org.//; $newconfig=~s/\./-/g; + if ( $project eq "emi" ) { $newconfig=~s/^glite/emi/; } + $moduleName=$module; + if ( $project eq "emi" ) { $moduleName=~s/^org.glite/emi/; } printf("\nNew configuration:\t$newconfig\n\nPreparing...\n"); open NEWCONF, ">", "$TMPDIR/$newconfig.ini.$$" or die $!; - printf (NEWCONF "[Configuration-$newconfig]\nprofile = None\nmoduleName = $module\ndisplayName = $newconfig\ndescription = None\nprojectName = org.glite\nage = $age\ntag = $tag\nversion = $major.$minor.$revision\npath = None\n\n"); + printf (NEWCONF "[Configuration-$newconfig]\nprofile = None\nmoduleName = $moduleName\ndisplayName = $newconfig\ndescription = None\nprojectName = $project\nage = $age$proj_suffix\ntag = $tag\nversion = $major.$minor.$revision\npath = None\n\n"); # printf (NEWCONF "[Platform-default:VcsCommand]\ndisplayName = None\ndescription = HEAD CVS commands\ntag = cvs -d \${vcsroot} tag -R \${tag} \${moduleName}\nbranch = None\ncommit = None\ncheckout = cvs -d \${vcsroot} co -r \${tag} \${moduleName}\n\n"); @@ -287,6 +311,7 @@ usage: $0 [-c ] module.name $modconfig="$m_$m" . "_R_$m_major" . "_$m_minor" . "_$m_revision" . "_$m_age"; $modconfig=~s/^org.//; $modconfig=~s/\./-/g; + if ( $project eq "emi" ) { $modconfig=~s/^glite/emi/; } # system("echo $m = $modconfig >> $TMPDIR/$newconfig.ini.$$"); printf(NEWCONF "$m = $modconfig\n"); diff --git a/org.glite.lb/etics-tag.pl b/org.glite.lb/etics-tag.pl index 223acf4..40b4b61 100755 --- a/org.glite.lb/etics-tag.pl +++ b/org.glite.lb/etics-tag.pl @@ -24,7 +24,7 @@ $GLITE_LB_LOCATION="./org.glite.lb"; if ($TMPDIR eq "") {$TMPDIR="/tmp";} -getopts('i:c:m:gh'); +getopts('i:c:m:p:gh'); $module = shift; @@ -38,6 +38,7 @@ usage: $0 [-i maj|min|rev|age|none|] [-g] [-c ] [-g] [-c ] [-g] [-c $TMPDIR/etics-tag-proj_configs.$$.tmp"); + + if ( !system("grep -x \"org.glite.HEAD\" $TMPDIR/etics-tag-proj_configs.$$.tmp > /dev/null") ) { $project = "org.glite"; } + else { + if ( !system("grep -x \"emi.HEAD\" $TMPDIR/etics-tag-proj_configs.$$.tmp > /dev/null") ) { $project = "emi"; } + else { die "Unable to autodetect project. Run from workspace root or specify by -p" } + } + + system("rm $TMPDIR/etics-tag-proj_configs.$$.tmp"); + } + + if ($project eq "emi") { $proj_opt = " --emi"; } + else { $proj_opt = ""; } + # According to the documentation, symbolic names in the 'cvs log' output are sorted by age so this should be OK #$current_tag=`cvs log -h $module/Makefile | grep \"_R_\" | head -n 1`; #$current_tag=~s/^\s//; @@ -197,6 +217,7 @@ usage: $0 [-i maj|min|rev|age|none|] [-g] [-c ] [-g] [-c ] [-g] [-c '/opt/c-ares', - classads => '/opt/classads', - cppunit => '/usr', - expat => '/usr', - globus => '/opt/globus', - myproxy => '/opt/myproxy', - gsoap => '/usr', - mysql => '/usr', - 'mysql-devel' => '', - 'mysql-server' => '', - voms => '/opt/glite', - gridsite => '/opt/glite', - lcas => '/opt/glite', - trustmanager => '/opt/glite', - utiljava => '/opt/glite', - ant => '/usr', - jdk => '/usr', - libtar => '/usr', - axis => '/usr', - log4c => '/usr', - postgresql => '/usr', - activemq => '/opt/activemq-cpp-library', - apr => '/opt/apr', - aprutil => '/opt/apr-util' +my %externs = ( + cares => { + prefix => '/opt/c-ares', + pkg => 'libcares' + }, + classads => { + prefix=> '/usr', + pkg => 'classads' + }, + cppunit => { + prefix=> '/usr', + pkg => 'cppunit' + }, + expat => { + prefix=> '/usr', + pkg => 'expat' + }, + globus => { + prefix=> '/opt/globus', + pkg => 'globus-gssapi-gsi' + }, + 'myproxy-essentials' => { + prefix=> '/opt/globus', + pkg => 'myproxy' + }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, + gsoap => { + prefix=> '/usr', + pkg => 'gsoap' + }, + mysql => { + prefix=> '/usr' + }, + 'mysql-devel' => { + prefix=> '' + }, + 'mysql-server' => { + prefix => '' + }, + voms => { + prefix => '/opt/glite', + pkg => 'voms-1.0' + }, + gridsite => { + prefix => '/opt/glite' + }, + lcas => { + prefix => '/opt/glite' + }, + trustmanager => { + prefix => '/opt/glite' + }, + utiljava => { + prefix=> '/opt/glite' + }, + ant => { + prefix=> '/usr' + }, + jdk => { + prefix=> '/usr' + }, + libtar => { + prefix=> '/usr' + }, + axis => { + prefix=> '/usr' + }, + log4c => { + prefix=> '/usr' + }, + postgresql => { + prefix=> '/usr' + } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -91,14 +156,15 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger logger-msg server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/proxyrenewal/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], 'gridsite' => [ qw/apache shared commands core/ ], + 'px' => [ qw/proxyrenewal glite-PX myproxy-yaim myproxy-config/ ], ); @@ -106,8 +172,8 @@ my @opts = ( 'prefix=s' => \$prefix, 'staged=s' => \$staged, 'module=s' => \$module, - 'thrflavour=s' => \$thrflavour, - 'nothrflavour=s' => \$nothrflavour, + 'thrflavour:s' => \$thrflavour, + 'nothrflavour:s' => \$nothrflavour, 'mode=s' => \$mode, 'listmodules=s' => \$listmodules, 'version=s' => \$version, @@ -117,10 +183,10 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, + 'emi' => \$emi, ); for (@nodes) { @@ -131,20 +197,26 @@ for (@nodes) { push @opts,"enable-$_",\$enable_nodes{$_}; } -push @opts,"with-$_=s",\$extern_prefix{$_} for keys %extern_prefix; +push @opts,"with-$_=s",\$externs{$_}{withprefix} for keys %externs; push @opts,"with-$_=s",\$jar{$_} for keys %jar; my @keeparg = @ARGV; GetOptions @opts or die "Errors parsing command line\n"; -$extern_prefix{'mysql-devel'}=$extern_prefix{mysql} if $extern_prefix{'mysql-devel'} eq ''; -$extern_prefix{'mysql-server'}=$extern_prefix{mysql} if $extern_prefix{'mysql-server'} eq ''; +$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; +$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -164,7 +236,33 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; + +if ($mode eq 'build') { for my $ext (keys %externs) { + if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } + elsif (defined $externs{$ext}{pkg}) { + my ($prefix, $flag); + my $pkg = $externs{$ext}{pkg}; + my $flagname = uc $externs{$ext}{pkg}; + $flagname =~ s/-[0-9\.]*$//; + $flagname =~ s/-/_/g; + + print "Checking $pkg ... "; + `pkg-config "$pkg" --exists >/dev/null`; + if ($? == 0) { + $externs{$ext}{prefix}=`pkg-config $pkg --variable=prefix`; + chomp $externs{$ext}{prefix}; + print "$externs{$ext}{prefix}\n"; + + $flag=`pkg-config $pkg --cflags`; + $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag); + $flag=`pkg-config $pkg --libs`; + $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); + } else { + print "(using default $externs{$ext}{prefix})\n"; + } + } +} } if ($dis) { for (@nodes) { @@ -181,7 +279,7 @@ $stagedir = $prefix unless $stagedir; if ($mode eq 'build') { print "Writing config.status\n"; open CONF,">config.status" or die "config.status: $!\n"; - print CONF "$0 @keeparg\n"; + print CONF "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH} $0 @keeparg\n"; close CONF; } @@ -227,8 +325,9 @@ sub mode_build { @myjars = keys %aux; print "\nRequired externals:\n"; - print "\t$_: $extern_prefix{$_}\n" for @ext; + print "\t$_: $externs{$_}{prefix}\n" for @ext; print "\t$_: $jar{$_}\n" for @myjars; + for (@ext) { if (defined($externs{$_}{flags})) { print "$externs{$_}{flags}"; } }; print "\nThis is a poor-man configure, it's up to you to have sources and externals there\n\n"; mkinc($_) for @modules; @@ -295,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -343,7 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.proxyrenewal' => [ qw/voms globus:B myproxy/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -354,6 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], + 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -435,7 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.proxyrenewal' => [ qw// ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -467,6 +561,11 @@ for my $jar (keys %need_jars) { 'jp.ws-interface' => [ qw// ], 'gridsite.core' => [ qw/build.common-cpp:B/ ], + + 'px.proxyrenewal' => [ qw// ], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], + 'px.myproxy-config' => [], ); for my $ext (keys %deps_aux) { @@ -491,6 +590,9 @@ for my $ext (keys %deps_aux) { %obsoletes = ( 'lb.yaim' => [ qq/glite-yaim-lb/ ], + 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], + 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -501,7 +603,7 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', + 'px' => 'org.glite', ); %conf_prefix = ( @@ -510,7 +612,16 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', + 'px' => 'glite-', +); + +%emi_conf_prefix = ( + 'lb' => 'emi-', + 'jp' => 'emi-', + 'jobid' => 'emi-', + 'lbjp-common' => 'emi-', + 'gridsite' => '', + 'px' => 'emi-', ); my @k = keys %deps_aux; @@ -536,8 +647,9 @@ sub mkinc lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java -lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface +lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface +px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config /; @aux{@m} = (1) x ($#m+1); @@ -574,7 +686,8 @@ libdir = $libdir }; for (@{$need_externs{$short}}) { - print MKINC "${_}_prefix = $extern_prefix{$_}\n" + print MKINC "${_}_prefix = $externs{$_}{prefix}\n"; + print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags}; } for (@{$need_jars{$short}}) { @@ -589,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -615,10 +728,20 @@ BEGIN{ apr=>'apr-dev', aprutil=>'aprutil-dev', ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' + ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -666,30 +789,48 @@ sub mode_etics { for (@{$need_externs{"$subsys.$module"}}) { if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + if ($emi) { + if ($ge{$_} and not defined $externs{$_}{pkg}) { + push @copts, "--with-$_=\${stageDir}"; + } + } else { + push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + } } } for (@{$need_jars{"$subsys.$module"}}) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,"--with-$_ \${$eext.location}/usr/share/java/$_*.jar"; + push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (not $emi); } my $conf; my $conftag; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; + + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; + if ($branch) { - $conf = "$conf_prefix{$subsys}${subsys}-${module}_$branch"; + $conf = "$confprefix${subsys}-${module}_$branch"; $conftag = $branch; # forced low age number $age = $branch eq 'HEAD' ? '0head' : '0dev'; } else { - $conf = "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; + $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; # XXX: gridsite hack - $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : $conf; } + $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : + "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; } + if ($emi) { + $age = "${age}emi"; + } + my $file = $output ? $output : "$conf.ini"; open C,">$file" or die "$file: $!\n"; @@ -728,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -738,8 +885,13 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor} --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; $cmd{compile} = 'make'; $cmd{test} = 'make check'; $cmd{install} = 'make install'; @@ -751,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -800,8 +949,9 @@ $buildroot aprSuffix = 0 package.RPMSLocation = \${moduleDir}/RPMTMP/RPMS package.SRPMSLocation = \${moduleDir}/RPMTMP/SRPMS -$package_description$package_summary$defprops -}; +package.preserve.libtool = false +$package_description$package_summary$defprops}; + for (@{$obsoletes{"$subsys.$module"}}) { print C "package.obsoletes = $_\n"; print C "package.replaces = $_\n"; @@ -828,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -839,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -848,12 +1001,13 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS sub gsoap_version { local $_; my $gsoap_version; - open S,"$extern_prefix{gsoap}/bin/soapcpp2 -v 2>&1 |" or die "$extern_prefix{gsoap}/bin/soapcpp2: $!\n"; + open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n"; while ($_ = ) { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -910,7 +1064,7 @@ sub getlibdir { } sub usage { - my @ext = keys %extern_prefix; + my @ext = keys %externs; my @myjars, keys %jar; print STDERR qq{ @@ -925,6 +1079,7 @@ General options (defaults in []): --version=maj.min.rev-age specify version here instead of reading version.properties --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...) --libdir=libdir typically [lib,lib64] postfix + --emi generate configurations with emi flavor in mode 'etics' Mode of operation: --mode={checkout|build|etics} what to do [build] @@ -932,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.lbjp-common.db/project/ChangeLog b/org.glite.lbjp-common.db/project/ChangeLog index 2a167f4..81c8e8e 100644 --- a/org.glite.lbjp-common.db/project/ChangeLog +++ b/org.glite.lbjp-common.db/project/ChangeLog @@ -60,3 +60,6 @@ 2.0.4-2 - Module rebuilt +2.0.4-3 +- Module rebuilt + diff --git a/org.glite.lbjp-common.db/project/version.properties b/org.glite.lbjp-common.db/project/version.properties index 864f172..e0912e6 100644 --- a/org.glite.lbjp-common.db/project/version.properties +++ b/org.glite.lbjp-common.db/project/version.properties @@ -1,3 +1,3 @@ : /cvs/jra1mw/org.glite.lbjp-common.db/project/version.properties,v 1.2 2009/01/21 10:44:34 zsustr Exp $ module.version=2.0.4 -module.age=2 +module.age=3 diff --git a/org.glite.lbjp-common.db/src/db-mysql.c b/org.glite.lbjp-common.db/src/db-mysql.c index ecec644..d3282a1 100644 --- a/org.glite.lbjp-common.db/src/db-mysql.c +++ b/org.glite.lbjp-common.db/src/db-mysql.c @@ -447,7 +447,7 @@ int glite_lbu_QueryIndicesMysql(glite_lbu_DBContext ctx_gen, const char *table, Key_name = Seq_in_index = Column_name = Sub_part = -1; asprintf(&sql, "show index from %s", table); - glite_common_log(ctx_gen->log_category, LOG_PRIORITY_DEBUG, sql); + glite_common_log_msg(ctx_gen->log_category, LOG_PRIORITY_DEBUG, sql); if (glite_lbu_ExecSQLMysql(ctx_gen,sql,&stmt)<0) { free(sql); return STATUS(ctx); @@ -961,7 +961,7 @@ static int transaction_test(glite_lbu_DBContext ctx, int *caps) { glite_lbu_FreeStmtMysql(&stmt); trio_asprintf(&cmd, "SHOW CREATE TABLE %|Ss", table[0]); - glite_common_log(ctx->log_category, LOG_PRIORITY_DEBUG, cmd); + glite_common_log_msg(ctx->log_category, LOG_PRIORITY_DEBUG, cmd); if (glite_lbu_ExecSQLMysql(ctx, cmd, &stmt) <= 0 || (retval = glite_lbu_FetchRowMysql(stmt, 2, NULL, res)) < 0 ) goto quit; if (retval != 2 || strcmp(res[0], table[0])) { ERR(ctx, EIO, "unexpected show create result"); diff --git a/org.glite.lbjp-common.db/src/db-pg.c b/org.glite.lbjp-common.db/src/db-pg.c index 1581ac8..81b0356 100644 --- a/org.glite.lbjp-common.db/src/db-pg.c +++ b/org.glite.lbjp-common.db/src/db-pg.c @@ -376,7 +376,7 @@ void glite_lbu_FreeStmtPsql(glite_lbu_Statement *stmt_gen) { if (stmt->res) psql_module.PQclear(stmt->res); if (stmt->name) { asprintf(&sql, "DEALLOCATE %s", stmt->name); - glite_common_log(ctx->generic.log_category, LOG_PRIORITY_DEBUG, sql); + glite_common_log_msg(ctx->generic.log_category, LOG_PRIORITY_DEBUG, sql); stmt->res = psql_module.PQexec(ctx->conn, sql); free(sql); psql_module.PQclear(stmt->res); @@ -470,7 +470,7 @@ int glite_lbu_PrepareStmtPsql(glite_lbu_DBContext ctx_gen, const char *sql, glit asprintf(&stmt->name, "%s%d", prepared_names[i], ++ctx->prepared_counts[i]); asprintf(&sqlPrep, "PREPARE %s AS %s", stmt->name, stmt->sql); - glite_common_log(ctx_gen->log_category, LOG_PRIORITY_DEBUG, sqlPrep); + glite_common_log_msg(ctx_gen->log_category, LOG_PRIORITY_DEBUG, sqlPrep); res = psql_module.PQexec(ctx->conn, sqlPrep); if (psql_module.PQresultStatus(res) != PGRES_COMMAND_OK) { asprintf(&s, "error preparing command: %s", psql_module.PQerrorMessage(ctx->conn)); @@ -600,7 +600,7 @@ int glite_lbu_ExecPreparedStmtPsql_v(glite_lbu_Statement stmt_gen, int n, va_lis } if (n) strcat(sql, ")"); - glite_common_log(ctx->generic.log_category, LOG_PRIORITY_DEBUG, sql); + glite_common_log_msg(ctx->generic.log_category, LOG_PRIORITY_DEBUG, sql); stmt->res = psql_module.PQexec(ctx->conn, sql); status = psql_module.PQresultStatus(stmt->res); if (status != PGRES_COMMAND_OK && status != PGRES_TUPLES_OK) { diff --git a/org.glite.lbjp-common.db/src/db.c b/org.glite.lbjp-common.db/src/db.c index 095a28b..d4a1760 100644 --- a/org.glite.lbjp-common.db/src/db.c +++ b/org.glite.lbjp-common.db/src/db.c @@ -396,7 +396,7 @@ static int flush_bufferd_insert(glite_lbu_bufInsert bi) trio_asprintf(&stmt, "insert into %|Ss(%|Ss) values %s;", bi->table_name, bi->columns, vals); - glite_common_log(bi->ctx->log_category, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(bi->ctx->log_category, LOG_PRIORITY_DEBUG, stmt); if (glite_lbu_ExecSQL(bi->ctx,stmt,NULL) < 0) { if (STATUS(bi->ctx) == EEXIST) diff --git a/org.glite.lbjp-common.gsoap-plugin/configure b/org.glite.lbjp-common.gsoap-plugin/configure index 598d569..76e67f9 100755 --- a/org.glite.lbjp-common.gsoap-plugin/configure +++ b/org.glite.lbjp-common.gsoap-plugin/configure @@ -41,11 +41,12 @@ my $output; my $lb_tag = ''; my $lbjp_tag = ''; my $jp_tag = ''; -my $sec_tag = ''; my $jobid_tag = ''; my $libdir = getlibdir(); +my $projectname; -my @nodes = qw/client server logger utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; + +my @nodes = qw/client server logger logger-msg utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; my %enable_nodes; my %disable_nodes; @@ -55,7 +56,7 @@ my %externs = ( pkg => 'libcares' }, classads => { - prefix=> '/opt/classads', + prefix=> '/usr', pkg => 'classads' }, cppunit => { @@ -70,10 +71,16 @@ my %externs = ( prefix=> '/opt/globus', pkg => 'globus-gssapi-gsi' }, - myproxy => { - prefix=> '/opt/myproxy', + 'myproxy-essentials' => { + prefix=> '/opt/globus', pkg => 'myproxy' }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, gsoap => { prefix=> '/usr', pkg => 'gsoap' @@ -121,6 +128,17 @@ my %externs = ( postgresql => { prefix=> '/usr' } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -138,10 +156,10 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/gss gsoap-plugin/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], @@ -165,7 +183,6 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, @@ -189,11 +206,17 @@ GetOptions @opts or die "Errors parsing command line\n"; $externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; $externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -213,7 +236,7 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; if ($mode eq 'build') { for my $ext (keys %externs) { if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } @@ -236,7 +259,7 @@ if ($mode eq 'build') { for my $ext (keys %externs) { $flag=`pkg-config $pkg --libs`; $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); } else { - print "(using default)\n"; + print "(using default $externs{$ext}{prefix})\n"; } } } } @@ -371,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -401,6 +417,7 @@ BEGIN{ 'lb.common' => [ qw/expat cares:B cppunit:B classads/ ], 'lb.doc' => [], 'lb.logger' => [ qw/cppunit:B/ ], + 'lb.logger-msg' => [ qw/cppunit:B activemq apr aprutil/ ], 'lb.server' => [ qw/globus_essentials:R globus:B expat cares mysql:R mysql-server:R mysql-devel:B cppunit:B gsoap:B classads voms lcas gridsite/ ], 'lb.state-machine' => [ qw/classads/ ], 'lb.utils' => [ qw/cppunit:B/ ], @@ -418,8 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], - 'security.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -430,10 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], - 'px.proxyrenewal' => [ qw/globus:B myproxy voms/ ], - 'px.glite-PX' => [qw/myproxy:R fetchcrl:R gip_service:R bdii:R glite_version:R/], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], - 'px.myproxy-config' => [], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -480,6 +495,9 @@ for my $jar (keys %need_jars) { lb.common lbjp-common.gss / ], + 'lb.logger-msg' => [ qw/ + lb.logger + / ], 'lb.server' => [ qw/ lb.ws-interface lb.types:B lb.common lb.state-machine lbjp-common.db lbjp-common.server-bones lbjp-common.trio lbjp-common.maildir lbjp-common.log @@ -512,8 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.gss' => [ qw// ], - 'security.gsoap-plugin' => [ qw/security.gss/ ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -547,8 +563,8 @@ for my $jar (keys %need_jars) { 'gridsite.core' => [ qw/build.common-cpp:B/ ], 'px.proxyrenewal' => [ qw// ], - 'px.glite-PX' => [qw/px.myproxy-yaim:R/], - 'px.myproxy-yaim' => [], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], 'px.myproxy-config' => [], ); @@ -576,7 +592,7 @@ for my $ext (keys %deps_aux) { 'lb.yaim' => [ qq/glite-yaim-lb/ ], 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], - 'px.myproxy-config' => [ qq/myproxy-config/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -587,7 +603,6 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', 'px' => 'org.glite', ); @@ -597,7 +612,6 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', 'px' => 'glite-', ); @@ -607,7 +621,6 @@ for my $ext (keys %deps_aux) { 'jobid' => 'emi-', 'lbjp-common' => 'emi-', 'gridsite' => '', - 'security' => 'emi-', 'px' => 'emi-', ); @@ -631,8 +644,8 @@ sub mkinc my %aux; undef %aux; my @m=qw/ -lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB -security.gss security.gsoap-plugin +lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB +lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface @@ -689,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -711,11 +724,24 @@ BEGIN{ glite_info_templates=>'glite-info-templates', glue_schema=>'glue-schema', yaim_core=>'org.glite.yaim.core', + activemq=>'activemq-cpp-library', + apr=>'apr-dev', + aprutil=>'aprutil-dev', + ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -781,12 +807,14 @@ sub mode_etics { my $conf; my $conftag; - my $confprefix; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; - if ($emi) { $confprefix = $emi_conf_prefix{$subsys} } - else { $confprefix = $conf_prefix{$subsys} } + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; if ($branch) { $conf = "$confprefix${subsys}-${module}_$branch"; @@ -841,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -851,6 +885,10 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; @@ -865,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -943,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -954,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -969,6 +1007,7 @@ sub gsoap_version { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -1048,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.lbjp-common.gss/configure b/org.glite.lbjp-common.gss/configure index 598d569..76e67f9 100755 --- a/org.glite.lbjp-common.gss/configure +++ b/org.glite.lbjp-common.gss/configure @@ -41,11 +41,12 @@ my $output; my $lb_tag = ''; my $lbjp_tag = ''; my $jp_tag = ''; -my $sec_tag = ''; my $jobid_tag = ''; my $libdir = getlibdir(); +my $projectname; -my @nodes = qw/client server logger utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; + +my @nodes = qw/client server logger logger-msg utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; my %enable_nodes; my %disable_nodes; @@ -55,7 +56,7 @@ my %externs = ( pkg => 'libcares' }, classads => { - prefix=> '/opt/classads', + prefix=> '/usr', pkg => 'classads' }, cppunit => { @@ -70,10 +71,16 @@ my %externs = ( prefix=> '/opt/globus', pkg => 'globus-gssapi-gsi' }, - myproxy => { - prefix=> '/opt/myproxy', + 'myproxy-essentials' => { + prefix=> '/opt/globus', pkg => 'myproxy' }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, gsoap => { prefix=> '/usr', pkg => 'gsoap' @@ -121,6 +128,17 @@ my %externs = ( postgresql => { prefix=> '/usr' } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -138,10 +156,10 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/gss gsoap-plugin/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], @@ -165,7 +183,6 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, @@ -189,11 +206,17 @@ GetOptions @opts or die "Errors parsing command line\n"; $externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; $externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -213,7 +236,7 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; if ($mode eq 'build') { for my $ext (keys %externs) { if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } @@ -236,7 +259,7 @@ if ($mode eq 'build') { for my $ext (keys %externs) { $flag=`pkg-config $pkg --libs`; $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); } else { - print "(using default)\n"; + print "(using default $externs{$ext}{prefix})\n"; } } } } @@ -371,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -401,6 +417,7 @@ BEGIN{ 'lb.common' => [ qw/expat cares:B cppunit:B classads/ ], 'lb.doc' => [], 'lb.logger' => [ qw/cppunit:B/ ], + 'lb.logger-msg' => [ qw/cppunit:B activemq apr aprutil/ ], 'lb.server' => [ qw/globus_essentials:R globus:B expat cares mysql:R mysql-server:R mysql-devel:B cppunit:B gsoap:B classads voms lcas gridsite/ ], 'lb.state-machine' => [ qw/classads/ ], 'lb.utils' => [ qw/cppunit:B/ ], @@ -418,8 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], - 'security.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -430,10 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], - 'px.proxyrenewal' => [ qw/globus:B myproxy voms/ ], - 'px.glite-PX' => [qw/myproxy:R fetchcrl:R gip_service:R bdii:R glite_version:R/], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], - 'px.myproxy-config' => [], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -480,6 +495,9 @@ for my $jar (keys %need_jars) { lb.common lbjp-common.gss / ], + 'lb.logger-msg' => [ qw/ + lb.logger + / ], 'lb.server' => [ qw/ lb.ws-interface lb.types:B lb.common lb.state-machine lbjp-common.db lbjp-common.server-bones lbjp-common.trio lbjp-common.maildir lbjp-common.log @@ -512,8 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.gss' => [ qw// ], - 'security.gsoap-plugin' => [ qw/security.gss/ ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -547,8 +563,8 @@ for my $jar (keys %need_jars) { 'gridsite.core' => [ qw/build.common-cpp:B/ ], 'px.proxyrenewal' => [ qw// ], - 'px.glite-PX' => [qw/px.myproxy-yaim:R/], - 'px.myproxy-yaim' => [], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], 'px.myproxy-config' => [], ); @@ -576,7 +592,7 @@ for my $ext (keys %deps_aux) { 'lb.yaim' => [ qq/glite-yaim-lb/ ], 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], - 'px.myproxy-config' => [ qq/myproxy-config/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -587,7 +603,6 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', 'px' => 'org.glite', ); @@ -597,7 +612,6 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', 'px' => 'glite-', ); @@ -607,7 +621,6 @@ for my $ext (keys %deps_aux) { 'jobid' => 'emi-', 'lbjp-common' => 'emi-', 'gridsite' => '', - 'security' => 'emi-', 'px' => 'emi-', ); @@ -631,8 +644,8 @@ sub mkinc my %aux; undef %aux; my @m=qw/ -lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB -security.gss security.gsoap-plugin +lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB +lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface @@ -689,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -711,11 +724,24 @@ BEGIN{ glite_info_templates=>'glite-info-templates', glue_schema=>'glue-schema', yaim_core=>'org.glite.yaim.core', + activemq=>'activemq-cpp-library', + apr=>'apr-dev', + aprutil=>'aprutil-dev', + ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -781,12 +807,14 @@ sub mode_etics { my $conf; my $conftag; - my $confprefix; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; - if ($emi) { $confprefix = $emi_conf_prefix{$subsys} } - else { $confprefix = $conf_prefix{$subsys} } + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; if ($branch) { $conf = "$confprefix${subsys}-${module}_$branch"; @@ -841,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -851,6 +885,10 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; @@ -865,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -943,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -954,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -969,6 +1007,7 @@ sub gsoap_version { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -1048,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.lbjp-common.jp-interface/Makefile b/org.glite.lbjp-common.jp-interface/Makefile index 310ff8d..4730cb0 100644 --- a/org.glite.lbjp-common.jp-interface/Makefile +++ b/org.glite.lbjp-common.jp-interface/Makefile @@ -10,8 +10,6 @@ version=0.0.0 PREFIX=/opt/glite globus_prefix=/opt/globus -nothrflavour=gcc32 -thrflavour=gcc32pthr expat_prefix=/opt/expat gsoap_prefix=/software/gsoap-2.6 @@ -56,29 +54,39 @@ THROBJS:=${OBJS:.o=.thr.lo} LIBS:=-L${stagedir}/${libdir} -lglite_jobid -lglite_lbu_db THRLIBS:=${LIBS} -commonlib:= libglite_jp_common_${nothrflavour}.la -commonlib_thr:= libglite_jp_common_${thrflavour}.la - -TEST_LIBS:=-L${cppunit_prefix}/${libdir} -lcppunit -ldl -TEST_INC:=-I${cppunit_prefix}/include +CPPUNIT_LIBS?=-L${cppunit_prefix}/${libdir} -lcppunit -ldl +CPPUNIT_CFLAGS?=-I${cppunit_prefix}/include +commonlib_nothr:= libglite_jp_common_${nothrflavour}.la +commonlib_thr:= libglite_jp_common_${thrflavour}.la +commonlib:= libglite_jp_common.la +ifeq (${thrflavour},) +lib_LTLIBRARIES=${commonlib} +default_commonlib=${commonlib} +else +lib_LTLIBRARIES=${commonlib_nothr} ${commonlib_thr} +default_commonlib=${commonlib_nothr} +endif default all: compile -compile: ${commonlib} ${commonlib_thr} +compile: ${lib_LTLIBRARIES} -${commonlib}: ${OBJS} +${commonlib_nothr}: ${OBJS} ${LINK} -o $@ ${OBJS} ${LIBS} ${commonlib_thr}: ${THROBJS} ${LINK} -o $@ ${THROBJS} ${THRLIBS} +${commonlib}: ${OBJS} + ${LINK} -o $@ ${OBJS} ${LIBS} + check: type_test LD_LIBRARY_PATH=${log4c_prefix}/${libdir}:${log4c_prefix}/lib:${LD_LIBRARY_PATH} ./type_test type_test.xml type_test: %: %.cpp compile - ${CXX} -c ${CFLAGS} ${TEST_INC} $< - ${LINKXX} -o $@ $@.o ${commonlib} ${TEST_LIBS} + ${CXX} -c ${CFLAGS} ${CPPUNIT_CFLAGS} $< + ${LINKXX} -o $@ $@.o ${default_commonlib} ${CPPUNIT_LIBS} doc: @@ -89,7 +97,7 @@ install: -mkdir -p ${PREFIX}/include/${globalprefix}/${jpprefix} cd ${top_srcdir}/interface && install -m 644 ${HDRS} ${PREFIX}/include/${globalprefix}/${jpprefix} -mkdir -p ${PREFIX}/${libdir} - ${INSTALL} -m 755 ${commonlib} ${commonlib_thr} ${PREFIX}/${libdir} + ${INSTALL} -m 755 ${lib_LTLIBRARIES} ${PREFIX}/${libdir} clean: rm -rvf *.o *.lo .libs lib* diff --git a/org.glite.lbjp-common.jp-interface/configure b/org.glite.lbjp-common.jp-interface/configure index 0d662fe..76e67f9 100755 --- a/org.glite.lbjp-common.jp-interface/configure +++ b/org.glite.lbjp-common.jp-interface/configure @@ -41,39 +41,104 @@ my $output; my $lb_tag = ''; my $lbjp_tag = ''; my $jp_tag = ''; -my $sec_tag = ''; my $jobid_tag = ''; my $libdir = getlibdir(); +my $projectname; + my @nodes = qw/client server logger logger-msg utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; my %enable_nodes; my %disable_nodes; -my %extern_prefix = ( - cares => '/opt/c-ares', - classads => '/opt/classads', - cppunit => '/usr', - expat => '/usr', - globus => '/opt/globus', - myproxy => '/opt/myproxy', - gsoap => '/usr', - mysql => '/usr', - 'mysql-devel' => '', - 'mysql-server' => '', - voms => '/opt/glite', - gridsite => '/opt/glite', - lcas => '/opt/glite', - trustmanager => '/opt/glite', - utiljava => '/opt/glite', - ant => '/usr', - jdk => '/usr', - libtar => '/usr', - axis => '/usr', - log4c => '/usr', - postgresql => '/usr', - activemq => '/opt/activemq-cpp-library', - apr => '/opt/apr', - aprutil => '/opt/apr-util' +my %externs = ( + cares => { + prefix => '/opt/c-ares', + pkg => 'libcares' + }, + classads => { + prefix=> '/usr', + pkg => 'classads' + }, + cppunit => { + prefix=> '/usr', + pkg => 'cppunit' + }, + expat => { + prefix=> '/usr', + pkg => 'expat' + }, + globus => { + prefix=> '/opt/globus', + pkg => 'globus-gssapi-gsi' + }, + 'myproxy-essentials' => { + prefix=> '/opt/globus', + pkg => 'myproxy' + }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, + gsoap => { + prefix=> '/usr', + pkg => 'gsoap' + }, + mysql => { + prefix=> '/usr' + }, + 'mysql-devel' => { + prefix=> '' + }, + 'mysql-server' => { + prefix => '' + }, + voms => { + prefix => '/opt/glite', + pkg => 'voms-1.0' + }, + gridsite => { + prefix => '/opt/glite' + }, + lcas => { + prefix => '/opt/glite' + }, + trustmanager => { + prefix => '/opt/glite' + }, + utiljava => { + prefix=> '/opt/glite' + }, + ant => { + prefix=> '/usr' + }, + jdk => { + prefix=> '/usr' + }, + libtar => { + prefix=> '/usr' + }, + axis => { + prefix=> '/usr' + }, + log4c => { + prefix=> '/usr' + }, + postgresql => { + prefix=> '/usr' + } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -91,14 +156,15 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger logger-msg server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/proxyrenewal/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], 'gridsite' => [ qw/apache shared commands core/ ], + 'px' => [ qw/proxyrenewal glite-PX myproxy-yaim myproxy-config/ ], ); @@ -106,8 +172,8 @@ my @opts = ( 'prefix=s' => \$prefix, 'staged=s' => \$staged, 'module=s' => \$module, - 'thrflavour=s' => \$thrflavour, - 'nothrflavour=s' => \$nothrflavour, + 'thrflavour:s' => \$thrflavour, + 'nothrflavour:s' => \$nothrflavour, 'mode=s' => \$mode, 'listmodules=s' => \$listmodules, 'version=s' => \$version, @@ -117,10 +183,10 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, + 'emi' => \$emi, ); for (@nodes) { @@ -131,20 +197,26 @@ for (@nodes) { push @opts,"enable-$_",\$enable_nodes{$_}; } -push @opts,"with-$_=s",\$extern_prefix{$_} for keys %extern_prefix; +push @opts,"with-$_=s",\$externs{$_}{withprefix} for keys %externs; push @opts,"with-$_=s",\$jar{$_} for keys %jar; my @keeparg = @ARGV; GetOptions @opts or die "Errors parsing command line\n"; -$extern_prefix{'mysql-devel'}=$extern_prefix{mysql} if $extern_prefix{'mysql-devel'} eq ''; -$extern_prefix{'mysql-server'}=$extern_prefix{mysql} if $extern_prefix{'mysql-server'} eq ''; +$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; +$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -164,7 +236,33 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; + +if ($mode eq 'build') { for my $ext (keys %externs) { + if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } + elsif (defined $externs{$ext}{pkg}) { + my ($prefix, $flag); + my $pkg = $externs{$ext}{pkg}; + my $flagname = uc $externs{$ext}{pkg}; + $flagname =~ s/-[0-9\.]*$//; + $flagname =~ s/-/_/g; + + print "Checking $pkg ... "; + `pkg-config "$pkg" --exists >/dev/null`; + if ($? == 0) { + $externs{$ext}{prefix}=`pkg-config $pkg --variable=prefix`; + chomp $externs{$ext}{prefix}; + print "$externs{$ext}{prefix}\n"; + + $flag=`pkg-config $pkg --cflags`; + $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag); + $flag=`pkg-config $pkg --libs`; + $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); + } else { + print "(using default $externs{$ext}{prefix})\n"; + } + } +} } if ($dis) { for (@nodes) { @@ -181,7 +279,7 @@ $stagedir = $prefix unless $stagedir; if ($mode eq 'build') { print "Writing config.status\n"; open CONF,">config.status" or die "config.status: $!\n"; - print CONF "$0 @keeparg\n"; + print CONF "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH} $0 @keeparg\n"; close CONF; } @@ -227,8 +325,9 @@ sub mode_build { @myjars = keys %aux; print "\nRequired externals:\n"; - print "\t$_: $extern_prefix{$_}\n" for @ext; + print "\t$_: $externs{$_}{prefix}\n" for @ext; print "\t$_: $jar{$_}\n" for @myjars; + for (@ext) { if (defined($externs{$_}{flags})) { print "$externs{$_}{flags}"; } }; print "\nThis is a poor-man configure, it's up to you to have sources and externals there\n\n"; mkinc($_) for @modules; @@ -295,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -343,7 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.proxyrenewal' => [ qw/voms globus:B myproxy/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -354,6 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], + 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -435,7 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.proxyrenewal' => [ qw// ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -467,6 +561,11 @@ for my $jar (keys %need_jars) { 'jp.ws-interface' => [ qw// ], 'gridsite.core' => [ qw/build.common-cpp:B/ ], + + 'px.proxyrenewal' => [ qw// ], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], + 'px.myproxy-config' => [], ); for my $ext (keys %deps_aux) { @@ -491,6 +590,9 @@ for my $ext (keys %deps_aux) { %obsoletes = ( 'lb.yaim' => [ qq/glite-yaim-lb/ ], + 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], + 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -501,7 +603,7 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', + 'px' => 'org.glite', ); %conf_prefix = ( @@ -510,7 +612,16 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', + 'px' => 'glite-', +); + +%emi_conf_prefix = ( + 'lb' => 'emi-', + 'jp' => 'emi-', + 'jobid' => 'emi-', + 'lbjp-common' => 'emi-', + 'gridsite' => '', + 'px' => 'emi-', ); my @k = keys %deps_aux; @@ -536,8 +647,9 @@ sub mkinc lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java -lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface +lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface +px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config /; @aux{@m} = (1) x ($#m+1); @@ -574,7 +686,8 @@ libdir = $libdir }; for (@{$need_externs{$short}}) { - print MKINC "${_}_prefix = $extern_prefix{$_}\n" + print MKINC "${_}_prefix = $externs{$_}{prefix}\n"; + print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags}; } for (@{$need_jars{$short}}) { @@ -589,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -615,10 +728,20 @@ BEGIN{ apr=>'apr-dev', aprutil=>'aprutil-dev', ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' + ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -666,30 +789,48 @@ sub mode_etics { for (@{$need_externs{"$subsys.$module"}}) { if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + if ($emi) { + if ($ge{$_} and not defined $externs{$_}{pkg}) { + push @copts, "--with-$_=\${stageDir}"; + } + } else { + push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + } } } for (@{$need_jars{"$subsys.$module"}}) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,"--with-$_ \${$eext.location}/usr/share/java/$_*.jar"; + push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (not $emi); } my $conf; my $conftag; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; + + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; + if ($branch) { - $conf = "$conf_prefix{$subsys}${subsys}-${module}_$branch"; + $conf = "$confprefix${subsys}-${module}_$branch"; $conftag = $branch; # forced low age number $age = $branch eq 'HEAD' ? '0head' : '0dev'; } else { - $conf = "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; + $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; # XXX: gridsite hack - $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : $conf; } + $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : + "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; } + if ($emi) { + $age = "${age}emi"; + } + my $file = $output ? $output : "$conf.ini"; open C,">$file" or die "$file: $!\n"; @@ -728,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -738,8 +885,13 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor} --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; $cmd{compile} = 'make'; $cmd{test} = 'make check'; $cmd{install} = 'make install'; @@ -751,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -800,8 +949,9 @@ $buildroot aprSuffix = 0 package.RPMSLocation = \${moduleDir}/RPMTMP/RPMS package.SRPMSLocation = \${moduleDir}/RPMTMP/SRPMS -$package_description$package_summary$defprops -}; +package.preserve.libtool = false +$package_description$package_summary$defprops}; + for (@{$obsoletes{"$subsys.$module"}}) { print C "package.obsoletes = $_\n"; print C "package.replaces = $_\n"; @@ -828,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -839,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -848,12 +1001,13 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS sub gsoap_version { local $_; my $gsoap_version; - open S,"$extern_prefix{gsoap}/bin/soapcpp2 -v 2>&1 |" or die "$extern_prefix{gsoap}/bin/soapcpp2: $!\n"; + open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n"; while ($_ = ) { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -910,7 +1064,7 @@ sub getlibdir { } sub usage { - my @ext = keys %extern_prefix; + my @ext = keys %externs; my @myjars, keys %jar; print STDERR qq{ @@ -925,6 +1079,7 @@ General options (defaults in []): --version=maj.min.rev-age specify version here instead of reading version.properties --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...) --libdir=libdir typically [lib,lib64] postfix + --emi generate configurations with emi flavor in mode 'etics' Mode of operation: --mode={checkout|build|etics} what to do [build] @@ -932,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.lbjp-common.jp-interface/project/ChangeLog b/org.glite.lbjp-common.jp-interface/project/ChangeLog index f2b52a6..24f1539 100644 --- a/org.glite.lbjp-common.jp-interface/project/ChangeLog +++ b/org.glite.lbjp-common.jp-interface/project/ChangeLog @@ -32,3 +32,6 @@ 2.0.2-2 - Module rebuilt +2.0.3-1 +- Makefile a configuration updated to work across org.glite & EMI + diff --git a/org.glite.lbjp-common.jp-interface/project/version.properties b/org.glite.lbjp-common.jp-interface/project/version.properties index be4ad82..bf37951 100644 --- a/org.glite.lbjp-common.jp-interface/project/version.properties +++ b/org.glite.lbjp-common.jp-interface/project/version.properties @@ -1,3 +1,3 @@ #: /cvs/jra1mw/org.glite.lbjp-common.jp-interface/project/version.properties,v 1.1.1.1 2009/01/21 14:43:52 zsustr Exp $ -module.version=2.0.2 -module.age=2 +module.version=2.0.3 +module.age=1 diff --git a/org.glite.lbjp-common.log/Makefile b/org.glite.lbjp-common.log/Makefile index 80846d0..26b420d 100644 --- a/org.glite.lbjp-common.log/Makefile +++ b/org.glite.lbjp-common.log/Makefile @@ -16,7 +16,7 @@ log4c_prefix=/usr version=${module.version} CC=gcc -VPATH=${top_srcdir}/interface:${top_srcdir}/src +VPATH=${top_srcdir}/interface:${top_srcdir}/src:${top_srcdir}/tests LOG4C_CFLAGS:=-I${log4c_prefix}/include LOG4C_LIBS:=-L${log4c_prefix}/${libdir} -L${log4c_prefix}/lib -llog4c @@ -78,10 +78,14 @@ clean: rm -rvf *.o *.lo .libs lib* rm -rvf log.xml project/ rpmbuild/ RPMS/ tgz/ debian/ -check: +check: test + LOG4C_RCPATH=${top_srcdir}/tests ./test ${LTLIB}: ${LOBJS} ${LINK} ${version_info} -o $@ $+ ${LOG4C_LIBS} +test: test.o + ${LINK} -o $@ $+ ${LTLIB} ${LOG4C_LIBS} + %.o %.lo: %.c ${COMPILE} -c $< diff --git a/org.glite.lbjp-common.log/config/log4crc b/org.glite.lbjp-common.log/config/log4crc index 2d65d8b..d1782db 100644 --- a/org.glite.lbjp-common.log/config/log4crc +++ b/org.glite.lbjp-common.log/config/log4crc @@ -4,7 +4,7 @@ - 0 + 1024 0 @@ -19,18 +19,20 @@ - + + + - + - - - + + + diff --git a/org.glite.lbjp-common.log/config/log4crc.debugging b/org.glite.lbjp-common.log/config/log4crc.debugging index 163e874..a21de78 100644 --- a/org.glite.lbjp-common.log/config/log4crc.debugging +++ b/org.glite.lbjp-common.log/config/log4crc.debugging @@ -4,7 +4,7 @@ - 0 + 1024 0 @@ -17,18 +17,19 @@ - + + - - - + + + diff --git a/org.glite.lbjp-common.log/configure b/org.glite.lbjp-common.log/configure index 0d662fe..76e67f9 100755 --- a/org.glite.lbjp-common.log/configure +++ b/org.glite.lbjp-common.log/configure @@ -41,39 +41,104 @@ my $output; my $lb_tag = ''; my $lbjp_tag = ''; my $jp_tag = ''; -my $sec_tag = ''; my $jobid_tag = ''; my $libdir = getlibdir(); +my $projectname; + my @nodes = qw/client server logger logger-msg utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; my %enable_nodes; my %disable_nodes; -my %extern_prefix = ( - cares => '/opt/c-ares', - classads => '/opt/classads', - cppunit => '/usr', - expat => '/usr', - globus => '/opt/globus', - myproxy => '/opt/myproxy', - gsoap => '/usr', - mysql => '/usr', - 'mysql-devel' => '', - 'mysql-server' => '', - voms => '/opt/glite', - gridsite => '/opt/glite', - lcas => '/opt/glite', - trustmanager => '/opt/glite', - utiljava => '/opt/glite', - ant => '/usr', - jdk => '/usr', - libtar => '/usr', - axis => '/usr', - log4c => '/usr', - postgresql => '/usr', - activemq => '/opt/activemq-cpp-library', - apr => '/opt/apr', - aprutil => '/opt/apr-util' +my %externs = ( + cares => { + prefix => '/opt/c-ares', + pkg => 'libcares' + }, + classads => { + prefix=> '/usr', + pkg => 'classads' + }, + cppunit => { + prefix=> '/usr', + pkg => 'cppunit' + }, + expat => { + prefix=> '/usr', + pkg => 'expat' + }, + globus => { + prefix=> '/opt/globus', + pkg => 'globus-gssapi-gsi' + }, + 'myproxy-essentials' => { + prefix=> '/opt/globus', + pkg => 'myproxy' + }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, + gsoap => { + prefix=> '/usr', + pkg => 'gsoap' + }, + mysql => { + prefix=> '/usr' + }, + 'mysql-devel' => { + prefix=> '' + }, + 'mysql-server' => { + prefix => '' + }, + voms => { + prefix => '/opt/glite', + pkg => 'voms-1.0' + }, + gridsite => { + prefix => '/opt/glite' + }, + lcas => { + prefix => '/opt/glite' + }, + trustmanager => { + prefix => '/opt/glite' + }, + utiljava => { + prefix=> '/opt/glite' + }, + ant => { + prefix=> '/usr' + }, + jdk => { + prefix=> '/usr' + }, + libtar => { + prefix=> '/usr' + }, + axis => { + prefix=> '/usr' + }, + log4c => { + prefix=> '/usr' + }, + postgresql => { + prefix=> '/usr' + } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -91,14 +156,15 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger logger-msg server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/proxyrenewal/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], 'gridsite' => [ qw/apache shared commands core/ ], + 'px' => [ qw/proxyrenewal glite-PX myproxy-yaim myproxy-config/ ], ); @@ -106,8 +172,8 @@ my @opts = ( 'prefix=s' => \$prefix, 'staged=s' => \$staged, 'module=s' => \$module, - 'thrflavour=s' => \$thrflavour, - 'nothrflavour=s' => \$nothrflavour, + 'thrflavour:s' => \$thrflavour, + 'nothrflavour:s' => \$nothrflavour, 'mode=s' => \$mode, 'listmodules=s' => \$listmodules, 'version=s' => \$version, @@ -117,10 +183,10 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, + 'emi' => \$emi, ); for (@nodes) { @@ -131,20 +197,26 @@ for (@nodes) { push @opts,"enable-$_",\$enable_nodes{$_}; } -push @opts,"with-$_=s",\$extern_prefix{$_} for keys %extern_prefix; +push @opts,"with-$_=s",\$externs{$_}{withprefix} for keys %externs; push @opts,"with-$_=s",\$jar{$_} for keys %jar; my @keeparg = @ARGV; GetOptions @opts or die "Errors parsing command line\n"; -$extern_prefix{'mysql-devel'}=$extern_prefix{mysql} if $extern_prefix{'mysql-devel'} eq ''; -$extern_prefix{'mysql-server'}=$extern_prefix{mysql} if $extern_prefix{'mysql-server'} eq ''; +$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; +$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -164,7 +236,33 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; + +if ($mode eq 'build') { for my $ext (keys %externs) { + if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } + elsif (defined $externs{$ext}{pkg}) { + my ($prefix, $flag); + my $pkg = $externs{$ext}{pkg}; + my $flagname = uc $externs{$ext}{pkg}; + $flagname =~ s/-[0-9\.]*$//; + $flagname =~ s/-/_/g; + + print "Checking $pkg ... "; + `pkg-config "$pkg" --exists >/dev/null`; + if ($? == 0) { + $externs{$ext}{prefix}=`pkg-config $pkg --variable=prefix`; + chomp $externs{$ext}{prefix}; + print "$externs{$ext}{prefix}\n"; + + $flag=`pkg-config $pkg --cflags`; + $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag); + $flag=`pkg-config $pkg --libs`; + $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); + } else { + print "(using default $externs{$ext}{prefix})\n"; + } + } +} } if ($dis) { for (@nodes) { @@ -181,7 +279,7 @@ $stagedir = $prefix unless $stagedir; if ($mode eq 'build') { print "Writing config.status\n"; open CONF,">config.status" or die "config.status: $!\n"; - print CONF "$0 @keeparg\n"; + print CONF "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH} $0 @keeparg\n"; close CONF; } @@ -227,8 +325,9 @@ sub mode_build { @myjars = keys %aux; print "\nRequired externals:\n"; - print "\t$_: $extern_prefix{$_}\n" for @ext; + print "\t$_: $externs{$_}{prefix}\n" for @ext; print "\t$_: $jar{$_}\n" for @myjars; + for (@ext) { if (defined($externs{$_}{flags})) { print "$externs{$_}{flags}"; } }; print "\nThis is a poor-man configure, it's up to you to have sources and externals there\n\n"; mkinc($_) for @modules; @@ -295,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -343,7 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.proxyrenewal' => [ qw/voms globus:B myproxy/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -354,6 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], + 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -435,7 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.proxyrenewal' => [ qw// ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -467,6 +561,11 @@ for my $jar (keys %need_jars) { 'jp.ws-interface' => [ qw// ], 'gridsite.core' => [ qw/build.common-cpp:B/ ], + + 'px.proxyrenewal' => [ qw// ], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], + 'px.myproxy-config' => [], ); for my $ext (keys %deps_aux) { @@ -491,6 +590,9 @@ for my $ext (keys %deps_aux) { %obsoletes = ( 'lb.yaim' => [ qq/glite-yaim-lb/ ], + 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], + 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -501,7 +603,7 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', + 'px' => 'org.glite', ); %conf_prefix = ( @@ -510,7 +612,16 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', + 'px' => 'glite-', +); + +%emi_conf_prefix = ( + 'lb' => 'emi-', + 'jp' => 'emi-', + 'jobid' => 'emi-', + 'lbjp-common' => 'emi-', + 'gridsite' => '', + 'px' => 'emi-', ); my @k = keys %deps_aux; @@ -536,8 +647,9 @@ sub mkinc lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java -lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface +lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface +px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config /; @aux{@m} = (1) x ($#m+1); @@ -574,7 +686,8 @@ libdir = $libdir }; for (@{$need_externs{$short}}) { - print MKINC "${_}_prefix = $extern_prefix{$_}\n" + print MKINC "${_}_prefix = $externs{$_}{prefix}\n"; + print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags}; } for (@{$need_jars{$short}}) { @@ -589,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -615,10 +728,20 @@ BEGIN{ apr=>'apr-dev', aprutil=>'aprutil-dev', ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' + ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -666,30 +789,48 @@ sub mode_etics { for (@{$need_externs{"$subsys.$module"}}) { if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + if ($emi) { + if ($ge{$_} and not defined $externs{$_}{pkg}) { + push @copts, "--with-$_=\${stageDir}"; + } + } else { + push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + } } } for (@{$need_jars{"$subsys.$module"}}) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,"--with-$_ \${$eext.location}/usr/share/java/$_*.jar"; + push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (not $emi); } my $conf; my $conftag; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; + + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; + if ($branch) { - $conf = "$conf_prefix{$subsys}${subsys}-${module}_$branch"; + $conf = "$confprefix${subsys}-${module}_$branch"; $conftag = $branch; # forced low age number $age = $branch eq 'HEAD' ? '0head' : '0dev'; } else { - $conf = "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; + $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; # XXX: gridsite hack - $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : $conf; } + $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : + "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; } + if ($emi) { + $age = "${age}emi"; + } + my $file = $output ? $output : "$conf.ini"; open C,">$file" or die "$file: $!\n"; @@ -728,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -738,8 +885,13 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor} --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; $cmd{compile} = 'make'; $cmd{test} = 'make check'; $cmd{install} = 'make install'; @@ -751,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -800,8 +949,9 @@ $buildroot aprSuffix = 0 package.RPMSLocation = \${moduleDir}/RPMTMP/RPMS package.SRPMSLocation = \${moduleDir}/RPMTMP/SRPMS -$package_description$package_summary$defprops -}; +package.preserve.libtool = false +$package_description$package_summary$defprops}; + for (@{$obsoletes{"$subsys.$module"}}) { print C "package.obsoletes = $_\n"; print C "package.replaces = $_\n"; @@ -828,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -839,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -848,12 +1001,13 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS sub gsoap_version { local $_; my $gsoap_version; - open S,"$extern_prefix{gsoap}/bin/soapcpp2 -v 2>&1 |" or die "$extern_prefix{gsoap}/bin/soapcpp2: $!\n"; + open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n"; while ($_ = ) { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -910,7 +1064,7 @@ sub getlibdir { } sub usage { - my @ext = keys %extern_prefix; + my @ext = keys %externs; my @myjars, keys %jar; print STDERR qq{ @@ -925,6 +1079,7 @@ General options (defaults in []): --version=maj.min.rev-age specify version here instead of reading version.properties --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...) --libdir=libdir typically [lib,lib64] postfix + --emi generate configurations with emi flavor in mode 'etics' Mode of operation: --mode={checkout|build|etics} what to do [build] @@ -932,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.lbjp-common.log/project/ChangeLog b/org.glite.lbjp-common.log/project/ChangeLog index 53c36dc..0eb1a1f 100644 --- a/org.glite.lbjp-common.log/project/ChangeLog +++ b/org.glite.lbjp-common.log/project/ChangeLog @@ -18,3 +18,6 @@ 1.0.3-2 - Module rebuilt +1.0.4-1 +- Makefile adopts compilation and linking flags from the environment. + diff --git a/org.glite.lbjp-common.log/project/version.properties b/org.glite.lbjp-common.log/project/version.properties index 5b89f40..0b9fd97 100644 --- a/org.glite.lbjp-common.log/project/version.properties +++ b/org.glite.lbjp-common.log/project/version.properties @@ -1,4 +1,4 @@ # $Header$ -module.version=1.0.3 -module.age=2 +module.version=1.0.4 +module.age=1 diff --git a/org.glite.lbjp-common.log/src/log.c b/org.glite.lbjp-common.log/src/log.c index 485d7db..0dad938 100644 --- a/org.glite.lbjp-common.log/src/log.c +++ b/org.glite.lbjp-common.log/src/log.c @@ -59,7 +59,7 @@ void glite_common_log_msg(char *catName,int a_priority, char *msg) { const log4c_category_t* a_category = log4c_category_get(catName); if (log4c_category_is_priority_enabled(a_category, a_priority)) { - log4c_category_log(log4c_category_get(catName), a_priority, msg); + log4c_category_log(log4c_category_get(catName), a_priority, "%s", msg); } #else printf(msg); diff --git a/org.glite.lbjp-common.log/src/log.h b/org.glite.lbjp-common.log/src/log.h index bfbdc14..25ab863 100644 --- a/org.glite.lbjp-common.log/src/log.h +++ b/org.glite.lbjp-common.log/src/log.h @@ -83,7 +83,7 @@ extern void glite_common_log_msg(char *catName,int a_priority, char *msg); * @param a_format Format specifier for the string to write in the log file. * @param ... The arguments for a_format **/ -extern void glite_common_log(char *catName,int a_priority, const char* a_format,...); +extern void glite_common_log(char *catName,int a_priority, const char* a_format,...) __attribute__((format(printf, 3, 4))); /** * Returns priority as a string diff --git a/org.glite.lbjp-common.log/tests/log4crc b/org.glite.lbjp-common.log/tests/log4crc new file mode 100644 index 0000000..575056f --- /dev/null +++ b/org.glite.lbjp-common.log/tests/log4crc @@ -0,0 +1,17 @@ + + + + + + 512 + + 0 + + + + + + + + + diff --git a/org.glite.lbjp-common.log/tests/test.c b/org.glite.lbjp-common.log/tests/test.c new file mode 100644 index 0000000..524cb4e --- /dev/null +++ b/org.glite.lbjp-common.log/tests/test.c @@ -0,0 +1,32 @@ +#include +#include + +#include "log.h" + +int main() { + char *line = NULL; + size_t i, n; + const char *testcat = "miaow"; + + n = 10000; + line = malloc(n); + for (i = 0; i < n; i++) line[i] = (i % 64) ? 'A' : '\n'; + line[n - 3] = '#'; + line[n - 2] = '\n'; + line[n - 1] = '\0'; + + + if (glite_common_log_init()) { + fprintf(stderr,"glite_common_log_init() failed, exiting."); + return 2; + } + + glite_common_log(testcat, LOG_PRIORITY_ERROR, "%s", line); + glite_common_log(testcat, LOG_PRIORITY_DEBUG, "%s", line); + printf("%s\n", line); + + glite_common_log_fini(); + + free(line); + return 0; +} diff --git a/org.glite.lbjp-common.maildir/configure b/org.glite.lbjp-common.maildir/configure index 0d662fe..76e67f9 100755 --- a/org.glite.lbjp-common.maildir/configure +++ b/org.glite.lbjp-common.maildir/configure @@ -41,39 +41,104 @@ my $output; my $lb_tag = ''; my $lbjp_tag = ''; my $jp_tag = ''; -my $sec_tag = ''; my $jobid_tag = ''; my $libdir = getlibdir(); +my $projectname; + my @nodes = qw/client server logger logger-msg utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; my %enable_nodes; my %disable_nodes; -my %extern_prefix = ( - cares => '/opt/c-ares', - classads => '/opt/classads', - cppunit => '/usr', - expat => '/usr', - globus => '/opt/globus', - myproxy => '/opt/myproxy', - gsoap => '/usr', - mysql => '/usr', - 'mysql-devel' => '', - 'mysql-server' => '', - voms => '/opt/glite', - gridsite => '/opt/glite', - lcas => '/opt/glite', - trustmanager => '/opt/glite', - utiljava => '/opt/glite', - ant => '/usr', - jdk => '/usr', - libtar => '/usr', - axis => '/usr', - log4c => '/usr', - postgresql => '/usr', - activemq => '/opt/activemq-cpp-library', - apr => '/opt/apr', - aprutil => '/opt/apr-util' +my %externs = ( + cares => { + prefix => '/opt/c-ares', + pkg => 'libcares' + }, + classads => { + prefix=> '/usr', + pkg => 'classads' + }, + cppunit => { + prefix=> '/usr', + pkg => 'cppunit' + }, + expat => { + prefix=> '/usr', + pkg => 'expat' + }, + globus => { + prefix=> '/opt/globus', + pkg => 'globus-gssapi-gsi' + }, + 'myproxy-essentials' => { + prefix=> '/opt/globus', + pkg => 'myproxy' + }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, + gsoap => { + prefix=> '/usr', + pkg => 'gsoap' + }, + mysql => { + prefix=> '/usr' + }, + 'mysql-devel' => { + prefix=> '' + }, + 'mysql-server' => { + prefix => '' + }, + voms => { + prefix => '/opt/glite', + pkg => 'voms-1.0' + }, + gridsite => { + prefix => '/opt/glite' + }, + lcas => { + prefix => '/opt/glite' + }, + trustmanager => { + prefix => '/opt/glite' + }, + utiljava => { + prefix=> '/opt/glite' + }, + ant => { + prefix=> '/usr' + }, + jdk => { + prefix=> '/usr' + }, + libtar => { + prefix=> '/usr' + }, + axis => { + prefix=> '/usr' + }, + log4c => { + prefix=> '/usr' + }, + postgresql => { + prefix=> '/usr' + } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -91,14 +156,15 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger logger-msg server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/proxyrenewal/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], 'gridsite' => [ qw/apache shared commands core/ ], + 'px' => [ qw/proxyrenewal glite-PX myproxy-yaim myproxy-config/ ], ); @@ -106,8 +172,8 @@ my @opts = ( 'prefix=s' => \$prefix, 'staged=s' => \$staged, 'module=s' => \$module, - 'thrflavour=s' => \$thrflavour, - 'nothrflavour=s' => \$nothrflavour, + 'thrflavour:s' => \$thrflavour, + 'nothrflavour:s' => \$nothrflavour, 'mode=s' => \$mode, 'listmodules=s' => \$listmodules, 'version=s' => \$version, @@ -117,10 +183,10 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, + 'emi' => \$emi, ); for (@nodes) { @@ -131,20 +197,26 @@ for (@nodes) { push @opts,"enable-$_",\$enable_nodes{$_}; } -push @opts,"with-$_=s",\$extern_prefix{$_} for keys %extern_prefix; +push @opts,"with-$_=s",\$externs{$_}{withprefix} for keys %externs; push @opts,"with-$_=s",\$jar{$_} for keys %jar; my @keeparg = @ARGV; GetOptions @opts or die "Errors parsing command line\n"; -$extern_prefix{'mysql-devel'}=$extern_prefix{mysql} if $extern_prefix{'mysql-devel'} eq ''; -$extern_prefix{'mysql-server'}=$extern_prefix{mysql} if $extern_prefix{'mysql-server'} eq ''; +$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; +$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -164,7 +236,33 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; + +if ($mode eq 'build') { for my $ext (keys %externs) { + if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } + elsif (defined $externs{$ext}{pkg}) { + my ($prefix, $flag); + my $pkg = $externs{$ext}{pkg}; + my $flagname = uc $externs{$ext}{pkg}; + $flagname =~ s/-[0-9\.]*$//; + $flagname =~ s/-/_/g; + + print "Checking $pkg ... "; + `pkg-config "$pkg" --exists >/dev/null`; + if ($? == 0) { + $externs{$ext}{prefix}=`pkg-config $pkg --variable=prefix`; + chomp $externs{$ext}{prefix}; + print "$externs{$ext}{prefix}\n"; + + $flag=`pkg-config $pkg --cflags`; + $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag); + $flag=`pkg-config $pkg --libs`; + $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); + } else { + print "(using default $externs{$ext}{prefix})\n"; + } + } +} } if ($dis) { for (@nodes) { @@ -181,7 +279,7 @@ $stagedir = $prefix unless $stagedir; if ($mode eq 'build') { print "Writing config.status\n"; open CONF,">config.status" or die "config.status: $!\n"; - print CONF "$0 @keeparg\n"; + print CONF "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH} $0 @keeparg\n"; close CONF; } @@ -227,8 +325,9 @@ sub mode_build { @myjars = keys %aux; print "\nRequired externals:\n"; - print "\t$_: $extern_prefix{$_}\n" for @ext; + print "\t$_: $externs{$_}{prefix}\n" for @ext; print "\t$_: $jar{$_}\n" for @myjars; + for (@ext) { if (defined($externs{$_}{flags})) { print "$externs{$_}{flags}"; } }; print "\nThis is a poor-man configure, it's up to you to have sources and externals there\n\n"; mkinc($_) for @modules; @@ -295,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -343,7 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.proxyrenewal' => [ qw/voms globus:B myproxy/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -354,6 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], + 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -435,7 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.proxyrenewal' => [ qw// ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -467,6 +561,11 @@ for my $jar (keys %need_jars) { 'jp.ws-interface' => [ qw// ], 'gridsite.core' => [ qw/build.common-cpp:B/ ], + + 'px.proxyrenewal' => [ qw// ], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], + 'px.myproxy-config' => [], ); for my $ext (keys %deps_aux) { @@ -491,6 +590,9 @@ for my $ext (keys %deps_aux) { %obsoletes = ( 'lb.yaim' => [ qq/glite-yaim-lb/ ], + 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], + 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -501,7 +603,7 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', + 'px' => 'org.glite', ); %conf_prefix = ( @@ -510,7 +612,16 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', + 'px' => 'glite-', +); + +%emi_conf_prefix = ( + 'lb' => 'emi-', + 'jp' => 'emi-', + 'jobid' => 'emi-', + 'lbjp-common' => 'emi-', + 'gridsite' => '', + 'px' => 'emi-', ); my @k = keys %deps_aux; @@ -536,8 +647,9 @@ sub mkinc lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java -lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface +lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface +px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config /; @aux{@m} = (1) x ($#m+1); @@ -574,7 +686,8 @@ libdir = $libdir }; for (@{$need_externs{$short}}) { - print MKINC "${_}_prefix = $extern_prefix{$_}\n" + print MKINC "${_}_prefix = $externs{$_}{prefix}\n"; + print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags}; } for (@{$need_jars{$short}}) { @@ -589,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -615,10 +728,20 @@ BEGIN{ apr=>'apr-dev', aprutil=>'aprutil-dev', ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' + ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -666,30 +789,48 @@ sub mode_etics { for (@{$need_externs{"$subsys.$module"}}) { if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + if ($emi) { + if ($ge{$_} and not defined $externs{$_}{pkg}) { + push @copts, "--with-$_=\${stageDir}"; + } + } else { + push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + } } } for (@{$need_jars{"$subsys.$module"}}) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,"--with-$_ \${$eext.location}/usr/share/java/$_*.jar"; + push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (not $emi); } my $conf; my $conftag; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; + + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; + if ($branch) { - $conf = "$conf_prefix{$subsys}${subsys}-${module}_$branch"; + $conf = "$confprefix${subsys}-${module}_$branch"; $conftag = $branch; # forced low age number $age = $branch eq 'HEAD' ? '0head' : '0dev'; } else { - $conf = "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; + $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; # XXX: gridsite hack - $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : $conf; } + $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : + "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; } + if ($emi) { + $age = "${age}emi"; + } + my $file = $output ? $output : "$conf.ini"; open C,">$file" or die "$file: $!\n"; @@ -728,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -738,8 +885,13 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor} --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; $cmd{compile} = 'make'; $cmd{test} = 'make check'; $cmd{install} = 'make install'; @@ -751,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -800,8 +949,9 @@ $buildroot aprSuffix = 0 package.RPMSLocation = \${moduleDir}/RPMTMP/RPMS package.SRPMSLocation = \${moduleDir}/RPMTMP/SRPMS -$package_description$package_summary$defprops -}; +package.preserve.libtool = false +$package_description$package_summary$defprops}; + for (@{$obsoletes{"$subsys.$module"}}) { print C "package.obsoletes = $_\n"; print C "package.replaces = $_\n"; @@ -828,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -839,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -848,12 +1001,13 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS sub gsoap_version { local $_; my $gsoap_version; - open S,"$extern_prefix{gsoap}/bin/soapcpp2 -v 2>&1 |" or die "$extern_prefix{gsoap}/bin/soapcpp2: $!\n"; + open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n"; while ($_ = ) { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -910,7 +1064,7 @@ sub getlibdir { } sub usage { - my @ext = keys %extern_prefix; + my @ext = keys %externs; my @myjars, keys %jar; print STDERR qq{ @@ -925,6 +1079,7 @@ General options (defaults in []): --version=maj.min.rev-age specify version here instead of reading version.properties --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...) --libdir=libdir typically [lib,lib64] postfix + --emi generate configurations with emi flavor in mode 'etics' Mode of operation: --mode={checkout|build|etics} what to do [build] @@ -932,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.lbjp-common.maildir/project/ChangeLog b/org.glite.lbjp-common.maildir/project/ChangeLog index d5486a5..2395028 100644 --- a/org.glite.lbjp-common.maildir/project/ChangeLog +++ b/org.glite.lbjp-common.maildir/project/ChangeLog @@ -23,3 +23,6 @@ 2.0.1-2 - Module rebuilt +2.0.2-1 +- Makefile adopts compilation and linking flags from the environment. + diff --git a/org.glite.lbjp-common.maildir/project/version.properties b/org.glite.lbjp-common.maildir/project/version.properties index 66b27cf..55e34a9 100644 --- a/org.glite.lbjp-common.maildir/project/version.properties +++ b/org.glite.lbjp-common.maildir/project/version.properties @@ -1,3 +1,3 @@ # : /cvs/jra1mw/org.glite.lbjp-common.maildir/project/version.properties,v 1.1 2007/11/01 20:17:45 valtri Exp $ -module.version=2.0.1 -module.age=2 +module.version=2.0.2 +module.age=1 diff --git a/org.glite.lbjp-common.server-bones/configure b/org.glite.lbjp-common.server-bones/configure index 0d662fe..76e67f9 100755 --- a/org.glite.lbjp-common.server-bones/configure +++ b/org.glite.lbjp-common.server-bones/configure @@ -41,39 +41,104 @@ my $output; my $lb_tag = ''; my $lbjp_tag = ''; my $jp_tag = ''; -my $sec_tag = ''; my $jobid_tag = ''; my $libdir = getlibdir(); +my $projectname; + my @nodes = qw/client server logger logger-msg utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; my %enable_nodes; my %disable_nodes; -my %extern_prefix = ( - cares => '/opt/c-ares', - classads => '/opt/classads', - cppunit => '/usr', - expat => '/usr', - globus => '/opt/globus', - myproxy => '/opt/myproxy', - gsoap => '/usr', - mysql => '/usr', - 'mysql-devel' => '', - 'mysql-server' => '', - voms => '/opt/glite', - gridsite => '/opt/glite', - lcas => '/opt/glite', - trustmanager => '/opt/glite', - utiljava => '/opt/glite', - ant => '/usr', - jdk => '/usr', - libtar => '/usr', - axis => '/usr', - log4c => '/usr', - postgresql => '/usr', - activemq => '/opt/activemq-cpp-library', - apr => '/opt/apr', - aprutil => '/opt/apr-util' +my %externs = ( + cares => { + prefix => '/opt/c-ares', + pkg => 'libcares' + }, + classads => { + prefix=> '/usr', + pkg => 'classads' + }, + cppunit => { + prefix=> '/usr', + pkg => 'cppunit' + }, + expat => { + prefix=> '/usr', + pkg => 'expat' + }, + globus => { + prefix=> '/opt/globus', + pkg => 'globus-gssapi-gsi' + }, + 'myproxy-essentials' => { + prefix=> '/opt/globus', + pkg => 'myproxy' + }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, + gsoap => { + prefix=> '/usr', + pkg => 'gsoap' + }, + mysql => { + prefix=> '/usr' + }, + 'mysql-devel' => { + prefix=> '' + }, + 'mysql-server' => { + prefix => '' + }, + voms => { + prefix => '/opt/glite', + pkg => 'voms-1.0' + }, + gridsite => { + prefix => '/opt/glite' + }, + lcas => { + prefix => '/opt/glite' + }, + trustmanager => { + prefix => '/opt/glite' + }, + utiljava => { + prefix=> '/opt/glite' + }, + ant => { + prefix=> '/usr' + }, + jdk => { + prefix=> '/usr' + }, + libtar => { + prefix=> '/usr' + }, + axis => { + prefix=> '/usr' + }, + log4c => { + prefix=> '/usr' + }, + postgresql => { + prefix=> '/usr' + } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -91,14 +156,15 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger logger-msg server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/proxyrenewal/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], 'gridsite' => [ qw/apache shared commands core/ ], + 'px' => [ qw/proxyrenewal glite-PX myproxy-yaim myproxy-config/ ], ); @@ -106,8 +172,8 @@ my @opts = ( 'prefix=s' => \$prefix, 'staged=s' => \$staged, 'module=s' => \$module, - 'thrflavour=s' => \$thrflavour, - 'nothrflavour=s' => \$nothrflavour, + 'thrflavour:s' => \$thrflavour, + 'nothrflavour:s' => \$nothrflavour, 'mode=s' => \$mode, 'listmodules=s' => \$listmodules, 'version=s' => \$version, @@ -117,10 +183,10 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, + 'emi' => \$emi, ); for (@nodes) { @@ -131,20 +197,26 @@ for (@nodes) { push @opts,"enable-$_",\$enable_nodes{$_}; } -push @opts,"with-$_=s",\$extern_prefix{$_} for keys %extern_prefix; +push @opts,"with-$_=s",\$externs{$_}{withprefix} for keys %externs; push @opts,"with-$_=s",\$jar{$_} for keys %jar; my @keeparg = @ARGV; GetOptions @opts or die "Errors parsing command line\n"; -$extern_prefix{'mysql-devel'}=$extern_prefix{mysql} if $extern_prefix{'mysql-devel'} eq ''; -$extern_prefix{'mysql-server'}=$extern_prefix{mysql} if $extern_prefix{'mysql-server'} eq ''; +$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; +$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -164,7 +236,33 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; + +if ($mode eq 'build') { for my $ext (keys %externs) { + if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } + elsif (defined $externs{$ext}{pkg}) { + my ($prefix, $flag); + my $pkg = $externs{$ext}{pkg}; + my $flagname = uc $externs{$ext}{pkg}; + $flagname =~ s/-[0-9\.]*$//; + $flagname =~ s/-/_/g; + + print "Checking $pkg ... "; + `pkg-config "$pkg" --exists >/dev/null`; + if ($? == 0) { + $externs{$ext}{prefix}=`pkg-config $pkg --variable=prefix`; + chomp $externs{$ext}{prefix}; + print "$externs{$ext}{prefix}\n"; + + $flag=`pkg-config $pkg --cflags`; + $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag); + $flag=`pkg-config $pkg --libs`; + $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); + } else { + print "(using default $externs{$ext}{prefix})\n"; + } + } +} } if ($dis) { for (@nodes) { @@ -181,7 +279,7 @@ $stagedir = $prefix unless $stagedir; if ($mode eq 'build') { print "Writing config.status\n"; open CONF,">config.status" or die "config.status: $!\n"; - print CONF "$0 @keeparg\n"; + print CONF "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH} $0 @keeparg\n"; close CONF; } @@ -227,8 +325,9 @@ sub mode_build { @myjars = keys %aux; print "\nRequired externals:\n"; - print "\t$_: $extern_prefix{$_}\n" for @ext; + print "\t$_: $externs{$_}{prefix}\n" for @ext; print "\t$_: $jar{$_}\n" for @myjars; + for (@ext) { if (defined($externs{$_}{flags})) { print "$externs{$_}{flags}"; } }; print "\nThis is a poor-man configure, it's up to you to have sources and externals there\n\n"; mkinc($_) for @modules; @@ -295,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -343,7 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.proxyrenewal' => [ qw/voms globus:B myproxy/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -354,6 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], + 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -435,7 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.proxyrenewal' => [ qw// ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -467,6 +561,11 @@ for my $jar (keys %need_jars) { 'jp.ws-interface' => [ qw// ], 'gridsite.core' => [ qw/build.common-cpp:B/ ], + + 'px.proxyrenewal' => [ qw// ], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], + 'px.myproxy-config' => [], ); for my $ext (keys %deps_aux) { @@ -491,6 +590,9 @@ for my $ext (keys %deps_aux) { %obsoletes = ( 'lb.yaim' => [ qq/glite-yaim-lb/ ], + 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], + 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -501,7 +603,7 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', + 'px' => 'org.glite', ); %conf_prefix = ( @@ -510,7 +612,16 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', + 'px' => 'glite-', +); + +%emi_conf_prefix = ( + 'lb' => 'emi-', + 'jp' => 'emi-', + 'jobid' => 'emi-', + 'lbjp-common' => 'emi-', + 'gridsite' => '', + 'px' => 'emi-', ); my @k = keys %deps_aux; @@ -536,8 +647,9 @@ sub mkinc lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java -lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface +lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface +px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config /; @aux{@m} = (1) x ($#m+1); @@ -574,7 +686,8 @@ libdir = $libdir }; for (@{$need_externs{$short}}) { - print MKINC "${_}_prefix = $extern_prefix{$_}\n" + print MKINC "${_}_prefix = $externs{$_}{prefix}\n"; + print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags}; } for (@{$need_jars{$short}}) { @@ -589,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -615,10 +728,20 @@ BEGIN{ apr=>'apr-dev', aprutil=>'aprutil-dev', ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' + ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -666,30 +789,48 @@ sub mode_etics { for (@{$need_externs{"$subsys.$module"}}) { if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + if ($emi) { + if ($ge{$_} and not defined $externs{$_}{pkg}) { + push @copts, "--with-$_=\${stageDir}"; + } + } else { + push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + } } } for (@{$need_jars{"$subsys.$module"}}) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,"--with-$_ \${$eext.location}/usr/share/java/$_*.jar"; + push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (not $emi); } my $conf; my $conftag; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; + + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; + if ($branch) { - $conf = "$conf_prefix{$subsys}${subsys}-${module}_$branch"; + $conf = "$confprefix${subsys}-${module}_$branch"; $conftag = $branch; # forced low age number $age = $branch eq 'HEAD' ? '0head' : '0dev'; } else { - $conf = "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; + $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; # XXX: gridsite hack - $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : $conf; } + $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : + "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; } + if ($emi) { + $age = "${age}emi"; + } + my $file = $output ? $output : "$conf.ini"; open C,">$file" or die "$file: $!\n"; @@ -728,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -738,8 +885,13 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor} --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; $cmd{compile} = 'make'; $cmd{test} = 'make check'; $cmd{install} = 'make install'; @@ -751,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -800,8 +949,9 @@ $buildroot aprSuffix = 0 package.RPMSLocation = \${moduleDir}/RPMTMP/RPMS package.SRPMSLocation = \${moduleDir}/RPMTMP/SRPMS -$package_description$package_summary$defprops -}; +package.preserve.libtool = false +$package_description$package_summary$defprops}; + for (@{$obsoletes{"$subsys.$module"}}) { print C "package.obsoletes = $_\n"; print C "package.replaces = $_\n"; @@ -828,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -839,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -848,12 +1001,13 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS sub gsoap_version { local $_; my $gsoap_version; - open S,"$extern_prefix{gsoap}/bin/soapcpp2 -v 2>&1 |" or die "$extern_prefix{gsoap}/bin/soapcpp2: $!\n"; + open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n"; while ($_ = ) { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -910,7 +1064,7 @@ sub getlibdir { } sub usage { - my @ext = keys %extern_prefix; + my @ext = keys %externs; my @myjars, keys %jar; print STDERR qq{ @@ -925,6 +1079,7 @@ General options (defaults in []): --version=maj.min.rev-age specify version here instead of reading version.properties --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...) --libdir=libdir typically [lib,lib64] postfix + --emi generate configurations with emi flavor in mode 'etics' Mode of operation: --mode={checkout|build|etics} what to do [build] @@ -932,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.lbjp-common.server-bones/project/ChangeLog b/org.glite.lbjp-common.server-bones/project/ChangeLog index ff50e6e..2a89f57 100644 --- a/org.glite.lbjp-common.server-bones/project/ChangeLog +++ b/org.glite.lbjp-common.server-bones/project/ChangeLog @@ -26,3 +26,7 @@ 2.0.1-2 - Module rebuilt +2.0.2-1 +- Makefile adopts compilation and linking flags from the environment. +- Memory handling fixes + diff --git a/org.glite.lbjp-common.server-bones/project/version.properties b/org.glite.lbjp-common.server-bones/project/version.properties index 8bfed77..22afe3c 100644 --- a/org.glite.lbjp-common.server-bones/project/version.properties +++ b/org.glite.lbjp-common.server-bones/project/version.properties @@ -1,3 +1,3 @@ # : /cvs/jra1mw/org.glite.lbjp-common.server-bones/project/version.properties,v 1.2 2009/01/21 10:44:34 zsustr Exp $ -module.version=2.0.1 -module.age=2 +module.version=2.0.2 +module.age=1 diff --git a/org.glite.lbjp-common.server-bones/src/srvbones.c b/org.glite.lbjp-common.server-bones/src/srvbones.c index dd257cd..20cb3eb 100644 --- a/org.glite.lbjp-common.server-bones/src/srvbones.c +++ b/org.glite.lbjp-common.server-bones/src/srvbones.c @@ -313,7 +313,7 @@ int glite_srvbones_daemonize(const char *servername, const char *custom_pidfile, } fclose(fpid); } else if (errno != ENOENT) { - glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_FATAL, pidfile); + glite_common_log_msg(LOG_CATEGORY_CONTROL, LOG_PRIORITY_FATAL, pidfile); free(pidfile); return 0; } @@ -321,7 +321,7 @@ int glite_srvbones_daemonize(const char *servername, const char *custom_pidfile, if (((fpid = fopen(pidfile, "w")) == NULL) || (fprintf(fpid, "%d", getpid()) <= 0) || (fclose(fpid) != 0)) { - glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_FATAL, pidfile); + glite_common_log_msg(LOG_CATEGORY_CONTROL, LOG_PRIORITY_FATAL, pidfile); free(pidfile); return 0; } diff --git a/org.glite.lbjp-common.trio/configure b/org.glite.lbjp-common.trio/configure index 0d662fe..76e67f9 100755 --- a/org.glite.lbjp-common.trio/configure +++ b/org.glite.lbjp-common.trio/configure @@ -41,39 +41,104 @@ my $output; my $lb_tag = ''; my $lbjp_tag = ''; my $jp_tag = ''; -my $sec_tag = ''; my $jobid_tag = ''; my $libdir = getlibdir(); +my $projectname; + my @nodes = qw/client server logger logger-msg utils client-java doc ws-test db jpprimary jpindex jpclient harvester/; my %enable_nodes; my %disable_nodes; -my %extern_prefix = ( - cares => '/opt/c-ares', - classads => '/opt/classads', - cppunit => '/usr', - expat => '/usr', - globus => '/opt/globus', - myproxy => '/opt/myproxy', - gsoap => '/usr', - mysql => '/usr', - 'mysql-devel' => '', - 'mysql-server' => '', - voms => '/opt/glite', - gridsite => '/opt/glite', - lcas => '/opt/glite', - trustmanager => '/opt/glite', - utiljava => '/opt/glite', - ant => '/usr', - jdk => '/usr', - libtar => '/usr', - axis => '/usr', - log4c => '/usr', - postgresql => '/usr', - activemq => '/opt/activemq-cpp-library', - apr => '/opt/apr', - aprutil => '/opt/apr-util' +my %externs = ( + cares => { + prefix => '/opt/c-ares', + pkg => 'libcares' + }, + classads => { + prefix=> '/usr', + pkg => 'classads' + }, + cppunit => { + prefix=> '/usr', + pkg => 'cppunit' + }, + expat => { + prefix=> '/usr', + pkg => 'expat' + }, + globus => { + prefix=> '/opt/globus', + pkg => 'globus-gssapi-gsi' + }, + 'myproxy-essentials' => { + prefix=> '/opt/globus', + pkg => 'myproxy' + }, + 'myproxy-server' => { + prefix=> '/opt/globus', + }, + 'myproxy-client' => { + prefix=> '/opt/globus', + }, + gsoap => { + prefix=> '/usr', + pkg => 'gsoap' + }, + mysql => { + prefix=> '/usr' + }, + 'mysql-devel' => { + prefix=> '' + }, + 'mysql-server' => { + prefix => '' + }, + voms => { + prefix => '/opt/glite', + pkg => 'voms-1.0' + }, + gridsite => { + prefix => '/opt/glite' + }, + lcas => { + prefix => '/opt/glite' + }, + trustmanager => { + prefix => '/opt/glite' + }, + utiljava => { + prefix=> '/opt/glite' + }, + ant => { + prefix=> '/usr' + }, + jdk => { + prefix=> '/usr' + }, + libtar => { + prefix=> '/usr' + }, + axis => { + prefix=> '/usr' + }, + log4c => { + prefix=> '/usr' + }, + postgresql => { + prefix=> '/usr' + } + activemq => { + prefix=>'/opt/activemq-cpp-library' + } + apr => { + prefix=>'/opt/apr', + pkg => 'apr-1' + } + aprutil => { + prefix=>'/opt/apr-util', + pkg => 'apr-util-1' + } ); my %jar = ( @@ -91,14 +156,15 @@ my %extranodmod; my %deps; my %deps_type; my %buildroot; +my (%etics_externs, %etics_projects, %etics_projects_emi, %etics_externs_emi); my %lbmodules = ( - 'lb' => [ qw/client client-java common doc logger logger-msg server state-machine types utils ws-interface ws-test harvester yaim glite-LB/], - 'security' => [qw/proxyrenewal/], + 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim glite-LB logger-msg/], 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin/], 'jobid' => [qw/api-c api-cpp api-java/], 'jp' => [ qw/client doc index primary server-common ws-interface/ ], 'gridsite' => [ qw/apache shared commands core/ ], + 'px' => [ qw/proxyrenewal glite-PX myproxy-yaim myproxy-config/ ], ); @@ -106,8 +172,8 @@ my @opts = ( 'prefix=s' => \$prefix, 'staged=s' => \$staged, 'module=s' => \$module, - 'thrflavour=s' => \$thrflavour, - 'nothrflavour=s' => \$nothrflavour, + 'thrflavour:s' => \$thrflavour, + 'nothrflavour:s' => \$nothrflavour, 'mode=s' => \$mode, 'listmodules=s' => \$listmodules, 'version=s' => \$version, @@ -117,10 +183,10 @@ my @opts = ( 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, - 'security-tag=s' => \$sec_tag, 'jobid-tag=s' => \$jobid_tag, 'help' => \$help, 'libdir=s' => \$libdir, + 'emi' => \$emi, ); for (@nodes) { @@ -131,20 +197,26 @@ for (@nodes) { push @opts,"enable-$_",\$enable_nodes{$_}; } -push @opts,"with-$_=s",\$extern_prefix{$_} for keys %extern_prefix; +push @opts,"with-$_=s",\$externs{$_}{withprefix} for keys %externs; push @opts,"with-$_=s",\$jar{$_} for keys %jar; my @keeparg = @ARGV; GetOptions @opts or die "Errors parsing command line\n"; -$extern_prefix{'mysql-devel'}=$extern_prefix{mysql} if $extern_prefix{'mysql-devel'} eq ''; -$extern_prefix{'mysql-server'}=$extern_prefix{mysql} if $extern_prefix{'mysql-server'} eq ''; +$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; +$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; +$projectname = $emi ? 'emi' : 'org.glite'; +if ($emi) { + for $_ (keys %etics_externs_emi) { + $etics_externs{$_} = $etics_externs_emi{$_}; + } +} if ($help) { usage(); exit 0; } if ($listmodules) { - my @m = map "org.glite.$listmodules.$_",@{$lbmodules{$listmodules}}; + my @m = map "$projectname.$listmodules.$_",@{$lbmodules{$listmodules}}; print "@m\n"; exit 0; } @@ -164,7 +236,33 @@ die "--enable-* and --disable-* are mutually exclusive\n" die "--module cannot be used with --enable-* or --disable-*\n" if $module && ($en || $dis); -die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},@{$lbmodules{security}},{$lbmodules{jp}}; +die "$module: unknown module\n" if $module && ! grep $module,@{$lbmodules{lb}},{$lbmodules{jp}}; + +if ($mode eq 'build') { for my $ext (keys %externs) { + if (defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; } + elsif (defined $externs{$ext}{pkg}) { + my ($prefix, $flag); + my $pkg = $externs{$ext}{pkg}; + my $flagname = uc $externs{$ext}{pkg}; + $flagname =~ s/-[0-9\.]*$//; + $flagname =~ s/-/_/g; + + print "Checking $pkg ... "; + `pkg-config "$pkg" --exists >/dev/null`; + if ($? == 0) { + $externs{$ext}{prefix}=`pkg-config $pkg --variable=prefix`; + chomp $externs{$ext}{prefix}; + print "$externs{$ext}{prefix}\n"; + + $flag=`pkg-config $pkg --cflags`; + $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag); + $flag=`pkg-config $pkg --libs`; + $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag); + } else { + print "(using default $externs{$ext}{prefix})\n"; + } + } +} } if ($dis) { for (@nodes) { @@ -181,7 +279,7 @@ $stagedir = $prefix unless $stagedir; if ($mode eq 'build') { print "Writing config.status\n"; open CONF,">config.status" or die "config.status: $!\n"; - print CONF "$0 @keeparg\n"; + print CONF "PKG_CONFIG_PATH=$ENV{PKG_CONFIG_PATH} $0 @keeparg\n"; close CONF; } @@ -227,8 +325,9 @@ sub mode_build { @myjars = keys %aux; print "\nRequired externals:\n"; - print "\t$_: $extern_prefix{$_}\n" for @ext; + print "\t$_: $externs{$_}{prefix}\n" for @ext; print "\t$_: $jar{$_}\n" for @myjars; + for (@ext) { if (defined($externs{$_}{flags})) { print "$externs{$_}{flags}"; } }; print "\nThis is a poor-man configure, it's up to you to have sources and externals there\n\n"; mkinc($_) for @modules; @@ -295,13 +394,6 @@ sub mode_checkout() { } } } - if ($sec_tag){ - for (@{$lbmodules{security}}){ - if ("security.".$_ eq $module){ - $tag = '-r '.$sec_tag; - } - } - } if ($jobid_tag){ for (@{$lbmodules{jobid}}){ if ("jobid.".$_ eq $module){ @@ -343,7 +435,6 @@ BEGIN{ 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B/ ], 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B/ ], 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap:B/ ], - 'security.proxyrenewal' => [ qw/voms globus:B myproxy/ ], 'jobid.api-c' => [ qw/cppunit:B/ ], 'jobid.api-cpp' => [ qw/cppunit:B/ ], 'jobid.api-java' => [ qw/ant:B jdk:B/ ], @@ -354,6 +445,10 @@ BEGIN{ 'jp.server-common' => [], 'jp.ws-interface' => [], 'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ], + 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-essentials voms/ ], + 'px.glite-PX' => [qw/myproxy-server:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/], + 'px.myproxy-yaim' => [ qw/yaim_core:R/ ], + 'px.myproxy-config' => [ qw/myproxy-client:R/ ], # in myproxy-config.spec ); for my $ext (keys %need_externs_aux) { @@ -435,7 +530,6 @@ for my $jar (keys %need_jars) { 'lbjp-common.trio' => [ qw// ], 'lbjp-common.gss' => [ qw// ], 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ], - 'security.proxyrenewal' => [ qw// ], 'jobid.api-c' => [ qw// ], 'jobid.api-cpp' => [ qw/jobid.api-c/ ], 'jobid.api-java' => [ qw// ], @@ -467,6 +561,11 @@ for my $jar (keys %need_jars) { 'jp.ws-interface' => [ qw// ], 'gridsite.core' => [ qw/build.common-cpp:B/ ], + + 'px.proxyrenewal' => [ qw// ], + 'px.glite-PX' => [qw/px.myproxy-yaim:R px.myproxy-config:R/], + 'px.myproxy-yaim' => [ qw/px.myproxy-config:R/ ], + 'px.myproxy-config' => [], ); for my $ext (keys %deps_aux) { @@ -491,6 +590,9 @@ for my $ext (keys %deps_aux) { %obsoletes = ( 'lb.yaim' => [ qq/glite-yaim-lb/ ], + 'px.proxyrenewal' => [ qq/glite-security-proxyrenewal/ ], + 'px.myproxy-yaim' => [ qq/glite-yaim-myproxy/ ], + 'px.myproxy-config' => [ qq/myproxy-config/ ], # in myproxy-config.spec 'lbjp-common.gss' => [ qq/glite-security-gss/ ], 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ], ); @@ -501,7 +603,7 @@ for my $ext (keys %deps_aux) { 'jobid' => 'org.glite', 'lbjp-common' => 'org.glite', 'gridsite' => 'org', - 'security' => 'org.glite', + 'px' => 'org.glite', ); %conf_prefix = ( @@ -510,7 +612,16 @@ for my $ext (keys %deps_aux) { 'jobid' => 'glite-', 'lbjp-common' => 'glite-', 'gridsite' => '', - 'security' => 'glite-', + 'px' => 'glite-', +); + +%emi_conf_prefix = ( + 'lb' => 'emi-', + 'jp' => 'emi-', + 'jobid' => 'emi-', + 'lbjp-common' => 'emi-', + 'gridsite' => '', + 'px' => 'emi-', ); my @k = keys %deps_aux; @@ -536,8 +647,9 @@ sub mkinc lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lbjp-common.gss lbjp-common.gsoap-plugin jobid.api-c jobid.api-cpp jobid.api-java -lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface +lbjp-common.db lbjp-common.log lbjp-common.maildir lbjp-common.server-bones lbjp-common.trio lbjp-common.jp-interface lbjp-common.gss lbjp-common.gsoap-plugin jp.client jp.doc jp.index jp.primary jp.server-common jp.ws-interface +px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config /; @aux{@m} = (1) x ($#m+1); @@ -574,7 +686,8 @@ libdir = $libdir }; for (@{$need_externs{$short}}) { - print MKINC "${_}_prefix = $extern_prefix{$_}\n" + print MKINC "${_}_prefix = $externs{$_}{prefix}\n"; + print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags}; } for (@{$need_jars{$short}}) { @@ -589,13 +702,13 @@ libdir = $libdir close MKINC; } -my %etics_externs; -my %etics_projects; BEGIN{ %etics_externs = ( globus_essentials=>'vdt_globus_essentials', globus=>'globus', - myproxy=>'myproxy', + 'myproxy-essentials'=>'myproxy_essentials', + 'myproxy-server'=>'myproxy_server', + 'myproxy-client'=>'myproxy_client', cares=>'c-ares', voms=>'org.glite.security.voms-api-cpp', gridsite=>'org.gridsite.shared', @@ -615,10 +728,20 @@ BEGIN{ apr=>'apr-dev', aprutil=>'aprutil-dev', ); + %etics_externs_emi = ( + globus_essentials=>'globus-gssapi-gsi', + globus=>'globus-gssapi-gsi-devel', + gridsite=>'emi.gridsite.shared', + yaim_core=>'emi.yaim.yaim-core' + ); %etics_projects = ( vdt=>[qw/globus globus_essentials myproxy/], 'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/], ); + %etics_projects_emi = ( + vdt=>'externs', + 'org.glite'=>'emi', + ); %platform_properties = ( 'gridsite.core' => { @@ -666,30 +789,48 @@ sub mode_etics { for (@{$need_externs{"$subsys.$module"}}) { if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + if ($emi) { + if ($ge{$_} and not defined $externs{$_}{pkg}) { + push @copts, "--with-$_=\${stageDir}"; + } + } else { + push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}"; + } } } for (@{$need_jars{"$subsys.$module"}}) { my $eext = $etics_externs{$_} ? $etics_externs{$_} : $_; - push @copts,"--with-$_ \${$eext.location}/usr/share/java/$_*.jar"; + push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (not $emi); } my $conf; my $conftag; + my ($confprefix, $nameprefix); $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; + + $confprefix = $emi ? $emi_conf_prefix{$subsys} : $conf_prefix{$subsys}; + $nameprefix = $confprefix; + $nameprefix =~ s/-$//; + $nameprefix =~ s/-/\./g; + if ($branch) { - $conf = "$conf_prefix{$subsys}${subsys}-${module}_$branch"; + $conf = "$confprefix${subsys}-${module}_$branch"; $conftag = $branch; # forced low age number $age = $branch eq 'HEAD' ? '0head' : '0dev'; } else { - $conf = "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; + $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; # XXX: gridsite hack - $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : $conf; } + $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : + "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; } + if ($emi) { + $age = "${age}emi"; + } + my $file = $output ? $output : "$conf.ini"; open C,">$file" or die "$file: $!\n"; @@ -728,7 +869,13 @@ sub mode_etics { if ($subsys eq 'gridsite') { if ($module eq 'core') { - my $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + my $flags; + + if ($emi) { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=`pkg-config gsoap --variable=prefix` OPENSSL_GLOBUS_FLAGS=`pkg-config globus-openssl --cflags` OPENSSL_GLOBUS_LIBS=`pkg-config globus-openssl --libs` FLAVOR_GLOBUS_EXT= HTTPD_FLAGS="-I/usr/include/httpd -I/usr/include/apache2 -I/usr/include/apr-${aprSuffix} -I/usr/include/pcre"'; + } else { + $flags = 'RELEASE_VERSION=${age}.${platformFamily} prefix=${prefix} libdir=${libdir} GSOAPDIR=${gsoap.location} OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor} OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}/ FLAVOR_GLOBUS_EXT=_${globus.dbg.nothr.flavor} HTTPD_FLAGS="-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-${aprSuffix} -I${httpd-devel.location}/include/pcre"'; + } $cmd{compile} = "make $flags build"; $cmd{install} = "make $flags install"; @@ -738,8 +885,13 @@ sub mode_etics { $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this"; } } + elsif ($subsys eq 'px' and $module eq 'myproxy-config') { + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; + } else { - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor} --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; + my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --module $subsys.$module @copts"; $cmd{compile} = 'make'; $cmd{test} = 'make check'; $cmd{install} = 'make install'; @@ -751,23 +903,20 @@ sub mode_etics { $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n"; } - my $checkoutcmd; - if ($conftag eq 'HEAD') { - $checkoutcmd = "cvs -d \${vcsroot} co -A \${moduleName}"; - } else { - $checkoutcmd = "cvs -d \${vcsroot} co -r \${tag} \${moduleName}"; - } + my $checkoutcmd = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.$module"; + $checkoutcmd .= "; ln -s \${moduleName} $cvs_prefix{$subsys}.$subsys.$module 2>/dev/null || true" if ($emi); print STDERR "Writing $file\n"; print C qq{ [Configuration-$conf] profile = None -moduleName = $cvs_prefix{$subsys}.$subsys.$module +moduleName = $projectname.$subsys.$module displayName = $conf description = $cvs_prefix{$subsys}.$subsys.$module -projectName = org.glite +projectName = $projectname age = $age deploymentType = None +vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite tag = $conftag version = $major.$minor.$rev $dwpath @@ -800,8 +949,9 @@ $buildroot aprSuffix = 0 package.RPMSLocation = \${moduleDir}/RPMTMP/RPMS package.SRPMSLocation = \${moduleDir}/RPMTMP/SRPMS -$package_description$package_summary$defprops -}; +package.preserve.libtool = false +$package_description$package_summary$defprops}; + for (@{$obsoletes{"$subsys.$module"}}) { print C "package.obsoletes = $_\n"; print C "package.replaces = $_\n"; @@ -828,6 +978,9 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS my $proj = 'externals'; for my $p (keys %etics_projects) { + if ($emi and defined $etics_projects_emi{$p}) { + $p = $etics_projects_emi{$p}; + } for $m (@{$etics_projects{$p}}) { $proj = $p if $m eq $_; } @@ -839,7 +992,7 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS for (@{$deps{"$subsys.$module"}}) { my $type = $deps_type{"$subsys.$module"}->{$_}; - print C "org.glite|org.glite.$_ = $type\n"; + print C "$projectname|$projectname.$_ = $type\n"; } close C; @@ -848,12 +1001,13 @@ package.SRPMSLocation = ${moduleDir}/RPMTMP/SRPMS sub gsoap_version { local $_; my $gsoap_version; - open S,"$extern_prefix{gsoap}/bin/soapcpp2 -v 2>&1 |" or die "$extern_prefix{gsoap}/bin/soapcpp2: $!\n"; + open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n"; while ($_ = ) { chomp; $gsoap_version = $1 if /The gSOAP Stub and Skeleton Compiler for C and C\+\+ ([.[:digit:][:alpha:]]+)$/; + $gsoap_version = $1 if /The gSOAP code generator for C and C\+\+, soapcpp2 release ([.[:digit:][:alpha:]]+)$/; } close S; return $gsoap_version; @@ -910,7 +1064,7 @@ sub getlibdir { } sub usage { - my @ext = keys %extern_prefix; + my @ext = keys %externs; my @myjars, keys %jar; print STDERR qq{ @@ -925,6 +1079,7 @@ General options (defaults in []): --version=maj.min.rev-age specify version here instead of reading version.properties --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...) --libdir=libdir typically [lib,lib64] postfix + --emi generate configurations with emi flavor in mode 'etics' Mode of operation: --mode={checkout|build|etics} what to do [build] @@ -932,12 +1087,11 @@ Mode of operation: What to build: --module=module build this module only (mostly in-Etics operation) --enable-NODE build this "node" (set of modules) only. Available nodes are - @{$lbmodules{lb}},@{$lbmodules{security}} + @{$lbmodules{lb}} --disable-NODE don't build this node --lb-tag=tag checkout LB modules with specific tag --jp-tag=tag checkout JP modules with specific tag --lbjp-common-tag=tag checkout lbjp-common modules with specific tag - --security-tag=tag checkout security modules with specific tag --jobid-tag=tag checkout jobid modules with specific tag Dependencies: diff --git a/org.glite.lbjp-common.trio/project/ChangeLog b/org.glite.lbjp-common.trio/project/ChangeLog index 939658e..1c8f72a 100644 --- a/org.glite.lbjp-common.trio/project/ChangeLog +++ b/org.glite.lbjp-common.trio/project/ChangeLog @@ -32,3 +32,6 @@ 2.0.2-2 - Module rebuilt +2.0.3-1 +- Makefile adopts compilation and linking flags from the environment. + diff --git a/org.glite.lbjp-common.trio/project/version.properties b/org.glite.lbjp-common.trio/project/version.properties index eb077ec..a367634 100644 --- a/org.glite.lbjp-common.trio/project/version.properties +++ b/org.glite.lbjp-common.trio/project/version.properties @@ -1,3 +1,3 @@ # : /cvs/jra1mw/org.glite.lbjp-common.trio/project/version.properties,v 1.2 2009/01/21 10:44:34 zsustr Exp $ -module.version=2.0.2 -module.age=2 +module.version=2.0.3 +module.age=1 -- 1.8.2.3