elementary support for gridsite
authorAleš Křenek <ljocha@ics.muni.cz>
Fri, 2 Jul 2010 14:21:35 +0000 (14:21 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Fri, 2 Jul 2010 14:21:35 +0000 (14:21 +0000)
seems to generate reasonable configuration for org.gridsite.core
but I'm not able to verify it right now due to missing access rights
to gridsite in etics

org.glite.lb/configure

index c82ed75..78f66d8 100755 (executable)
@@ -94,6 +94,7 @@ my %lbmodules = (
        'lbjp-common' => [qw/db log maildir server-bones trio jp-interface/],
        'jobid' => [qw/api-c api-cpp api-java/],
        'jp' => [ qw/client doc index primary server-common ws-interface/ ],
+       'gridsite' => [ qw/apache shared commands core/ ],
        );
 
 
@@ -347,6 +348,7 @@ BEGIN{
         'jp.primary' => [ qw/classads gsoap libtar globus_essentials:R globus:B/ ],
         'jp.server-common' => [],
         'jp.ws-interface' => [],
+       'gridsite.core' => [qw/httpd-devel:B gsoap:B globus:B/ ],
 );
 
 for my $ext (keys %need_externs_aux) {
@@ -453,6 +455,8 @@ for my $jar (keys %need_jars) {
                 lbjp-common.jp-interface lbjp-common.db
         / ],
        'jp.ws-interface' => [ qw// ],
+
+       'gridsite.core' => [ qw/build.common-cpp:B/ ],
 );
 
 for my $ext (keys %deps_aux) {
@@ -479,6 +483,22 @@ for my $ext (keys %deps_aux) {
        'lb.yaim' => [ qq/glite-yaim-lb/ ],
 );
 
+%cvs_prefix = (
+       'lb' => 'org.glite',
+       'jp' => 'org.glite',
+       'jobid' => 'org.glite',
+       'lbjp-common' => 'org.glite',
+       'gridsite' => 'org',
+);
+
+%conf_prefix = (
+       'lb' => 'glite-',
+       'jp' => 'glite-',
+       'jobid' => 'glite-',
+       'lbjp-common' => 'glite-',
+       'gridsite' => '',
+);
+
 my @t = qw/lb.client-java jobid.api-java lb.types/;
 @topbuild{@t} = (1) x ($#t+1);
 }
@@ -576,6 +596,19 @@ BEGIN{
                vdt=>[qw/globus globus_essentials/],
                'org.glite'=>[qw/voms gridsite lcas gpt gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/],
        );
+
+       %platform_properties = (
+               'gridsite.core' => {
+                       sl5_x86_64_gcc412 => { aprSuffix => '1' },
+                       sl5_ia32_gcc412 => { aprSuffix => '1' },
+                       deb5_ia32_gcc432 => { aprSuffix => '1.0' },
+                       slc4_x86_64_gcc346 => { aprSuffix => '0' },
+                       default => { 
+                               'package.RPMSLocation' => '${moduleDir}/RPMTMP/RPMS',
+                               'package.SRPMSLocation' => '${moduleDir}/RPMTMP/SRPMS',
+                       }
+               },
+       );
 };
 
 sub mode_etics {
@@ -592,8 +625,8 @@ sub mode_etics {
                ($major,$minor,$rev,$age) = ($1,$2,$3,$4);
        }
        else { 
-               open V,"org.glite.$subsys.$module/project/version.properties"
-                       or die "org.glite.$subsys.$module/project/version.properties: $!\n";
+               open V,"$cvs_prefix{$subsys}.$subsys.$module/project/version.properties"
+                       or die "$cvs_prefix{$subsys}.$subsys.$module/project/version.properties: $!\n";
        
                while ($_ = <V>) {
                        chomp;
@@ -624,14 +657,15 @@ sub mode_etics {
        my $conftag;
 
        if ($branch) {
-               $conf = "glite-${subsys}-${module}_$branch"; 
+               $conf = "$conf_prefix{$subsys}${subsys}-${module}_$branch"; 
                $conftag = $branch; 
                $dwpath = ""; }
        else {
-               $conf = "glite-$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; 
-               $conftag = $conf; 
+               $conf = "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}"; 
+
+# XXX: gridsite hack
+               $conftag = $subsys eq 'gridsite' ? "$conf_prefix{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" : $conf; 
                $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n"; }
-#      my $conf = "glite-$subsys-${module}_R_${major}_${minor}_${rev}_${age}";
        my $file = $output ? $output : "$conf.ini";
        open C,">$file" or die "$file: $!\n";
 
@@ -642,8 +676,8 @@ sub mode_etics {
        my $package_description = "";
        my $package_summary = "";
 
-       if (-e "org.glite.$subsys.$module/project/package.description") {
-               open V, "org.glite.$subsys.$module/project/package.description";
+       if (-e "$cvs_prefix{$subsys}.$subsys.$module/project/package.description") {
+               open V, "$cvs_prefix{$subsys}.$subsys.$module/project/package.description";
                $package_description = join ("", <V>);
                close V;
                chomp $package_description;
@@ -653,8 +687,8 @@ sub mode_etics {
        else { 
                print STDERR "package.description not found for $subsys.$module!\n"; }
 
-       if (-e "org.glite.$subsys.$module/project/package.summary") {
-               open V, "org.glite.$subsys.$module/project/package.summary";
+       if (-e "$cvs_prefix{$subsys}.$subsys.$module/project/package.summary") {
+               open V, "$cvs_prefix{$subsys}.$subsys.$module/project/package.summary";
                $package_summary = join ("", <V>);
                close V;
                chomp $package_summary;
@@ -664,14 +698,42 @@ sub mode_etics {
        else { 
                print STDERR "package.summary not found for $subsys.$module!\n"; }
 
+       my %cmd;
+       @cmd{qw/configure compile test install packaging clean/} = ('None') x 6;
+       $cmd{clean} = 'make clean';
+
+       if ($subsys eq 'gridsite') {
+               if ($module eq 'core') {
+                       my $flags = 'make prefix=${prefix} libdir=${libdir} 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";
+                       $cmd{packaging} = "make RELEASE_VERSION=1.\${platformFamily} $flags rpm";
+               }
+               else {
+                       $cmd{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this";
+               }
+       }
+       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";
+               $cmd{compile} = 'make';
+               $cmd{test} = 'make check';
+               $cmd{install} = 'make install';
+       }
+
+       my $defprops = '';
+
+       for my $p (keys %{$platform_properties{"$subsys.$module"}->{default}}) {
+               $defprops .= $p . ' = ' . $platform_properties{"$subsys.$module"}->{default}->{$p} . "\n";
+       }
 
        print STDERR "Writing $file\n";
        print C qq{
 [Configuration-$conf]
 profile = None
-moduleName = org.glite.$subsys.$module
+moduleName = $cvs_prefix{$subsys}.$subsys.$module
 displayName = $conf
-description = org.glite.$subsys.$module
+description = $cvs_prefix{$subsys}.$subsys.$module
 projectName = org.glite
 age = $age
 deploymentType = None
@@ -694,24 +756,35 @@ description = None
 doc = None
 prepublish = None
 publish = None
-compile = make
+compile = $cmd{compile}
 init = None
-install = make install
-clean = make clean
-test = make check
-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
+install = $cmd{install}
+clean = $cmd{clean}
+test = $cmd{test}
+configure = $cmd{configure}
 checkstyle = None
 
 [Platform-default:Property]
 $buildroot
 $package_description
 $package_summary
+$defprops
 };
        for (@{$obsoletes{"$subsys.$module"}}) {
                print C "package.obsoletes = $_\n";
                print C "package.replaces = $_\n";
        }
 
+       for my $pp (keys %{$platform_properties{"$subsys.$module"}}) {
+               next if $pp eq 'default';
+               print C "[Platform-$pp:Property]\n";
+
+               for my $p (keys %{$platform_properties{"$subsys.$module"}->{$pp}}) {
+                       print C $p . ' = ' . $platform_properties{"$subsys.$module"}->{$pp}->{$p} . "\n";
+               }
+               print C "\n";
+       }
+
        print C qq{
 [Platform-default:DynamicDependency]
 };