Sprout from branch_3_2 2012-04-24 14:50:03 UTC cvs2svn <admin@example.com> 'This commit was manufactured by cvs2svn to create branch 'branch_3_2'.'
Cherrypick from master 2012-04-20 14:09:18 UTC František Dvořák <valtri@civ.zcu.cz> 'Propagate forced version into packaging (used for changing age - in EMI-1 or branches).':
org.glite.lb.harvester/examples/test.sh
org.glite.lb/configure
Delete:
org.glite.jobid.api-c/Makefile
org.glite.jobid.api-c/configure
org.glite.jobid.api-c/interface/cjobid.h
org.glite.jobid.api-c/interface/strmd5.h
org.glite.jobid.api-c/project/.post
org.glite.jobid.api-c/project/.postun
org.glite.jobid.api-c/project/ChangeLog
org.glite.jobid.api-c/project/debian.control
org.glite.jobid.api-c/project/debian.copyright
org.glite.jobid.api-c/project/debian.libglite-jobid-api-c-dev.dirs
org.glite.jobid.api-c/project/debian.libglite-jobid-api-c-dev.install
org.glite.jobid.api-c/project/debian.libglite-jobid2.dirs
org.glite.jobid.api-c/project/debian.libglite-jobid2.install
org.glite.jobid.api-c/project/debian.rules
org.glite.jobid.api-c/project/glite-jobid-api-c.spec
org.glite.jobid.api-c/project/package.description
org.glite.jobid.api-c/project/package.summary
org.glite.jobid.api-c/project/version.properties
org.glite.jobid.api-c/src/cjobid.c
org.glite.jobid.api-c/src/md32_common.h
org.glite.jobid.api-c/src/md5.h
org.glite.jobid.api-c/src/md5_dgst.c
org.glite.jobid.api-c/src/md5_locl.h
org.glite.jobid.api-c/src/strmd5.c
org.glite.jobid.api-c/test/base64_test.cpp
org.glite.jobid.api-cpp/Makefile
org.glite.jobid.api-cpp/configure
org.glite.jobid.api-cpp/interface/JobId.h
org.glite.jobid.api-cpp/project/ChangeLog
org.glite.jobid.api-cpp/project/debian.control
org.glite.jobid.api-cpp/project/debian.copyright
org.glite.jobid.api-cpp/project/debian.libglite-jobid-api-cpp-dev.dirs
org.glite.jobid.api-cpp/project/debian.libglite-jobid-api-cpp-dev.install
org.glite.jobid.api-cpp/project/debian.rules
org.glite.jobid.api-cpp/project/glite-jobid-api-cpp.spec
org.glite.jobid.api-cpp/project/package.description
org.glite.jobid.api-cpp/project/package.summary
org.glite.jobid.api-cpp/project/version.properties
org.glite.jobid.api-java/Makefile
org.glite.jobid.api-java/build.xml
org.glite.jobid.api-java/configure
org.glite.jobid.api-java/nbproject/build-impl.xml
org.glite.jobid.api-java/nbproject/genfiles.properties
org.glite.jobid.api-java/nbproject/private/config.properties
org.glite.jobid.api-java/nbproject/private/private.properties
org.glite.jobid.api-java/nbproject/private/private.xml
org.glite.jobid.api-java/nbproject/project.properties
org.glite.jobid.api-java/nbproject/project.xml
org.glite.jobid.api-java/project/ChangeLog
org.glite.jobid.api-java/project/debian.control
org.glite.jobid.api-java/project/debian.copyright
org.glite.jobid.api-java/project/debian.glite-jobid-api-java.dirs
org.glite.jobid.api-java/project/debian.glite-jobid-api-java.install
org.glite.jobid.api-java/project/debian.rules
org.glite.jobid.api-java/project/glite-jobid-api-java.spec
org.glite.jobid.api-java/project/package.description
org.glite.jobid.api-java/project/package.summary
org.glite.jobid.api-java/project/version.properties
org.glite.jobid.api-java/src/org/glite/jobid/ExampleJobid.java
org.glite.jobid.api-java/src/org/glite/jobid/Jobid.java
org.glite.jobid/project/version.properties
org.glite.lbjp-common.db/.cvsignore
org.glite.lbjp-common.db/LICENSE
org.glite.lbjp-common.db/Makefile
org.glite.lbjp-common.db/configure
org.glite.lbjp-common.db/doc/C.dox
org.glite.lbjp-common.db/examples/db_expire.c
org.glite.lbjp-common.db/examples/db_test.c
org.glite.lbjp-common.db/interface/db-int.h
org.glite.lbjp-common.db/interface/db.h
org.glite.lbjp-common.db/project/.post
org.glite.lbjp-common.db/project/.postun
org.glite.lbjp-common.db/project/ChangeLog
org.glite.lbjp-common.db/project/debian.control
org.glite.lbjp-common.db/project/debian.copyright
org.glite.lbjp-common.db/project/debian.libglite-lbjp-common-db-dev.dirs
org.glite.lbjp-common.db/project/debian.libglite-lbjp-common-db-dev.install
org.glite.lbjp-common.db/project/debian.libglite-lbu-db3.dirs
org.glite.lbjp-common.db/project/debian.libglite-lbu-db3.install
org.glite.lbjp-common.db/project/debian.rules
org.glite.lbjp-common.db/project/glite-lbjp-common-db.spec
org.glite.lbjp-common.db/project/package.description
org.glite.lbjp-common.db/project/package.summary
org.glite.lbjp-common.db/project/version.properties
org.glite.lbjp-common.db/src/db-mysql.c
org.glite.lbjp-common.db/src/db-pg.c
org.glite.lbjp-common.db/src/db.c
org.glite.lbjp-common.db/test/timezone.cpp
org.glite.lbjp-common.gsoap-plugin/LICENSE
org.glite.lbjp-common.gsoap-plugin/Makefile
org.glite.lbjp-common.gsoap-plugin/configure
org.glite.lbjp-common.gsoap-plugin/examples/calc.h.S
org.glite.lbjp-common.gsoap-plugin/examples/wscalc_clt_ex.c
org.glite.lbjp-common.gsoap-plugin/examples/wscalc_srv_ex.c
org.glite.lbjp-common.gsoap-plugin/examples/wscalc_srv_ex2.c
org.glite.lbjp-common.gsoap-plugin/interface/glite_gscompat.h.in
org.glite.lbjp-common.gsoap-plugin/interface/glite_gsplugin-int.h
org.glite.lbjp-common.gsoap-plugin/interface/glite_gsplugin.h
org.glite.lbjp-common.gsoap-plugin/project/.post
org.glite.lbjp-common.gsoap-plugin/project/.postun
org.glite.lbjp-common.gsoap-plugin/project/ChangeLog
org.glite.lbjp-common.gsoap-plugin/project/debian.control
org.glite.lbjp-common.gsoap-plugin/project/debian.copyright
org.glite.lbjp-common.gsoap-plugin/project/debian.libglite-lbjp-common-gsoap-plugin-dev.dirs
org.glite.lbjp-common.gsoap-plugin/project/debian.libglite-lbjp-common-gsoap-plugin-dev.install
org.glite.lbjp-common.gsoap-plugin/project/debian.libglite-lbjp-common-gsoap-plugin.dirs
org.glite.lbjp-common.gsoap-plugin/project/debian.libglite-lbjp-common-gsoap-plugin.install
org.glite.lbjp-common.gsoap-plugin/project/debian.rules
org.glite.lbjp-common.gsoap-plugin/project/glite-lbjp-common-gsoap-plugin.spec
org.glite.lbjp-common.gsoap-plugin/project/gsoap-plugin++.pc.in
org.glite.lbjp-common.gsoap-plugin/project/gsoap-plugin.pc.in
org.glite.lbjp-common.gsoap-plugin/project/libtoolhack/gcc
org.glite.lbjp-common.gsoap-plugin/project/package.description
org.glite.lbjp-common.gsoap-plugin/project/package.summary
org.glite.lbjp-common.gsoap-plugin/project/version.properties
org.glite.lbjp-common.gsoap-plugin/src/glite_gsplugin.c
org.glite.lbjp-common.gsoap-plugin/src/sizeof_soap.c
org.glite.lbjp-common.gsoap-plugin/test/test_gsplugin_cxx.cpp
org.glite.lbjp-common.gss/LICENSE
org.glite.lbjp-common.gss/Makefile
org.glite.lbjp-common.gss/configure
org.glite.lbjp-common.gss/examples/example_common.c
org.glite.lbjp-common.gss/examples/example_locl.h
org.glite.lbjp-common.gss/examples/gss_client.c
org.glite.lbjp-common.gss/examples/gss_server.c
org.glite.lbjp-common.gss/interface/glite_gss.h
org.glite.lbjp-common.gss/project/.post
org.glite.lbjp-common.gss/project/.postun
org.glite.lbjp-common.gss/project/ChangeLog
org.glite.lbjp-common.gss/project/debian.control
org.glite.lbjp-common.gss/project/debian.copyright
org.glite.lbjp-common.gss/project/debian.libglite-lbjp-common-gss-dev.dirs
org.glite.lbjp-common.gss/project/debian.libglite-lbjp-common-gss-dev.install
org.glite.lbjp-common.gss/project/debian.libglite-security-gss9.dirs
org.glite.lbjp-common.gss/project/debian.libglite-security-gss9.install
org.glite.lbjp-common.gss/project/debian.rules
org.glite.lbjp-common.gss/project/doc/EMI_Logo_std.pdf
org.glite.lbjp-common.gss/project/doc/Makefile
org.glite.lbjp-common.gss/project/doc/cesnet.pdf
org.glite.lbjp-common.gss/project/doc/emi.cls
org.glite.lbjp-common.gss/project/doc/lbjp-common-gss_FD.tex
org.glite.lbjp-common.gss/project/glite-lbjp-common-gss.spec
org.glite.lbjp-common.gss/project/package.description
org.glite.lbjp-common.gss/project/package.summary
org.glite.lbjp-common.gss/project/version.properties
org.glite.lbjp-common.gss/src/glite_gss.c
org.glite.lbjp-common.gss/test/test_gss.cpp
org.glite.lbjp-common.jp-interface/Makefile
org.glite.lbjp-common.jp-interface/configure
org.glite.lbjp-common.jp-interface/interface/attr.h
org.glite.lbjp-common.jp-interface/interface/backend.h
org.glite.lbjp-common.jp-interface/interface/builtin_plugins.h
org.glite.lbjp-common.jp-interface/interface/context.h
org.glite.lbjp-common.jp-interface/interface/file_plugin.h
org.glite.lbjp-common.jp-interface/interface/indexdb.h
org.glite.lbjp-common.jp-interface/interface/known_attr.h
org.glite.lbjp-common.jp-interface/interface/type_plugin.h
org.glite.lbjp-common.jp-interface/interface/types.h
org.glite.lbjp-common.jp-interface/project/.post
org.glite.lbjp-common.jp-interface/project/.postun
org.glite.lbjp-common.jp-interface/project/ChangeLog
org.glite.lbjp-common.jp-interface/project/debian.control
org.glite.lbjp-common.jp-interface/project/debian.copyright
org.glite.lbjp-common.jp-interface/project/debian.libglite-jp-common2.dirs
org.glite.lbjp-common.jp-interface/project/debian.libglite-jp-common2.install
org.glite.lbjp-common.jp-interface/project/debian.libglite-lbjp-common-jp-interface-dev.dirs
org.glite.lbjp-common.jp-interface/project/debian.libglite-lbjp-common-jp-interface-dev.install
org.glite.lbjp-common.jp-interface/project/debian.rules
org.glite.lbjp-common.jp-interface/project/glite-lbjp-common-jp-interface.spec
org.glite.lbjp-common.jp-interface/project/package.description
org.glite.lbjp-common.jp-interface/project/package.summary
org.glite.lbjp-common.jp-interface/project/version.properties
org.glite.lbjp-common.jp-interface/src/attr.c
org.glite.lbjp-common.jp-interface/src/context.c
org.glite.lbjp-common.jp-interface/src/indexdb.c
org.glite.lbjp-common.jp-interface/src/utils.c
org.glite.lbjp-common.jp-interface/test/type_test.cpp
org.glite.lbjp-common.log/LICENSE
org.glite.lbjp-common.log/Makefile
org.glite.lbjp-common.log/README
org.glite.lbjp-common.log/config/log4crc
org.glite.lbjp-common.log/config/log4crc.debugging
org.glite.lbjp-common.log/configure
org.glite.lbjp-common.log/project/.post
org.glite.lbjp-common.log/project/.postun
org.glite.lbjp-common.log/project/ChangeLog
org.glite.lbjp-common.log/project/debian.control
org.glite.lbjp-common.log/project/debian.copyright
org.glite.lbjp-common.log/project/debian.libglite-lbjp-common-log-dev.dirs
org.glite.lbjp-common.log/project/debian.libglite-lbjp-common-log-dev.install
org.glite.lbjp-common.log/project/debian.libglite-lbu-log1.dirs
org.glite.lbjp-common.log/project/debian.libglite-lbu-log1.install
org.glite.lbjp-common.log/project/debian.rules
org.glite.lbjp-common.log/project/glite-lbjp-common-log.spec
org.glite.lbjp-common.log/project/package.description
org.glite.lbjp-common.log/project/package.summary
org.glite.lbjp-common.log/project/version.properties
org.glite.lbjp-common.log/src/log.c
org.glite.lbjp-common.log/src/log.h
org.glite.lbjp-common.log/tests/log4crc
org.glite.lbjp-common.log/tests/test.c
org.glite.lbjp-common.maildir/.cvsignore
org.glite.lbjp-common.maildir/Makefile
org.glite.lbjp-common.maildir/configure
org.glite.lbjp-common.maildir/interface/maildir.h
org.glite.lbjp-common.maildir/project/.post
org.glite.lbjp-common.maildir/project/.postun
org.glite.lbjp-common.maildir/project/ChangeLog
org.glite.lbjp-common.maildir/project/debian.control
org.glite.lbjp-common.maildir/project/debian.copyright
org.glite.lbjp-common.maildir/project/debian.libglite-lbjp-common-maildir-dev.dirs
org.glite.lbjp-common.maildir/project/debian.libglite-lbjp-common-maildir-dev.install
org.glite.lbjp-common.maildir/project/debian.libglite-lbu-maildir2.dirs
org.glite.lbjp-common.maildir/project/debian.libglite-lbu-maildir2.install
org.glite.lbjp-common.maildir/project/debian.rules
org.glite.lbjp-common.maildir/project/glite-lbjp-common-maildir.spec
org.glite.lbjp-common.maildir/project/package.description
org.glite.lbjp-common.maildir/project/package.summary
org.glite.lbjp-common.maildir/project/version.properties
org.glite.lbjp-common.maildir/src/maildir.c
org.glite.lbjp-common.server-bones/.cvsignore
org.glite.lbjp-common.server-bones/Makefile
org.glite.lbjp-common.server-bones/configure
org.glite.lbjp-common.server-bones/examples/cnt_example.c
org.glite.lbjp-common.server-bones/examples/run_test.sh
org.glite.lbjp-common.server-bones/examples/srv_example.c
org.glite.lbjp-common.server-bones/interface/srvbones.h
org.glite.lbjp-common.server-bones/project/.post
org.glite.lbjp-common.server-bones/project/.postun
org.glite.lbjp-common.server-bones/project/ChangeLog
org.glite.lbjp-common.server-bones/project/debian.control
org.glite.lbjp-common.server-bones/project/debian.copyright
org.glite.lbjp-common.server-bones/project/debian.libglite-lbjp-common-server-bones-dev.dirs
org.glite.lbjp-common.server-bones/project/debian.libglite-lbjp-common-server-bones-dev.install
org.glite.lbjp-common.server-bones/project/debian.libglite-lbu-server-bones2.dirs
org.glite.lbjp-common.server-bones/project/debian.libglite-lbu-server-bones2.install
org.glite.lbjp-common.server-bones/project/debian.rules
org.glite.lbjp-common.server-bones/project/glite-lbjp-common-server-bones.spec
org.glite.lbjp-common.server-bones/project/package.description
org.glite.lbjp-common.server-bones/project/package.summary
org.glite.lbjp-common.server-bones/project/version.properties
org.glite.lbjp-common.server-bones/src/srvbones.c
org.glite.lbjp-common.trio/.cvsignore
org.glite.lbjp-common.trio/LICENSE
org.glite.lbjp-common.trio/Makefile
org.glite.lbjp-common.trio/configure
org.glite.lbjp-common.trio/interface/escape.h
org.glite.lbjp-common.trio/interface/trio.h
org.glite.lbjp-common.trio/project/.post
org.glite.lbjp-common.trio/project/.postun
org.glite.lbjp-common.trio/project/ChangeLog
org.glite.lbjp-common.trio/project/debian.control
org.glite.lbjp-common.trio/project/debian.copyright
org.glite.lbjp-common.trio/project/debian.libglite-lbjp-common-trio-dev.dirs
org.glite.lbjp-common.trio/project/debian.libglite-lbjp-common-trio-dev.install
org.glite.lbjp-common.trio/project/debian.libglite-lbu-trio2.dirs
org.glite.lbjp-common.trio/project/debian.libglite-lbu-trio2.install
org.glite.lbjp-common.trio/project/debian.rules
org.glite.lbjp-common.trio/project/glite-lbjp-common-trio.spec
org.glite.lbjp-common.trio/project/package.description
org.glite.lbjp-common.trio/project/package.summary
org.glite.lbjp-common.trio/project/version.properties
org.glite.lbjp-common.trio/src/escape.c
org.glite.lbjp-common.trio/src/strio.c
org.glite.lbjp-common.trio/src/strio.h
org.glite.lbjp-common.trio/src/trio.c
org.glite.lbjp-common.trio/src/triop.h
org.glite.lbjp-common.trio/test/trio_test.cpp
org.glite.lbjp-common/project/version.properties
+++ /dev/null
-# Default values
-top_srcdir=..
-stagedir=.
-globalprefix=glite
-jobidprefix=jobid
-package=glite-jobid-api-c
-version=0.0.0
-
-CC:=gcc
-CXX:=g++
-
--include Makefile.inc
--include ${top_srcdir}/project/version.properties
-
-version=${module.version}
-
-VPATH=${top_srcdir}/src:${top_srcdir}/interface:${top_srcdir}/test
-
-DEBUG:=-g -O0 -Wall
-
-CFLAGS:=${DEBUG} \
- -I${top_srcdir}/interface -I${top_srcdir}/src \
- ${COVERAGE_FLAGS} \
- -D_GNU_SOURCE ${CFLAGS}
-
-COMPILE:=libtool --mode=compile ${CC} ${CFLAGS}
-CXXCOMPILE:=libtool --mode=compile ${CXX} ${CXXFLAGS}
-LINK:=libtool --mode=link ${CC} ${LDFLAGS}
-LINKXX:=libtool --mode=link ${CXX} ${LDFLAGS}
-INSTALL:=libtool --mode=install install
-
-LIBOBJS:=cjobid.o strmd5.o
-HDRS:=cjobid.h strmd5.h
-
-LIBLOBJS:=${LIBOBJS:.o=.lo}
-
-LIB:=libglite_jobid.la
-
-os=${shell uname}
-DL_LIBS:=
-ifeq (${os},Linux)
- DL_LIBS:=-ldl
-endif
-TEST_LIBS:=-L${cppunit_prefix}/${libdir} -lcppunit ${DL_LIBS}
-TEST_INC:=-I${cppunit_prefix}/include
-
-compile all: ${LIB}
-
-# In order to use libtool versioning correcty, we must have:
-#
-# current = major + minor + offset
-# revision = patch
-# age = minor
-#
-# where offset is a sum of maximal released minor's of all previous major's
-#
-
-# counted minors: 1.0
-offset=0
-version_info:=-version-info ${shell \
- perl -e '$$,=":"; @F=split /\./,"${version}"; print $$F[0]+$$F[1]+${offset},$$F[2],$$F[1]' }
-
-${LIB}: ${LIBOBJS}
- ${LINK} ${version_info} -o $@ ${LIBLOBJS} -rpath ${stagedir}${prefix}/${libdir}
-
-check: compile base64_test
- ./base64_test base64_test.xml
-
-base64_test: %: %.cpp compile
- ${CXX} -c ${CFLAGS} ${TEST_INC} $<
- ${LINKXX} -o $@ $@.o ${LIB} ${TEST_LIBS}
-
-clean:
- rm -rvf *.o *.lo .libs/ lib* *.c *.cpp *.h
- rm -vf base64_test base64_test.xml
-
-distclean:
- rm -rvf Makefile.inc *.spec debian/
-
-stage:
- $(MAKE) install PREFIX=${stagedir}
-
-install: ${LIB}
- mkdir -p ${DESTDIR}${PREFIX}${prefix}/${libdir}
- mkdir -p ${DESTDIR}${PREFIX}${prefix}/include/${globalprefix}/${jobidprefix}
- ${INSTALL} -m 755 ${LIB} ${DESTDIR}${PREFIX}${prefix}/${libdir}
- (cd ${top_srcdir}/interface; ${INSTALL} -m 644 ${HDRS} ${DESTDIR}${PREFIX}${prefix}/include/${globalprefix}/${jobidprefix})
-
-
-%.lo %.o: %.c
- ${COMPILE} -o $@ -c $<
-
-
-.PHONY: default all compile check stage install clean distclean
+++ /dev/null
-#!/usr/bin/perl
-
-# WARNING: Don't edit this file unless it is the master copy in org.glite.lb
-#
-# For the purpose of standalone builds of lb/jobid/lbjp-common components
-# it is copied on tagging
-
-# $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.
-#
-
-use Getopt::Long;
-use POSIX qw(locale_h strftime);
-
-my $pwd = `pwd`; chomp $pwd;
-my $prefix = '/usr';
-my $stagedir = undef;
-my $root = $pwd.'/stage';
-my $sysroot = '';
-my $sysconfdir;
-my $localstatedir;
-my $staged;
-my $module;
-my $thrflavour = 'gcc64dbgpthr';
-my $nothrflavour = 'gcc64dbg';
-my $mode = 'build';
-my $help = 0;
-my $listmodules;
-my ($version, $force_version);
-my $branch;
-my $output;
-my $lb_tag = '';
-my $lbjp_tag = '';
-my $jp_tag = '';
-my $jobid_tag = '';
-my $libdir = getlibdir();
-my $project = 'emi';
-my $project_version;
-my (%projects, %project);
-my $debug = 0;
-my $pkg_config_env = (defined $ENV{PKG_CONFIG_PATH}) ? "$ENV{PKG_CONFIG_PATH}:" : '';
-
-my @nodes = qw/client server logger logger-msg nagios utils client-java doc ws-test db jpprimary jpindex jpclient harvester lb px proxyrenewal/;
-my @default_nodes = qw/lb px proxyrenewal nagios/;
-my %enable_nodes;
-my %disable_nodes;
-my %default_nodes; @default_nodes{@default_nodes} = (1) x ($#default_nodes + 1);
-
-my %package = (
- 'maintainer' => 'CESNET Product Teams <emi-lb@metacentrum.cz>',
- 'uploaders' => 'František Dvořák <valtri@civ.zcu.cz>',
- 'url' => 'http://glite.cern.ch',
- 'debian_vcs' => 'Vcs-Cvs: :pserver:anonymous@jra1mw.cvs.cern.ch:/cvs/jra1mw
-Vcs-Browser: http://jra1mw.cvs.cern.ch/cgi-bin/jra1mw.cgi',
-);
-
-# key: internal package name (arguments, ...)
-# 'pkg': pkg-config name
-# 'prefix': used when pkg-config fails
-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-devel' => {
- prefix=> '/opt/globus',
- pkg => 'myproxy'
- },
- 'myproxy-server' => {
- prefix=> '',
- },
- 'myproxy-admin' => {
- prefix=> '',
- },
- gsoap => {
- prefix=> '/usr',
- pkg => 'gsoap'
- },
- gsoapxx => {
- prefix=> '/usr',
- pkg => 'gsoap++'
- },
- mysql => {
- prefix=> '/usr'
- },
- 'mysql-devel' => {
- prefix=> ''
- },
- 'mysql-server' => {
- prefix => ''
- },
- voms => {
- prefix => '/opt/glite',
- pkg => 'voms-2.0'
- },
- gridsite => {
- prefix => '/opt/glite'
- },
- lcas => {
- prefix => '/opt/glite',
- pkg => 'lcas'
- },
- trustmanager => {
- prefix => '/opt/glite'
- },
- trustmanager_axis => {
- prefix => '/opt/glite'
- },
- utiljava => {
- prefix=> '/opt/glite'
- },
- ant => {
- prefix=> '/usr'
- },
- jdk => {
- prefix=> '/usr/java/latest',
- locations => [ '/usr/lib/jvm/java', '/usr/lib/jvm/default-java', '/usr/java/latest' ],
- },
- libtar => {
- prefix=> '/usr'
- },
- axis => {
- prefix=> '/usr'
- },
- log4c => {
- prefix=> '/usr'
- },
- postgresql => {
- prefix=> '/usr'
- },
- activemq => {
- prefix=>'/opt/activemq-cpp-library',
- pkg => 'activemq-cpp'
- },
-);
-
-my %jar = (
- 'jakarta-commons-codec' => '/usr/share/java/commons-codec.jar',
- 'jakarta-commons-lang' => '/usr/share/java/commons-lang.jar',
-);
-
-
-my %glite_prefix;
-my %need_externs;
-my %need_externs_type;
-my %need_jars;
-my %extrafull;
-my %extranodmod;
-my %deps;
-my %deps_type;
-my %buildroot;
-my (%etics_externs, %etics_projects);
-
-#
-# modules of the subsystems
-#
-# additional modules from $project{modules} are automatically added
-#
-my %lbmodules = (
- 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim logger-msg nagios client-devel client-progs common-devel logger-devel state-machine-devel/],
- 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin db-devel log-devel maildir-devel server-bones-devel trio-devel jp-interface-devel gss-devel gsoap-plugin-devel/],
- 'jobid' => [qw/api-c api-c-devel api-cpp api-cpp-devel api-java/],
- 'jp' => [ qw/client doc index primary server-common ws-interface/ ],
- 'gridsite' => [ qw/apache libs commands core devel slashgrid services service-clients gsexec/ ],
- 'px' => [ qw/proxyrenewal myproxy-yaim proxyrenewal-devel proxyrenewal-progs/ ],
- 'canl' => [ qw/c c-devel/ ],
- );
-
-#
-# sub-packages
-#
-# modify %lbmodules, %deps_aux, %extrafull, and %properties accodingly
-#
-my %subpackages = (
- 'jobid.api-c-devel' => 'jobid.api-c',
- 'jobid.api-cpp-devel' => 'jobid.api-cpp',
- 'lbjp-common.db-devel' => 'lbjp-common.db',
- 'lbjp-common.gsoap-plugin-devel' => 'lbjp-common.gsoap-plugin',
- 'lbjp-common.gss-devel' => 'lbjp-common.gss',
- 'lbjp-common.jp-interface-devel' => 'lbjp-common.jp-interface',
- 'lbjp-common.log-devel' => 'lbjp-common.log',
- 'lbjp-common.maildir-devel' => 'lbjp-common.maildir',
- 'lbjp-common.server-bones-devel' => 'lbjp-common.server-bones',
- 'lbjp-common.trio-devel' => 'lbjp-common.trio',
- 'lb.client-progs' => 'lb.client',
- 'lb.client-devel' => 'lb.client',
- 'lb.common-devel' => 'lb.common',
- 'lb.logger-devel' => 'lb.logger',
- 'lb.state-machine-devel' => 'lb.state-machine',
- 'px.proxyrenewal-devel' => 'px.proxyrenewal',
- 'px.proxyrenewal-progs' => 'px.proxyrenewal',
- 'canl.c-devel' => 'canl.c',
-);
-
-my @opts = (
- 'prefix:s' => \$prefix,
- 'staged=s' => \$staged,
- 'module=s' => \$module,
- 'thrflavour:s' => \$thrflavour,
- 'nothrflavour:s' => \$nothrflavour,
- 'mode=s' => \$mode,
- 'listmodules=s' => \$listmodules,
- 'version=s' => \$force_version,
- 'branch=s' => \$branch,
- 'output=s' => \$output,
- 'stage=s' => \$stagedir,
- 'root:s' => \$root,
- 'sysroot:s' => \$sysroot,
- 'sysconfdir=s' => \$sysconfdir,
- 'localstatedir=s' => \$localstatedir,
- 'lb-tag=s' => \$lb_tag,
- 'lbjp-common-tag=s' => \$lbjp_tag,
- 'jp-tag=s' => \$jp_tag,
- 'jobid-tag=s' => \$jobid_tag,
- 'canl-tag=s' => \$canl_tag,
- 'help' => \$help,
- 'libdir=s' => \$libdir,
- 'project=s' => \$project,
- 'debug' => \$debug,
-);
-
-for (@nodes) {
- $enable_nodes{$_} = 0;
- $disable_nodes{$_} = 0;
-
- push @opts,"disable-$_",\$disable_nodes{$_};
- push @opts,"enable-$_",\$enable_nodes{$_};
-}
-
-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";
-$prefix=~s/\/$//;
-$root=~s/\/$//;
-$sysroot=~s/\/$//;
-if (not $sysconfdir) { $sysconfdir = $prefix eq '/usr' ? '/etc' : "$prefix/etc"; }
-if (not $localstatedir) { $localstatedir = $prefix eq '/usr' ? '/var' : "$prefix/var"; }
-$sysconfdir=~s/\/$//;
-$localstatedir=~s/\/$//;
-
-$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq '';
-$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq '';
-$externs{'gsoapxx'}{prefix}=$externs{gsoap}{prefix} if $externs{'gsoapxx'}{prefix} eq '';
-
-$externs{'mysql-server'}{withprefix}=$externs{mysql}{withprefix} if $externs{'mysql-server'}{withprefix} eq '';
-$externs{'mysql-devel'}{wihtprefix}=$externs{mysql}{withprefix} if $externs{'mysql-devel'}{withprefix} eq '';
-$externs{'gsoapxx'}{withprefix}=$externs{gsoap}{withprefix} if $externs{'gsoapxx'}{withprefix} eq '';
-
-if ($project =~ /^([^0-9]*)(.*)$/) {
- $project = $1;
- $project_version = $2;
-}
-%project = %{$projects{$project}};
-$project_version = $project{current_version} unless $project_version;
-for my $platform (keys %{$project{etics_externs}}) {
- for $_ (keys %{$project{etics_externs}{$platform}}) {
- $etics_externs{$platform}{$_} = $project{etics_externs}{$platform}{$_};
- }
-}
-reshuffle_platforms(\%etics_externs, $project{supported_platforms});
-reshuffle_platforms(\%{$project{etics_externs_devel}}, $project{supported_platforms});
-for $_ (keys %{$project{etics_projects}}) {
- $etics_projects{$_} = $project{etics_projects}{$_};
-}
-for $_ (keys %{$project{need_externs_aux}}) {
- $need_externs_aux{$_} = $project{need_externs_aux}{$_};
-}
-for my $ext (keys %need_externs_aux) {
- for (@{$need_externs_aux{$ext}}) {
- my ($pkg, $type) =/([^:]*)(?::(.*))?/;
- $type = 'BR' unless ($type);
-
- push @{$need_externs{$ext}},$pkg;
- $need_externs_type{$ext}->{$pkg} = $type;
- }
-}
-if ($project eq 'emi') {
- $extranodmod{lb} = 'lb.emi-lb';
- $extranodmod{px} = 'px.emi-px';
-}
-for $_ (keys %{$project{modules}}) {
- push @{$lbmodules{$_}},@{$project{modules}{$_}};
-}
-
-
-if ($help) { usage(); exit 0; }
-
-if ($listmodules) {
- my $name_prefix = ($listmodules eq 'gridsite' and $project eq 'glite') ? 'org' : $project{etics_name};
- my @m;
-
- if (exists $lbmodules{$listmodules}) {
- @m = map exists $subpackages{$listmodules . '.' . $_} ? "" : "$name_prefix.$listmodules.$_",@{$lbmodules{$listmodules}};
- } else {
- if ($project eq 'emi' and $project_version == 1) {
- # no sub-packages in EMI-1
- } else {
- for my $sub (keys %subpackages) {
- push @m, $sub if ($subpackages{$sub} eq $listmodules);
- }
- }
- }
- print map $_ eq "" ? "" : "$_ ", @m;
- print "\n";
- exit 0;
-}
-
-warn "$0: --branch and --output make sense only in --mode=etics\n"
- if ($output || $branch) && $mode ne 'etics';
-
-my $en;
-for (keys %enable_nodes) { $en = 1 if $enable_nodes{$_}; }
-
-my $dis;
-for (keys %disable_nodes) { $dis = 1 if $disable_nodes{$_}; }
-
-die "--enable-* and --disable-* are mutually exclusive\n"
- if $en && $dis;
-
-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{jp}};
-
-if ($dis) {
- for (@nodes) {
- $enable_nodes{$_} = 1 unless ($disable_nodes{$_} or not $default_nodes{$_});
- }
-}
-
-if (!$en && !$dis) { for (@nodes) { $enable_nodes{$_} = 1 if ($default_nodes{$_}) } };
-
-for (keys %enable_nodes) { delete $enable_nodes{$_} unless $enable_nodes{$_}; }
-
-$stagedir = $root unless $stagedir;
-$stagedir=~s/\/$// if ($stagedir);
-
-if ($mode eq 'build') { for my $ext (keys %externs) {
- if (defined $externs{$ext} and defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; }
- elsif (defined $externs{$ext}{pkg}) {
- my ($flag, $env, $cmd, $ret);
- my $pkg = $externs{$ext}{pkg};
- my $flagname = uc $externs{$ext}{pkg};
- $flagname =~ s/-[0-9\.]*$//;
- $flagname =~ y/-\+/_X/;
-
- print "Checking $pkg ... ";
- $env = "PKG_CONFIG_PATH=$pkg_config_env$stagedir$prefix/$libdir/pkgconfig";
- $cmd = "$env pkg-config $pkg --exists >/dev/null";
- `$cmd`; $ret = $?;
- print "('$cmd' => $ret)\n" if ($debug);
- if ($ret == 0) {
- $externs{$ext}{prefix}=`$env pkg-config $pkg --variable=prefix`;
- chomp $externs{$ext}{prefix};
- print "$externs{$ext}{prefix}\n";
-
- $flag=`$env pkg-config $pkg --cflags`;
- $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag);
- $flag=`$env pkg-config $pkg --libs`;
- $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag);
- } else {
- print "(using default $externs{$ext}{prefix})\n";
- }
- print "\n" if ($debug);
- }
- elsif ($ext eq 'jdk') {
- my $jdk_prefix;
-
- print "Looking for some caffein ... ";
- if (defined $ENV{'JDK_HOME'}) {
- $jdk_prefix = $ENV{'JDK_HOME'};
- print "JDK_HOME=$jdk_prefix\n";
- } elsif (defined $ENV{'JAVA_HOME'}) {
- $jdk_prefix = $ENV{'JAVA_HOME'};
- print "JAVA_HOME=$jdk_prefix\n";
- } else {
- foreach my $i (0..$#{$externs{$ext}{locations}}) {
- if (-e $externs{$ext}{locations}[$i]) {
- $jdk_prefix=$externs{$ext}{locations}[$i];
- print "(found directory $jdk_prefix)\n";
- last;
- }
- }
- print "(using default $externs{$ext}{prefix})\n" unless ($jdk_prefix);
- }
- $externs{$ext}{prefix} = $jdk_prefix if ($jdk_prefix);
- }
-} }
-
-if ($mode eq 'build') {
- print "Writing config.status\n";
- open CONF,">config.status" or die "config.status: $!\n";
- for ('JDK_HOME', 'JAVA_HOME', 'PKG_CONFIG_PATH') {
- print CONF "$_=$ENV{$_} " if (defined $ENV{$_});
- }
- print CONF "$0 @keeparg\n";
- close CONF;
-}
-
-
-my @modules;
-my %aux;
-
-if ($module) {
-# push @modules,split(/[,.]+/,$module);
- push @modules,$module;
-}
-else {
- @modules = map(($extranodmod{$_} ? $extranodmod{$_} : 'lb.'.$_),(keys %enable_nodes));
-
- my $n;
-
- do {
- local $"="\n";
- $n = $#modules;
- push @modules,(map @{$deps{$_}},@modules);
-
- undef %aux; @aux{@modules} = (1) x ($#modules+1);
- @modules = keys %aux;
- } while ($#modules > $n);
-}
-
-@aux{@modules} = (1) x ($#modules+1);
-delete $aux{$_} for (split /,/,$staged);
-@modules = keys %aux;
-
-mode_build() if $mode eq 'build';
-mode_checkout() if $mode eq 'checkout';
-mode_etics($module) if $mode eq 'etics';
-
-sub mode_build {
- print "\nBuilding modules: @modules\n";
- print "Mode: "; print $module ? "single module" : "multiple modules"; print "\n";
-
- my @ext = map @{$need_externs{$_}},@modules;
- my @myjars = map @{$need_jars{$_}},@modules;
- undef %aux; @aux{@ext} = 1;
- @ext = keys %aux;
- undef %aux; @aux{@myjars} = (1) x ($#myjars+1);
- @myjars = keys %aux;
-
- print "\nRequired externals:\n";
- print "\t$_: ".($externs{$_}{prefix}?$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;
-
- if ($module) {
- print "Not creating summary Makefile\n" if $debug;
- } else {
- print "Creating Makefile\n";
-
- open MAK,">Makefile" or die "Makefile: $!\n";
-
- print MAK "all: @modules\n\n";
- print MAK "stage: ".(join '-stage ', @modules)."-stage\n\n";
- print MAK "clean check install:\n";
-
- for (@modules) {
- my $full = full($_);
- print MAK "\tcd $full/$buildroot{$_} && \${MAKE} \$@\n"
- }
-
- print MAK "\ndistclean:\n";
-
- for (@modules) {
- my $full = full($_);
- print MAK $buildroot{$_} eq '' ?
- "\tcd $full && \${MAKE} distclean\n" :
- "\trm -rf $full/$buildroot{$_}\n"
- }
-
- print MAK "\n";
-
- for (@modules) {
- my %ldeps; undef %ldeps;
- @ldeps{@{$deps{$_}}} = 1;
- for my $x (split /,/,$staged) { delete $ldeps{$x}; }
- my @dnames = $module ? () : keys %ldeps;
- my $snames = $#dnames == -1 ? '' : join('-stage ', @dnames).'-stage';
-
- my $full = full($_);
- my $build = $buildroot{$_};
-
- print MAK "$_: @dnames\n\tcd $full/$build && \${MAKE} && \${MAKE} install\n\n";
- print MAK "$_-stage: $snames\n\tcd $full/$build && \${MAKE} && \${MAKE} stage\n\n";
- }
-
- close MAK;
- }
-}
-
-sub mode_checkout() {
- for (@modules) {
- my $module = $_;
- my $tag = "";
- if ($lb_tag){
- for (@{$lbmodules{lb}}){
- if ("lb.".$_ eq $module){
- $tag = '-r '.$lb_tag;
- }
- }
- }
- if ($lbjp_tag) {
- for (@{$lbmodules{'lbjp-common'}}){
- if ("lbjp-common.".$_ eq $module){
- $tag = '-r '.$lbjp_tag;
- }
- }
- }
- if ($jp_tag){
- for (@{$lbmodules{'jp'}}){
- if ("jp.".$_ eq $module){
- $tag = '-r '.$jp_tag;
- }
- }
- }
- if ($jobid_tag){
- for (@{$lbmodules{jobid}}){
- if ("jobid.".$_ eq $module){
- $tag = '-r '.$jobid_tag;
- }
- }
- }
- if ($canl_tag) {
- for (@{$lbmodules{'canl'}}){
- if ("canl.".$_ eq $module){
- $tag = '-r '.$canl_tag;
- }
- }
- }
- #if (grep {"lb.".$_ eq $module} @{$lbmodules{lb}}){
- # print "found";
- #}
- $_ = full($_);
- print "\n*** Checking out $_\n";
- system("cvs checkout $tag $_") == 0 or die "cvs checkout $tag $_: $?\n";
- }
-}
-
-BEGIN{
-%etics_externs = (
- default => {
- 'myproxy-devel'=>'myproxy-devel',
- 'myproxy-server'=>'myproxy-server',
- 'myproxy-admin'=>'myproxy-admin',
- cares=>'c-ares',
- utiljava=>'org.glite.security.util-java',
- gpt=>'gpt',
- fetchcrl=>'fetch-crl',
- activemq=>'activemq-cpp-library',
- },
-);
-
-%etics_projects = (
-);
-
-%need_externs_aux = (
- 'lb.client' => [ qw/cppunit:B classads libtool:B globus:B/ ],
- 'lb.common' => [ qw/expat cares:B cppunit:B classads libtool:B globus:B/ ],
- 'lb.doc' => [ qw/tetex-latex:B/ ],
- 'lb.logger' => [ qw/cppunit:B libtool:B globus:B/ ],
- 'lb.logger-msg' => [ qw/cppunit:B activemq libtool:B globus:B/ ],
- 'lb.nagios' => [ qw/globus_proxy_utils:R/ ],
- 'lb.server' => [ qw/globus_essentials:R globus:B expat cares mysql-server:R cppunit:B gsoap:B classads voms:B lcas gridsite:B bison:B libtool:B libxml2 flex:B/ ],
- 'lb.state-machine' => [ qw/classads libtool:B libxslt:B expat:B globus:B/ ],
- 'lb.utils' => [ qw/cppunit:B libtool:B globus:B/ ],
- 'lb.ws-interface' => [ qw/libxslt:B tidy:B/ ],
- 'lb.ws-test' => [ qw/gsoap:B libtool:B globus:B/ ],
- 'lb.types' => [ qw// ],
- 'lb.harvester' => [ qw/docbook-utils:B libtool:B globus:B/ ],
- 'lbjp-common.db' => [ qw/mysql-devel:B postgresql:B cppunit:B log4c:B libtool:B/ ],
- 'lbjp-common.log' => [ qw/log4c libtool:B/ ],
- 'lbjp-common.maildir' => [ qw/libtool:B/ ],
- 'lbjp-common.server-bones' => [ qw/libtool:B/ ],
- 'lbjp-common.trio' => [ qw/cppunit:B libtool:B/ ],
- 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B libtool:B/ ],
- 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B libtool:B/ ],
- 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap gsoapxx libtool:B/ ],
- 'jobid.api-c' => [ qw/cppunit:B libtool:B openssl:B/ ],
- 'jobid.api-cpp' => [ qw/cppunit:B libtool:B/ ],
- 'jobid.api-java' => [ qw/ant:B jdk:B/ ],
- 'jp.client' => [ qw/gsoap libtar globus_essentials:R globus:B/ ],
- 'jp.doc' => [],
- 'jp.index' => [ qw/gsoap globus_essentials:R globus:B mysql-server:R/ ],
- 'jp.primary' => [ qw/classads gsoap libtar globus_essentials:R globus:B mysql-server:R/ ],
- 'jp.server-common' => [],
- 'jp.ws-interface' => [],
- 'gridsite.core' => [ qw/httpd-devel:B gsoap:B globus:B curl:B doxygen:B fuse-devel:B libxml2:B openssl:B doxygen:B/ ],
- 'gridsite.commands' => [ qw/curl:R openssl:R/ ],
- 'gridsite.apache' => [ qw/libxml2:R openssl:R curl:R/ ],
- 'gridsite.libs' => [ qw/libxml2:R openssl:R/ ],
- 'gridsite.devel' => [ qw// ],
- 'gridsite.slashgrid' => [ qw/curl:R fuse:R/],
- 'gridsite.services' => [ qw/curl:R gsoap:R/ ],
- 'gridsite.service-clients' => [ qw/curl:R gsoap:R gsoapxx:R/ ],
- 'gridsite.gsexec' => [ qw// ],
- 'gridsite.1.5-compat' => [ qw/httpd-devel:B gsoap:B globus:B curl:B doxygen:B fuse-devel:B libxml2:B openssl:B doxygen:B/ ],
- 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-devel:B voms:B libtool:B/ ],
- 'px.myproxy-config' => [ qw/myproxy-admin:R/ ], # in myproxy-config.spec
- 'canl.c' => [ qw/cares:B openssl:B libtool:B bison:B flex:B krb5-devel:B/ ],
-);
-
-%need_jars = (
- 'jobid.api-java' => [ qw/jakarta-commons-codec/ ],
- 'lb.client-java' => [ qw/jakarta-commons-lang/ ],
-);
-
-for my $jar (keys %need_jars) {
- for (@{$need_jars{$jar}}) {
- $need_externs_type{$jar}->{$_} = 'BR'; # XXX
- }
-}
-
-%deps_aux = (
- 'lb.client' => [ qw/
- lb.types:B lb.common
- lbjp-common.trio
- jobid.api-cpp:B jobid.api-c
- lbjp-common.gss
- / ],
- 'lb.client-java' => [ qw/
- lb.types:B
- lb.ws-interface:B
- jobid.api-java
- / ],
- 'lb.common' => [ qw/
- jobid.api-cpp:B jobid.api-c
- lb.types:B lbjp-common.trio lbjp-common.gss
- / ],
- 'lb.doc' => [ qw/lb.types:B/ ],
- 'lb.logger' => [ qw/
- lbjp-common.trio
- lbjp-common.log
- jobid.api-c
- lb.common
- lbjp-common.gss
- / ],
- 'lb.logger-msg' => [ qw/
- lb.logger:B
- / ],
- 'lb.nagios' => [ qw/
- lb.client:R
- lb.ws-test:R
- lb.utils:R
- / ],
- 'lb.server' => [ qw/
- lb.ws-interface lb.types:B lb.common lb.state-machine lb.utils:R
- lbjp-common.db lbjp-common.server-bones lbjp-common.trio lbjp-common.maildir lbjp-common.log
- jobid.api-c
- lbjp-common.gsoap-plugin lbjp-common.gss
- / ],
- 'lb.state-machine' => [ qw/lb.types:B lb.common lbjp-common.jp-interface lbjp-common.gss/ ],
- 'lb.utils' => [ qw/
- lbjp-common.jp-interface
- jobid.api-c
- lbjp-common.trio lbjp-common.maildir
- lb.client lb.state-machine lb.types:B
- / ],
- 'lb.ws-test' => [ qw/lbjp-common.gsoap-plugin lb.ws-interface/ ],
- 'lb.ws-interface' => [ qw/lb.types:B/ ],
- 'lb.types' => [ qw// ],
- 'lb.harvester' => [ qw/
- jobid.api-c lbjp-common.trio lbjp-common.db lb.common lb.client
- lbjp-common.gss lbjp-common.log
- / ],
- 'lb.yaim' => [ qw// ],
- 'lb.glite-LB' => [ qw/
- lb.logger:R lb.server:R lb.utils:R lb.doc:R
- lb.ws-test:R lb.harvester:R lb.yaim:R lb.client-java:R
- lb.logger-msg:R
- / ],
- 'lb.emi-lb' => [ qw/
- lb.logger:R lb.server:R lb.utils:R lb.doc:R
- lb.ws-test:R lb.harvester:R lb.yaim:R lb.client-java:R
- lb.logger-msg:R
- / ],
- 'lbjp-common.db' => [ qw/lbjp-common.trio lbjp-common.log/ ],
- 'lbjp-common.maildir' => [ qw// ],
- 'lbjp-common.log' => [ qw// ],
- 'lbjp-common.server-bones' => [ qw/lbjp-common.log/ ],
- 'lbjp-common.trio' => [ qw// ],
- 'lbjp-common.gss' => [ qw// ],
- 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ],
- 'jobid.api-c' => [ qw// ],
- 'jobid.api-cpp' => [ qw/jobid.api-c/ ],
- 'jobid.api-java' => [ qw// ],
-
- 'lbjp-common.jp-interface' => [ qw/lbjp-common.trio lbjp-common.db jobid.api-c/ ],
-
- 'jp.client' => [ qw/
- jp.ws-interface
- lbjp-common.jp-interface lbjp-common.maildir
- jobid.api-c
- lbjp-common.gsoap-plugin
- / ],
- 'jp.doc' => [ qw// ],
- 'jp.index' => [ qw/
- jp.server-common jp.ws-interface
- lbjp-common.jp-interface lbjp-common.trio lbjp-common.db lbjp-common.server-bones
- lbjp-common.gsoap-plugin
- / ],
- 'jp.primary' => [ qw/
- jobid.api-c
- jp.server-common jp.ws-interface
- lb.state-machine
- lbjp-common.jp-interface lbjp-common.trio lbjp-common.db lbjp-common.server-bones
- lbjp-common.gsoap-plugin
- / ],
- 'jp.server-common' => [ qw/
- lbjp-common.jp-interface lbjp-common.db
- / ],
- 'jp.ws-interface' => [ qw// ],
-
- 'gridsite.core' => [ qw// ],
- 'gridsite.commands' => [ qw/gridsite.core:B/ ],
- 'gridsite.apache' => [ qw/gridsite.core:B/ ],
- 'gridsite.libs' => [ qw/gridsite.core:B / ],
- 'gridsite.devel' => [ qw/gridsite.core:B/ ],
- 'gridsite.slashgrid' => [ qw/gridsite.core:B/],
- 'gridsite.services' => [ qw/gridsite.core:B/ ],
- 'gridsite.service-clients' => [ qw/gridsite.core:B/ ],
- 'gridsite.gsexec' => [ qw/gridsite.core:B/ ],
-
- 'px.proxyrenewal' => [ qw// ],
- 'px.glite-PX' => [qw/px.myproxy-yaim:R/],
- 'px.emi-px' => [qw/px.myproxy-yaim:R/],
- 'px.myproxy-yaim' => [ qw// ],
- 'px.myproxy-config' => [],
-
- 'canl.c' => [],
-
- # sub-packages (virtual ETICS components depending on the main)
- 'jobid.api-c-devel' => [ qw/jobid.api-c:B/ ],
- 'jobid.api-cpp-devel' => [ qw/jobid.api-cpp:B/ ],
- 'lbjp-common.db-devel' => [ qw/lbjp-common.db:B/ ],
- 'lbjp-common.gsoap-plugin-devel' => [ qw/lbjp-common.gsoap-plugin:B/ ],
- 'lbjp-common.gss-devel' => [ qw/lbjp-common.gss:B/ ],
- 'lbjp-common.jp-interface-devel' => [ qw/lbjp-common.jp-interface:B/ ],
- 'lbjp-common.log-devel' => [ qw/lbjp-common.log:B/ ],
- 'lbjp-common.maildir-devel' => [ qw/lbjp-common.maildir:B/ ],
- 'lbjp-common.server-bones-devel' => [ qw/lbjp-common.server-bones:B/ ],
- 'lbjp-common.trio-devel' => [ qw/lbjp-common.trio:B/ ],
- 'lb.client-progs' => [ qw/lb.client:B/ ],
- 'lb.client-devel' => [ qw/lb.client:B/ ],
- 'lb.common-devel' => [ qw/lb.common:B/ ],
- 'lb.logger-devel' => [ qw/lb.logger:B/ ],
- 'lb.state-machine-devel' => [ qw/lb.state-machine:B/ ],
- 'px.proxyrenewal-devel' => [ qw/px.proxyrenewal:B/ ],
- 'px.proxyrenewal-progs' => [ qw/px.proxyrenewal:B/ ],
- 'canl.c-devel' => [ qw/canl.c:B/ ],
-);
-
-for my $ext (keys %deps_aux) {
- for (@{$deps_aux{$ext}}) {
- /([^:]*)(?::(.*))?/;
- push @{$deps{$ext}},$1;
- my $type = $2 ? $2 : 'BR';
- $deps_type{$ext}->{$1} = $type;
- }
-}
-
-
-%extrafull = (
- gridsite=>'org.gridsite.core',
- 'canl.c' => 'emi.canl.canl-c',
- 'canl.c-devel' => 'emi.canl.canl-c',
- 'jobid.api-c-devel' => 'org.glite.jobid.api-c',
- 'jobid.api-cpp-devel' => 'org.glite.jobid.api-cpp',
- 'lbjp-common.db-devel' => 'org.glite.lbjp-common.db',
- 'lbjp-common.gsoap-plugin-devel' => 'org.glite.lbjp-common.gsoap-plugin',
- 'lbjp-common.gss-devel' => 'org.glite.lbjp-common.gss',
- 'lbjp-common.jp-interface-devel' => 'org.glite.lbjp-common.jp-interface',
- 'lbjp-common.log-devel' => 'org.glite.lbjp-common.log',
- 'lbjp-common.maildir-devel' => 'org.glite.lbjp-common.maildir',
- 'lbjp-common.server-bones-devel' => 'org.glite.lbjp-common.server-bones',
- 'lbjp-common.trio-devel' => 'org.glite.lbjp-common.trio',
- 'lb.client-devel' => 'org.glite.lb.client',
- 'lb.client-progs' => 'org.glite.lb.client',
- 'lb.common-devel' => 'org.glite.lb.common',
- 'lb.logger-devel' => 'org.glite.lb.logger',
- 'lb.state-machine-devel' => 'org.glite.lb.state-machine',
- 'px.proxyrenewal-devel' => 'org.glite.px.proxyrenewal',
- 'px.proxyrenewal-progs' => 'org.glite.px.proxyrenewal',
-);
-
-#( java => 'client-java' );
-%extranodmod = (
- db => 'lbjp-common.db',
- jpprimary => 'jp.primary',
- jpindex => 'jp.index',
- jpclient => 'jp.client',
- lb => 'lb.glite-LB',
- px => 'px.glite-PX',
- proxyrenewal => 'px.proxyrenewal',
- canl => 'canl.c',
-);
-
-%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/ ],
-);
-
-%conflicts = (
-);
-
-%provides = (
- 'lbjp-common.gss' => [ qq/glite-security-gss/ ],
- 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ],
- 'lb.nagios' => [ qq/glite-lb-nagios-plugins/ ],
-);
-
-%cvs_prefix = (
- 'lb' => 'org.glite',
- 'jp' => 'org.glite',
- 'jobid' => 'org.glite',
- 'lbjp-common' => 'org.glite',
- 'gridsite' => 'org',
- 'px' => 'org.glite',
- 'canl' => 'emi',
-);
-
-%cvs_tag_prefix = (
- 'lb' => 'glite-',
- 'jp' => 'glite-',
- 'jobid' => 'glite-',
- 'lbjp-common' => 'glite-',
- 'gridsite' => '',
- 'px' => 'glite-',
- 'canl' => 'emi-',
-);
-
-# ==== projects specification ====
-# etics_name ........... ETICS project name
-# conf_prefix .......... ETICS configurations name prefix
-# tag_prefix ........... VCS tag prefix
-# local_prefix ......... prefix (relative to stage)
-# etics_externs ........ ETICS modules names of externals
-# (${NAME.location}, ETICS conf. dependencies)
-# etics_projects ....... ETICS project names of externals
-# etics_externs_devel .. ETICS modules names of devel versions of externals
-# etics_locations ...... ETICS locations in ${NAME.location} properties
-# need_externs_aux ..... project-specific external dependencies
-# supported_platforms .. platforms supported by the project
-# modules .............. additional modules in subsystems
-%projects = (
- glite => {
- current_version => 3,
- etics_name => 'org.glite',
- conf_prefix => { %cvs_tag_prefix },
- tag_prefix => { %cvs_tag_prefix },
- flavours => '--thrflavour=${globus.thr.flavor} --nothrflavour=${globus.nothr.flavor}',
- local_prefix => '',
- etics_externs => {
- default => {
- globus_essentials=>'vdt_globus_essentials',
- globus=>'globus',
- globus_proxy_utils=>'vdt_globus_essentials',
- gridsite=>'org.gridsite.libs',
- yaim_core=>'org.glite.yaim.core',
- gip_release=>'glite-info-provider-release',
- gip_service=>'glite-info-provider-service',
- bdii=>'bdii',
- glite_version=>'glite-version',
- glite_info_templates=>'glite-info-templates',
- glue_schema=>'glue-schema',
- trustmanager=>'org.glite.security.trustmanager',
- axis=>'axis',
- lcas=>'org.glite.security.lcas',
- gsoapxx=>'-',
- jdk=>'jdk',
- voms=>'org.glite.security.voms-api-cpp',
- },
- },
- etics_externs_devel => {
- default => {
- gridsite=>'org.gridsite.devel',
- voms=>'org.glite.security.voms-api',
- },
- },
- etics_projects => {
- vdt=>[qw/globus globus_essentials globus_proxy_utils gpt/],
- 'org.glite'=>[qw/voms gridsite lcas gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/],
- },
- etics_locations => {
- '*' => '',
- },
- need_externs_aux => {
- 'lb.client-java' => [ qw/ant:B jdk:B axis:B trustmanager utiljava libtool:B/ ],
- 'lb.glite-LB' => [ qw/fetchcrl:R gpt:R gip_release:R gip_service:R bdii:R glite_version:R glite_info_templates:R glue_schema:R/ ],
- 'lb.yaim' => [ qw/yaim_core:R/ ],
- 'px.glite-PX' => [qw/myproxy-server:R myproxy-admin:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/],
- 'px.myproxy-yaim' => [ qw/yaim_core:R/ ],
- },
- supported_platforms => {
- sl5_x86_64_gcc412 => 1,
- sl5_ia32_gcc412 => 1,
- deb5_x86_64_gcc432 => 1,
- deb5_ia32_gcc432 => 1,
- slc4_x86_64_gcc346 => 1,
- slc4_ia32_gcc346 => 1,
- },
- modules => {
- 'lb' => [ qw/glite-LB/ ],
- 'px' => [ qw/glite-PX/ ],
- },
- },
-
- emi => {
- current_version => 2,
- etics_name => 'emi',
- conf_prefix => {
- 'lb' => 'emi-',
- 'jp' => 'emi-',
- 'jobid' => 'emi-',
- 'lbjp-common' => 'emi-',
- 'gridsite' => 'emi-',
- 'px' => 'emi-',
- 'canl' => 'emi-',
- },
- tag_prefix => { %cvs_tag_prefix },
- flavours => '--thrflavour= --nothrflavour=',
- local_prefix => '/usr',
- etics_externs => {
- default => {
- globus_essentials=>'globus-gssapi-gsi',
- globus=>'globus-gssapi-gsi-devel',
- globus_proxy_utils=>'globus-proxy-utils',
- gridsite=>'emi.gridsite.libs',
- yaim_core=>'emi.yaim.yaim-core',
- yaim_bdii=>'emi.bdii.yaim-bdii',
- gip_service=>'emi.bdii.glite-info-provider-service',
- bdii=>'emi.bdii.core',
- glite_version=>'emi.emi-version',
- glue_schema=>'emi.bdii.glue-schema',
- trustmanager=>'emi.java-security.trustmanager',
- trustmanager_axis=>'emi.java-security.trustmanager-axis',
- axis=>'axis1.4',
- lcas=>'emi.sac.lcas',
- gsoapxx=>'-',
- jdk=>'java',
- voms => 'emi.voms.voms-api',
- },
- sl5_x86_64_gcc412EPEL => {
- 'myproxy-devel' => 'myproxy-devel.x86_64',
- },
- sl6_x86_64_gcc446EPEL => {
- 'myproxy-devel' => 'myproxy-devel.x86_64',
- },
- deb6_x86_64_gcc445 => {
- axis => 'axis1.4',
- # mappings in ETICS project configuration
- #globus_essentials => 'libglobus-gssapi-gsi4',
- #globus => 'libglobus-gssapi-gsi-dev',
- #axis => 'libaxis-java',
- #cares => 'libc-ares2',
- #cppunit => 'libcppunit',
- #expat => 'libexpat1',
- #log4c => 'liblog4c3',
- #curl => 'libcurl3',
- #'mysql' => 'libmysqlclient16',
- #'mysql-devel' => 'libmysqlclient-dev',
- #libxslt => 'xsltproc',
- #'jakarta-commons-codec' => 'libcommons-codec-java',
- #'jakarta-commons-lang' => 'libcommons-lang-java',
- #'tetex-latex' => 'texlive-latex-extra',
- #'perl-LDAP' => 'libnet-ldap-perl',
- #'fuse-lib' => 'libfuse2',
- #'fuse' => 'fuse-utils',
- },
- },
- etics_externs_devel => {
- default => {
- cares => 'c-ares-devel',
- classads => 'classads-devel',
- cppunit => 'cppunit-devel',
- expat => 'expat-devel',
- gsoap => 'gsoap-devel',
- voms => 'emi.voms.voms-api-devel',
- libtar => 'libtar-devel',
- log4c => 'log4c-devel',
- postgresql => 'postgresql-devel',
- curl => 'curl-devel',
- libxml2 => 'libxml2-devel',
- openssl => 'openssl-devel',
- gridsite=>'emi.gridsite.devel',
- jdk=>'java-devel',
- },
- deb6_x86_64_gcc445 => {
- # mappings in ETICS project configuration
- #cares => 'libc-ares-dev',
- #cppunit => 'libcppunit-dev',
- #expat => 'libexpat1-dev',
- #libtar => 'libtar-dev',
- #log4c => 'liblog4c-dev',
- #postgresql => 'libpq-dev',
- #curl => 'libcurl4-openssl-dev',
- #libxml2 => 'libxml2-dev',
- #openssl => 'libssl-dev',
- #'tetex-latex' => 'texlive-latex-extra',
- #libxslt=>'xsltproc',
- #'httpd-devel' => 'apache2-prefork-dev',
- #'fuse-devel' => 'libfuse-dev',
- #gsoap => 'gsoap',
- #'krb5-devel' => 'libkrb5-dev',
- },
- },
- etics_projects => {
- 'emi'=>[qw/voms voms-devel gridsite lcas gip_service bdii glite_version glue_schema yaim_core yaim_bdii trustmanager trustmanager_axis/],
- },
- etics_locations => {
- axis => 'axis',
- },
- need_externs_aux => {
- 'lb.client-java' => [ qw/ant:B jdk:B axis:B trustmanager trustmanager_axis libtool:B/ ],
- 'lb.emi-lb' => [ qw/fetchcrl:R gip_service:R bdii:R glite_version:R glue_schema:R/ ],
- 'lb.yaim' => [ qw/yaim_core:R yaim_bdii:R/ ],
- 'px.emi-px' => [qw/myproxy-server:R myproxy-admin:R fetchcrl:R gip_service:R bdii:R glite_version:R glue_schema:R/],
- 'px.myproxy-yaim' => [ qw/yaim_core:R yaim_bdii:R/ ],
- },
- supported_platforms => {
- sl5_x86_64_gcc412EPEL => 1,
- sl5_ia32_gcc412EPEL => 1,
- sl6_x86_64_gcc446EPEL => 1,
- deb6_x86_64_gcc445 => 1,
- },
- modules => {
- 'lb' => [ qw/emi-lb/ ],
- 'px' => [ qw/emi-px/ ],
- },
- },
-);
-
-%platform_properties = (
- 'jobid.api-java' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.types' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.doc' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.ws-interface' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.yaim' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.nagios' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'px.yaim' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'px.myproxy-config' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'gridsite.devel' => {
- default => { 'packageName' => 'gridsite-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libgridsite-dev' },
- },
- 'canl.c-devel' => {
- default => { 'packageName' => 'canl-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libcanl-dev' },
- },
- 'jobid.api-c-devel' => {
- default => { 'packageName' => 'glite-jobid-api-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-jobid-dev' },
- },
- 'jobid.api-cpp-devel' => {
- default => { 'packageName' => 'glite-jobid-api-cpp-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-jobid-cpp-dev' },
- },
- 'lbjp-common.db-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-db-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-db-dev' },
- },
- 'lbjp-common.gsoap-plugin-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-gsoap-plugin-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-gsoap-plugin-dev' },
- },
- 'lbjp-common.gss-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-gss-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-gss-dev' },
- },
- 'lbjp-common.jp-interface-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-jp-interface-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-jp-interface-dev' },
- },
- 'lbjp-common.log-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-log-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-log-dev' },
- },
- 'lbjp-common.maildir-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-maildir-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-maildir-dev' },
- },
- 'lbjp-common.server-bones-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-server-bones-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-server-bones-dev' },
- },
- 'lbjp-common.trio-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-trio-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-trio-dev' },
- },
- 'lb.client-devel' => {
- default => { 'packageName' => 'glite-lb-client-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-client-dev' },
- },
- 'lb.common-devel' => {
- default => { 'packageName' => 'glite-lb-common-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-common-dev' },
- },
- 'lb.state-machine-devel' => {
- default => { 'packageName' => 'glite-lb-state-machine-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-state-machine-dev' },
- },
- 'lb.logger-devel' => {
- default => { 'packageName' => 'glite-lb-logger-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-logger-dev' },
- },
- 'px.proxyrenewal-devel' => {
- default => { 'packageName' => 'glite-px-proxyrenewal-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-security-proxyrenewal-dev' },
- },
- 'canl.c-devel' => {
- default => { 'packageName' => 'canl-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libcanl-c-dev' },
- },
-);
-
-my @k = keys %deps_aux;
-@buildroot{@k} = ('') x ($#k+1);
-
-$buildroot{'gridsite.core'} = 'src';
-}
-
-sub full
-{
- my ($short) = @_;
- my $subsys = $short;
- $subsys =~ s/\..*//;
-
- my $cvs_prefix = exists $cvs_prefix{$subsys} ? $cvs_prefix{$subsys} : 'org.glite';
- return $extrafull{$short} ? $extrafull{$short} : "$cvs_prefix.$short";
-}
-
-sub get_version
-{
- my ($fmod, $top_srcdir) = @_;
-
- my ($subsys,$mod) = split /\./,$fmod,2;
- my ($major,$minor,$rev,$age);
- my $old_;
-
- if ($force_version) {
- $force_version =~ /([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)-(.+)/;
- ($major,$minor,$rev,$age) = ($1,$2,$3,$4);
- }
- else {
- my $path = "$top_srcdir/project";
- if ($subsys eq 'gridsite') {
- $path = "$cvs_prefix{$subsys}.$subsys.core/project";
- }
- open V,"$path/version.properties"
- or die "$path/version.properties: $!\n";
-
- $old_ = $_;
- while (<V>) {
- chomp;
- ($major,$minor,$rev) = ($1,$2,$3) if /module\.version\s*=\s*([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/;
- $age = $1 if /module\.age\s*=\s*([[:digit:]]+)/;
- }
- close V;
- $_ = $old_;
- }
- $version = "$major.$minor.$rev-$age";
-
- return ($major, $minor, $rev, $age);
-}
-
-sub get_description
-{
- my ($top_srcdir) = @_;
-
- my $cvs_module = $top_srcdir;
- my $package_description = "";
- my $package_summary = "";
-
- if (-e "$cvs_module/project/package.description") {
- open V, "$cvs_module/project/package.description";
- $package_description = join ("", <V>);
- close V;
- chomp $package_description;
- }
- else {
- print STDERR "package.description not found for $subsys.$module!\n"; }
-
- if (-e "$cvs_module/project/package.summary") {
- open V, "$cvs_module/project/package.summary";
- $package_summary = join ("", <V>);
- close V;
- chomp $package_summary;
- $package_summary =~ s/\n/\\n/g;
- }
- else {
- print STDERR "package.summary not found for $subsys.$module!\n"; }
-
- return ($package_summary, $package_description);
-}
-
-sub mkinc
-{
- my %aux;
- undef %aux;
- my @m=qw/
-lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.nagios lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lb.emi-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
-px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config px.emi-px
-canl.c
-/;
- @aux{@m} = (1) x ($#m+1);
-
- my ($short) = @_;
- my $full = full $short;
- my ($subsys,$mod) = split /\./,$short,2;
- my $packageName = "$project{tag_prefix}{$subsys}$subsys-${mod}";
-
- unless ($aux{$short}) {
- print "Makefile.inc not needed in $full\n";
- return;
- }
-
- my $top_srcdir = '.';
- my $abs_srcdir = '';
- my $build = '';
-
- if ($module) {
- $top_srcdir = $0;
- $top_srcdir =~ s,/?[^/]*$,,;
- $abs_srcdir = $top_srcdir;
- $top_srcdir =~ s,^$,\.,;
- } else {
- $build = "$full/";
- $abs_srcdir = "$full/";
- unless ($buildroot{$_} eq '') {
- $top_srcdir = '..';
- $build .= "$buildroot{$_}/";
- unless (-d "$build") {
- mkdir "$build" or die "mkdir $build: $!\n";
- }
- }
- }
-
- my ($major, $minor, $rev, $age) = get_version $short, $abs_srcdir;
- my ($package_summary, $package_description) = get_description $abs_srcdir;
- if ($package_description) { $package_description =~ s/(.{1,78}\S|\S+)\s+/$1\n/mg; }
- my $package_description_debian = $package_description;
- $package_description_debian =~ s/^/ /mg;
-
- my ($old_locale, $specdate, $debdate);
-
- # files for ETICS always in root source directory
- mkdir $abs_srcdir."project" unless (-d $abs_srcdir."project");
- open PKGCHL,">".$abs_srcdir."project/changelog"
- or die $abs_srcdir."project/changelog: $!\n";
- $old_locale = setlocale(LC_TIME);
- setlocale(LC_TIME, "C");
- $specdate = strftime("%a %b %d %Y", gmtime());
- $debdate = strftime("%a, %d %b %Y %H:%M:%S %z", gmtime());
- setlocale(LC_TIME, $old_locale);
- print PKGCHL qq{* $specdate CESNET team <emi-lb\@metacentrum.cz>
-- automatically generated package
-};
- close PKGCHL;
-
- unless ($top_srcdir eq '.') {
- unlink $build."Makefile";
- symlink "$top_srcdir/Makefile",$build."Makefile" or die "symlink $top_srcdir/Makefile ".$build."Makefile: $!\n";
- }
-
- open MKINC,">".$build."Makefile.inc"
- or die $build."Makefile.inc: $!\n";
-
- print "Creating ".$build."Makefile.inc\n";
-
- print MKINC qq{project = $project
-PREFIX = $root
-prefix = $prefix
-stagedir = $stagedir
-sysroot = $sysroot
-sysconfdir = $sysconfdir
-localstatedir = $localstatedir
-thrflavour = $thrflavour
-nothrflavour = $nothrflavour
-libdir = $libdir
-top_srcdir = $top_srcdir
-};
-
- for (@{$need_externs{$short}}) {
- next unless defined $externs{$_} and defined $externs{$_}{prefix};
- print MKINC "${_}_prefix = $externs{$_}{prefix}\n";
- print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags};
- }
-
- for (@{$need_jars{$short}}) {
- print MKINC "${_}_jar = $jar{$_}\n"
- }
-
- my $need_gsoap = 0;
- for (@{$need_externs{$short}}) { $need_gsoap = 1 if $_ eq 'gsoap'; }
-
- print MKINC "gsoap_default_version=".gsoap_version()."\n" if $need_gsoap;
-
- close MKINC;
-
- my $dh;
- my $debian = 0;
-
- opendir $dh, "$abs_srcdir/project" || die "Can't open $abs_srcdir/project: $!";
- for my $dir (readdir $dh) {
- if ($dir=~/^(.*)\.spec$/) {
- if ($1 ne $packageName) {
- printf STDERR "Changed RPM name: $packageName --> $1\n" if ($debug);;
- $packageName=$1;
- }
- last;
- }
- }
- closedir $dh;
-
- for my $file ("$packageName.spec", "debian.rules", "debian.control", "debian.changelog", "debian.copyright") {
- if (-f "$abs_srcdir/project/$file") {
- my $old_ = $_;
- printf STDERR "Creating $build$file\n" if ($debug);;
- open DST, ">$build$file";
- open SRC, "<$abs_srcdir/project/$file";
- while (<SRC>) {
- if (/\@MODULE\@/) { s/\@MODULE\@/$full/g; }
- if (/\@URL\@/) { s/\@URL\@/$package{url}/g; }
- if (/\@SUMMARY\@/) { s/\@SUMMARY\@/$package_summary/g; }
- if (/\@DESCRIPTION\@/) { s/\@DESCRIPTION\@/$package_description/g; }
- if (/\@DEBIAN_DESCRIPTION\@/) { s/\@DEBIAN_DESCRIPTION\@/$package_description_debian/g; }
- if (/\@VERSION\@/) { s/\@VERSION\@/$version/g; }
- if (/\@MAJOR\@/) { s/\@MAJOR\@/$major/g; }
- if (/\@MINOR\@/) { s/\@MINOR\@/$minor/g; }
- if (/\@REVISION\@/) { s/\@REVISION\@/$rev/g; }
- if (/\@AGE\@/) { s/\@AGE\@/$age/g; }
- if (/\@MAINTAINER\@/) { s/\@MAINTAINER\@/$package{maintainer}/g; }
- if (/\@UPLOADERS\@/) { s/\@UPLOADERS\@/$package{uploaders}/g; }
- if (/\@DEBIAN_VCS\@/) { s/\@DEBIAN_VCS\@/$package{debian_vcs}/g; }
- if (/\@DEBIAN_DATE\@/) { s/\@DEBIAN_DATE\@/$debdate/g; }
- if (/\@SPEC_DATE\@/) { s/\@SPEC_DATE\@/$specdate/g; }
- if (/^\s*.+\/configure\s/ and $force_version) {
- print "Version forced to $version\n" if ($debug);;
- s/--version\s+\S+\s?//;
- s/$/ --version $version/;
- }
- printf DST "%s", "$_";
- }
- close SRC;
- close DST;
- $_ = $old_;
- }
- }
-
- print "Creating ${build}debian/\n" if ($debug);;
-
- `rm -rfv ${build}debian`;
- mkdir $build."debian" or die $!;
- `cp $abs_srcdir/project/debian.* ${build}debian/ 2>/dev/null`;
- `mv ${build}debian.* ${build}debian/ 2>/dev/null`;
- `rm -f ${build}debian/*.orig`;
- opendir $dh, "${build}debian" || die "Can't open ${build}debian: $!";
- for $_ (readdir $dh) {
- if (/^debian\.(.*)/) {
- `mv ${build}debian/$_ ${build}debian/$1`;
- $debian = 1;
- }
- }
- closedir $dh;
-
- if ($debian) {
- my ($dir, $file);
-
- chmod 0755, "${build}debian/rules";
- $file="${build}debian/docs"; if (not -f $file) { `touch $file`; }
- $dir="${build}debian/source"; if (not -d $dir) { mkdir $dir; }
- $file="${build}debian/source/format"; if (not -f $file) { `echo "3.0 (quilt)" > $file` }
- $file="${build}debian/compat"; if (not -f $file) { `echo "7" > $file` }
- $file="${build}debian/changelog"; if (not -f $file) {
- open FH, ">$file" or die $!;
- print FH qq{$packageName ($major.$minor.$rev-$age) unstable; urgency=low
-
- * Automatically generated package
-
- -- $package{maintainer} $debdate
-};
- close FH;
- }
-
- } else {
- `rm -rf ${build}debian`;
- }
-}
-
-BEGIN{
-};
-
-sub mode_etics_packaging {
- my ($fmod, $cmd, $rpmprepare, $debprepare) = @_;
- my ($workspaceDir, $srcPackageName, $srcAge, $topDir);
-
- # old-school packaging by ETICS for EMI-1
- if ($project eq 'emi' and $project_version == 1) { return; }
-
- if ($fmod eq 'gridsite.core') {
- $workspaceDir = '..';
- $srcPackageName = 'gridsite';
- $srcAge = '';
- $topDir = '../';
- } else {
- $workspaceDir = '${workspaceDir}';
- $srcPackageName = '${packageName}';
- $srcAge = '-${age}';
- $topDir = '';
- }
-
- $cmd->{clean} = 'make clean
- rm -rfv ${package.tgzLocation} ${package.SRPMSLocation}';
- $cmd->{default}{packaging} = $rpmprepare;
- $cmd->{default}{packaging} .= "dir=\${workspaceDir}/rpm_build_src_\$\$
- mkdir -p \${package.tgzLocation} \${package.SRPMSLocation} \$dir/{BUILD,RPMS,SOURCES,SRPMS} 2>/dev/null || true
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \${package.tgzLocation}/
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \$dir/SOURCES/
- rpmbuild -bs --nodeps --define \"_topdir \$dir\" $srcPackageName.spec
- cp -v \$dir/SRPMS/*.src.rpm \${package.SRPMSLocation}/
- rm -rf \$dir";
-
- for my $p ('deb5_x86_64_gcc432', 'deb5_ia32_gcc432', 'deb6_x86_64_gcc445', 'deb6_ia32_gcc445') {
- for my $c (keys %{$cmd->{default}}) { $cmd->{$p}{$c} = $cmd->{default}{$c}; }
- $cmd->{$p}{clean} = 'make clean
- rm -rfv ${package.tgzLocation} ${package.SDEBSLocation}';
- $cmd->{$p}{packaging} = $debprepare;
- $cmd->{$p}{packaging} .= "dir=\${workspaceDir}/dpkg_build_src_\$\$
- mkdir -p \${package.tgzLocation} \${package.SDEBSLocation} \$dir 2>/dev/null || true
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \${package.tgzLocation}/
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \$dir/${srcPackageName}_\${version}.orig.tar.gz
- tar xzf \$dir/${srcPackageName}_\${version}.orig.tar.gz -C \$dir
- cp -rf ${topDir}debian/ \$dir/$srcPackageName-\${version}/
- cd \$dir/$srcPackageName-\${version}
- dpkg-buildpackage -S -d -nc
- cd -
- cp -v \$dir/*.tar.gz \$dir/*.dsc \${package.SDEBSLocation}/
- rm -rf \$dir";
- }
-}
-
-sub mode_etics {
- $fmod = shift;
-
- die "$0: --module required with --etics\n" unless $fmod;
-
- my ($subsys,$module) = split /\./,$fmod,2;
- my $full = full "$subsys.$module";
-
- my ($major,$minor,$rev,$age) = get_version $fmod, $full;
-
- # XXX: --with ignored for platform-dependend packages
- my @copts = ();
- my %ge;
- @ge{@{$etics_projects{$project{etics_name}}}} = (1) x ($#{$etics_projects{$project{etics_name}}}+1);
-
- for (@{$need_externs{"$subsys.$module"}}) {
- if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/ and (defined $externs{$_} or defined $jar{$_})) {
- my $eext = $etics_externs{default}{$_} ? $etics_externs{default}{$_} : $_;
- next if ($eext eq '-');
- if (defined $project{etics_locations}{'*'} or defined $project{etics_locations}{$_}) {
- $eext = $project{etics_locations}{$_} if ($project{etics_locations}{$_});
- push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}";
- } else {
- if ($ge{$_} and not defined $externs{$_}{pkg}) {
- push @copts, "--with-$_=\${stageDir}";
- }
- }
- }
- }
-
- for (@{$need_jars{"$subsys.$module"}}) {
- my $eext = $etics_externs{default}{$_} ? $etics_externs{default}{$_} : $_;
-
- push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (defined $project{etics_locations}{'*'} or defined $project{etics_locations}{$_});
- }
-
- my $conf;
- my $conftag;
- my ($confprefix, $nameprefix, $packageName);
-
- $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n";
-
- $confprefix = $project{conf_prefix}{$subsys};
- $nameprefix = $confprefix;
- $nameprefix =~ s/-$//;
- $nameprefix =~ s/-/\./g;
- $packageName = "$project{tag_prefix}{$subsys}$subsys-${module}";
-
- if ($branch) {
- $conf = "$confprefix${subsys}-${module}_$branch";
- $conftag = $branch;
- # forced low age number
- $age = $branch eq 'HEAD' ? '0head' : '0dev';
- push @copts, '--version ${version}-${age}';
- }
- else {
- $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}";
-# XXX: gridsite hack
- $conftag = $subsys eq 'gridsite' ? "$project{tag_prefix}{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" :
- "$project{tag_prefix}{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}";
-
- # lowering age for older packaging
- if ($project eq 'emi' and $project_version == 1) {
- $age = $age - 1;
- }
- }
-
- # emi1 suffix for older packaging
- if ($project eq 'emi' and $project_version == 1) {
- $age = $age.$project.$project_version;
- $conf = $conf.$project.$project_version;
- }
-
- my $file = $output ? $output : "$conf.ini";
- open C,">$file" or die "$file: $!\n";
-
- my $buildroot = $buildroot{"$subsys.$module"} eq '' ? '#no build.root' : "build.root = " . $buildroot{"$subsys.$module"};
-
- my $confdir = $buildroot{"$subsys.$module"} eq '' ? '.' : '..';
-
- my $cvs_module = full "$subsys.$module";
- my ($package_summary, $package_description) = get_description $cvs_module;
- if ($package_description) {
- $package_description =~ s/\n/\\n/g;
- $package_description = "package.description = $package_description\n";
- }
- if ($package_summary) {
- $package_summary = "package.summary = $package_summary\n";
- }
-
- my %cmd;
- $cmd_vcs{checkout} = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_module 2>/dev/null";
- #$cmd_vcs{checkout} = "((test -d jra1mw/.git && (cd jra1mw; git pull)) || (git clone -q http://scientific.zcu.cz/git/jra1mw.git";
- #$cmd_vcs{checkout} .= " && (cd jra1mw; git checkout -b \${tag} --track origin/\${tag})" unless ($conftag eq /HEAD/);
- #$cmd_vcs{checkout} .= ")) && (test -d \${moduleName} || ln -s jra1mw/$cvs_module \${moduleName})";
- $cmd_vcs{checkout} .= "\n\ttest -f \${packageName}-\${version}-\${age}.src.tar.gz || (ln -s \${moduleName} \${packageName}-\${version}; tar -chf - \${packageName}-\${version} --exclude CVS --exclude .git --exclude .etics | gzip --best > \${packageName}-\${version}-\${age}.src.tar.gz; rm \${packageName}-\${version})";
- $cmd_vcs{tag} = "cvs -d \${vcsroot} tag -R \${tag} ${moduleName}";
-
- $cmd{default}{init} = 'None';
- $cmd{default}{configure} = 'None';
- $cmd{default}{compile} = 'None';
- $cmd{default}{test} = 'None';
- $cmd{default}{install} = 'None';
- $cmd{default}{packaging} = 'None';
- $cmd{default}{clean} = 'make clean';
-
- if (exists $subpackages{$fmod}) {
- $cmd{default}{clean} = 'None';
- $cmd{default}{packaging} = "echo building nothing, $subpackages{$fmod} will build this package";
- $cmd_vcs{checkout} = "mkdir -v \${moduleName} 2>/dev/null || true";
- } elsif ($subsys eq 'gridsite') {
- $cmd_vcs{tag} = 'None';
-
- if ($module eq 'core') {
- my $flags;
-
- if ($project ne 'glite') {
- # don't evaluate pkg-config calls to get them into source package
- $flags = 'RELEASE_VERSION=${age}
- GSOAPDIR=\`pkg-config gsoap --variable=prefix\`
- OPENSSL_GLOBUS_FLAGS=\`pkg-config globus-openssl --cflags\`
- OPENSSL_GLOBUS_LIBS=\`pkg-config globus-openssl --libs\`';
- } else {
- $flags = 'RELEASE_VERSION=${age}
- GSOAPDIR=${gsoap.location}
- OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor}
- OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}
- HTTPD_FLAGS=-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-1 -I${httpd-devel.location}/include/apr-1.0 -I${httpd-devel.location}/include/apr-0 -I${httpd-devel.location}/include/pcre';
- }
-
- $cmd{default}{configure} = "cat > Makefile.inc <<EOF
- project = $project
- top_srcdir = ..
- $flags
- EOF";
- $cmd{default}{compile} = "make prefix=\${prefix}$project{local_prefix} libdir=\${libdir}";
- $cmd{default}{install} = "make prefix=\${prefix}$project{local_prefix} libdir=\${libdir} install";
- mode_etics_packaging($fmod, \%cmd,
- "make prefix=\${prefix}$project{local_prefix} rpm-prepare
- cp gridsite.spec ../\n\t",
- "chmod +x \${moduleDir}/src/make-debian-files || true
- make prefix=\${prefix}$project{local_prefix} deb-prepare\n\t"
- );
- }
- elsif ($module eq '1.5-compat') {
- $cmd_vcs{checkout} = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.core 2>/dev/null";
- $cmd{default}{init} = 'echo "/sbin/ldconfig" > project/.post
- echo "/sbin/ldconfig" > project/.postun';
- $cmd{default}{configure} = "cat > src/Makefile.inc <<EOF
- project = emi
- libdir = \${libdir}
- MAJOR_VERSION=1
- MINOR_VERSION=1.5
- PATCH_VERSION=1.5.0
- VERSION=\\\$(PATCH_VERSION)
- RELEASE_VERSION=\${age}
- GSOAPDIR=\\`pkg-config gsoap --variable=prefix\\`
- OPENSSL_GLOBUS_FLAGS=\\`pkg-config globus-openssl --cflags\\`
- OPENSSL_GLOBUS_LIBS=\\`pkg-config globus-openssl --libs\\`
- EOF";
- $cmd{default}{compile} = "make -C src prefix=\${prefix}$project{local_prefix}
- rm -fv project/debian.changelog";
- $cmd{default}{install} = "make -C src prefix=\${prefix}$project{local_prefix} install-lib
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.so.1
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.so
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.a";
- $cmd{default}{packaging} = "None";
- }
- else {
- $cmd{default}{clean} = 'None';
- $cmd{default}{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this";
- $cmd_vcs{checkout} = "mkdir -v \${moduleName} 2>/dev/null || true";
- }
- }
- elsif ($subsys eq 'px' and $module eq 'myproxy-config') {
- $cmd{default}{configure} = "/usr/bin/perl $confdir/configure --root=\${prefix} --prefix= --stage=\${stageDir} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts";
- $cmd{default}{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config";
- }
- else {
- $cmd{default}{configure} = "/usr/bin/perl $confdir/configure $project{flavours} --root=\${prefix} --prefix=$project{local_prefix} --stage=\${stageDir} --sysroot=\${package.prefix} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts";
- $cmd{default}{compile} = 'make';
- $cmd{default}{test} = 'make check';
- $cmd{default}{install} = 'make install';
- if ($subsys eq 'lb' and $module eq 'client') {
- $cmd{default}{compile} = "make rpath=$project{local_prefix}/\${libdir}";
- $cmd{default}{install} = "make install post-install rpath=$project{local_prefix}/\${libdir}";
- }
- mode_etics_packaging($fmod, \%cmd);
- }
-
- 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 = $project{etics_name}.$subsys.$module
-displayName = $conf
-description = $cvs_prefix{$subsys}.$subsys.$module
-projectName = $project{etics_name}
-age = $age
-deploymentType = None
-vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite
-tag = $conftag
-version = $major.$minor.$rev
-$dwpath
-[Platform-default:VcsCommand]
-displayName = None
-description = None
-tag = $cmd_vcs{tag}
-branch = None
-commit = None
-checkout = $cmd_vcs{checkout}
-
-};
-
- for my $p (keys %cmd) {
- next if $p ne 'default' and exists $project{supported_platforms} and not exists $project{supported_platforms}{$p};
-
- print C qq{[Platform-$p:BuildCommand]
-postpublish = None
-packaging = $cmd{$p}{packaging}
-displayName = None
-description = None
-doc = None
-prepublish = None
-publish = None
-compile = $cmd{$p}{compile}
-init = $cmd{$p}{init}
-install = $cmd{$p}{install}
-clean = $cmd{$p}{clean}
-test = $cmd{$p}{test}
-configure = $cmd{$p}{configure}
-checkstyle = None
-
-};
- }
-
- print C qq{[Platform-default:Property]
-$buildroot
-package.preserve.libtool = false
-$package_description$package_summary$defprops};
-
- for (@{$obsoletes{"$subsys.$module"}}) {
- print C "package.obsoletes = $_\n";
- print C "package.replaces = $_\n";
- }
- for (@{$conflicts{"$subsys.$module"}}) {
- print C "package.conflicts = $_\n";
- }
- for (@{$provides{"$subsys.$module"}}) {
- print C "package.provides = $_\n";
- }
- print C "\n";
-
- for my $pp (keys %{$platform_properties{"$subsys.$module"}}) {
- next if $pp eq 'default';
- next if exists $project{supported_platforms} and not exists $project{supported_platforms}{$pp};
-
- print C "[Platform-$pp:Property]\n$buildroot\n";
-
- for my $p (keys %{$platform_properties{"$subsys.$module"}->{$pp}}) {
- print C $p . ' = ' . $platform_properties{"$subsys.$module"}->{$pp}->{$p} . "\n";
- }
- print C "$package_description$package_summary\n";
- }
-
- for my $platform ('default', keys %{$project{supported_platforms}}) {
- my $used = 0;
- my $output = '';
-
- for (@{$need_externs{"$subsys.$module"}},@{$need_jars{"$subsys.$module"}}) {
- my $eext = $etics_externs{$platform}{$_};
- my $edev = $project{etics_externs_devel}{$platform}{$_};
-
- # for the default platform using package of the same
- # name for runtime dependency
- if (not $eext) {
- if ($platform eq 'default') {
-#print "default runtime $_ on default\n";
- $eext = $_; }
- else {
-#print "no runtime $_ on $platform\n";
- $eext = '-'; }
- }
- if ($eext eq '-' and $edev eq '-') {
-#print "skipping $_ on $platform\n";
- next;
- }
-
- my $proj = 'externals';
- for my $p (keys %etics_projects) {
- for $m (@{$etics_projects{$p}}) {
- $proj = $p if $m eq $_;
- }
- }
-
- my $type = $need_externs_type{"$subsys.$module"}->{$_};
-
- if ($edev) {
- if ($type eq 'B') {
- # no runtime - change to devel pkg
- $eext = $edev;
- } elsif ($type eq 'BR' or $type eq 'RB') {
- # additional devel pkg
- if ($edev ne '-') { $output .= "$proj|$edev = B\n"; }
- }
- }
- if ($eext ne '-') { $output .= "$proj|$eext = $type\n"; }
- }
-
- if ($platform eq 'default') {
- for (@{$deps{"$subsys.$module"}}) {
- my $type = $deps_type{"$subsys.$module"}->{$_};
- if (not $used) {
- $used = 1;
- }
- $output .= "$project{etics_name}|$project{etics_name}.$_ = $type\n";
- }
- }
-
- if ($output) {
- print C qq{
-[Platform-$platform:DynamicDependency]
-$output};
- }
- }
-
- close C;
-
- for $file ("$cvs_module/project/debian.rules", "$cvs_module/project/$packageName.spec") {
- my $lib;
- my $main_module;
- @copts = ();
-
- if ($file =~ /debian\.rules$/) { $lib = 'lib'; }
- else { $lib = '%{_lib}'; }
-
- my $main_module = "$subsys.$module";
- if (exists $subpackages{$main_module}) { $main_module = $subpackages{$main_module}; }
-
- # locations hacks
- if ($file =~ /$packageName\.spec$/) {
- if ($fmod eq 'lb.client-java') {
- push @copts, '';
- push @copts, '--with-axis=/usr/local/axis1.4';
- }
- }
-
- if (-f $file) {
- open DST,">$file.new" or die "$file.new: $!\n";
- open SRC,"<$file" or die "$file: $!\n";
- while (<SRC>) {
- if (/^(\s*).+\/configure\s/) {
- printf DST "%s", "$1";
- printf DST "/usr/bin/perl $confdir/configure $project{flavours} --root=/ --prefix=$project{local_prefix} --libdir=$lib --project=$project --module $main_module@copts\n";
- } else {
- printf DST "%s", "$_";
- }
- }
- close SRC;
- close DST;
-
- `diff -b "$file" "$file.new"`;
- if ($? == 0) {
- print STDERR "($file not changed)\n";
- unlink "$file.new";
- } else {
- print STDERR "Writing $file\n";
- rename "$file", "$file.orig" unless -f "$file.orig";
- rename "$file.new", "$file";
- }
- }
- }
-}
-
-sub gsoap_version {
- local $_;
- my $gsoap_version;
- open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n";
-
- while ($_ = <S>) {
- 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;
-}
-
-sub getlibdir {
- if ( -e "/etc/debian_version") { # We are on Debian
- $lib64="lib";
- $lib32="lib32"; }
- else { # Another distribution
- $lib64="lib64";
- $lib32="lib"; }
- $libdir=$lib32;
-
- open INP, "uname -s | "; # Check kernel name
- $kname= <INP>;
- chomp($kname);
- close INP;
-
- if ( $kname eq "Linux") {
- $arch = ("x86_64\npowerpc\nppc64\n");
-
- open INP, "uname -p | "; # Check processor type
- $procname= <INP>;
- chomp($procname);
- close INP;
-
- if ($arch =~/^$procname\n/) {
- return ($lib64); }
-
- open INP, "uname -m | "; # Check machine hardware
- $machname= <INP>;
- chomp($machname);
- close INP;
-
- if ($arch =~/^$machname\n/) {
- return ($lib64); }
-
- # special cases (hyperlink lib64, Debian)
- if (-l "/usr/lib64") {
- $libdir=$lib32; }
-
- # if /usr/lib64 doesn't exist at all (AIX)
- unless ( -e "/usr/lib64" ) {
- $libdir=$lib32; }
- }
-
- if ( $kname eq "SunOS") {
- if (-e "/usr/lib/64") {
- $libdir="lib/64"; }
- }
-
- return $libdir;
-}
-
-sub reshuffle_platforms($$) {
- my ($data, $platforms) = @_;
- my ($platform, %blacklist, $value);
-
- return if not $platforms;
-
- for $platform (keys %$data) {
-#print "plat: $platform: $data->{$platform}\n";
- next if $platform eq 'default';
- for $_ (keys %{$data->{$platform}}) {
-#print " blacklist: $_ = $data->{$platform}{$_}\n";
- $blacklist{$_} = 1;
- }
- }
-
- for $_ (keys %blacklist) {
- $value = $data->{default}{$_} ? $data->{default}{$_} : $_;
- for $platform (keys %$platforms) {
- next if $platform eq 'default';
- if (not defined $data->{$platform}{$_}) {
- $data->{$platform}{$_} = $value;
-#print "added $value to $platform\n"
- }
- }
- $data->{default}{$_} = '-';
-#print "deleted $_ from default\n";
- }
-
- # merge dependencies across the supported platforms
- %blacklist = [];
- for $platform (keys %$platforms) {
- next if $platform eq 'default';
- for $_ (keys %{$data->{$platform}}) {
- $blacklist{$_} = 1;
- }
- }
- for $_ (keys %blacklist) {
- $value = undef;
- $same = 1;
- for $platform (keys %$platforms) {
- if (not $value) { $value = $data->{$platform}{$_}; }
- if (not $data->{$platform}{$_} or $value ne $data->{$platform}{$_}) {
- $same = 0;
- last;
- }
- }
- if ($same and $value) {
-#print "merged dependency $_\n";
- $data->{default}{$_} = $value;
- for $platform (keys %$platforms) {
- delete $data->{$platform}{$_};
- }
- }
- }
-}
-
-sub usage {
- my @ext = keys %externs;
- my @myjars = keys %jar;
-
- print STDERR qq{
-Usage: $0 options
-
-General options (defaults in []):
- --prefix=PREFIX destination directory [./stage]
- --stage=DIR staging directory [./stage]
- --root=DIR installation root (custom relocation root -> sysroot) [./stage]
- --sysroot=DIR system root (custom relocation root -> sysroot) []
- --sysconfdir=DIR system configuration directory [PREFIX/etc]
- --staged=module,module,... what is already in PREFIX (specify without org.glite.)
- --thrflavour=flavour
- --nothrflavour=flavour threaded and non-treaded flavours [gcc64dbgpthr,gcc64dbg]
- --listmodules=subsys list modules of a subsystem
- --listmodules=module list subpackages of a module
- --version=maj.min.rev-age version used instead of reading version.properties
- --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...)
- --libdir=libdir typically [lib,lib64] postfix
- --project=PROJECT build or generate etics for a project (glite/emi1/emi) [emi]
- --debug print more details
-
-Mode of operation:
- --mode=\{checkout|build|etics\} what to do [build]
-
-What to build:
- --module=module build this module only
- --enable-NODE build this "node" (set of modules) only
- --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
- --jobid-tag=tag checkout jobid modules with specific tag
- --canl-tag=tag checkout canl modules with specific tag
-
-Dependencies (summary of what will be used is always printed):
- --with-EXTERNAL=PATH where to look for an external [autodetect]
- --with-JAR=JAR where to look for jars
-
-Available nodes:
- @nodes
-
-Default nodes:
- @default_nodes
-
-Externals (not all for all modules) are:
- @ext
-
-External jars are:
- @myjars
-
-};
-
-}
+++ /dev/null
-#ifndef _GLITE_JOBID_H
-#define _GLITE_JOBID_H
-
-/*!
- * \file cjobid.h
- * \brief L&B consumer API
- */
-
-#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.
-*/
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct _edg_wlc_JobId *glite_jobid_t;
-typedef const struct _edg_wlc_JobId *glite_jobid_const_t;
-typedef glite_jobid_t edg_wlc_JobId;
-
-#define edg_wlc_JobIdCreate glite_jobid_create
-#define edg_wlc_JobIdRecreate glite_jobid_recreate
-#define edg_wlc_JobIdDup glite_jobid_dup
-#define edg_wlc_JobIdFree glite_jobid_free
-#define edg_wlc_JobIdParse glite_jobid_parse
-#define edg_wlc_JobIdUnparse glite_jobid_unparse
-#define edg_wlc_JobIdGetServer glite_jobid_getServer
-#define edg_wlc_JobIdGetServerParts glite_jobid_getServerParts
-#define edg_wlc_JobIdGetUnique glite_jobid_getUnique
-
-#define GLITE_JOBID_DEFAULT_PORT 9000 /**< Default port where bookkeeping server listens */
-#define GLITE_JOBID_PROTO_PREFIX "https://" /**< JobId protocol prefix */
-
-
-/* All the pointer functions return malloc'ed objects (or NULL on error) */
-
-/**
- * Create a Job ID.
- * See the lb_draft document for details on its construction and components
- * \param bkserver book keeping server hostname
- * \param port port for the bk service
- * \param jobid new created job id
- * \ret al 0 success
- * \retval EINVAL invalid bkserver
- * \retval ENOMEM if memory allocation fails
- */
-int glite_jobid_create(const char * bkserver, int port, glite_jobid_t * jobid);
-
-/**
- * Recreate a Job ID
- * \param bkserver bookkeeping server hostname
- * \param port port for the bk service
- * \param unique string which represent created jobid (if NULL then new
- * one is created)
- * \param jobid new created job id
- * \retval 0 success
- * \retval EINVAL invalid bkserver
- * \retval ENOMEM if memory allocation fails
- */
-int glite_jobid_recreate(const char *bkserver, int port, const char * unique, edg_wlc_JobId * jobid);
-
-/**
- * Create copy of Job ID
- * \param in jobid for duplication
- * \param jobid duplicated jobid
- * \retval 0 for success
- * \retval EINVAL invalid jobid
- * \retval ENOMEM if memory allocation fails
- */
-int glite_jobid_dup(glite_jobid_const_t in, glite_jobid_t * jobid);
-
-/*
- * Free jobid structure
- * \param jobid for dealocation
- */
-void glite_jobid_free(glite_jobid_t jobid);
-
-/**
- * Parse Job ID string and creates jobid structure
- * \param jobidstr string representation of jobid
- * \param jobid parsed job id
- * \retval 0 for success
- * \retval EINVAL jobidstr can't be parsed
- * \retval ENOMEM if memory allocation fails
- */
-int glite_jobid_parse(const char* jobidstr, glite_jobid_t * jobid);
-
-/**
- * Unparse Job ID (produce the string form of JobId).
- * \param jobid to be converted to string
- * \return allocated string which represents jobid
- */
-char* glite_jobid_unparse(glite_jobid_const_t jobid);
-
-/**
- * Extract bookkeeping server address (address:port)
- * \param jobid from which the bkserver address should be extracted
- * \retval pointer to allocated string with bkserver address
- * \retval NULL if jobid is 0 or memory allocation fails
- */
-char* glite_jobid_getServer(glite_jobid_const_t jobid);
-
-/**
- * Extract bookkeeping server address and port
- * \param jobid from which the bkserver address should be extracted
- * \param srvName pointer where to return server name
- * \param srvPort pointer where to return server port
- * */
-void glite_jobid_getServerParts(glite_jobid_const_t jobid, char **srvName, unsigned int *srvPort);
-
-/**
- * Extract bookkeeping server address and port
- * \param jobid from which the bkserver address should be extracted
- * \param srvName pointer where to return server name
- * \param srvPort pointer where to return server port
- * */
-void glite_jobid_getServerParts_internal(glite_jobid_const_t jobid, char **srvName, unsigned int *srvPort);
-
-/**
- * Extract unique string
- * \param jobid
- * \retval pointer to allocated unique string representing jobid
- * \retval NULL if jobid is 0 or memory allocation fails
- */
-char* glite_jobid_getUnique(glite_jobid_const_t jobid);
-
-/**
- * Extract unique string
- * \param jobid
- * \retval pointer to allocated unique string representing jobid
- * \retval NULL if jobid is 0 or memory allocation fails
- */
-char* glite_jobid_getUnique_internal(glite_jobid_const_t jobid);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _GLITE_JOBID_H */
+++ /dev/null
-#ifndef _GLITE_STRMD5_H
-#define _GLITE_STRMD5_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#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.
-*/
-
-
-/* Compute MD5 sum of the first argument.
- * The sum is returned in the 16-byte array pointed to by 2nd argument
- * (if not NULL)
- *
- * Return value: ASCII string of the sum, i.e. 32 characters [0-9a-f]
- * (pointer to static area, changed by subsequent calls)
- */
-
-char *strmd5(const char *src, unsigned char *dst);
-
-/**
- * Returns: allocated 32bytes long ASCII string with md5 sum
- * of the first argument
- */
-char *str2md5(const char *src);
-
-/**
- * Returns: allocated 22bytes long ASCII string with md5 sum in base64
- * format of the source argument
- */
-char *str2md5base64(const char *src);
-
-int base64_encode(const void *enc, int enc_size, char *out, int out_max_size);
-int base64_decode(const char *enc,char *out,int out_size);
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif /* _GLITE_STRMD5_H */
+++ /dev/null
-/sbin/ldconfig
+++ /dev/null
-/sbin/ldconfig
+++ /dev/null
-1.0.0-1
-- ChangeLog created
-
-1.0.0-2
-- fixes in etics' invocation of configure
-
-1.0.0-4
-- configure script update
-
-1.0.0-5
-- install libraries into $libdir
-
-1.0.1-1
-- additional includes in base64_test to fix build on Deb5
-
-1.0.2-1
-- Generic lbdir settings in the Makefile
-- Fixed package description and summary
-
-1.0.3-1
-- Fix library versioning
-
-1.0.4-1
-- Fixed libtool version numbering
-
-1.0.5-1
-- Fixed target 'clean' in the Makefile
-
-1.0.6-1
-- Support for IPv6 literal addresses
-- Fixed notification ID parsing
-
-1.0.7-1
-- Handling error returned by gethostbyname() (Savannah Bug #67627)
-
-2.0.0-1
-- Version numbering fixed
-
-2.0.0-2
-- Module rebuilt
-
-2.0.1-1
-- Root directory option (ETICS performs own files relocation)
-- Prefix option as prefix inside stage
-- Sysconfdir option (for /etc vs /usr)
-- DESTDIR in makefiles
-
-2.0.2-1
-- Relocatable build directory.
-
-2.0.2-2
-- Module rebuilt
-
-2.0.2-3
-- Module rebuilt
-
-2.0.2-4
-- Module rebuilt
-
-2.0.2-5
-- Module rebuilt
-
-2.0.3-1
-- Handling error returned by gethostbyname() (Savannah Bug #67627)
-
-2.0.3-2
-- Module rebuilt
-
-2.1.0-1
-- Preparation for a new multiplatform release
-
-2.1.0-2
-- Module rebuilt
-
-2.1.1-1
-- Packaging improvements (rpmlint and lintian checks):
-- License string as recognized by rpmlint and packaging guidelines.
-
-2.1.2-1
-- EMI-2-supported-platform adjustment
-
-2.1.2-2
-- Module rebuilt
-
+++ /dev/null
-Source: glite-jobid-api-c
-Priority: extra
-Maintainer: @MAINTAINER@
-Uploaders: @UPLOADERS@
-Build-Depends: debhelper (>= 7.0.50~), chrpath, libcppunit-dev, libtool, libssl-dev
-Standards-Version: 3.9.1
-Section: libs
-Homepage: @URL@
-DM-Upload-Allowed: yes
-@DEBIAN_VCS@
-
-Package: libglite-jobid2
-Section: libs
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: @SUMMARY@
-@DEBIAN_DESCRIPTION@
-
-Package: libglite-jobid-api-c-dev
-Section: libdevel
-Architecture: any
-Provides: glite-jobid-api-c
-Depends: libglite-jobid2 (= ${binary:Version}), ${misc:Depends}
-Description: Development files for gLite jobid C library
- This package contains development libraries and header files for gLite jobid
- C library.
-
-Package: glite-jobid-api-c-dbg
-Section: debug
-Architecture: any
-Priority: extra
-Depends: libglite-jobid2 (= ${binary:Version}), ${misc:Depends}
-Description: gLite jobid library debugging symbols
- This package contains debugging symbols for gLite jobid library.
+++ /dev/null
-This work was packaged for Debian by:
-
- @MAINTAINER@ on Thu, 08 Dec 2011 00:46:07 +0100
-
-It was downloaded from:
-
- @URL@
-
-Upstream Author(s):
-
- @MAINTAINER@
-
-Copyright:
-
- <Copyright (C) 2004-2011 Members of the EGEE Collaboration>
-
-License:
-
- 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.
-
-On Debian systems, the complete text of the Apache version 2.0 license
-can be found in "/usr/share/common-licenses/Apache-2.0".
-
-The Debian packaging is:
-
- Copyright (C) 2004-2011 Members of the EGEE Collaboration
-
-and is licensed under the Apache License, Version 2.0.
+++ /dev/null
-usr/lib
-usr/include/glite/jobid
+++ /dev/null
-usr/include/glite/jobid/*.h
-usr/lib/lib*.so
+++ /dev/null
-usr/lib/lib*.so.*
+++ /dev/null
-#!/usr/bin/make -f
-# -*- makefile -*-
-
--include /usr/share/dpkg/buildflags.mk
-
-# Uncomment this to turn on verbose mode.
-export DH_VERBOSE=1
-
-configure: configure-stamp
-configure-stamp:
- dh_testdir
- /usr/bin/perl ./configure --thrflavour= --nothrflavour= --root=/ --prefix=/usr --libdir=lib --project=emi --module jobid.api-c
- touch $@
-
-build: build-arch build-indep
-
-build-arch build-indep: build-stamp
-
-build-stamp: configure-stamp
- dh_testdir
- CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE)
- CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) check
- touch $@
-
-clean: configure-stamp
- dh_testdir
- dh_testroot
- rm -f configure-stamp build-stamp
- $(MAKE) clean
- rm -f Makefile.inc config.status
- dh_clean
-
-install: build-stamp
- dh_testdir
- dh_testroot
- dh_prep
- dh_installdirs
- $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
- rm -f $(CURDIR)/debian/tmp/usr/lib/*.la
- rm -f $(CURDIR)/debian/tmp/usr/lib/*.a
- find $(CURDIR)/debian/tmp -name '*' -print | xargs -I {} -i bash -c "chrpath -d {} > /dev/null 2>&1" || echo 'Stripped RPATH'
-
-binary-indep:
-
-binary-arch: install
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_installexamples
- dh_installman
- dh_installlogrotate
- dh_installcron
- dh_install --fail-missing
- dh_link
- dh_strip --dbg-package=glite-jobid-api-c-dbg
- dh_compress
- dh_fixperms
- dh_makeshlibs
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-arch binary-indep
+++ /dev/null
-Summary: @SUMMARY@
-Name: glite-jobid-api-c
-Version: @MAJOR@.@MINOR@.@REVISION@
-Release: @AGE@%{?dist}
-Url: @URL@
-License: ASL 2.0
-Vendor: EMI
-Group: System Environment/Libraries
-BuildRequires: chrpath
-BuildRequires: libtool
-BuildRequires: cppunit-devel
-BuildRequires: openssl-devel
-BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
-AutoReqProv: yes
-Source: http://eticssoft.web.cern.ch/eticssoft/repository/emi/emi.jobid.api-c/%{version}/src/%{name}-@VERSION@.src.tar.gz
-
-
-%description
-@DESCRIPTION@
-
-
-%package devel
-Summary: Development files for gLite jobid C library
-Group: Development/Libraries
-Requires: %{name}%{?_isa} = %{version}-%{release}
-
-
-%description devel
-This package contains development libraries and header files for gLite jobid
-C library.
-
-
-%prep
-%setup -q
-
-
-%build
-/usr/bin/perl ./configure --thrflavour= --nothrflavour= --root=/ --prefix=/usr --libdir=%{_lib} --project=emi --module jobid.api-c
-make
-
-
-%check
-make check
-
-
-%install
-rm -rf $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
-find $RPM_BUILD_ROOT -name '*.la' -exec rm -rf {} \;
-find $RPM_BUILD_ROOT -name '*.a' -exec rm -rf {} \;
-find $RPM_BUILD_ROOT -name '*' -print | xargs -I {} -i bash -c "chrpath -d {} > /dev/null 2>&1" || echo 'Stripped RPATH'
-
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
-%post -p /sbin/ldconfig
-
-
-%postun -p /sbin/ldconfig
-
-
-%files
-%defattr(-,root,root)
-/usr/%{_lib}/libglite_jobid.so.@MAJOR@.@MINOR@.@REVISION@
-/usr/%{_lib}/libglite_jobid.so.@MAJOR@
-
-
-%files devel
-%defattr(-,root,root)
-%dir /usr/include/glite
-%dir /usr/include/glite/jobid
-/usr/include/glite/jobid/strmd5.h
-/usr/include/glite/jobid/cjobid.h
-/usr/%{_lib}/libglite_jobid.so
-
-
-%changelog
-* @SPEC_DATE@ @MAINTAINER@ - @MAJOR@.@MINOR@.@REVISION@-@AGE@%{?dist}
-- automatically generated package
+++ /dev/null
-C library handling gLite jobid.
+++ /dev/null
-C library handling gLite jobid
+++ /dev/null
-# : /cvs/jra1mw/org.glite.jobid.api-c/project/version.properties,v 1.1 2009/01/16 08:48:52 zsustr Exp $
-module.version=2.1.2
-module.age=2
+++ /dev/null
-#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 <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <assert.h>
-#include <ctype.h>
-#include <netdb.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <stdint.h>
-
-#include "cjobid.h"
-#include "strmd5.h"
-
-struct _edg_wlc_JobId {
- char *id; /* unique job identification */
- /* additional information */
- char *BShost;/* bookkeeping server hostname */
- unsigned int BSport; /* bookkeeping server port */
- char *info; /* additional information (after ? in URI) */
-};
-
-int glite_jobid_create(const char *bkserver, int port, glite_jobid_t *jobId)
-{
- return glite_jobid_recreate(bkserver, port, NULL, jobId);
-}
-
-
-int glite_jobid_recreate(const char* bkserver, int port, const char *unique, glite_jobid_t *jobId)
-{
- glite_jobid_t out;
- char hostname[200]; /* used to hold string for encrypt */
- struct timeval tv;
- int skip;
- char* portbeg;
- int rndaddr = 0;
-
- struct hostent* he;
-
- if (!bkserver)
- return EINVAL;
-
- if (unique == NULL) {
- gettimeofday(&tv, NULL);
- srandom(tv.tv_usec);
- gethostname(hostname, 100);
- he = gethostbyname(hostname);
- if (he) rndaddr = *((uint32_t *)he->h_addr_list[0]);
- else {
-#define RAND8 (rand() & 0xFF)
-#define RAND16 (RAND8 << 8 | RAND8)
- rndaddr = RAND16 << 16 | RAND16;
- }
-
- skip = strlen(hostname);
- skip += sprintf(hostname + skip, "-IP:0x%x-pid:%d-rnd:%d-time:%d:%d",
- rndaddr,
- getpid(), (int)random(), (int)tv.tv_sec, (int)tv.tv_usec);
- }
-
- *jobId = NULL;
- out = (glite_jobid_t) malloc (sizeof(*out));
- if (!out)
- return ENOMEM;
-
- memset(out, 0, sizeof(*out));
-
- /* check if it begins with prefix */
- /* unsupported */
- /* FIXME: fill in PROTO_PREFIX if missing */
- if (strncmp(bkserver, GLITE_JOBID_PROTO_PREFIX, sizeof(GLITE_JOBID_PROTO_PREFIX)-1) == 0)
- return EINVAL;
-
- out->BShost = strdup(bkserver);
- portbeg = strrchr(out->BShost, ':');
- if (portbeg) {
- *portbeg = 0;
- /* try to get port number */
- if (port == 0)
- port = atoi(portbeg + 1);
- }
-
- if (port == 0)
- port = GLITE_JOBID_DEFAULT_PORT;
-
- out->BSport = port;
-
- out->id = (unique) ? strdup(unique) : str2md5base64(hostname);
- //printf("Encrypt: %s\nBASE64 %s\n", hostname, out->id);
-
- if (!out->id || !out->BShost) {
- glite_jobid_free(out);
- return ENOMEM;
- }
-
- *jobId = out;
- return 0;
-}
-
-
-int glite_jobid_dup(glite_jobid_const_t in, glite_jobid_t *out)
-{
- glite_jobid_t jid;
- *out = NULL;
- if (in == NULL)
- return 0;
-
- jid = malloc(sizeof(*jid));
- if (!jid)
- return ENOMEM;
-
- memset(jid, 0,sizeof(*jid));
- jid->BShost = strdup(in->BShost);
- jid->id = strdup(in->id);
- if (in->info)
- jid->info = strdup(in->info);
-
- if (jid->BShost == NULL || jid->id == NULL) {
- glite_jobid_free(jid);
- return ENOMEM;
- }
-
- jid->BSport = in->BSport;
- *out = jid;
- return 0;
-}
-
-
-// XXX
-// use recreate
-// parse name, port, unique
-int glite_jobid_parse(const char *idString, glite_jobid_t *jobId)
-{
- char *pom, *pom1, *pom2;
- glite_jobid_t out;
-
- *jobId = NULL;
-
- out = (glite_jobid_t) malloc (sizeof(*out));
- if (out == NULL )
- return ENOMEM;
-
- memset(out,0,sizeof(*out));
-
- if (strncmp(idString, GLITE_JOBID_PROTO_PREFIX, sizeof(GLITE_JOBID_PROTO_PREFIX) - 1)) {
- out->BShost = (char *) NULL;
- out->BSport = 0;
-
- free(out);
- return EINVAL;
- }
-
- pom = strdup(idString + sizeof(GLITE_JOBID_PROTO_PREFIX) - 1);
- pom1 = strchr(pom, '/');
-
- if (!pom1) { free(pom); free(out); return EINVAL; }
- pom1[0] = '\0';
-
- pom2 = strrchr(pom, ':');
- if (pom2 && strchr(pom2,']')) pom2 = NULL;
-
- if ( pom2 ) {
- pom[pom2-pom] = '\0';
- out->BShost = strdup(pom);
- pom[pom1-pom] = '\0';
- out->BSport = (unsigned int) strtoul(pom2 + 1,NULL,10);
- } else {
- pom[pom1-pom] = '\0';
- out->BShost = strdup(pom);
- out->BSport = GLITE_JOBID_DEFAULT_PORT;
- }
-
- /* XXX: localhost not supported in jobid
- if (!strncmp(out->BShost,"localhost",9) {
- free(pom);
- free(out->BShost);
- free(out);
- return EINVAL;
- }
- */
-
- /* additional info from URI */
- pom2 = strchr(pom1+1,'?');
- if (pom2) {
- *pom2 = 0;
- out->info = strdup(pom2+1);
- }
-
- /* extract the unique part */
- out->id = strdup(pom1+1);
-
- for (pom1 = out->BShost; *pom1; pom1++)
- if (isspace(*pom1)) break;
-
- for (pom2 = out->id; *pom2; pom2++)
- if (isspace(*pom2)) break;
-
- if (*pom1 || *pom2) {
- free(pom);
- glite_jobid_free(out);
- return EINVAL;
- }
-
- free(pom);
- *jobId = out;
- return 0;
-}
-
-
-void glite_jobid_free(glite_jobid_t job)
-{
- if (job) {
- free(job->id);
- free(job->BShost);
- free(job->info);
- free(job);
- }
-}
-
-
-char* glite_jobid_unparse(glite_jobid_const_t jobid)
-{
- char *out, port[40];
-
- if (!jobid)
- return NULL;
-
- if (jobid->BSport)
- sprintf(port,":%d",jobid->BSport);
- else
- *port = 0;
-
- asprintf(&out, GLITE_JOBID_PROTO_PREFIX"%s%s/%s%s%s",
- jobid->BShost,port,
- jobid->id,
- (jobid->info ? "?" : ""),
- (jobid->info ? jobid->info : ""));
-
- return out;
-}
-
-
-char* glite_jobid_getServer(glite_jobid_const_t jobid)
-{
- char *bs = NULL;
-
- if (jobid)
- asprintf(&bs, "%s:%u", jobid->BShost,
- jobid->BSport ? jobid->BSport : GLITE_JOBID_DEFAULT_PORT);
-
- return bs;
-}
-
-
-void glite_jobid_getServerParts(glite_jobid_const_t jobid, char **srvName, unsigned int *srvPort)
-{
- if (jobid) {
- *srvName = strdup(jobid->BShost);
- *srvPort = jobid->BSport ? jobid->BSport : GLITE_JOBID_DEFAULT_PORT;
- }
-}
-
-
-char* glite_jobid_getUnique(glite_jobid_const_t jobid)
-{
- return jobid ? strdup(jobid->id) : NULL;
-}
-
-
-void glite_jobid_getServerParts_internal(glite_jobid_const_t jobid, char **srvName, unsigned int *srvPort)
-{
- if (jobid) {
- *srvName = jobid->BShost;
- *srvPort = jobid->BSport ? jobid->BSport : GLITE_JOBID_DEFAULT_PORT;
- }
-}
-
-
-char* glite_jobid_getUnique_internal(glite_jobid_const_t jobid)
-{
- return jobid ? jobid->id : NULL;
-}
+++ /dev/null
-/*
-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.
-*/
-
-/* crypto/md32_common.h */
-/* ====================================================================
- * Copyright (c) 1999-2002 The OpenSSL Project. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. All advertising materials mentioning features or use of this
- * software must display the following acknowledgment:
- * "This product includes software developed by the OpenSSL Project
- * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
- *
- * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
- * endorse or promote products derived from this software without
- * prior written permission. For written permission, please contact
- * licensing@OpenSSL.org.
- *
- * 5. Products derived from this software may not be called "OpenSSL"
- * nor may "OpenSSL" appear in their names without prior written
- * permission of the OpenSSL Project.
- *
- * 6. Redistributions of any form whatsoever must retain the following
- * acknowledgment:
- * "This product includes software developed by the OpenSSL Project
- * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
- *
- * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- * ====================================================================
- *
- * This product includes cryptographic software written by Eric Young
- * (eay@cryptsoft.com). This product includes software written by Tim
- * Hudson (tjh@cryptsoft.com).
- *
- */
-
-/*
- * This is a generic 32 bit "collector" for message digest algorithms.
- * Whenever needed it collects input character stream into chunks of
- * 32 bit values and invokes a block function that performs actual hash
- * calculations.
- *
- * Porting guide.
- *
- * Obligatory macros:
- *
- * DATA_ORDER_IS_BIG_ENDIAN or DATA_ORDER_IS_LITTLE_ENDIAN
- * this macro defines byte order of input stream.
- * HASH_CBLOCK
- * size of a unit chunk HASH_BLOCK operates on.
- * HASH_LONG
- * has to be at lest 32 bit wide, if it's wider, then
- * HASH_LONG_LOG2 *has to* be defined along
- * HASH_CTX
- * context structure that at least contains following
- * members:
- * typedef struct {
- * ...
- * HASH_LONG Nl,Nh;
- * HASH_LONG data[HASH_LBLOCK];
- * unsigned int num;
- * ...
- * } HASH_CTX;
- * HASH_UPDATE
- * name of "Update" function, implemented here.
- * HASH_TRANSFORM
- * name of "Transform" function, implemented here.
- * HASH_FINAL
- * name of "Final" function, implemented here.
- * HASH_BLOCK_HOST_ORDER
- * name of "block" function treating *aligned* input message
- * in host byte order, implemented externally.
- * HASH_BLOCK_DATA_ORDER
- * name of "block" function treating *unaligned* input message
- * in original (data) byte order, implemented externally (it
- * actually is optional if data and host are of the same
- * "endianess").
- * HASH_MAKE_STRING
- * macro convering context variables to an ASCII hash string.
- *
- * Optional macros:
- *
- * B_ENDIAN or L_ENDIAN
- * defines host byte-order.
- * HASH_LONG_LOG2
- * defaults to 2 if not states otherwise.
- * HASH_LBLOCK
- * assumed to be HASH_CBLOCK/4 if not stated otherwise.
- * HASH_BLOCK_DATA_ORDER_ALIGNED
- * alternative "block" function capable of treating
- * aligned input message in original (data) order,
- * implemented externally.
- *
- * MD5 example:
- *
- * #define DATA_ORDER_IS_LITTLE_ENDIAN
- *
- * #define HASH_LONG MD5_LONG
- * #define HASH_LONG_LOG2 MD5_LONG_LOG2
- * #define HASH_CTX MD5_CTX
- * #define HASH_CBLOCK MD5_CBLOCK
- * #define HASH_LBLOCK MD5_LBLOCK
- * #define HASH_UPDATE MD5_Update
- * #define HASH_TRANSFORM MD5_Transform
- * #define HASH_FINAL MD5_Final
- * #define HASH_BLOCK_HOST_ORDER md5_block_host_order
- * #define HASH_BLOCK_DATA_ORDER md5_block_data_order
- *
- * <appro@fy.chalmers.se>
- */
-
-#if !defined(DATA_ORDER_IS_BIG_ENDIAN) && !defined(DATA_ORDER_IS_LITTLE_ENDIAN)
-#error "DATA_ORDER must be defined!"
-#endif
-
-#ifndef HASH_CBLOCK
-#error "HASH_CBLOCK must be defined!"
-#endif
-#ifndef HASH_LONG
-#error "HASH_LONG must be defined!"
-#endif
-#ifndef HASH_CTX
-#error "HASH_CTX must be defined!"
-#endif
-
-#ifndef HASH_UPDATE
-#error "HASH_UPDATE must be defined!"
-#endif
-#ifndef HASH_TRANSFORM
-#error "HASH_TRANSFORM must be defined!"
-#endif
-#ifndef HASH_FINAL
-#error "HASH_FINAL must be defined!"
-#endif
-
-#ifndef HASH_BLOCK_HOST_ORDER
-#error "HASH_BLOCK_HOST_ORDER must be defined!"
-#endif
-
-#if 0
-/*
- * Moved below as it's required only if HASH_BLOCK_DATA_ORDER_ALIGNED
- * isn't defined.
- */
-#ifndef HASH_BLOCK_DATA_ORDER
-#error "HASH_BLOCK_DATA_ORDER must be defined!"
-#endif
-#endif
-
-#ifndef HASH_LBLOCK
-#define HASH_LBLOCK (HASH_CBLOCK/4)
-#endif
-
-#ifndef HASH_LONG_LOG2
-#define HASH_LONG_LOG2 2
-#endif
-
-/*
- * Engage compiler specific rotate intrinsic function if available.
- */
-#undef ROTATE
-#ifndef PEDANTIC
-# if defined(_MSC_VER) || defined(__ICC)
-# define ROTATE(a,n) _lrotl(a,n)
-# elif defined(__MWERKS__)
-# if defined(__POWERPC__)
-# define ROTATE(a,n) __rlwinm(a,n,0,31)
-# elif defined(__MC68K__)
- /* Motorola specific tweak. <appro@fy.chalmers.se> */
-# define ROTATE(a,n) ( n<24 ? __rol(a,n) : __ror(a,32-n) )
-# else
-# define ROTATE(a,n) __rol(a,n)
-# endif
-# elif defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
- /*
- * Some GNU C inline assembler templates. Note that these are
- * rotates by *constant* number of bits! But that's exactly
- * what we need here...
- * <appro@fy.chalmers.se>
- */
-# if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__)
-# define ROTATE(a,n) ({ register unsigned int ret; \
- asm ( \
- "roll %1,%0" \
- : "=r"(ret) \
- : "I"(n), "0"(a) \
- : "cc"); \
- ret; \
- })
-# elif defined(__powerpc) || defined(__ppc__) || defined(__powerpc64__)
-# define ROTATE(a,n) ({ register unsigned int ret; \
- asm ( \
- "rlwinm %0,%1,%2,0,31" \
- : "=r"(ret) \
- : "r"(a), "I"(n)); \
- ret; \
- })
-# endif
-# endif
-#endif /* PEDANTIC */
-
-#if HASH_LONG_LOG2==2 /* Engage only if sizeof(HASH_LONG)== 4 */
-/* A nice byte order reversal from Wei Dai <weidai@eskimo.com> */
-#ifdef ROTATE
-/* 5 instructions with rotate instruction, else 9 */
-#define REVERSE_FETCH32(a,l) ( \
- l=*(const HASH_LONG *)(a), \
- ((ROTATE(l,8)&0x00FF00FF)|(ROTATE((l&0x00FF00FF),24))) \
- )
-#else
-/* 6 instructions with rotate instruction, else 8 */
-#define REVERSE_FETCH32(a,l) ( \
- l=*(const HASH_LONG *)(a), \
- l=(((l>>8)&0x00FF00FF)|((l&0x00FF00FF)<<8)), \
- ROTATE(l,16) \
- )
-/*
- * Originally the middle line started with l=(((l&0xFF00FF00)>>8)|...
- * It's rewritten as above for two reasons:
- * - RISCs aren't good at long constants and have to explicitely
- * compose 'em with several (well, usually 2) instructions in a
- * register before performing the actual operation and (as you
- * already realized:-) having same constant should inspire the
- * compiler to permanently allocate the only register for it;
- * - most modern CPUs have two ALUs, but usually only one has
- * circuitry for shifts:-( this minor tweak inspires compiler
- * to schedule shift instructions in a better way...
- *
- * <appro@fy.chalmers.se>
- */
-#endif
-#endif
-
-#ifndef ROTATE
-#define ROTATE(a,n) (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
-#endif
-
-/*
- * Make some obvious choices. E.g., HASH_BLOCK_DATA_ORDER_ALIGNED
- * and HASH_BLOCK_HOST_ORDER ought to be the same if input data
- * and host are of the same "endianess". It's possible to mask
- * this with blank #define HASH_BLOCK_DATA_ORDER though...
- *
- * <appro@fy.chalmers.se>
- */
-#if defined(B_ENDIAN)
-# if defined(DATA_ORDER_IS_BIG_ENDIAN)
-# if !defined(HASH_BLOCK_DATA_ORDER_ALIGNED) && HASH_LONG_LOG2==2
-# define HASH_BLOCK_DATA_ORDER_ALIGNED HASH_BLOCK_HOST_ORDER
-# endif
-# endif
-#elif defined(L_ENDIAN)
-# if defined(DATA_ORDER_IS_LITTLE_ENDIAN)
-# if !defined(HASH_BLOCK_DATA_ORDER_ALIGNED) && HASH_LONG_LOG2==2
-# define HASH_BLOCK_DATA_ORDER_ALIGNED HASH_BLOCK_HOST_ORDER
-# endif
-# endif
-#endif
-
-#if !defined(HASH_BLOCK_DATA_ORDER_ALIGNED)
-#ifndef HASH_BLOCK_DATA_ORDER
-#error "HASH_BLOCK_DATA_ORDER must be defined!"
-#endif
-#endif
-
-#if defined(DATA_ORDER_IS_BIG_ENDIAN)
-
-#ifndef PEDANTIC
-# if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
-# if ((defined(__i386) || defined(__i386__)) && !defined(I386_ONLY)) || \
- (defined(__x86_64) || defined(__x86_64__))
- /*
- * This gives ~30-40% performance improvement in SHA-256 compiled
- * with gcc [on P4]. Well, first macro to be frank. We can pull
- * this trick on x86* platforms only, because these CPUs can fetch
- * unaligned data without raising an exception.
- */
-# define HOST_c2l(c,l) ({ unsigned int r=*((const unsigned int *)(c)); \
- asm ("bswapl %0":"=r"(r):"0"(r)); \
- (c)+=4; (l)=r; })
-# define HOST_l2c(l,c) ({ unsigned int r=(l); \
- asm ("bswapl %0":"=r"(r):"0"(r)); \
- *((unsigned int *)(c))=r; (c)+=4; r; })
-# endif
-# endif
-#endif
-
-#ifndef HOST_c2l
-#define HOST_c2l(c,l) (l =(((unsigned long)(*((c)++)))<<24), \
- l|=(((unsigned long)(*((c)++)))<<16), \
- l|=(((unsigned long)(*((c)++)))<< 8), \
- l|=(((unsigned long)(*((c)++))) ), \
- l)
-#endif
-#define HOST_p_c2l(c,l,n) { \
- switch (n) { \
- case 0: l =((unsigned long)(*((c)++)))<<24; \
- case 1: l|=((unsigned long)(*((c)++)))<<16; \
- case 2: l|=((unsigned long)(*((c)++)))<< 8; \
- case 3: l|=((unsigned long)(*((c)++))); \
- } }
-#define HOST_p_c2l_p(c,l,sc,len) { \
- switch (sc) { \
- case 0: l =((unsigned long)(*((c)++)))<<24; \
- if (--len == 0) break; \
- case 1: l|=((unsigned long)(*((c)++)))<<16; \
- if (--len == 0) break; \
- case 2: l|=((unsigned long)(*((c)++)))<< 8; \
- } }
-/* NOTE the pointer is not incremented at the end of this */
-#define HOST_c2l_p(c,l,n) { \
- l=0; (c)+=n; \
- switch (n) { \
- case 3: l =((unsigned long)(*(--(c))))<< 8; \
- case 2: l|=((unsigned long)(*(--(c))))<<16; \
- case 1: l|=((unsigned long)(*(--(c))))<<24; \
- } }
-#ifndef HOST_l2c
-#define HOST_l2c(l,c) (*((c)++)=(unsigned char)(((l)>>24)&0xff), \
- *((c)++)=(unsigned char)(((l)>>16)&0xff), \
- *((c)++)=(unsigned char)(((l)>> 8)&0xff), \
- *((c)++)=(unsigned char)(((l) )&0xff), \
- l)
-#endif
-
-#elif defined(DATA_ORDER_IS_LITTLE_ENDIAN)
-
-#if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__)
-# ifndef B_ENDIAN
- /* See comment in DATA_ORDER_IS_BIG_ENDIAN section. */
-# define HOST_c2l(c,l) ((l)=*((const unsigned int *)(c)), (c)+=4, l)
-# define HOST_l2c(l,c) (*((unsigned int *)(c))=(l), (c)+=4, l)
-# endif
-#endif
-
-#ifndef HOST_c2l
-#define HOST_c2l(c,l) (l =(((unsigned long)(*((c)++))) ), \
- l|=(((unsigned long)(*((c)++)))<< 8), \
- l|=(((unsigned long)(*((c)++)))<<16), \
- l|=(((unsigned long)(*((c)++)))<<24), \
- l)
-#endif
-#define HOST_p_c2l(c,l,n) { \
- switch (n) { \
- case 0: l =((unsigned long)(*((c)++))); \
- case 1: l|=((unsigned long)(*((c)++)))<< 8; \
- case 2: l|=((unsigned long)(*((c)++)))<<16; \
- case 3: l|=((unsigned long)(*((c)++)))<<24; \
- } }
-#define HOST_p_c2l_p(c,l,sc,len) { \
- switch (sc) { \
- case 0: l =((unsigned long)(*((c)++))); \
- if (--len == 0) break; \
- case 1: l|=((unsigned long)(*((c)++)))<< 8; \
- if (--len == 0) break; \
- case 2: l|=((unsigned long)(*((c)++)))<<16; \
- } }
-/* NOTE the pointer is not incremented at the end of this */
-#define HOST_c2l_p(c,l,n) { \
- l=0; (c)+=n; \
- switch (n) { \
- case 3: l =((unsigned long)(*(--(c))))<<16; \
- case 2: l|=((unsigned long)(*(--(c))))<< 8; \
- case 1: l|=((unsigned long)(*(--(c)))); \
- } }
-#ifndef HOST_l2c
-#define HOST_l2c(l,c) (*((c)++)=(unsigned char)(((l) )&0xff), \
- *((c)++)=(unsigned char)(((l)>> 8)&0xff), \
- *((c)++)=(unsigned char)(((l)>>16)&0xff), \
- *((c)++)=(unsigned char)(((l)>>24)&0xff), \
- l)
-#endif
-
-#endif
-
-/*
- * Time for some action:-)
- */
-
-MD5_JOBID_PROTO int HASH_UPDATE (HASH_CTX *c, const void *data_, size_t len)
- {
- const unsigned char *data=data_;
- register HASH_LONG * p;
- register HASH_LONG l;
- size_t sw,sc,ew,ec;
-
- if (len==0) return 1;
-
- l=(c->Nl+(((HASH_LONG)len)<<3))&0xffffffffUL;
- /* 95-05-24 eay Fixed a bug with the overflow handling, thanks to
- * Wei Dai <weidai@eskimo.com> for pointing it out. */
- if (l < c->Nl) /* overflow */
- c->Nh++;
- c->Nh+=(len>>29); /* might cause compiler warning on 16-bit */
- c->Nl=l;
-
- if (c->num != 0)
- {
- p=c->data;
- sw=c->num>>2;
- sc=c->num&0x03;
-
- if ((c->num+len) >= HASH_CBLOCK)
- {
- l=p[sw]; HOST_p_c2l(data,l,sc); p[sw++]=l;
- for (; sw<HASH_LBLOCK; sw++)
- {
- HOST_c2l(data,l); p[sw]=l;
- }
- HASH_BLOCK_HOST_ORDER (c,p,1);
- len-=(HASH_CBLOCK-c->num);
- c->num=0;
- /* drop through and do the rest */
- }
- else
- {
- c->num+=(unsigned int)len;
- if ((sc+len) < 4) /* ugly, add char's to a word */
- {
- l=p[sw]; HOST_p_c2l_p(data,l,sc,len); p[sw]=l;
- }
- else
- {
- ew=(c->num>>2);
- ec=(c->num&0x03);
- if (sc)
- l=p[sw];
- HOST_p_c2l(data,l,sc);
- p[sw++]=l;
- for (; sw < ew; sw++)
- {
- HOST_c2l(data,l); p[sw]=l;
- }
- if (ec)
- {
- HOST_c2l_p(data,l,ec); p[sw]=l;
- }
- }
- return 1;
- }
- }
-
- sw=len/HASH_CBLOCK;
- if (sw > 0)
- {
-#if defined(HASH_BLOCK_DATA_ORDER_ALIGNED)
- /*
- * Note that HASH_BLOCK_DATA_ORDER_ALIGNED gets defined
- * only if sizeof(HASH_LONG)==4.
- */
- if ((((size_t)data)%4) == 0)
- {
- /* data is properly aligned so that we can cast it: */
- HASH_BLOCK_DATA_ORDER_ALIGNED (c,(const HASH_LONG *)data,sw);
- sw*=HASH_CBLOCK;
- data+=sw;
- len-=sw;
- }
- else
-#if !defined(HASH_BLOCK_DATA_ORDER)
- while (sw--)
- {
- memcpy (p=c->data,data,HASH_CBLOCK);
- HASH_BLOCK_DATA_ORDER_ALIGNED(c,p,1);
- data+=HASH_CBLOCK;
- len-=HASH_CBLOCK;
- }
-#endif
-#endif
-#if defined(HASH_BLOCK_DATA_ORDER)
- {
- HASH_BLOCK_DATA_ORDER(c,data,sw);
- sw*=HASH_CBLOCK;
- data+=sw;
- len-=sw;
- }
-#endif
- }
-
- if (len!=0)
- {
- p = c->data;
- c->num = len;
- ew=len>>2; /* words to copy */
- ec=len&0x03;
- for (; ew; ew--,p++)
- {
- HOST_c2l(data,l); *p=l;
- }
- HOST_c2l_p(data,l,ec);
- *p=l;
- }
- return 1;
- }
-
-
-MD5_JOBID_PROTO void HASH_TRANSFORM (HASH_CTX *c, const unsigned char *data)
- {
-#if defined(HASH_BLOCK_DATA_ORDER_ALIGNED)
- if ((((size_t)data)%4) == 0)
- /* data is properly aligned so that we can cast it: */
- HASH_BLOCK_DATA_ORDER_ALIGNED (c,(const HASH_LONG *)data,1);
- else
-#if !defined(HASH_BLOCK_DATA_ORDER)
- {
-
- HASH_BLOCK_DATA_ORDER_ALIGNED (c,c->data,1);
- }
-#endif
-#endif
-#if defined(HASH_BLOCK_DATA_ORDER)
- HASH_BLOCK_DATA_ORDER (c,data,1);
-#endif
- }
-
-
-MD5_JOBID_PROTO int HASH_FINAL (unsigned char *md, HASH_CTX *c)
- {
- register HASH_LONG *p;
- register unsigned long l;
- register int i,j;
- static const unsigned char end[4]={0x80,0x00,0x00,0x00};
- const unsigned char *cp=end;
-
- /* c->num should definitly have room for at least one more byte. */
- p=c->data;
- i=c->num>>2;
- j=c->num&0x03;
-
-#if 0
- /* purify often complains about the following line as an
- * Uninitialized Memory Read. While this can be true, the
- * following p_c2l macro will reset l when that case is true.
- * This is because j&0x03 contains the number of 'valid' bytes
- * already in p[i]. If and only if j&0x03 == 0, the UMR will
- * occur but this is also the only time p_c2l will do
- * l= *(cp++) instead of l|= *(cp++)
- * Many thanks to Alex Tang <altitude@cic.net> for pickup this
- * 'potential bug' */
-#ifdef PURIFY
- if (j==0) p[i]=0; /* Yeah, but that's not the way to fix it:-) */
-#endif
- l=p[i];
-#else
- l = (j==0) ? 0 : p[i];
-#endif
- HOST_p_c2l(cp,l,j); p[i++]=l; /* i is the next 'undefined word' */
-
- if (i>(HASH_LBLOCK-2)) /* save room for Nl and Nh */
- {
- if (i<HASH_LBLOCK) p[i]=0;
- HASH_BLOCK_HOST_ORDER (c,p,1);
- i=0;
- }
- for (; i<(HASH_LBLOCK-2); i++)
- p[i]=0;
-
-#if defined(DATA_ORDER_IS_BIG_ENDIAN)
- p[HASH_LBLOCK-2]=c->Nh;
- p[HASH_LBLOCK-1]=c->Nl;
-#elif defined(DATA_ORDER_IS_LITTLE_ENDIAN)
- p[HASH_LBLOCK-2]=c->Nl;
- p[HASH_LBLOCK-1]=c->Nh;
-#endif
- HASH_BLOCK_HOST_ORDER (c,p,1);
-
-#ifndef HASH_MAKE_STRING
-#error "HASH_MAKE_STRING must be defined!"
-#else
- HASH_MAKE_STRING(c,md);
-#endif
-
- c->num=0;
- /* clear stuff, HASH_BLOCK may be leaving some stuff on the stack
- * but I'm not worried :-)
- OPENSSL_cleanse((void *)c,sizeof(HASH_CTX));
- */
- return 1;
- }
-
-#ifndef MD32_REG_T
-#define MD32_REG_T long
-/*
- * This comment was originaly written for MD5, which is why it
- * discusses A-D. But it basically applies to all 32-bit digests,
- * which is why it was moved to common header file.
- *
- * In case you wonder why A-D are declared as long and not
- * as MD5_LONG. Doing so results in slight performance
- * boost on LP64 architectures. The catch is we don't
- * really care if 32 MSBs of a 64-bit register get polluted
- * with eventual overflows as we *save* only 32 LSBs in
- * *either* case. Now declaring 'em long excuses the compiler
- * from keeping 32 MSBs zeroed resulting in 13% performance
- * improvement under SPARC Solaris7/64 and 5% under AlphaLinux.
- * Well, to be honest it should say that this *prevents*
- * performance degradation.
- * <appro@fy.chalmers.se>
- * Apparently there're LP64 compilers that generate better
- * code if A-D are declared int. Most notably GCC-x86_64
- * generates better code.
- * <appro@fy.chalmers.se>
- */
-#endif
+++ /dev/null
-/*
-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.
-*/
-
-/* crypto/md5/md5.h */
-/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
- * All rights reserved.
- *
- * This package is an SSL implementation written
- * by Eric Young (eay@cryptsoft.com).
- * The implementation was written so as to conform with Netscapes SSL.
- *
- * This library is free for commercial and non-commercial use as long as
- * the following conditions are aheared to. The following conditions
- * apply to all code found in this distribution, be it the RC4, RSA,
- * lhash, DES, etc., code; not just the SSL code. The SSL documentation
- * included with this distribution is covered by the same copyright terms
- * except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed.
- * If this package is used in a product, Eric Young should be given attribution
- * as the author of the parts of the library used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * "This product includes cryptographic software written by
- * Eric Young (eay@cryptsoft.com)"
- * The word 'cryptographic' can be left out if the rouines from the library
- * being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
- * the apps directory (application code) you must include an acknowledgement:
- * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#ifndef HEADER_MD5_H
-#define HEADER_MD5_H
-
-/* ljocha
-#include <openssl/e_os2.h>
-*/
-#include <stddef.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef OPENSSL_NO_MD5
-#error MD5 is disabled.
-#endif
-
-/*
- * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- * ! MD5_LONG has to be at least 32 bits wide. If it's wider, then !
- * ! MD5_LONG_LOG2 has to be defined along. !
- * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- */
-
-#if defined(OPENSSL_SYS_WIN16) || defined(__LP32__)
-#define MD5_LONG unsigned long
-#elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
-#define MD5_LONG unsigned long
-#define MD5_LONG_LOG2 3
-
-/* _CRAY note. I could declare short, but I have no idea what impact
- * does it have on performance on none-T3E machines. I could declare
- * int, but at least on C90 sizeof(int) can be chosen at compile time.
- * So I've chosen long... * <appro@fy.chalmers.se>
- */
-#else
-#define MD5_LONG unsigned int
-#endif
-
-#define MD5_CBLOCK 64
-#define MD5_LBLOCK (MD5_CBLOCK/4)
-#define MD5_DIGEST_LENGTH 16
-
-typedef struct MD5state_st
- {
- MD5_LONG A,B,C,D;
- MD5_LONG Nl,Nh;
- MD5_LONG data[MD5_LBLOCK];
- unsigned int num;
- } MD5_CTX;
-
-MD5_JOBID_PROTO int MD5_Init(MD5_CTX *c);
-MD5_JOBID_PROTO int MD5_Update(MD5_CTX *c, const void *data, size_t len);
-MD5_JOBID_PROTO int MD5_Final(unsigned char *md, MD5_CTX *c);
-MD5_JOBID_PROTO unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md);
-MD5_JOBID_PROTO void MD5_Transform(MD5_CTX *c, const unsigned char *b);
-#ifdef __cplusplus
-}
-#endif
-
-#endif
+++ /dev/null
-/*
-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.
-*/
-
-/* crypto/md5/md5_dgst.c */
-/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
- * All rights reserved.
- *
- * This package is an SSL implementation written
- * by Eric Young (eay@cryptsoft.com).
- * The implementation was written so as to conform with Netscapes SSL.
- *
- * This library is free for commercial and non-commercial use as long as
- * the following conditions are aheared to. The following conditions
- * apply to all code found in this distribution, be it the RC4, RSA,
- * lhash, DES, etc., code; not just the SSL code. The SSL documentation
- * included with this distribution is covered by the same copyright terms
- * except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed.
- * If this package is used in a product, Eric Young should be given attribution
- * as the author of the parts of the library used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * "This product includes cryptographic software written by
- * Eric Young (eay@cryptsoft.com)"
- * The word 'cryptographic' can be left out if the rouines from the library
- * being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
- * the apps directory (application code) you must include an acknowledgement:
- * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#ifndef MD5_JOBID_PROTO
-#define MD5_JOBID_PROTO
-#endif
-
-#include <stdio.h>
-#include "md5_locl.h"
-/* ljocha
-#include <openssl/opensslv.h>
-
-const char MD5_version[]="MD5" OPENSSL_VERSION_PTEXT;
-*/
-
-/* Implemented from RFC1321 The MD5 Message-Digest Algorithm
- */
-
-#define INIT_DATA_A (unsigned long)0x67452301L
-#define INIT_DATA_B (unsigned long)0xefcdab89L
-#define INIT_DATA_C (unsigned long)0x98badcfeL
-#define INIT_DATA_D (unsigned long)0x10325476L
-
-MD5_JOBID_PROTO int MD5_Init(MD5_CTX *c)
- {
- c->A=INIT_DATA_A;
- c->B=INIT_DATA_B;
- c->C=INIT_DATA_C;
- c->D=INIT_DATA_D;
- c->Nl=0;
- c->Nh=0;
- c->num=0;
- return 1;
- }
-
-#ifndef md5_block_host_order
-MD5_JOBID_PROTO void md5_block_host_order (MD5_CTX *c, const void *data, size_t num)
- {
- const MD5_LONG *X=data;
- register unsigned MD32_REG_T A,B,C,D;
-
- A=c->A;
- B=c->B;
- C=c->C;
- D=c->D;
-
- for (;num--;X+=HASH_LBLOCK)
- {
- /* Round 0 */
- R0(A,B,C,D,X[ 0], 7,0xd76aa478L);
- R0(D,A,B,C,X[ 1],12,0xe8c7b756L);
- R0(C,D,A,B,X[ 2],17,0x242070dbL);
- R0(B,C,D,A,X[ 3],22,0xc1bdceeeL);
- R0(A,B,C,D,X[ 4], 7,0xf57c0fafL);
- R0(D,A,B,C,X[ 5],12,0x4787c62aL);
- R0(C,D,A,B,X[ 6],17,0xa8304613L);
- R0(B,C,D,A,X[ 7],22,0xfd469501L);
- R0(A,B,C,D,X[ 8], 7,0x698098d8L);
- R0(D,A,B,C,X[ 9],12,0x8b44f7afL);
- R0(C,D,A,B,X[10],17,0xffff5bb1L);
- R0(B,C,D,A,X[11],22,0x895cd7beL);
- R0(A,B,C,D,X[12], 7,0x6b901122L);
- R0(D,A,B,C,X[13],12,0xfd987193L);
- R0(C,D,A,B,X[14],17,0xa679438eL);
- R0(B,C,D,A,X[15],22,0x49b40821L);
- /* Round 1 */
- R1(A,B,C,D,X[ 1], 5,0xf61e2562L);
- R1(D,A,B,C,X[ 6], 9,0xc040b340L);
- R1(C,D,A,B,X[11],14,0x265e5a51L);
- R1(B,C,D,A,X[ 0],20,0xe9b6c7aaL);
- R1(A,B,C,D,X[ 5], 5,0xd62f105dL);
- R1(D,A,B,C,X[10], 9,0x02441453L);
- R1(C,D,A,B,X[15],14,0xd8a1e681L);
- R1(B,C,D,A,X[ 4],20,0xe7d3fbc8L);
- R1(A,B,C,D,X[ 9], 5,0x21e1cde6L);
- R1(D,A,B,C,X[14], 9,0xc33707d6L);
- R1(C,D,A,B,X[ 3],14,0xf4d50d87L);
- R1(B,C,D,A,X[ 8],20,0x455a14edL);
- R1(A,B,C,D,X[13], 5,0xa9e3e905L);
- R1(D,A,B,C,X[ 2], 9,0xfcefa3f8L);
- R1(C,D,A,B,X[ 7],14,0x676f02d9L);
- R1(B,C,D,A,X[12],20,0x8d2a4c8aL);
- /* Round 2 */
- R2(A,B,C,D,X[ 5], 4,0xfffa3942L);
- R2(D,A,B,C,X[ 8],11,0x8771f681L);
- R2(C,D,A,B,X[11],16,0x6d9d6122L);
- R2(B,C,D,A,X[14],23,0xfde5380cL);
- R2(A,B,C,D,X[ 1], 4,0xa4beea44L);
- R2(D,A,B,C,X[ 4],11,0x4bdecfa9L);
- R2(C,D,A,B,X[ 7],16,0xf6bb4b60L);
- R2(B,C,D,A,X[10],23,0xbebfbc70L);
- R2(A,B,C,D,X[13], 4,0x289b7ec6L);
- R2(D,A,B,C,X[ 0],11,0xeaa127faL);
- R2(C,D,A,B,X[ 3],16,0xd4ef3085L);
- R2(B,C,D,A,X[ 6],23,0x04881d05L);
- R2(A,B,C,D,X[ 9], 4,0xd9d4d039L);
- R2(D,A,B,C,X[12],11,0xe6db99e5L);
- R2(C,D,A,B,X[15],16,0x1fa27cf8L);
- R2(B,C,D,A,X[ 2],23,0xc4ac5665L);
- /* Round 3 */
- R3(A,B,C,D,X[ 0], 6,0xf4292244L);
- R3(D,A,B,C,X[ 7],10,0x432aff97L);
- R3(C,D,A,B,X[14],15,0xab9423a7L);
- R3(B,C,D,A,X[ 5],21,0xfc93a039L);
- R3(A,B,C,D,X[12], 6,0x655b59c3L);
- R3(D,A,B,C,X[ 3],10,0x8f0ccc92L);
- R3(C,D,A,B,X[10],15,0xffeff47dL);
- R3(B,C,D,A,X[ 1],21,0x85845dd1L);
- R3(A,B,C,D,X[ 8], 6,0x6fa87e4fL);
- R3(D,A,B,C,X[15],10,0xfe2ce6e0L);
- R3(C,D,A,B,X[ 6],15,0xa3014314L);
- R3(B,C,D,A,X[13],21,0x4e0811a1L);
- R3(A,B,C,D,X[ 4], 6,0xf7537e82L);
- R3(D,A,B,C,X[11],10,0xbd3af235L);
- R3(C,D,A,B,X[ 2],15,0x2ad7d2bbL);
- R3(B,C,D,A,X[ 9],21,0xeb86d391L);
-
- A = c->A += A;
- B = c->B += B;
- C = c->C += C;
- D = c->D += D;
- }
- }
-#endif
-
-#ifndef md5_block_data_order
-#ifdef X
-#undef X
-#endif
-MD5_JOBID_PROTO void md5_block_data_order (MD5_CTX *c, const void *data_, size_t num)
- {
- const unsigned char *data=data_;
- register unsigned MD32_REG_T A,B,C,D,l;
-#ifndef MD32_XARRAY
- /* See comment in crypto/sha/sha_locl.h for details. */
- unsigned MD32_REG_T XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7,
- XX8, XX9,XX10,XX11,XX12,XX13,XX14,XX15;
-# define X(i) XX##i
-#else
- MD5_LONG XX[MD5_LBLOCK];
-# define X(i) XX[i]
-#endif
-
- A=c->A;
- B=c->B;
- C=c->C;
- D=c->D;
-
- for (;num--;)
- {
- HOST_c2l(data,l); X( 0)=l; HOST_c2l(data,l); X( 1)=l;
- /* Round 0 */
- R0(A,B,C,D,X( 0), 7,0xd76aa478L); HOST_c2l(data,l); X( 2)=l;
- R0(D,A,B,C,X( 1),12,0xe8c7b756L); HOST_c2l(data,l); X( 3)=l;
- R0(C,D,A,B,X( 2),17,0x242070dbL); HOST_c2l(data,l); X( 4)=l;
- R0(B,C,D,A,X( 3),22,0xc1bdceeeL); HOST_c2l(data,l); X( 5)=l;
- R0(A,B,C,D,X( 4), 7,0xf57c0fafL); HOST_c2l(data,l); X( 6)=l;
- R0(D,A,B,C,X( 5),12,0x4787c62aL); HOST_c2l(data,l); X( 7)=l;
- R0(C,D,A,B,X( 6),17,0xa8304613L); HOST_c2l(data,l); X( 8)=l;
- R0(B,C,D,A,X( 7),22,0xfd469501L); HOST_c2l(data,l); X( 9)=l;
- R0(A,B,C,D,X( 8), 7,0x698098d8L); HOST_c2l(data,l); X(10)=l;
- R0(D,A,B,C,X( 9),12,0x8b44f7afL); HOST_c2l(data,l); X(11)=l;
- R0(C,D,A,B,X(10),17,0xffff5bb1L); HOST_c2l(data,l); X(12)=l;
- R0(B,C,D,A,X(11),22,0x895cd7beL); HOST_c2l(data,l); X(13)=l;
- R0(A,B,C,D,X(12), 7,0x6b901122L); HOST_c2l(data,l); X(14)=l;
- R0(D,A,B,C,X(13),12,0xfd987193L); HOST_c2l(data,l); X(15)=l;
- R0(C,D,A,B,X(14),17,0xa679438eL);
- R0(B,C,D,A,X(15),22,0x49b40821L);
- /* Round 1 */
- R1(A,B,C,D,X( 1), 5,0xf61e2562L);
- R1(D,A,B,C,X( 6), 9,0xc040b340L);
- R1(C,D,A,B,X(11),14,0x265e5a51L);
- R1(B,C,D,A,X( 0),20,0xe9b6c7aaL);
- R1(A,B,C,D,X( 5), 5,0xd62f105dL);
- R1(D,A,B,C,X(10), 9,0x02441453L);
- R1(C,D,A,B,X(15),14,0xd8a1e681L);
- R1(B,C,D,A,X( 4),20,0xe7d3fbc8L);
- R1(A,B,C,D,X( 9), 5,0x21e1cde6L);
- R1(D,A,B,C,X(14), 9,0xc33707d6L);
- R1(C,D,A,B,X( 3),14,0xf4d50d87L);
- R1(B,C,D,A,X( 8),20,0x455a14edL);
- R1(A,B,C,D,X(13), 5,0xa9e3e905L);
- R1(D,A,B,C,X( 2), 9,0xfcefa3f8L);
- R1(C,D,A,B,X( 7),14,0x676f02d9L);
- R1(B,C,D,A,X(12),20,0x8d2a4c8aL);
- /* Round 2 */
- R2(A,B,C,D,X( 5), 4,0xfffa3942L);
- R2(D,A,B,C,X( 8),11,0x8771f681L);
- R2(C,D,A,B,X(11),16,0x6d9d6122L);
- R2(B,C,D,A,X(14),23,0xfde5380cL);
- R2(A,B,C,D,X( 1), 4,0xa4beea44L);
- R2(D,A,B,C,X( 4),11,0x4bdecfa9L);
- R2(C,D,A,B,X( 7),16,0xf6bb4b60L);
- R2(B,C,D,A,X(10),23,0xbebfbc70L);
- R2(A,B,C,D,X(13), 4,0x289b7ec6L);
- R2(D,A,B,C,X( 0),11,0xeaa127faL);
- R2(C,D,A,B,X( 3),16,0xd4ef3085L);
- R2(B,C,D,A,X( 6),23,0x04881d05L);
- R2(A,B,C,D,X( 9), 4,0xd9d4d039L);
- R2(D,A,B,C,X(12),11,0xe6db99e5L);
- R2(C,D,A,B,X(15),16,0x1fa27cf8L);
- R2(B,C,D,A,X( 2),23,0xc4ac5665L);
- /* Round 3 */
- R3(A,B,C,D,X( 0), 6,0xf4292244L);
- R3(D,A,B,C,X( 7),10,0x432aff97L);
- R3(C,D,A,B,X(14),15,0xab9423a7L);
- R3(B,C,D,A,X( 5),21,0xfc93a039L);
- R3(A,B,C,D,X(12), 6,0x655b59c3L);
- R3(D,A,B,C,X( 3),10,0x8f0ccc92L);
- R3(C,D,A,B,X(10),15,0xffeff47dL);
- R3(B,C,D,A,X( 1),21,0x85845dd1L);
- R3(A,B,C,D,X( 8), 6,0x6fa87e4fL);
- R3(D,A,B,C,X(15),10,0xfe2ce6e0L);
- R3(C,D,A,B,X( 6),15,0xa3014314L);
- R3(B,C,D,A,X(13),21,0x4e0811a1L);
- R3(A,B,C,D,X( 4), 6,0xf7537e82L);
- R3(D,A,B,C,X(11),10,0xbd3af235L);
- R3(C,D,A,B,X( 2),15,0x2ad7d2bbL);
- R3(B,C,D,A,X( 9),21,0xeb86d391L);
-
- A = c->A += A;
- B = c->B += B;
- C = c->C += C;
- D = c->D += D;
- }
- }
-#endif
-
-#ifdef undef
-int printit(unsigned long *l)
- {
- int i,ii;
-
- for (i=0; i<2; i++)
- {
- for (ii=0; ii<8; ii++)
- {
- fprintf(stderr,"%08lx ",l[i*8+ii]);
- }
- fprintf(stderr,"\n");
- }
- }
-#endif
+++ /dev/null
-/*
-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.
-*/
-
-/* crypto/md5/md5_locl.h */
-/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
- * All rights reserved.
- *
- * This package is an SSL implementation written
- * by Eric Young (eay@cryptsoft.com).
- * The implementation was written so as to conform with Netscapes SSL.
- *
- * This library is free for commercial and non-commercial use as long as
- * the following conditions are aheared to. The following conditions
- * apply to all code found in this distribution, be it the RC4, RSA,
- * lhash, DES, etc., code; not just the SSL code. The SSL documentation
- * included with this distribution is covered by the same copyright terms
- * except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed.
- * If this package is used in a product, Eric Young should be given attribution
- * as the author of the parts of the library used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * "This product includes cryptographic software written by
- * Eric Young (eay@cryptsoft.com)"
- * The word 'cryptographic' can be left out if the rouines from the library
- * being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
- * the apps directory (application code) you must include an acknowledgement:
- * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <openssl/e_os2.h>
-#include <openssl/md5.h>
-
-#ifndef MD5_LONG_LOG2
-#define MD5_LONG_LOG2 2 /* default to 32 bits */
-#endif
-
-#ifdef MD5_ASM
-# if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__) || defined(__x86_64) || defined(__x86_64__)
-# if !defined(B_ENDIAN)
-# define md5_block_host_order md5_block_asm_host_order
-# endif
-# elif defined(__sparc) && defined(OPENSSL_SYS_ULTRASPARC)
- void md5_block_asm_data_order_aligned (MD5_CTX *c, const MD5_LONG *p,size_t num);
-# define HASH_BLOCK_DATA_ORDER_ALIGNED md5_block_asm_data_order_aligned
-# endif
-#endif
-
-MD5_JOBID_PROTO void md5_block_host_order (MD5_CTX *c, const void *p,size_t num);
-MD5_JOBID_PROTO void md5_block_data_order (MD5_CTX *c, const void *p,size_t num);
-
-#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__) || defined(__x86_64) || defined(__x86_64__)
-# if !defined(B_ENDIAN)
-/*
- * *_block_host_order is expected to handle aligned data while
- * *_block_data_order - unaligned. As algorithm and host (x86)
- * are in this case of the same "endianness" these two are
- * otherwise indistinguishable. But normally you don't want to
- * call the same function because unaligned access in places
- * where alignment is expected is usually a "Bad Thing". Indeed,
- * on RISCs you get punished with BUS ERROR signal or *severe*
- * performance degradation. Intel CPUs are in turn perfectly
- * capable of loading unaligned data without such drastic side
- * effect. Yes, they say it's slower than aligned load, but no
- * exception is generated and therefore performance degradation
- * is *incomparable* with RISCs. What we should weight here is
- * costs of unaligned access against costs of aligning data.
- * According to my measurements allowing unaligned access results
- * in ~9% performance improvement on Pentium II operating at
- * 266MHz. I won't be surprised if the difference will be higher
- * on faster systems:-)
- *
- * <appro@fy.chalmers.se>
- */
-# define md5_block_data_order md5_block_host_order
-# endif
-#endif
-
-#define DATA_ORDER_IS_LITTLE_ENDIAN
-
-#define HASH_LONG MD5_LONG
-#define HASH_LONG_LOG2 MD5_LONG_LOG2
-#define HASH_CTX MD5_CTX
-#define HASH_CBLOCK MD5_CBLOCK
-#define HASH_LBLOCK MD5_LBLOCK
-#define HASH_UPDATE MD5_Update
-#define HASH_TRANSFORM MD5_Transform
-#define HASH_FINAL MD5_Final
-#define HASH_MAKE_STRING(c,s) do { \
- unsigned long ll; \
- ll=(c)->A; HOST_l2c(ll,(s)); \
- ll=(c)->B; HOST_l2c(ll,(s)); \
- ll=(c)->C; HOST_l2c(ll,(s)); \
- ll=(c)->D; HOST_l2c(ll,(s)); \
- } while (0)
-#define HASH_BLOCK_HOST_ORDER md5_block_host_order
-#if !defined(L_ENDIAN) || defined(md5_block_data_order)
-#define HASH_BLOCK_DATA_ORDER md5_block_data_order
-/*
- * Little-endians (Intel and Alpha) feel better without this.
- * It looks like memcpy does better job than generic
- * md5_block_data_order on copying-n-aligning input data.
- * But frankly speaking I didn't expect such result on Alpha.
- * On the other hand I've got this with egcs-1.0.2 and if
- * program is compiled with another (better?) compiler it
- * might turn out other way around.
- *
- * <appro@fy.chalmers.se>
- */
-#endif
-
-#include "md32_common.h"
-
-/*
-#define F(x,y,z) (((x) & (y)) | ((~(x)) & (z)))
-#define G(x,y,z) (((x) & (z)) | ((y) & (~(z))))
-*/
-
-/* As pointed out by Wei Dai <weidai@eskimo.com>, the above can be
- * simplified to the code below. Wei attributes these optimizations
- * to Peter Gutmann's SHS code, and he attributes it to Rich Schroeppel.
- */
-#define F(b,c,d) ((((c) ^ (d)) & (b)) ^ (d))
-#define G(b,c,d) ((((b) ^ (c)) & (d)) ^ (c))
-#define H(b,c,d) ((b) ^ (c) ^ (d))
-#define I(b,c,d) (((~(d)) | (b)) ^ (c))
-
-#define R0(a,b,c,d,k,s,t) { \
- a+=((k)+(t)+F((b),(c),(d))); \
- a=ROTATE(a,s); \
- a+=b; };\
-
-#define R1(a,b,c,d,k,s,t) { \
- a+=((k)+(t)+G((b),(c),(d))); \
- a=ROTATE(a,s); \
- a+=b; };
-
-#define R2(a,b,c,d,k,s,t) { \
- a+=((k)+(t)+H((b),(c),(d))); \
- a=ROTATE(a,s); \
- a+=b; };
-
-#define R3(a,b,c,d,k,s,t) { \
- a+=((k)+(t)+I((b),(c),(d))); \
- a=ROTATE(a,s); \
- a+=b; };
+++ /dev/null
-#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 <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#define MD5_JOBID_PROTO static
-#include "md5.h"
-#include "strmd5.h"
-
-#include "md5_dgst.c"
-
-
-static char mbuf[33];
-static const char* b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
-static char *b64r;
-
-int base64_encode(const void *enc, int enc_size, char *out, int out_max_size)
-{
-
- unsigned char* enc_buf = (unsigned char*)enc;
- int out_size = 0;
- unsigned int bits = 0;
- unsigned int shift = 0;
-
- while ( out_size < out_max_size ) {
- if ( enc_size>0 ) {
- // Shift in byte
- bits <<= 8;
- bits |= *enc_buf;
- shift += 8;
- // Next byte
- enc_buf++;
- enc_size--;
- } else if ( shift>0 ) {
- // Pad last bits to 6 bits - will end next loop
- bits <<= 6 - shift;
- shift = 6;
- } else {
- // Terminate with Mime style '='
- *out = '=';
- out_size++;
-
- return out_size;
- }
-
- // Encode 6 bit segments
- while ( shift>=6 ) {
- shift -= 6;
- *out = b64[ (bits >> shift) & 0x3F ];
- out++;
- out_size++;
- }
- }
-
- // Output overflow
- return -1;
-}
-
-int base64_decode(const char *enc,char *out,int max_out_size)
-{
- unsigned int bits = 0;
- int shift = 0;
- int out_size = 0;
-
- if (!b64r) {
- int i;
- b64r = calloc(128,1);
-
- for (i=0; b64[i]; i++) b64r[(int)b64[i]] = i;
- }
-
- while (*enc && *enc != '=') {
- bits <<= 6;
- bits |= b64r[(int)*enc++];
- shift += 6;
-
- while (shift >= 8) {
- if (out_size >= max_out_size) return -1;
- shift -= 8;
- *out++ = (bits >> shift) & 0xff;
- out_size++;
- }
- }
-
- return out_size;
-}
-
-char *strmd5(const char *s, unsigned char *digest)
-{
- MD5_CTX md5;
- unsigned char d[16];
- int i;
-
- MD5_Init(&md5);
- MD5_Update(&md5,s,strlen(s));
- MD5_Final(d,&md5);
-
- if (digest) memcpy(digest,d,sizeof(d));
-
- for (i=0; i<16; i++) {
- int dd = d[i] & 0x0f;
- mbuf[2*i+1] = dd<10 ? dd+'0' : dd-10+'a';
- dd = d[i] >> 4;
- mbuf[2*i] = dd<10 ? dd+'0' : dd-10+'a';
- }
- mbuf[32] = 0;
- return (char *) mbuf;
-}
-
-char *str2md5(const char *s)
-{
- MD5_CTX md5;
- unsigned char d[16];
- char* ret = malloc(33);
- int i;
-
- if (!ret)
- return NULL;
-
- MD5_Init(&md5);
- MD5_Update(&md5, s, strlen(s));
- MD5_Final(d, &md5);
-
- for (i=0; i<16; i++) {
- int dd = d[i] & 0x0f;
- ret[2*i+1] = dd<10 ? dd+'0' : dd-10+'a';
- dd = d[i] >> 4;
- ret[2*i] = dd<10 ? dd+'0' : dd-10+'a';
- }
- ret[32] = 0;
- return ret;
-}
-
-char *str2md5base64(const char *s)
-{
- MD5_CTX md5;
- unsigned char d[16];
- char buf[50];
- int l;
-
- MD5_Init(&md5);
- MD5_Update(&md5, s, strlen(s));
- MD5_Final(d, &md5);
-
- l = base64_encode(d, 16, buf, sizeof(buf) - 1);
- if (l < 1)
- return NULL;
- buf[l - 1] = 0;
- return strdup(buf);
-}
+++ /dev/null
-/*
-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 <assert.h>
-#include <stdlib.h>
-#include <cstring>
-#include <fstream>
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/XmlOutputter.h>
-#include <cppunit/TestRunner.h>
-#include <cppunit/TestResult.h>
-#include <cppunit/TestResultCollector.h>
-
-#include "strmd5.h"
-
-class Base64Test: public CppUnit::TestFixture
-{
- CPPUNIT_TEST_SUITE(Base64Test);
- CPPUNIT_TEST(test);
- CPPUNIT_TEST_SUITE_END();
-public:
- void test();
-};
-
-void Base64Test::test()
-{
- int i;
- unsigned char in[2000], b[4000], out[2000];
-
- srandom(0xDEAD);
- in[0] = 'x';
- for (i=1; i<2000; i++) {
- char s[20];
- int len;
- sprintf(s,"%d",i);
- in[i] = random() % 256;
-
- std::cerr << '.';
-
- base64_encode(in,i,(char *) b,sizeof b);
- len = base64_decode((const char *) b,(char *) out,sizeof out);
-
- CPPUNIT_ASSERT_MESSAGE(std::string("len"),i == len);
- CPPUNIT_ASSERT_MESSAGE(std::string(s),!memcmp(in,out,i));
- }
- std::cerr << std::endl;
-}
-
-CPPUNIT_TEST_SUITE_REGISTRATION(Base64Test);
-
-
-int main (int argc,const char *argv[])
-{
- CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
-
- assert(argc == 2);
- std::ofstream xml(argv[1]);
-
- CppUnit::TestResult controller;
- CppUnit::TestResultCollector result;
- controller.addListener( &result );
-
- CppUnit::TestRunner runner;
- runner.addTest(suite);
- runner.run(controller);
-
- CppUnit::XmlOutputter xout( &result, xml );
- CppUnit::CompilerOutputter tout( &result, std::cout);
- xout.write();
- tout.write();
-
- return result.wasSuccessful() ? 0 : 1 ;
-}
+++ /dev/null
-# Default values
-top_srcdir=..
-stagedir=.
-globalprefix=glite
-jobidprefix=jobid
-package=glite-jobid-api-cpp
-version=0.0.0
-
-CC:=gcc
-CXX:=g++
-
--include Makefile.inc
-
-version=${module.version}
-
-VPATH=${top_srcdir}/src:${top_srcdir}/interface:${top_srcdir}/test
-
-DEBUG:=-g -O0 -Wall
-
-CFLAGS:=${DEBUG} \
- -I${top_srcdir}/interface -I${top_srcdir}/src \
- ${COVERAGE_FLAGS} \
- -D_GNU_SOURCE
-
-COMPILE:=libtool --mode=compile ${CC} ${CFLAGS}
-CXXCOMPILE:=libtool --mode=compile ${CXX} ${CXXFLAGS}
-LINK:=libtool --mode=link ${CC} ${LDFLAGS}
-LINKXX:=libtool --mode=link ${CXX} ${LDFLAGS}
-INSTALL:=libtool --mode=install install
-
-LIBOBJS:=
-HDRS:=JobId.h
-
-LIBLOBJS:=${LIBOBJS:.o=.lo}
-
-LIB:=
-
-compile all:
-
-
-check: compile
-#
-
-clean:
- rm -rvf *.o *.lo .libs lib* *.c *.cpp *.h
-
-distclean:
- rm -rvf Makefile.inc *.spec debian/
-
-install:
- mkdir -p ${DESTDIR}${PREFIX}${prefix}/include/${globalprefix}/${jobidprefix}
- (cd ${top_srcdir}/interface; ${INSTALL} -m 644 ${HDRS} ${DESTDIR}${PREFIX}${prefix}/include/${globalprefix}/${jobidprefix})
-
-stage:
- ${MAKE} install PREFIX=${stagedir} staging=1
-
-%.o: %.c
- ${COMPILE} -o $@ -c $<
-
-
-.PHONY: default all compile check install clean distclean
+++ /dev/null
-#!/usr/bin/perl
-
-# WARNING: Don't edit this file unless it is the master copy in org.glite.lb
-#
-# For the purpose of standalone builds of lb/jobid/lbjp-common components
-# it is copied on tagging
-
-# $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.
-#
-
-use Getopt::Long;
-use POSIX qw(locale_h strftime);
-
-my $pwd = `pwd`; chomp $pwd;
-my $prefix = '/usr';
-my $stagedir = undef;
-my $root = $pwd.'/stage';
-my $sysroot = '';
-my $sysconfdir;
-my $localstatedir;
-my $staged;
-my $module;
-my $thrflavour = 'gcc64dbgpthr';
-my $nothrflavour = 'gcc64dbg';
-my $mode = 'build';
-my $help = 0;
-my $listmodules;
-my ($version, $force_version);
-my $branch;
-my $output;
-my $lb_tag = '';
-my $lbjp_tag = '';
-my $jp_tag = '';
-my $jobid_tag = '';
-my $libdir = getlibdir();
-my $project = 'emi';
-my $project_version;
-my (%projects, %project);
-my $debug = 0;
-my $pkg_config_env = (defined $ENV{PKG_CONFIG_PATH}) ? "$ENV{PKG_CONFIG_PATH}:" : '';
-
-my @nodes = qw/client server logger logger-msg nagios utils client-java doc ws-test db jpprimary jpindex jpclient harvester lb px proxyrenewal/;
-my @default_nodes = qw/lb px proxyrenewal nagios/;
-my %enable_nodes;
-my %disable_nodes;
-my %default_nodes; @default_nodes{@default_nodes} = (1) x ($#default_nodes + 1);
-
-my %package = (
- 'maintainer' => 'CESNET Product Teams <emi-lb@metacentrum.cz>',
- 'uploaders' => 'František Dvořák <valtri@civ.zcu.cz>',
- 'url' => 'http://glite.cern.ch',
- 'debian_vcs' => 'Vcs-Cvs: :pserver:anonymous@jra1mw.cvs.cern.ch:/cvs/jra1mw
-Vcs-Browser: http://jra1mw.cvs.cern.ch/cgi-bin/jra1mw.cgi',
-);
-
-# key: internal package name (arguments, ...)
-# 'pkg': pkg-config name
-# 'prefix': used when pkg-config fails
-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-devel' => {
- prefix=> '/opt/globus',
- pkg => 'myproxy'
- },
- 'myproxy-server' => {
- prefix=> '',
- },
- 'myproxy-admin' => {
- prefix=> '',
- },
- gsoap => {
- prefix=> '/usr',
- pkg => 'gsoap'
- },
- gsoapxx => {
- prefix=> '/usr',
- pkg => 'gsoap++'
- },
- mysql => {
- prefix=> '/usr'
- },
- 'mysql-devel' => {
- prefix=> ''
- },
- 'mysql-server' => {
- prefix => ''
- },
- voms => {
- prefix => '/opt/glite',
- pkg => 'voms-2.0'
- },
- gridsite => {
- prefix => '/opt/glite'
- },
- lcas => {
- prefix => '/opt/glite',
- pkg => 'lcas'
- },
- trustmanager => {
- prefix => '/opt/glite'
- },
- trustmanager_axis => {
- prefix => '/opt/glite'
- },
- utiljava => {
- prefix=> '/opt/glite'
- },
- ant => {
- prefix=> '/usr'
- },
- jdk => {
- prefix=> '/usr/java/latest',
- locations => [ '/usr/lib/jvm/java', '/usr/lib/jvm/default-java', '/usr/java/latest' ],
- },
- libtar => {
- prefix=> '/usr'
- },
- axis => {
- prefix=> '/usr'
- },
- log4c => {
- prefix=> '/usr'
- },
- postgresql => {
- prefix=> '/usr'
- },
- activemq => {
- prefix=>'/opt/activemq-cpp-library',
- pkg => 'activemq-cpp'
- },
-);
-
-my %jar = (
- 'jakarta-commons-codec' => '/usr/share/java/commons-codec.jar',
- 'jakarta-commons-lang' => '/usr/share/java/commons-lang.jar',
-);
-
-
-my %glite_prefix;
-my %need_externs;
-my %need_externs_type;
-my %need_jars;
-my %extrafull;
-my %extranodmod;
-my %deps;
-my %deps_type;
-my %buildroot;
-my (%etics_externs, %etics_projects);
-
-#
-# modules of the subsystems
-#
-# additional modules from $project{modules} are automatically added
-#
-my %lbmodules = (
- 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim logger-msg nagios client-devel client-progs common-devel logger-devel state-machine-devel/],
- 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin db-devel log-devel maildir-devel server-bones-devel trio-devel jp-interface-devel gss-devel gsoap-plugin-devel/],
- 'jobid' => [qw/api-c api-c-devel api-cpp api-cpp-devel api-java/],
- 'jp' => [ qw/client doc index primary server-common ws-interface/ ],
- 'gridsite' => [ qw/apache libs commands core devel slashgrid services service-clients gsexec/ ],
- 'px' => [ qw/proxyrenewal myproxy-yaim proxyrenewal-devel proxyrenewal-progs/ ],
- 'canl' => [ qw/c c-devel/ ],
- );
-
-#
-# sub-packages
-#
-# modify %lbmodules, %deps_aux, %extrafull, and %properties accodingly
-#
-my %subpackages = (
- 'jobid.api-c-devel' => 'jobid.api-c',
- 'jobid.api-cpp-devel' => 'jobid.api-cpp',
- 'lbjp-common.db-devel' => 'lbjp-common.db',
- 'lbjp-common.gsoap-plugin-devel' => 'lbjp-common.gsoap-plugin',
- 'lbjp-common.gss-devel' => 'lbjp-common.gss',
- 'lbjp-common.jp-interface-devel' => 'lbjp-common.jp-interface',
- 'lbjp-common.log-devel' => 'lbjp-common.log',
- 'lbjp-common.maildir-devel' => 'lbjp-common.maildir',
- 'lbjp-common.server-bones-devel' => 'lbjp-common.server-bones',
- 'lbjp-common.trio-devel' => 'lbjp-common.trio',
- 'lb.client-progs' => 'lb.client',
- 'lb.client-devel' => 'lb.client',
- 'lb.common-devel' => 'lb.common',
- 'lb.logger-devel' => 'lb.logger',
- 'lb.state-machine-devel' => 'lb.state-machine',
- 'px.proxyrenewal-devel' => 'px.proxyrenewal',
- 'px.proxyrenewal-progs' => 'px.proxyrenewal',
- 'canl.c-devel' => 'canl.c',
-);
-
-my @opts = (
- 'prefix:s' => \$prefix,
- 'staged=s' => \$staged,
- 'module=s' => \$module,
- 'thrflavour:s' => \$thrflavour,
- 'nothrflavour:s' => \$nothrflavour,
- 'mode=s' => \$mode,
- 'listmodules=s' => \$listmodules,
- 'version=s' => \$force_version,
- 'branch=s' => \$branch,
- 'output=s' => \$output,
- 'stage=s' => \$stagedir,
- 'root:s' => \$root,
- 'sysroot:s' => \$sysroot,
- 'sysconfdir=s' => \$sysconfdir,
- 'localstatedir=s' => \$localstatedir,
- 'lb-tag=s' => \$lb_tag,
- 'lbjp-common-tag=s' => \$lbjp_tag,
- 'jp-tag=s' => \$jp_tag,
- 'jobid-tag=s' => \$jobid_tag,
- 'canl-tag=s' => \$canl_tag,
- 'help' => \$help,
- 'libdir=s' => \$libdir,
- 'project=s' => \$project,
- 'debug' => \$debug,
-);
-
-for (@nodes) {
- $enable_nodes{$_} = 0;
- $disable_nodes{$_} = 0;
-
- push @opts,"disable-$_",\$disable_nodes{$_};
- push @opts,"enable-$_",\$enable_nodes{$_};
-}
-
-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";
-$prefix=~s/\/$//;
-$root=~s/\/$//;
-$sysroot=~s/\/$//;
-if (not $sysconfdir) { $sysconfdir = $prefix eq '/usr' ? '/etc' : "$prefix/etc"; }
-if (not $localstatedir) { $localstatedir = $prefix eq '/usr' ? '/var' : "$prefix/var"; }
-$sysconfdir=~s/\/$//;
-$localstatedir=~s/\/$//;
-
-$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq '';
-$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq '';
-$externs{'gsoapxx'}{prefix}=$externs{gsoap}{prefix} if $externs{'gsoapxx'}{prefix} eq '';
-
-$externs{'mysql-server'}{withprefix}=$externs{mysql}{withprefix} if $externs{'mysql-server'}{withprefix} eq '';
-$externs{'mysql-devel'}{wihtprefix}=$externs{mysql}{withprefix} if $externs{'mysql-devel'}{withprefix} eq '';
-$externs{'gsoapxx'}{withprefix}=$externs{gsoap}{withprefix} if $externs{'gsoapxx'}{withprefix} eq '';
-
-if ($project =~ /^([^0-9]*)(.*)$/) {
- $project = $1;
- $project_version = $2;
-}
-%project = %{$projects{$project}};
-$project_version = $project{current_version} unless $project_version;
-for my $platform (keys %{$project{etics_externs}}) {
- for $_ (keys %{$project{etics_externs}{$platform}}) {
- $etics_externs{$platform}{$_} = $project{etics_externs}{$platform}{$_};
- }
-}
-reshuffle_platforms(\%etics_externs, $project{supported_platforms});
-reshuffle_platforms(\%{$project{etics_externs_devel}}, $project{supported_platforms});
-for $_ (keys %{$project{etics_projects}}) {
- $etics_projects{$_} = $project{etics_projects}{$_};
-}
-for $_ (keys %{$project{need_externs_aux}}) {
- $need_externs_aux{$_} = $project{need_externs_aux}{$_};
-}
-for my $ext (keys %need_externs_aux) {
- for (@{$need_externs_aux{$ext}}) {
- my ($pkg, $type) =/([^:]*)(?::(.*))?/;
- $type = 'BR' unless ($type);
-
- push @{$need_externs{$ext}},$pkg;
- $need_externs_type{$ext}->{$pkg} = $type;
- }
-}
-if ($project eq 'emi') {
- $extranodmod{lb} = 'lb.emi-lb';
- $extranodmod{px} = 'px.emi-px';
-}
-for $_ (keys %{$project{modules}}) {
- push @{$lbmodules{$_}},@{$project{modules}{$_}};
-}
-
-
-if ($help) { usage(); exit 0; }
-
-if ($listmodules) {
- my $name_prefix = ($listmodules eq 'gridsite' and $project eq 'glite') ? 'org' : $project{etics_name};
- my @m;
-
- if (exists $lbmodules{$listmodules}) {
- @m = map exists $subpackages{$listmodules . '.' . $_} ? "" : "$name_prefix.$listmodules.$_",@{$lbmodules{$listmodules}};
- } else {
- if ($project eq 'emi' and $project_version == 1) {
- # no sub-packages in EMI-1
- } else {
- for my $sub (keys %subpackages) {
- push @m, $sub if ($subpackages{$sub} eq $listmodules);
- }
- }
- }
- print map $_ eq "" ? "" : "$_ ", @m;
- print "\n";
- exit 0;
-}
-
-warn "$0: --branch and --output make sense only in --mode=etics\n"
- if ($output || $branch) && $mode ne 'etics';
-
-my $en;
-for (keys %enable_nodes) { $en = 1 if $enable_nodes{$_}; }
-
-my $dis;
-for (keys %disable_nodes) { $dis = 1 if $disable_nodes{$_}; }
-
-die "--enable-* and --disable-* are mutually exclusive\n"
- if $en && $dis;
-
-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{jp}};
-
-if ($dis) {
- for (@nodes) {
- $enable_nodes{$_} = 1 unless ($disable_nodes{$_} or not $default_nodes{$_});
- }
-}
-
-if (!$en && !$dis) { for (@nodes) { $enable_nodes{$_} = 1 if ($default_nodes{$_}) } };
-
-for (keys %enable_nodes) { delete $enable_nodes{$_} unless $enable_nodes{$_}; }
-
-$stagedir = $root unless $stagedir;
-$stagedir=~s/\/$// if ($stagedir);
-
-if ($mode eq 'build') { for my $ext (keys %externs) {
- if (defined $externs{$ext} and defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; }
- elsif (defined $externs{$ext}{pkg}) {
- my ($flag, $env, $cmd, $ret);
- my $pkg = $externs{$ext}{pkg};
- my $flagname = uc $externs{$ext}{pkg};
- $flagname =~ s/-[0-9\.]*$//;
- $flagname =~ y/-\+/_X/;
-
- print "Checking $pkg ... ";
- $env = "PKG_CONFIG_PATH=$pkg_config_env$stagedir$prefix/$libdir/pkgconfig";
- $cmd = "$env pkg-config $pkg --exists >/dev/null";
- `$cmd`; $ret = $?;
- print "('$cmd' => $ret)\n" if ($debug);
- if ($ret == 0) {
- $externs{$ext}{prefix}=`$env pkg-config $pkg --variable=prefix`;
- chomp $externs{$ext}{prefix};
- print "$externs{$ext}{prefix}\n";
-
- $flag=`$env pkg-config $pkg --cflags`;
- $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag);
- $flag=`$env pkg-config $pkg --libs`;
- $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag);
- } else {
- print "(using default $externs{$ext}{prefix})\n";
- }
- print "\n" if ($debug);
- }
- elsif ($ext eq 'jdk') {
- my $jdk_prefix;
-
- print "Looking for some caffein ... ";
- if (defined $ENV{'JDK_HOME'}) {
- $jdk_prefix = $ENV{'JDK_HOME'};
- print "JDK_HOME=$jdk_prefix\n";
- } elsif (defined $ENV{'JAVA_HOME'}) {
- $jdk_prefix = $ENV{'JAVA_HOME'};
- print "JAVA_HOME=$jdk_prefix\n";
- } else {
- foreach my $i (0..$#{$externs{$ext}{locations}}) {
- if (-e $externs{$ext}{locations}[$i]) {
- $jdk_prefix=$externs{$ext}{locations}[$i];
- print "(found directory $jdk_prefix)\n";
- last;
- }
- }
- print "(using default $externs{$ext}{prefix})\n" unless ($jdk_prefix);
- }
- $externs{$ext}{prefix} = $jdk_prefix if ($jdk_prefix);
- }
-} }
-
-if ($mode eq 'build') {
- print "Writing config.status\n";
- open CONF,">config.status" or die "config.status: $!\n";
- for ('JDK_HOME', 'JAVA_HOME', 'PKG_CONFIG_PATH') {
- print CONF "$_=$ENV{$_} " if (defined $ENV{$_});
- }
- print CONF "$0 @keeparg\n";
- close CONF;
-}
-
-
-my @modules;
-my %aux;
-
-if ($module) {
-# push @modules,split(/[,.]+/,$module);
- push @modules,$module;
-}
-else {
- @modules = map(($extranodmod{$_} ? $extranodmod{$_} : 'lb.'.$_),(keys %enable_nodes));
-
- my $n;
-
- do {
- local $"="\n";
- $n = $#modules;
- push @modules,(map @{$deps{$_}},@modules);
-
- undef %aux; @aux{@modules} = (1) x ($#modules+1);
- @modules = keys %aux;
- } while ($#modules > $n);
-}
-
-@aux{@modules} = (1) x ($#modules+1);
-delete $aux{$_} for (split /,/,$staged);
-@modules = keys %aux;
-
-mode_build() if $mode eq 'build';
-mode_checkout() if $mode eq 'checkout';
-mode_etics($module) if $mode eq 'etics';
-
-sub mode_build {
- print "\nBuilding modules: @modules\n";
- print "Mode: "; print $module ? "single module" : "multiple modules"; print "\n";
-
- my @ext = map @{$need_externs{$_}},@modules;
- my @myjars = map @{$need_jars{$_}},@modules;
- undef %aux; @aux{@ext} = 1;
- @ext = keys %aux;
- undef %aux; @aux{@myjars} = (1) x ($#myjars+1);
- @myjars = keys %aux;
-
- print "\nRequired externals:\n";
- print "\t$_: ".($externs{$_}{prefix}?$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;
-
- if ($module) {
- print "Not creating summary Makefile\n" if $debug;
- } else {
- print "Creating Makefile\n";
-
- open MAK,">Makefile" or die "Makefile: $!\n";
-
- print MAK "all: @modules\n\n";
- print MAK "stage: ".(join '-stage ', @modules)."-stage\n\n";
- print MAK "clean check install:\n";
-
- for (@modules) {
- my $full = full($_);
- print MAK "\tcd $full/$buildroot{$_} && \${MAKE} \$@\n"
- }
-
- print MAK "\ndistclean:\n";
-
- for (@modules) {
- my $full = full($_);
- print MAK $buildroot{$_} eq '' ?
- "\tcd $full && \${MAKE} distclean\n" :
- "\trm -rf $full/$buildroot{$_}\n"
- }
-
- print MAK "\n";
-
- for (@modules) {
- my %ldeps; undef %ldeps;
- @ldeps{@{$deps{$_}}} = 1;
- for my $x (split /,/,$staged) { delete $ldeps{$x}; }
- my @dnames = $module ? () : keys %ldeps;
- my $snames = $#dnames == -1 ? '' : join('-stage ', @dnames).'-stage';
-
- my $full = full($_);
- my $build = $buildroot{$_};
-
- print MAK "$_: @dnames\n\tcd $full/$build && \${MAKE} && \${MAKE} install\n\n";
- print MAK "$_-stage: $snames\n\tcd $full/$build && \${MAKE} && \${MAKE} stage\n\n";
- }
-
- close MAK;
- }
-}
-
-sub mode_checkout() {
- for (@modules) {
- my $module = $_;
- my $tag = "";
- if ($lb_tag){
- for (@{$lbmodules{lb}}){
- if ("lb.".$_ eq $module){
- $tag = '-r '.$lb_tag;
- }
- }
- }
- if ($lbjp_tag) {
- for (@{$lbmodules{'lbjp-common'}}){
- if ("lbjp-common.".$_ eq $module){
- $tag = '-r '.$lbjp_tag;
- }
- }
- }
- if ($jp_tag){
- for (@{$lbmodules{'jp'}}){
- if ("jp.".$_ eq $module){
- $tag = '-r '.$jp_tag;
- }
- }
- }
- if ($jobid_tag){
- for (@{$lbmodules{jobid}}){
- if ("jobid.".$_ eq $module){
- $tag = '-r '.$jobid_tag;
- }
- }
- }
- if ($canl_tag) {
- for (@{$lbmodules{'canl'}}){
- if ("canl.".$_ eq $module){
- $tag = '-r '.$canl_tag;
- }
- }
- }
- #if (grep {"lb.".$_ eq $module} @{$lbmodules{lb}}){
- # print "found";
- #}
- $_ = full($_);
- print "\n*** Checking out $_\n";
- system("cvs checkout $tag $_") == 0 or die "cvs checkout $tag $_: $?\n";
- }
-}
-
-BEGIN{
-%etics_externs = (
- default => {
- 'myproxy-devel'=>'myproxy-devel',
- 'myproxy-server'=>'myproxy-server',
- 'myproxy-admin'=>'myproxy-admin',
- cares=>'c-ares',
- utiljava=>'org.glite.security.util-java',
- gpt=>'gpt',
- fetchcrl=>'fetch-crl',
- activemq=>'activemq-cpp-library',
- },
-);
-
-%etics_projects = (
-);
-
-%need_externs_aux = (
- 'lb.client' => [ qw/cppunit:B classads libtool:B globus:B/ ],
- 'lb.common' => [ qw/expat cares:B cppunit:B classads libtool:B globus:B/ ],
- 'lb.doc' => [ qw/tetex-latex:B/ ],
- 'lb.logger' => [ qw/cppunit:B libtool:B globus:B/ ],
- 'lb.logger-msg' => [ qw/cppunit:B activemq libtool:B globus:B/ ],
- 'lb.nagios' => [ qw/globus_proxy_utils:R/ ],
- 'lb.server' => [ qw/globus_essentials:R globus:B expat cares mysql-server:R cppunit:B gsoap:B classads voms:B lcas gridsite:B bison:B libtool:B libxml2 flex:B/ ],
- 'lb.state-machine' => [ qw/classads libtool:B libxslt:B expat:B globus:B/ ],
- 'lb.utils' => [ qw/cppunit:B libtool:B globus:B/ ],
- 'lb.ws-interface' => [ qw/libxslt:B tidy:B/ ],
- 'lb.ws-test' => [ qw/gsoap:B libtool:B globus:B/ ],
- 'lb.types' => [ qw// ],
- 'lb.harvester' => [ qw/docbook-utils:B libtool:B globus:B/ ],
- 'lbjp-common.db' => [ qw/mysql-devel:B postgresql:B cppunit:B log4c:B libtool:B/ ],
- 'lbjp-common.log' => [ qw/log4c libtool:B/ ],
- 'lbjp-common.maildir' => [ qw/libtool:B/ ],
- 'lbjp-common.server-bones' => [ qw/libtool:B/ ],
- 'lbjp-common.trio' => [ qw/cppunit:B libtool:B/ ],
- 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B libtool:B/ ],
- 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B libtool:B/ ],
- 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap gsoapxx libtool:B/ ],
- 'jobid.api-c' => [ qw/cppunit:B libtool:B openssl:B/ ],
- 'jobid.api-cpp' => [ qw/cppunit:B libtool:B/ ],
- 'jobid.api-java' => [ qw/ant:B jdk:B/ ],
- 'jp.client' => [ qw/gsoap libtar globus_essentials:R globus:B/ ],
- 'jp.doc' => [],
- 'jp.index' => [ qw/gsoap globus_essentials:R globus:B mysql-server:R/ ],
- 'jp.primary' => [ qw/classads gsoap libtar globus_essentials:R globus:B mysql-server:R/ ],
- 'jp.server-common' => [],
- 'jp.ws-interface' => [],
- 'gridsite.core' => [ qw/httpd-devel:B gsoap:B globus:B curl:B doxygen:B fuse-devel:B libxml2:B openssl:B doxygen:B/ ],
- 'gridsite.commands' => [ qw/curl:R openssl:R/ ],
- 'gridsite.apache' => [ qw/libxml2:R openssl:R curl:R/ ],
- 'gridsite.libs' => [ qw/libxml2:R openssl:R/ ],
- 'gridsite.devel' => [ qw// ],
- 'gridsite.slashgrid' => [ qw/curl:R fuse:R/],
- 'gridsite.services' => [ qw/curl:R gsoap:R/ ],
- 'gridsite.service-clients' => [ qw/curl:R gsoap:R gsoapxx:R/ ],
- 'gridsite.gsexec' => [ qw// ],
- 'gridsite.1.5-compat' => [ qw/httpd-devel:B gsoap:B globus:B curl:B doxygen:B fuse-devel:B libxml2:B openssl:B doxygen:B/ ],
- 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-devel:B voms:B libtool:B/ ],
- 'px.myproxy-config' => [ qw/myproxy-admin:R/ ], # in myproxy-config.spec
- 'canl.c' => [ qw/cares:B openssl:B libtool:B bison:B flex:B krb5-devel:B/ ],
-);
-
-%need_jars = (
- 'jobid.api-java' => [ qw/jakarta-commons-codec/ ],
- 'lb.client-java' => [ qw/jakarta-commons-lang/ ],
-);
-
-for my $jar (keys %need_jars) {
- for (@{$need_jars{$jar}}) {
- $need_externs_type{$jar}->{$_} = 'BR'; # XXX
- }
-}
-
-%deps_aux = (
- 'lb.client' => [ qw/
- lb.types:B lb.common
- lbjp-common.trio
- jobid.api-cpp:B jobid.api-c
- lbjp-common.gss
- / ],
- 'lb.client-java' => [ qw/
- lb.types:B
- lb.ws-interface:B
- jobid.api-java
- / ],
- 'lb.common' => [ qw/
- jobid.api-cpp:B jobid.api-c
- lb.types:B lbjp-common.trio lbjp-common.gss
- / ],
- 'lb.doc' => [ qw/lb.types:B/ ],
- 'lb.logger' => [ qw/
- lbjp-common.trio
- lbjp-common.log
- jobid.api-c
- lb.common
- lbjp-common.gss
- / ],
- 'lb.logger-msg' => [ qw/
- lb.logger:B
- / ],
- 'lb.nagios' => [ qw/
- lb.client:R
- lb.ws-test:R
- lb.utils:R
- / ],
- 'lb.server' => [ qw/
- lb.ws-interface lb.types:B lb.common lb.state-machine lb.utils:R
- lbjp-common.db lbjp-common.server-bones lbjp-common.trio lbjp-common.maildir lbjp-common.log
- jobid.api-c
- lbjp-common.gsoap-plugin lbjp-common.gss
- / ],
- 'lb.state-machine' => [ qw/lb.types:B lb.common lbjp-common.jp-interface lbjp-common.gss/ ],
- 'lb.utils' => [ qw/
- lbjp-common.jp-interface
- jobid.api-c
- lbjp-common.trio lbjp-common.maildir
- lb.client lb.state-machine lb.types:B
- / ],
- 'lb.ws-test' => [ qw/lbjp-common.gsoap-plugin lb.ws-interface/ ],
- 'lb.ws-interface' => [ qw/lb.types:B/ ],
- 'lb.types' => [ qw// ],
- 'lb.harvester' => [ qw/
- jobid.api-c lbjp-common.trio lbjp-common.db lb.common lb.client
- lbjp-common.gss lbjp-common.log
- / ],
- 'lb.yaim' => [ qw// ],
- 'lb.glite-LB' => [ qw/
- lb.logger:R lb.server:R lb.utils:R lb.doc:R
- lb.ws-test:R lb.harvester:R lb.yaim:R lb.client-java:R
- lb.logger-msg:R
- / ],
- 'lb.emi-lb' => [ qw/
- lb.logger:R lb.server:R lb.utils:R lb.doc:R
- lb.ws-test:R lb.harvester:R lb.yaim:R lb.client-java:R
- lb.logger-msg:R
- / ],
- 'lbjp-common.db' => [ qw/lbjp-common.trio lbjp-common.log/ ],
- 'lbjp-common.maildir' => [ qw// ],
- 'lbjp-common.log' => [ qw// ],
- 'lbjp-common.server-bones' => [ qw/lbjp-common.log/ ],
- 'lbjp-common.trio' => [ qw// ],
- 'lbjp-common.gss' => [ qw// ],
- 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ],
- 'jobid.api-c' => [ qw// ],
- 'jobid.api-cpp' => [ qw/jobid.api-c/ ],
- 'jobid.api-java' => [ qw// ],
-
- 'lbjp-common.jp-interface' => [ qw/lbjp-common.trio lbjp-common.db jobid.api-c/ ],
-
- 'jp.client' => [ qw/
- jp.ws-interface
- lbjp-common.jp-interface lbjp-common.maildir
- jobid.api-c
- lbjp-common.gsoap-plugin
- / ],
- 'jp.doc' => [ qw// ],
- 'jp.index' => [ qw/
- jp.server-common jp.ws-interface
- lbjp-common.jp-interface lbjp-common.trio lbjp-common.db lbjp-common.server-bones
- lbjp-common.gsoap-plugin
- / ],
- 'jp.primary' => [ qw/
- jobid.api-c
- jp.server-common jp.ws-interface
- lb.state-machine
- lbjp-common.jp-interface lbjp-common.trio lbjp-common.db lbjp-common.server-bones
- lbjp-common.gsoap-plugin
- / ],
- 'jp.server-common' => [ qw/
- lbjp-common.jp-interface lbjp-common.db
- / ],
- 'jp.ws-interface' => [ qw// ],
-
- 'gridsite.core' => [ qw// ],
- 'gridsite.commands' => [ qw/gridsite.core:B/ ],
- 'gridsite.apache' => [ qw/gridsite.core:B/ ],
- 'gridsite.libs' => [ qw/gridsite.core:B / ],
- 'gridsite.devel' => [ qw/gridsite.core:B/ ],
- 'gridsite.slashgrid' => [ qw/gridsite.core:B/],
- 'gridsite.services' => [ qw/gridsite.core:B/ ],
- 'gridsite.service-clients' => [ qw/gridsite.core:B/ ],
- 'gridsite.gsexec' => [ qw/gridsite.core:B/ ],
-
- 'px.proxyrenewal' => [ qw// ],
- 'px.glite-PX' => [qw/px.myproxy-yaim:R/],
- 'px.emi-px' => [qw/px.myproxy-yaim:R/],
- 'px.myproxy-yaim' => [ qw// ],
- 'px.myproxy-config' => [],
-
- 'canl.c' => [],
-
- # sub-packages (virtual ETICS components depending on the main)
- 'jobid.api-c-devel' => [ qw/jobid.api-c:B/ ],
- 'jobid.api-cpp-devel' => [ qw/jobid.api-cpp:B/ ],
- 'lbjp-common.db-devel' => [ qw/lbjp-common.db:B/ ],
- 'lbjp-common.gsoap-plugin-devel' => [ qw/lbjp-common.gsoap-plugin:B/ ],
- 'lbjp-common.gss-devel' => [ qw/lbjp-common.gss:B/ ],
- 'lbjp-common.jp-interface-devel' => [ qw/lbjp-common.jp-interface:B/ ],
- 'lbjp-common.log-devel' => [ qw/lbjp-common.log:B/ ],
- 'lbjp-common.maildir-devel' => [ qw/lbjp-common.maildir:B/ ],
- 'lbjp-common.server-bones-devel' => [ qw/lbjp-common.server-bones:B/ ],
- 'lbjp-common.trio-devel' => [ qw/lbjp-common.trio:B/ ],
- 'lb.client-progs' => [ qw/lb.client:B/ ],
- 'lb.client-devel' => [ qw/lb.client:B/ ],
- 'lb.common-devel' => [ qw/lb.common:B/ ],
- 'lb.logger-devel' => [ qw/lb.logger:B/ ],
- 'lb.state-machine-devel' => [ qw/lb.state-machine:B/ ],
- 'px.proxyrenewal-devel' => [ qw/px.proxyrenewal:B/ ],
- 'px.proxyrenewal-progs' => [ qw/px.proxyrenewal:B/ ],
- 'canl.c-devel' => [ qw/canl.c:B/ ],
-);
-
-for my $ext (keys %deps_aux) {
- for (@{$deps_aux{$ext}}) {
- /([^:]*)(?::(.*))?/;
- push @{$deps{$ext}},$1;
- my $type = $2 ? $2 : 'BR';
- $deps_type{$ext}->{$1} = $type;
- }
-}
-
-
-%extrafull = (
- gridsite=>'org.gridsite.core',
- 'canl.c' => 'emi.canl.canl-c',
- 'canl.c-devel' => 'emi.canl.canl-c',
- 'jobid.api-c-devel' => 'org.glite.jobid.api-c',
- 'jobid.api-cpp-devel' => 'org.glite.jobid.api-cpp',
- 'lbjp-common.db-devel' => 'org.glite.lbjp-common.db',
- 'lbjp-common.gsoap-plugin-devel' => 'org.glite.lbjp-common.gsoap-plugin',
- 'lbjp-common.gss-devel' => 'org.glite.lbjp-common.gss',
- 'lbjp-common.jp-interface-devel' => 'org.glite.lbjp-common.jp-interface',
- 'lbjp-common.log-devel' => 'org.glite.lbjp-common.log',
- 'lbjp-common.maildir-devel' => 'org.glite.lbjp-common.maildir',
- 'lbjp-common.server-bones-devel' => 'org.glite.lbjp-common.server-bones',
- 'lbjp-common.trio-devel' => 'org.glite.lbjp-common.trio',
- 'lb.client-devel' => 'org.glite.lb.client',
- 'lb.client-progs' => 'org.glite.lb.client',
- 'lb.common-devel' => 'org.glite.lb.common',
- 'lb.logger-devel' => 'org.glite.lb.logger',
- 'lb.state-machine-devel' => 'org.glite.lb.state-machine',
- 'px.proxyrenewal-devel' => 'org.glite.px.proxyrenewal',
- 'px.proxyrenewal-progs' => 'org.glite.px.proxyrenewal',
-);
-
-#( java => 'client-java' );
-%extranodmod = (
- db => 'lbjp-common.db',
- jpprimary => 'jp.primary',
- jpindex => 'jp.index',
- jpclient => 'jp.client',
- lb => 'lb.glite-LB',
- px => 'px.glite-PX',
- proxyrenewal => 'px.proxyrenewal',
- canl => 'canl.c',
-);
-
-%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/ ],
-);
-
-%conflicts = (
-);
-
-%provides = (
- 'lbjp-common.gss' => [ qq/glite-security-gss/ ],
- 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ],
- 'lb.nagios' => [ qq/glite-lb-nagios-plugins/ ],
-);
-
-%cvs_prefix = (
- 'lb' => 'org.glite',
- 'jp' => 'org.glite',
- 'jobid' => 'org.glite',
- 'lbjp-common' => 'org.glite',
- 'gridsite' => 'org',
- 'px' => 'org.glite',
- 'canl' => 'emi',
-);
-
-%cvs_tag_prefix = (
- 'lb' => 'glite-',
- 'jp' => 'glite-',
- 'jobid' => 'glite-',
- 'lbjp-common' => 'glite-',
- 'gridsite' => '',
- 'px' => 'glite-',
- 'canl' => 'emi-',
-);
-
-# ==== projects specification ====
-# etics_name ........... ETICS project name
-# conf_prefix .......... ETICS configurations name prefix
-# tag_prefix ........... VCS tag prefix
-# local_prefix ......... prefix (relative to stage)
-# etics_externs ........ ETICS modules names of externals
-# (${NAME.location}, ETICS conf. dependencies)
-# etics_projects ....... ETICS project names of externals
-# etics_externs_devel .. ETICS modules names of devel versions of externals
-# etics_locations ...... ETICS locations in ${NAME.location} properties
-# need_externs_aux ..... project-specific external dependencies
-# supported_platforms .. platforms supported by the project
-# modules .............. additional modules in subsystems
-%projects = (
- glite => {
- current_version => 3,
- etics_name => 'org.glite',
- conf_prefix => { %cvs_tag_prefix },
- tag_prefix => { %cvs_tag_prefix },
- flavours => '--thrflavour=${globus.thr.flavor} --nothrflavour=${globus.nothr.flavor}',
- local_prefix => '',
- etics_externs => {
- default => {
- globus_essentials=>'vdt_globus_essentials',
- globus=>'globus',
- globus_proxy_utils=>'vdt_globus_essentials',
- gridsite=>'org.gridsite.libs',
- yaim_core=>'org.glite.yaim.core',
- gip_release=>'glite-info-provider-release',
- gip_service=>'glite-info-provider-service',
- bdii=>'bdii',
- glite_version=>'glite-version',
- glite_info_templates=>'glite-info-templates',
- glue_schema=>'glue-schema',
- trustmanager=>'org.glite.security.trustmanager',
- axis=>'axis',
- lcas=>'org.glite.security.lcas',
- gsoapxx=>'-',
- jdk=>'jdk',
- voms=>'org.glite.security.voms-api-cpp',
- },
- },
- etics_externs_devel => {
- default => {
- gridsite=>'org.gridsite.devel',
- voms=>'org.glite.security.voms-api',
- },
- },
- etics_projects => {
- vdt=>[qw/globus globus_essentials globus_proxy_utils gpt/],
- 'org.glite'=>[qw/voms gridsite lcas gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/],
- },
- etics_locations => {
- '*' => '',
- },
- need_externs_aux => {
- 'lb.client-java' => [ qw/ant:B jdk:B axis:B trustmanager utiljava libtool:B/ ],
- 'lb.glite-LB' => [ qw/fetchcrl:R gpt:R gip_release:R gip_service:R bdii:R glite_version:R glite_info_templates:R glue_schema:R/ ],
- 'lb.yaim' => [ qw/yaim_core:R/ ],
- 'px.glite-PX' => [qw/myproxy-server:R myproxy-admin:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/],
- 'px.myproxy-yaim' => [ qw/yaim_core:R/ ],
- },
- supported_platforms => {
- sl5_x86_64_gcc412 => 1,
- sl5_ia32_gcc412 => 1,
- deb5_x86_64_gcc432 => 1,
- deb5_ia32_gcc432 => 1,
- slc4_x86_64_gcc346 => 1,
- slc4_ia32_gcc346 => 1,
- },
- modules => {
- 'lb' => [ qw/glite-LB/ ],
- 'px' => [ qw/glite-PX/ ],
- },
- },
-
- emi => {
- current_version => 2,
- etics_name => 'emi',
- conf_prefix => {
- 'lb' => 'emi-',
- 'jp' => 'emi-',
- 'jobid' => 'emi-',
- 'lbjp-common' => 'emi-',
- 'gridsite' => 'emi-',
- 'px' => 'emi-',
- 'canl' => 'emi-',
- },
- tag_prefix => { %cvs_tag_prefix },
- flavours => '--thrflavour= --nothrflavour=',
- local_prefix => '/usr',
- etics_externs => {
- default => {
- globus_essentials=>'globus-gssapi-gsi',
- globus=>'globus-gssapi-gsi-devel',
- globus_proxy_utils=>'globus-proxy-utils',
- gridsite=>'emi.gridsite.libs',
- yaim_core=>'emi.yaim.yaim-core',
- yaim_bdii=>'emi.bdii.yaim-bdii',
- gip_service=>'emi.bdii.glite-info-provider-service',
- bdii=>'emi.bdii.core',
- glite_version=>'emi.emi-version',
- glue_schema=>'emi.bdii.glue-schema',
- trustmanager=>'emi.java-security.trustmanager',
- trustmanager_axis=>'emi.java-security.trustmanager-axis',
- axis=>'axis1.4',
- lcas=>'emi.sac.lcas',
- gsoapxx=>'-',
- jdk=>'java',
- voms => 'emi.voms.voms-api',
- },
- sl5_x86_64_gcc412EPEL => {
- 'myproxy-devel' => 'myproxy-devel.x86_64',
- },
- sl6_x86_64_gcc446EPEL => {
- 'myproxy-devel' => 'myproxy-devel.x86_64',
- },
- deb6_x86_64_gcc445 => {
- axis => 'axis1.4',
- # mappings in ETICS project configuration
- #globus_essentials => 'libglobus-gssapi-gsi4',
- #globus => 'libglobus-gssapi-gsi-dev',
- #axis => 'libaxis-java',
- #cares => 'libc-ares2',
- #cppunit => 'libcppunit',
- #expat => 'libexpat1',
- #log4c => 'liblog4c3',
- #curl => 'libcurl3',
- #'mysql' => 'libmysqlclient16',
- #'mysql-devel' => 'libmysqlclient-dev',
- #libxslt => 'xsltproc',
- #'jakarta-commons-codec' => 'libcommons-codec-java',
- #'jakarta-commons-lang' => 'libcommons-lang-java',
- #'tetex-latex' => 'texlive-latex-extra',
- #'perl-LDAP' => 'libnet-ldap-perl',
- #'fuse-lib' => 'libfuse2',
- #'fuse' => 'fuse-utils',
- },
- },
- etics_externs_devel => {
- default => {
- cares => 'c-ares-devel',
- classads => 'classads-devel',
- cppunit => 'cppunit-devel',
- expat => 'expat-devel',
- gsoap => 'gsoap-devel',
- voms => 'emi.voms.voms-api-devel',
- libtar => 'libtar-devel',
- log4c => 'log4c-devel',
- postgresql => 'postgresql-devel',
- curl => 'curl-devel',
- libxml2 => 'libxml2-devel',
- openssl => 'openssl-devel',
- gridsite=>'emi.gridsite.devel',
- jdk=>'java-devel',
- },
- deb6_x86_64_gcc445 => {
- # mappings in ETICS project configuration
- #cares => 'libc-ares-dev',
- #cppunit => 'libcppunit-dev',
- #expat => 'libexpat1-dev',
- #libtar => 'libtar-dev',
- #log4c => 'liblog4c-dev',
- #postgresql => 'libpq-dev',
- #curl => 'libcurl4-openssl-dev',
- #libxml2 => 'libxml2-dev',
- #openssl => 'libssl-dev',
- #'tetex-latex' => 'texlive-latex-extra',
- #libxslt=>'xsltproc',
- #'httpd-devel' => 'apache2-prefork-dev',
- #'fuse-devel' => 'libfuse-dev',
- #gsoap => 'gsoap',
- #'krb5-devel' => 'libkrb5-dev',
- },
- },
- etics_projects => {
- 'emi'=>[qw/voms voms-devel gridsite lcas gip_service bdii glite_version glue_schema yaim_core yaim_bdii trustmanager trustmanager_axis/],
- },
- etics_locations => {
- axis => 'axis',
- },
- need_externs_aux => {
- 'lb.client-java' => [ qw/ant:B jdk:B axis:B trustmanager trustmanager_axis libtool:B/ ],
- 'lb.emi-lb' => [ qw/fetchcrl:R gip_service:R bdii:R glite_version:R glue_schema:R/ ],
- 'lb.yaim' => [ qw/yaim_core:R yaim_bdii:R/ ],
- 'px.emi-px' => [qw/myproxy-server:R myproxy-admin:R fetchcrl:R gip_service:R bdii:R glite_version:R glue_schema:R/],
- 'px.myproxy-yaim' => [ qw/yaim_core:R yaim_bdii:R/ ],
- },
- supported_platforms => {
- sl5_x86_64_gcc412EPEL => 1,
- sl5_ia32_gcc412EPEL => 1,
- sl6_x86_64_gcc446EPEL => 1,
- deb6_x86_64_gcc445 => 1,
- },
- modules => {
- 'lb' => [ qw/emi-lb/ ],
- 'px' => [ qw/emi-px/ ],
- },
- },
-);
-
-%platform_properties = (
- 'jobid.api-java' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.types' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.doc' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.ws-interface' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.yaim' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.nagios' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'px.yaim' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'px.myproxy-config' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'gridsite.devel' => {
- default => { 'packageName' => 'gridsite-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libgridsite-dev' },
- },
- 'canl.c-devel' => {
- default => { 'packageName' => 'canl-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libcanl-dev' },
- },
- 'jobid.api-c-devel' => {
- default => { 'packageName' => 'glite-jobid-api-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-jobid-dev' },
- },
- 'jobid.api-cpp-devel' => {
- default => { 'packageName' => 'glite-jobid-api-cpp-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-jobid-cpp-dev' },
- },
- 'lbjp-common.db-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-db-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-db-dev' },
- },
- 'lbjp-common.gsoap-plugin-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-gsoap-plugin-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-gsoap-plugin-dev' },
- },
- 'lbjp-common.gss-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-gss-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-gss-dev' },
- },
- 'lbjp-common.jp-interface-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-jp-interface-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-jp-interface-dev' },
- },
- 'lbjp-common.log-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-log-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-log-dev' },
- },
- 'lbjp-common.maildir-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-maildir-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-maildir-dev' },
- },
- 'lbjp-common.server-bones-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-server-bones-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-server-bones-dev' },
- },
- 'lbjp-common.trio-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-trio-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-trio-dev' },
- },
- 'lb.client-devel' => {
- default => { 'packageName' => 'glite-lb-client-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-client-dev' },
- },
- 'lb.common-devel' => {
- default => { 'packageName' => 'glite-lb-common-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-common-dev' },
- },
- 'lb.state-machine-devel' => {
- default => { 'packageName' => 'glite-lb-state-machine-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-state-machine-dev' },
- },
- 'lb.logger-devel' => {
- default => { 'packageName' => 'glite-lb-logger-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-logger-dev' },
- },
- 'px.proxyrenewal-devel' => {
- default => { 'packageName' => 'glite-px-proxyrenewal-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-security-proxyrenewal-dev' },
- },
- 'canl.c-devel' => {
- default => { 'packageName' => 'canl-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libcanl-c-dev' },
- },
-);
-
-my @k = keys %deps_aux;
-@buildroot{@k} = ('') x ($#k+1);
-
-$buildroot{'gridsite.core'} = 'src';
-}
-
-sub full
-{
- my ($short) = @_;
- my $subsys = $short;
- $subsys =~ s/\..*//;
-
- my $cvs_prefix = exists $cvs_prefix{$subsys} ? $cvs_prefix{$subsys} : 'org.glite';
- return $extrafull{$short} ? $extrafull{$short} : "$cvs_prefix.$short";
-}
-
-sub get_version
-{
- my ($fmod, $top_srcdir) = @_;
-
- my ($subsys,$mod) = split /\./,$fmod,2;
- my ($major,$minor,$rev,$age);
- my $old_;
-
- if ($force_version) {
- $force_version =~ /([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)-(.+)/;
- ($major,$minor,$rev,$age) = ($1,$2,$3,$4);
- }
- else {
- my $path = "$top_srcdir/project";
- if ($subsys eq 'gridsite') {
- $path = "$cvs_prefix{$subsys}.$subsys.core/project";
- }
- open V,"$path/version.properties"
- or die "$path/version.properties: $!\n";
-
- $old_ = $_;
- while (<V>) {
- chomp;
- ($major,$minor,$rev) = ($1,$2,$3) if /module\.version\s*=\s*([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/;
- $age = $1 if /module\.age\s*=\s*([[:digit:]]+)/;
- }
- close V;
- $_ = $old_;
- }
- $version = "$major.$minor.$rev-$age";
-
- return ($major, $minor, $rev, $age);
-}
-
-sub get_description
-{
- my ($top_srcdir) = @_;
-
- my $cvs_module = $top_srcdir;
- my $package_description = "";
- my $package_summary = "";
-
- if (-e "$cvs_module/project/package.description") {
- open V, "$cvs_module/project/package.description";
- $package_description = join ("", <V>);
- close V;
- chomp $package_description;
- }
- else {
- print STDERR "package.description not found for $subsys.$module!\n"; }
-
- if (-e "$cvs_module/project/package.summary") {
- open V, "$cvs_module/project/package.summary";
- $package_summary = join ("", <V>);
- close V;
- chomp $package_summary;
- $package_summary =~ s/\n/\\n/g;
- }
- else {
- print STDERR "package.summary not found for $subsys.$module!\n"; }
-
- return ($package_summary, $package_description);
-}
-
-sub mkinc
-{
- my %aux;
- undef %aux;
- my @m=qw/
-lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.nagios lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lb.emi-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
-px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config px.emi-px
-canl.c
-/;
- @aux{@m} = (1) x ($#m+1);
-
- my ($short) = @_;
- my $full = full $short;
- my ($subsys,$mod) = split /\./,$short,2;
- my $packageName = "$project{tag_prefix}{$subsys}$subsys-${mod}";
-
- unless ($aux{$short}) {
- print "Makefile.inc not needed in $full\n";
- return;
- }
-
- my $top_srcdir = '.';
- my $abs_srcdir = '';
- my $build = '';
-
- if ($module) {
- $top_srcdir = $0;
- $top_srcdir =~ s,/?[^/]*$,,;
- $abs_srcdir = $top_srcdir;
- $top_srcdir =~ s,^$,\.,;
- } else {
- $build = "$full/";
- $abs_srcdir = "$full/";
- unless ($buildroot{$_} eq '') {
- $top_srcdir = '..';
- $build .= "$buildroot{$_}/";
- unless (-d "$build") {
- mkdir "$build" or die "mkdir $build: $!\n";
- }
- }
- }
-
- my ($major, $minor, $rev, $age) = get_version $short, $abs_srcdir;
- my ($package_summary, $package_description) = get_description $abs_srcdir;
- if ($package_description) { $package_description =~ s/(.{1,78}\S|\S+)\s+/$1\n/mg; }
- my $package_description_debian = $package_description;
- $package_description_debian =~ s/^/ /mg;
-
- my ($old_locale, $specdate, $debdate);
-
- # files for ETICS always in root source directory
- mkdir $abs_srcdir."project" unless (-d $abs_srcdir."project");
- open PKGCHL,">".$abs_srcdir."project/changelog"
- or die $abs_srcdir."project/changelog: $!\n";
- $old_locale = setlocale(LC_TIME);
- setlocale(LC_TIME, "C");
- $specdate = strftime("%a %b %d %Y", gmtime());
- $debdate = strftime("%a, %d %b %Y %H:%M:%S %z", gmtime());
- setlocale(LC_TIME, $old_locale);
- print PKGCHL qq{* $specdate CESNET team <emi-lb\@metacentrum.cz>
-- automatically generated package
-};
- close PKGCHL;
-
- unless ($top_srcdir eq '.') {
- unlink $build."Makefile";
- symlink "$top_srcdir/Makefile",$build."Makefile" or die "symlink $top_srcdir/Makefile ".$build."Makefile: $!\n";
- }
-
- open MKINC,">".$build."Makefile.inc"
- or die $build."Makefile.inc: $!\n";
-
- print "Creating ".$build."Makefile.inc\n";
-
- print MKINC qq{project = $project
-PREFIX = $root
-prefix = $prefix
-stagedir = $stagedir
-sysroot = $sysroot
-sysconfdir = $sysconfdir
-localstatedir = $localstatedir
-thrflavour = $thrflavour
-nothrflavour = $nothrflavour
-libdir = $libdir
-top_srcdir = $top_srcdir
-};
-
- for (@{$need_externs{$short}}) {
- next unless defined $externs{$_} and defined $externs{$_}{prefix};
- print MKINC "${_}_prefix = $externs{$_}{prefix}\n";
- print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags};
- }
-
- for (@{$need_jars{$short}}) {
- print MKINC "${_}_jar = $jar{$_}\n"
- }
-
- my $need_gsoap = 0;
- for (@{$need_externs{$short}}) { $need_gsoap = 1 if $_ eq 'gsoap'; }
-
- print MKINC "gsoap_default_version=".gsoap_version()."\n" if $need_gsoap;
-
- close MKINC;
-
- my $dh;
- my $debian = 0;
-
- opendir $dh, "$abs_srcdir/project" || die "Can't open $abs_srcdir/project: $!";
- for my $dir (readdir $dh) {
- if ($dir=~/^(.*)\.spec$/) {
- if ($1 ne $packageName) {
- printf STDERR "Changed RPM name: $packageName --> $1\n" if ($debug);;
- $packageName=$1;
- }
- last;
- }
- }
- closedir $dh;
-
- for my $file ("$packageName.spec", "debian.rules", "debian.control", "debian.changelog", "debian.copyright") {
- if (-f "$abs_srcdir/project/$file") {
- my $old_ = $_;
- printf STDERR "Creating $build$file\n" if ($debug);;
- open DST, ">$build$file";
- open SRC, "<$abs_srcdir/project/$file";
- while (<SRC>) {
- if (/\@MODULE\@/) { s/\@MODULE\@/$full/g; }
- if (/\@URL\@/) { s/\@URL\@/$package{url}/g; }
- if (/\@SUMMARY\@/) { s/\@SUMMARY\@/$package_summary/g; }
- if (/\@DESCRIPTION\@/) { s/\@DESCRIPTION\@/$package_description/g; }
- if (/\@DEBIAN_DESCRIPTION\@/) { s/\@DEBIAN_DESCRIPTION\@/$package_description_debian/g; }
- if (/\@VERSION\@/) { s/\@VERSION\@/$version/g; }
- if (/\@MAJOR\@/) { s/\@MAJOR\@/$major/g; }
- if (/\@MINOR\@/) { s/\@MINOR\@/$minor/g; }
- if (/\@REVISION\@/) { s/\@REVISION\@/$rev/g; }
- if (/\@AGE\@/) { s/\@AGE\@/$age/g; }
- if (/\@MAINTAINER\@/) { s/\@MAINTAINER\@/$package{maintainer}/g; }
- if (/\@UPLOADERS\@/) { s/\@UPLOADERS\@/$package{uploaders}/g; }
- if (/\@DEBIAN_VCS\@/) { s/\@DEBIAN_VCS\@/$package{debian_vcs}/g; }
- if (/\@DEBIAN_DATE\@/) { s/\@DEBIAN_DATE\@/$debdate/g; }
- if (/\@SPEC_DATE\@/) { s/\@SPEC_DATE\@/$specdate/g; }
- if (/^\s*.+\/configure\s/ and $force_version) {
- print "Version forced to $version\n" if ($debug);;
- s/--version\s+\S+\s?//;
- s/$/ --version $version/;
- }
- printf DST "%s", "$_";
- }
- close SRC;
- close DST;
- $_ = $old_;
- }
- }
-
- print "Creating ${build}debian/\n" if ($debug);;
-
- `rm -rfv ${build}debian`;
- mkdir $build."debian" or die $!;
- `cp $abs_srcdir/project/debian.* ${build}debian/ 2>/dev/null`;
- `mv ${build}debian.* ${build}debian/ 2>/dev/null`;
- `rm -f ${build}debian/*.orig`;
- opendir $dh, "${build}debian" || die "Can't open ${build}debian: $!";
- for $_ (readdir $dh) {
- if (/^debian\.(.*)/) {
- `mv ${build}debian/$_ ${build}debian/$1`;
- $debian = 1;
- }
- }
- closedir $dh;
-
- if ($debian) {
- my ($dir, $file);
-
- chmod 0755, "${build}debian/rules";
- $file="${build}debian/docs"; if (not -f $file) { `touch $file`; }
- $dir="${build}debian/source"; if (not -d $dir) { mkdir $dir; }
- $file="${build}debian/source/format"; if (not -f $file) { `echo "3.0 (quilt)" > $file` }
- $file="${build}debian/compat"; if (not -f $file) { `echo "7" > $file` }
- $file="${build}debian/changelog"; if (not -f $file) {
- open FH, ">$file" or die $!;
- print FH qq{$packageName ($major.$minor.$rev-$age) unstable; urgency=low
-
- * Automatically generated package
-
- -- $package{maintainer} $debdate
-};
- close FH;
- }
-
- } else {
- `rm -rf ${build}debian`;
- }
-}
-
-BEGIN{
-};
-
-sub mode_etics_packaging {
- my ($fmod, $cmd, $rpmprepare, $debprepare) = @_;
- my ($workspaceDir, $srcPackageName, $srcAge, $topDir);
-
- # old-school packaging by ETICS for EMI-1
- if ($project eq 'emi' and $project_version == 1) { return; }
-
- if ($fmod eq 'gridsite.core') {
- $workspaceDir = '..';
- $srcPackageName = 'gridsite';
- $srcAge = '';
- $topDir = '../';
- } else {
- $workspaceDir = '${workspaceDir}';
- $srcPackageName = '${packageName}';
- $srcAge = '-${age}';
- $topDir = '';
- }
-
- $cmd->{clean} = 'make clean
- rm -rfv ${package.tgzLocation} ${package.SRPMSLocation}';
- $cmd->{default}{packaging} = $rpmprepare;
- $cmd->{default}{packaging} .= "dir=\${workspaceDir}/rpm_build_src_\$\$
- mkdir -p \${package.tgzLocation} \${package.SRPMSLocation} \$dir/{BUILD,RPMS,SOURCES,SRPMS} 2>/dev/null || true
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \${package.tgzLocation}/
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \$dir/SOURCES/
- rpmbuild -bs --nodeps --define \"_topdir \$dir\" $srcPackageName.spec
- cp -v \$dir/SRPMS/*.src.rpm \${package.SRPMSLocation}/
- rm -rf \$dir";
-
- for my $p ('deb5_x86_64_gcc432', 'deb5_ia32_gcc432', 'deb6_x86_64_gcc445', 'deb6_ia32_gcc445') {
- for my $c (keys %{$cmd->{default}}) { $cmd->{$p}{$c} = $cmd->{default}{$c}; }
- $cmd->{$p}{clean} = 'make clean
- rm -rfv ${package.tgzLocation} ${package.SDEBSLocation}';
- $cmd->{$p}{packaging} = $debprepare;
- $cmd->{$p}{packaging} .= "dir=\${workspaceDir}/dpkg_build_src_\$\$
- mkdir -p \${package.tgzLocation} \${package.SDEBSLocation} \$dir 2>/dev/null || true
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \${package.tgzLocation}/
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \$dir/${srcPackageName}_\${version}.orig.tar.gz
- tar xzf \$dir/${srcPackageName}_\${version}.orig.tar.gz -C \$dir
- cp -rf ${topDir}debian/ \$dir/$srcPackageName-\${version}/
- cd \$dir/$srcPackageName-\${version}
- dpkg-buildpackage -S -d -nc
- cd -
- cp -v \$dir/*.tar.gz \$dir/*.dsc \${package.SDEBSLocation}/
- rm -rf \$dir";
- }
-}
-
-sub mode_etics {
- $fmod = shift;
-
- die "$0: --module required with --etics\n" unless $fmod;
-
- my ($subsys,$module) = split /\./,$fmod,2;
- my $full = full "$subsys.$module";
-
- my ($major,$minor,$rev,$age) = get_version $fmod, $full;
-
- # XXX: --with ignored for platform-dependend packages
- my @copts = ();
- my %ge;
- @ge{@{$etics_projects{$project{etics_name}}}} = (1) x ($#{$etics_projects{$project{etics_name}}}+1);
-
- for (@{$need_externs{"$subsys.$module"}}) {
- if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/ and (defined $externs{$_} or defined $jar{$_})) {
- my $eext = $etics_externs{default}{$_} ? $etics_externs{default}{$_} : $_;
- next if ($eext eq '-');
- if (defined $project{etics_locations}{'*'} or defined $project{etics_locations}{$_}) {
- $eext = $project{etics_locations}{$_} if ($project{etics_locations}{$_});
- push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}";
- } else {
- if ($ge{$_} and not defined $externs{$_}{pkg}) {
- push @copts, "--with-$_=\${stageDir}";
- }
- }
- }
- }
-
- for (@{$need_jars{"$subsys.$module"}}) {
- my $eext = $etics_externs{default}{$_} ? $etics_externs{default}{$_} : $_;
-
- push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (defined $project{etics_locations}{'*'} or defined $project{etics_locations}{$_});
- }
-
- my $conf;
- my $conftag;
- my ($confprefix, $nameprefix, $packageName);
-
- $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n";
-
- $confprefix = $project{conf_prefix}{$subsys};
- $nameprefix = $confprefix;
- $nameprefix =~ s/-$//;
- $nameprefix =~ s/-/\./g;
- $packageName = "$project{tag_prefix}{$subsys}$subsys-${module}";
-
- if ($branch) {
- $conf = "$confprefix${subsys}-${module}_$branch";
- $conftag = $branch;
- # forced low age number
- $age = $branch eq 'HEAD' ? '0head' : '0dev';
- push @copts, '--version ${version}-${age}';
- }
- else {
- $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}";
-# XXX: gridsite hack
- $conftag = $subsys eq 'gridsite' ? "$project{tag_prefix}{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" :
- "$project{tag_prefix}{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}";
-
- # lowering age for older packaging
- if ($project eq 'emi' and $project_version == 1) {
- $age = $age - 1;
- }
- }
-
- # emi1 suffix for older packaging
- if ($project eq 'emi' and $project_version == 1) {
- $age = $age.$project.$project_version;
- $conf = $conf.$project.$project_version;
- }
-
- my $file = $output ? $output : "$conf.ini";
- open C,">$file" or die "$file: $!\n";
-
- my $buildroot = $buildroot{"$subsys.$module"} eq '' ? '#no build.root' : "build.root = " . $buildroot{"$subsys.$module"};
-
- my $confdir = $buildroot{"$subsys.$module"} eq '' ? '.' : '..';
-
- my $cvs_module = full "$subsys.$module";
- my ($package_summary, $package_description) = get_description $cvs_module;
- if ($package_description) {
- $package_description =~ s/\n/\\n/g;
- $package_description = "package.description = $package_description\n";
- }
- if ($package_summary) {
- $package_summary = "package.summary = $package_summary\n";
- }
-
- my %cmd;
- $cmd_vcs{checkout} = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_module 2>/dev/null";
- #$cmd_vcs{checkout} = "((test -d jra1mw/.git && (cd jra1mw; git pull)) || (git clone -q http://scientific.zcu.cz/git/jra1mw.git";
- #$cmd_vcs{checkout} .= " && (cd jra1mw; git checkout -b \${tag} --track origin/\${tag})" unless ($conftag eq /HEAD/);
- #$cmd_vcs{checkout} .= ")) && (test -d \${moduleName} || ln -s jra1mw/$cvs_module \${moduleName})";
- $cmd_vcs{checkout} .= "\n\ttest -f \${packageName}-\${version}-\${age}.src.tar.gz || (ln -s \${moduleName} \${packageName}-\${version}; tar -chf - \${packageName}-\${version} --exclude CVS --exclude .git --exclude .etics | gzip --best > \${packageName}-\${version}-\${age}.src.tar.gz; rm \${packageName}-\${version})";
- $cmd_vcs{tag} = "cvs -d \${vcsroot} tag -R \${tag} ${moduleName}";
-
- $cmd{default}{init} = 'None';
- $cmd{default}{configure} = 'None';
- $cmd{default}{compile} = 'None';
- $cmd{default}{test} = 'None';
- $cmd{default}{install} = 'None';
- $cmd{default}{packaging} = 'None';
- $cmd{default}{clean} = 'make clean';
-
- if (exists $subpackages{$fmod}) {
- $cmd{default}{clean} = 'None';
- $cmd{default}{packaging} = "echo building nothing, $subpackages{$fmod} will build this package";
- $cmd_vcs{checkout} = "mkdir -v \${moduleName} 2>/dev/null || true";
- } elsif ($subsys eq 'gridsite') {
- $cmd_vcs{tag} = 'None';
-
- if ($module eq 'core') {
- my $flags;
-
- if ($project ne 'glite') {
- # don't evaluate pkg-config calls to get them into source package
- $flags = 'RELEASE_VERSION=${age}
- GSOAPDIR=\`pkg-config gsoap --variable=prefix\`
- OPENSSL_GLOBUS_FLAGS=\`pkg-config globus-openssl --cflags\`
- OPENSSL_GLOBUS_LIBS=\`pkg-config globus-openssl --libs\`';
- } else {
- $flags = 'RELEASE_VERSION=${age}
- GSOAPDIR=${gsoap.location}
- OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor}
- OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}
- HTTPD_FLAGS=-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-1 -I${httpd-devel.location}/include/apr-1.0 -I${httpd-devel.location}/include/apr-0 -I${httpd-devel.location}/include/pcre';
- }
-
- $cmd{default}{configure} = "cat > Makefile.inc <<EOF
- project = $project
- top_srcdir = ..
- $flags
- EOF";
- $cmd{default}{compile} = "make prefix=\${prefix}$project{local_prefix} libdir=\${libdir}";
- $cmd{default}{install} = "make prefix=\${prefix}$project{local_prefix} libdir=\${libdir} install";
- mode_etics_packaging($fmod, \%cmd,
- "make prefix=\${prefix}$project{local_prefix} rpm-prepare
- cp gridsite.spec ../\n\t",
- "chmod +x \${moduleDir}/src/make-debian-files || true
- make prefix=\${prefix}$project{local_prefix} deb-prepare\n\t"
- );
- }
- elsif ($module eq '1.5-compat') {
- $cmd_vcs{checkout} = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.core 2>/dev/null";
- $cmd{default}{init} = 'echo "/sbin/ldconfig" > project/.post
- echo "/sbin/ldconfig" > project/.postun';
- $cmd{default}{configure} = "cat > src/Makefile.inc <<EOF
- project = emi
- libdir = \${libdir}
- MAJOR_VERSION=1
- MINOR_VERSION=1.5
- PATCH_VERSION=1.5.0
- VERSION=\\\$(PATCH_VERSION)
- RELEASE_VERSION=\${age}
- GSOAPDIR=\\`pkg-config gsoap --variable=prefix\\`
- OPENSSL_GLOBUS_FLAGS=\\`pkg-config globus-openssl --cflags\\`
- OPENSSL_GLOBUS_LIBS=\\`pkg-config globus-openssl --libs\\`
- EOF";
- $cmd{default}{compile} = "make -C src prefix=\${prefix}$project{local_prefix}
- rm -fv project/debian.changelog";
- $cmd{default}{install} = "make -C src prefix=\${prefix}$project{local_prefix} install-lib
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.so.1
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.so
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.a";
- $cmd{default}{packaging} = "None";
- }
- else {
- $cmd{default}{clean} = 'None';
- $cmd{default}{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this";
- $cmd_vcs{checkout} = "mkdir -v \${moduleName} 2>/dev/null || true";
- }
- }
- elsif ($subsys eq 'px' and $module eq 'myproxy-config') {
- $cmd{default}{configure} = "/usr/bin/perl $confdir/configure --root=\${prefix} --prefix= --stage=\${stageDir} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts";
- $cmd{default}{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config";
- }
- else {
- $cmd{default}{configure} = "/usr/bin/perl $confdir/configure $project{flavours} --root=\${prefix} --prefix=$project{local_prefix} --stage=\${stageDir} --sysroot=\${package.prefix} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts";
- $cmd{default}{compile} = 'make';
- $cmd{default}{test} = 'make check';
- $cmd{default}{install} = 'make install';
- if ($subsys eq 'lb' and $module eq 'client') {
- $cmd{default}{compile} = "make rpath=$project{local_prefix}/\${libdir}";
- $cmd{default}{install} = "make install post-install rpath=$project{local_prefix}/\${libdir}";
- }
- mode_etics_packaging($fmod, \%cmd);
- }
-
- 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 = $project{etics_name}.$subsys.$module
-displayName = $conf
-description = $cvs_prefix{$subsys}.$subsys.$module
-projectName = $project{etics_name}
-age = $age
-deploymentType = None
-vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite
-tag = $conftag
-version = $major.$minor.$rev
-$dwpath
-[Platform-default:VcsCommand]
-displayName = None
-description = None
-tag = $cmd_vcs{tag}
-branch = None
-commit = None
-checkout = $cmd_vcs{checkout}
-
-};
-
- for my $p (keys %cmd) {
- next if $p ne 'default' and exists $project{supported_platforms} and not exists $project{supported_platforms}{$p};
-
- print C qq{[Platform-$p:BuildCommand]
-postpublish = None
-packaging = $cmd{$p}{packaging}
-displayName = None
-description = None
-doc = None
-prepublish = None
-publish = None
-compile = $cmd{$p}{compile}
-init = $cmd{$p}{init}
-install = $cmd{$p}{install}
-clean = $cmd{$p}{clean}
-test = $cmd{$p}{test}
-configure = $cmd{$p}{configure}
-checkstyle = None
-
-};
- }
-
- print C qq{[Platform-default:Property]
-$buildroot
-package.preserve.libtool = false
-$package_description$package_summary$defprops};
-
- for (@{$obsoletes{"$subsys.$module"}}) {
- print C "package.obsoletes = $_\n";
- print C "package.replaces = $_\n";
- }
- for (@{$conflicts{"$subsys.$module"}}) {
- print C "package.conflicts = $_\n";
- }
- for (@{$provides{"$subsys.$module"}}) {
- print C "package.provides = $_\n";
- }
- print C "\n";
-
- for my $pp (keys %{$platform_properties{"$subsys.$module"}}) {
- next if $pp eq 'default';
- next if exists $project{supported_platforms} and not exists $project{supported_platforms}{$pp};
-
- print C "[Platform-$pp:Property]\n$buildroot\n";
-
- for my $p (keys %{$platform_properties{"$subsys.$module"}->{$pp}}) {
- print C $p . ' = ' . $platform_properties{"$subsys.$module"}->{$pp}->{$p} . "\n";
- }
- print C "$package_description$package_summary\n";
- }
-
- for my $platform ('default', keys %{$project{supported_platforms}}) {
- my $used = 0;
- my $output = '';
-
- for (@{$need_externs{"$subsys.$module"}},@{$need_jars{"$subsys.$module"}}) {
- my $eext = $etics_externs{$platform}{$_};
- my $edev = $project{etics_externs_devel}{$platform}{$_};
-
- # for the default platform using package of the same
- # name for runtime dependency
- if (not $eext) {
- if ($platform eq 'default') {
-#print "default runtime $_ on default\n";
- $eext = $_; }
- else {
-#print "no runtime $_ on $platform\n";
- $eext = '-'; }
- }
- if ($eext eq '-' and $edev eq '-') {
-#print "skipping $_ on $platform\n";
- next;
- }
-
- my $proj = 'externals';
- for my $p (keys %etics_projects) {
- for $m (@{$etics_projects{$p}}) {
- $proj = $p if $m eq $_;
- }
- }
-
- my $type = $need_externs_type{"$subsys.$module"}->{$_};
-
- if ($edev) {
- if ($type eq 'B') {
- # no runtime - change to devel pkg
- $eext = $edev;
- } elsif ($type eq 'BR' or $type eq 'RB') {
- # additional devel pkg
- if ($edev ne '-') { $output .= "$proj|$edev = B\n"; }
- }
- }
- if ($eext ne '-') { $output .= "$proj|$eext = $type\n"; }
- }
-
- if ($platform eq 'default') {
- for (@{$deps{"$subsys.$module"}}) {
- my $type = $deps_type{"$subsys.$module"}->{$_};
- if (not $used) {
- $used = 1;
- }
- $output .= "$project{etics_name}|$project{etics_name}.$_ = $type\n";
- }
- }
-
- if ($output) {
- print C qq{
-[Platform-$platform:DynamicDependency]
-$output};
- }
- }
-
- close C;
-
- for $file ("$cvs_module/project/debian.rules", "$cvs_module/project/$packageName.spec") {
- my $lib;
- my $main_module;
- @copts = ();
-
- if ($file =~ /debian\.rules$/) { $lib = 'lib'; }
- else { $lib = '%{_lib}'; }
-
- my $main_module = "$subsys.$module";
- if (exists $subpackages{$main_module}) { $main_module = $subpackages{$main_module}; }
-
- # locations hacks
- if ($file =~ /$packageName\.spec$/) {
- if ($fmod eq 'lb.client-java') {
- push @copts, '';
- push @copts, '--with-axis=/usr/local/axis1.4';
- }
- }
-
- if (-f $file) {
- open DST,">$file.new" or die "$file.new: $!\n";
- open SRC,"<$file" or die "$file: $!\n";
- while (<SRC>) {
- if (/^(\s*).+\/configure\s/) {
- printf DST "%s", "$1";
- printf DST "/usr/bin/perl $confdir/configure $project{flavours} --root=/ --prefix=$project{local_prefix} --libdir=$lib --project=$project --module $main_module@copts\n";
- } else {
- printf DST "%s", "$_";
- }
- }
- close SRC;
- close DST;
-
- `diff -b "$file" "$file.new"`;
- if ($? == 0) {
- print STDERR "($file not changed)\n";
- unlink "$file.new";
- } else {
- print STDERR "Writing $file\n";
- rename "$file", "$file.orig" unless -f "$file.orig";
- rename "$file.new", "$file";
- }
- }
- }
-}
-
-sub gsoap_version {
- local $_;
- my $gsoap_version;
- open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n";
-
- while ($_ = <S>) {
- 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;
-}
-
-sub getlibdir {
- if ( -e "/etc/debian_version") { # We are on Debian
- $lib64="lib";
- $lib32="lib32"; }
- else { # Another distribution
- $lib64="lib64";
- $lib32="lib"; }
- $libdir=$lib32;
-
- open INP, "uname -s | "; # Check kernel name
- $kname= <INP>;
- chomp($kname);
- close INP;
-
- if ( $kname eq "Linux") {
- $arch = ("x86_64\npowerpc\nppc64\n");
-
- open INP, "uname -p | "; # Check processor type
- $procname= <INP>;
- chomp($procname);
- close INP;
-
- if ($arch =~/^$procname\n/) {
- return ($lib64); }
-
- open INP, "uname -m | "; # Check machine hardware
- $machname= <INP>;
- chomp($machname);
- close INP;
-
- if ($arch =~/^$machname\n/) {
- return ($lib64); }
-
- # special cases (hyperlink lib64, Debian)
- if (-l "/usr/lib64") {
- $libdir=$lib32; }
-
- # if /usr/lib64 doesn't exist at all (AIX)
- unless ( -e "/usr/lib64" ) {
- $libdir=$lib32; }
- }
-
- if ( $kname eq "SunOS") {
- if (-e "/usr/lib/64") {
- $libdir="lib/64"; }
- }
-
- return $libdir;
-}
-
-sub reshuffle_platforms($$) {
- my ($data, $platforms) = @_;
- my ($platform, %blacklist, $value);
-
- return if not $platforms;
-
- for $platform (keys %$data) {
-#print "plat: $platform: $data->{$platform}\n";
- next if $platform eq 'default';
- for $_ (keys %{$data->{$platform}}) {
-#print " blacklist: $_ = $data->{$platform}{$_}\n";
- $blacklist{$_} = 1;
- }
- }
-
- for $_ (keys %blacklist) {
- $value = $data->{default}{$_} ? $data->{default}{$_} : $_;
- for $platform (keys %$platforms) {
- next if $platform eq 'default';
- if (not defined $data->{$platform}{$_}) {
- $data->{$platform}{$_} = $value;
-#print "added $value to $platform\n"
- }
- }
- $data->{default}{$_} = '-';
-#print "deleted $_ from default\n";
- }
-
- # merge dependencies across the supported platforms
- %blacklist = [];
- for $platform (keys %$platforms) {
- next if $platform eq 'default';
- for $_ (keys %{$data->{$platform}}) {
- $blacklist{$_} = 1;
- }
- }
- for $_ (keys %blacklist) {
- $value = undef;
- $same = 1;
- for $platform (keys %$platforms) {
- if (not $value) { $value = $data->{$platform}{$_}; }
- if (not $data->{$platform}{$_} or $value ne $data->{$platform}{$_}) {
- $same = 0;
- last;
- }
- }
- if ($same and $value) {
-#print "merged dependency $_\n";
- $data->{default}{$_} = $value;
- for $platform (keys %$platforms) {
- delete $data->{$platform}{$_};
- }
- }
- }
-}
-
-sub usage {
- my @ext = keys %externs;
- my @myjars = keys %jar;
-
- print STDERR qq{
-Usage: $0 options
-
-General options (defaults in []):
- --prefix=PREFIX destination directory [./stage]
- --stage=DIR staging directory [./stage]
- --root=DIR installation root (custom relocation root -> sysroot) [./stage]
- --sysroot=DIR system root (custom relocation root -> sysroot) []
- --sysconfdir=DIR system configuration directory [PREFIX/etc]
- --staged=module,module,... what is already in PREFIX (specify without org.glite.)
- --thrflavour=flavour
- --nothrflavour=flavour threaded and non-treaded flavours [gcc64dbgpthr,gcc64dbg]
- --listmodules=subsys list modules of a subsystem
- --listmodules=module list subpackages of a module
- --version=maj.min.rev-age version used instead of reading version.properties
- --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...)
- --libdir=libdir typically [lib,lib64] postfix
- --project=PROJECT build or generate etics for a project (glite/emi1/emi) [emi]
- --debug print more details
-
-Mode of operation:
- --mode=\{checkout|build|etics\} what to do [build]
-
-What to build:
- --module=module build this module only
- --enable-NODE build this "node" (set of modules) only
- --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
- --jobid-tag=tag checkout jobid modules with specific tag
- --canl-tag=tag checkout canl modules with specific tag
-
-Dependencies (summary of what will be used is always printed):
- --with-EXTERNAL=PATH where to look for an external [autodetect]
- --with-JAR=JAR where to look for jars
-
-Available nodes:
- @nodes
-
-Default nodes:
- @default_nodes
-
-Externals (not all for all modules) are:
- @ext
-
-External jars are:
- @myjars
-
-};
-
-}
+++ /dev/null
-/*
-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.
-*/
-
-#ifndef GLITE_JOBID_JOBID_H
-#define GLITE_JOBID_JOBID_H
-
-#include <string>
-#include <stdexcept>
-#include <new>
-#include <cerrno>
-#include <cassert>
-#include <cstdlib>
-
-#include "glite/jobid/cjobid.h"
-
-
-namespace glite {
-namespace jobid {
-
-
-/**
- * class glite::jobid::JobIdError
- */
-
-class JobIdError : public std::runtime_error {
-public:
- /** Constructor for mandatory fields.
- *
- * Updates all the mandatory fields and names the exception.
- * \param[in] exception Error message describing the exception.
- */
- JobIdError(std::string const& exception)
- : std::runtime_error(std::string("JobId: bad argument (") + exception + ")")
- {}
-
- virtual ~JobIdError() throw()
- {}
-
-};
-
-
-/**
- * class glite::jobid::JobId
- */
-
-class JobId
-{
-public:
- class Hostname {
- public:
- std::string const& name;
- Hostname(std::string const& n) : name(n)
- {}
- };
-
- //@name Constructors/Destructor
- //@{
-
- /**
- * Constructor from string format.
- * @param job_id_string
- * @throws Exception When a string is passed in a wrong format
- */
- JobId(std::string const& job_id_string);
-
- /**
- * Constructor from job id components.
- * \param host
- * \param port
- * \param unique
- */
- explicit JobId(Hostname const& host = Hostname("localhost"),
- int port = GLITE_JOBID_DEFAULT_PORT,
- std::string const& unique = std::string(""));
-
- /**
- * Destructor.
- */
- ~JobId();
-
- //@}
-
- //@ Conversions, assignments, comparisons
- //@{
-
- /**
- * Copy constructor.
- */
- JobId(JobId const&);
-
- /**
- * Constructor from C jobid.
- * \param src C API job id
- */
- explicit JobId(glite_jobid_const_t src);
-
- /**
- * Assignment operator.
- * Create a deep copy of the JobId instance.
- */
- JobId& operator=(JobId const& src);
-
- /**
- * Casting operator.
- */
- glite_jobid_const_t c_jobid() const;
-
- /**
- * Returns the string representing the job id
- * @return String representation of a JobId
- */
- std::string toString() const;
-
-
- /**
- * Comparison given by lexicographical ordering of string representations.
- * @return Result of comparison.
- */
- int operator< (const JobId &j) const;
- //@}
-
-
- /**@name Member access
- * @{
- */
-
- /**
- * Get server:port.
- * @return hostname and port
- */
- std::string server() const;
-
- /**
- * Get host.
- * @return hostname
- */
- std::string host() const;
-
- /**
- * Get port.
- * @return port
- */
- int port() const;
-
- /**
- * Get unique.
- * @return unique string
- */
- std::string unique() const;
-
- //@}
-
-private:
- glite_jobid_t m_jobid;
-};
-
-
-
-// -------------------- implementation ------------------------
-
-inline
-JobId::JobId(std::string const& job_id_string)
-{
- int ret = glite_jobid_parse(job_id_string.c_str(),
- &m_jobid);
- switch(ret) {
- case EINVAL:
- throw JobIdError(job_id_string);
-
- case ENOMEM:
- throw std::bad_alloc();
-
- default:
- break;
- }
-}
-
-
-inline
-JobId::JobId(JobId::Hostname const& host, int port, std::string const& unique)
-{
- if(port < 0) {
- throw JobIdError("negative port");
- }
-
- int ret = glite_jobid_recreate(host.name.c_str(), port,
- unique.empty() ? NULL : unique.c_str(),
- &m_jobid);
- switch(ret) {
- case EINVAL:
- throw JobIdError(host.name);
-
- case ENOMEM:
- throw std::bad_alloc();
-
- default:
- break;
- }
-}
-
-
-inline
-JobId::~JobId() {
- glite_jobid_free(m_jobid);
-}
-
-
-inline
-JobId::JobId(JobId const& src)
-{
- int ret = glite_jobid_dup(src.m_jobid,
- &m_jobid);
- if(ret) {
- // we rely on dup returning only ENOMEM on error
- assert(ret == ENOMEM);
- throw std::bad_alloc();
- }
-}
-
-
-inline
-JobId::JobId(glite_jobid_const_t src)
-{
- if(src == NULL) {
- throw JobIdError("null");
- }
-
- int ret = glite_jobid_dup(src,
- &m_jobid);
- if(ret) {
- throw std::bad_alloc();
- }
-}
-
-
-inline
-JobId&
-JobId::operator=(JobId const& src)
-{
- if(this == &src) {
- return *this;
- }
-
- glite_jobid_free(m_jobid);
- int ret = glite_jobid_dup(src.m_jobid,
- &m_jobid);
- if(ret) {
- throw std::bad_alloc();
- }
- return *this;
-}
-
-
-inline
-glite_jobid_const_t
-JobId::c_jobid() const
-{
- return m_jobid;
-}
-
-
-inline
-std::string
-JobId::toString() const
-{
- char *out = glite_jobid_unparse(m_jobid);
- std::string res(out);
-
- free(out);
- return res;
-}
-
-
-inline
-int
-JobId::operator< (const JobId &j) const
-{
- std::string me(toString());
- std::string js(j.toString());
-
- return(me < js);
-}
-
-
-inline
-std::string
-JobId::server() const
-{
- char *server = glite_jobid_getServer(m_jobid);
- std::string res(server);
-
- free(server);
- return res;
-}
-
-
-inline
-std::string
-JobId::host() const
-{
- char *name;
- unsigned int port;
-
- glite_jobid_getServerParts_internal(m_jobid,
- &name, &port);
- return std::string(name);
-}
-
-
-inline
-int
-JobId::port() const
-{
- char *name;
- unsigned int port;
-
- glite_jobid_getServerParts_internal(m_jobid,
- &name, &port);
- return port;
-}
-
-
-inline
-std::string
-JobId::unique() const
-{
- char *unique = glite_jobid_getUnique_internal(m_jobid);
- std::string res(unique);
-
- return res;
-}
-
-
-} // namespace jobid
-} // namespace glite
-
-#endif // GLITE_JOBID_JOBID_H
+++ /dev/null
-1.0.0-1
-- initial release
-
-1.0.0-2
-- fixes in etics' invocation of configure
-
-1.0.0-4
-- configure script update
-- compatibility with g++ 4.3.2
-
-1.0.0-5
-- module rebuilt
-
-1.0.0-6
-- module rebuilt
-
-1.0.1-1
-- Fixed target 'clean' in the Makefile
-
-1.0.1-2
-- Module rebuilt
-
-1.0.1-3
-- Module rebuilt
-
-1.1.0-1
-- Fixes for parallel release in EMI & gLite
-
-1.1.0-2
-- Module rebuilt
-
-1.1.1-1
-- Root directory option (ETICS performs own files relocation)
-- Prefix option as prefix inside stage
-- Sysconfdir option (for /etc vs /usr)
-- DESTDIR in makefiles
-
-1.1.2-1
-- Relocatable build directory.
-
-1.1.2-2
-- Module rebuilt
-
-1.1.2-3
-- Module rebuilt
-
-1.1.2-4
-- Module rebuilt
-
-1.1.2-5
-- Module rebuilt
-
-1.1.2-6
-- Module rebuilt
-
-1.1.3-1
-- experiments with staging in summary Makefile in etics-less build
-
-1.1.3-2
-- Module rebuilt
-
-1.2.0-1
-- Preparation for a new multiplatform release
-
-1.2.0-2
-- Module rebuilt
-
-1.2.0-3
-- Module rebuilt
-
-1.2.0-4
-- Module rebuilt
-
-1.2.0-5
-- Module rebuilt
-
+++ /dev/null
-Source: glite-jobid-api-cpp
-Priority: extra
-Maintainer: @MAINTAINER@
-Uploaders: @UPLOADERS@
-Build-Depends: debhelper (>= 7.0.50~), libglite-jobid-api-c-dev, libcppunit-dev, libtool
-Standards-Version: 3.9.1
-Section: libs
-Homepage: @URL@
-DM-Upload-Allowed: yes
-@DEBIAN_VCS@
-
-Package: libglite-jobid-api-cpp-dev
-Section: libdevel
-Architecture: any
-Depends: libglite-jobid2, ${misc:Depends}
-Provides: glite-jobid-api-cpp
-Description: @SUMMARY@
-@DEBIAN_DESCRIPTION@
+++ /dev/null
-This work was packaged for Debian by:
-
- @MAINTAINER@ on Thu, 08 Dec 2011 00:46:07 +0100
-
-It was downloaded from:
-
- @URL@
-
-Upstream Author(s):
-
- @MAINTAINER@
-
-Copyright:
-
- <Copyright (C) 2004-2011 Members of the EGEE Collaboration>
-
-License:
-
- 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.
-
-On Debian systems, the complete text of the Apache version 2.0 license
-can be found in "/usr/share/common-licenses/Apache-2.0".
-
-The Debian packaging is:
-
- Copyright (C) 2004-2011 Members of the EGEE Collaboration
-
-and is licensed under the Apache License, Version 2.0.
+++ /dev/null
-usr/include/glite/jobid
+++ /dev/null
-usr/include/glite/jobid/*.h
+++ /dev/null
-#!/usr/bin/make -f
-# -*- makefile -*-
-
--include /usr/share/dpkg/buildflags.mk
-
-# Uncomment this to turn on verbose mode.
-export DH_VERBOSE=1
-
-configure: configure-stamp
-configure-stamp:
- dh_testdir
- /usr/bin/perl ./configure --thrflavour= --nothrflavour= --root=/ --prefix=/usr --libdir=lib --project=emi --module jobid.api-cpp
- touch $@
-
-build: build-arch build-indep
-
-build-arch build-indep: build-stamp
-
-build-stamp: configure-stamp
- dh_testdir
- CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE)
- CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) check
- touch $@
-
-clean: configure-stamp
- dh_testdir
- dh_testroot
- rm -f configure-stamp build-stamp
- $(MAKE) clean
- rm -f Makefile.inc config.status
- dh_clean
-
-install: build-stamp
- dh_testdir
- dh_testroot
- dh_prep
- dh_installdirs
- $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
-
-binary-indep:
-
-binary-arch: install
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_installexamples
- dh_installman
- dh_installlogrotate
- dh_installcron
- dh_install --fail-missing
- dh_link
- dh_compress
- dh_fixperms
- dh_makeshlibs
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-arch binary-indep
+++ /dev/null
-Summary: Virtual package for development with gLite jobid C++ API
-Name: glite-jobid-api-cpp
-Version: @MAJOR@.@MINOR@.@REVISION@
-Release: @AGE@%{?dist}
-Url: @URL@
-License: ASL 2.0
-Vendor: EMI
-Group: Development/Libraries
-BuildRequires: glite-jobid-api-c-devel
-BuildRequires: libtool
-BuildRequires: cppunit-devel
-BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
-AutoReqProv: yes
-Source: http://eticssoft.web.cern.ch/eticssoft/repository/emi/emi.jobid.api-c/%{version}/src/%{name}-@VERSION@.src.tar.gz
-
-
-%description
-This is a virtual package providing runtime and development files for gLite
-jobid C++ API.
-
-
-%package devel
-Summary: @SUMMARY@
-Group: Development/Libraries
-Requires: glite-jobid-api-c%{?_isa}
-Provides: %{name} = %{version}-%{release}
-
-
-%description devel
-@DESCRIPTION@
-
-
-%prep
-%setup -q
-
-
-%build
-/usr/bin/perl ./configure --thrflavour= --nothrflavour= --root=/ --prefix=/usr --libdir=%{_lib} --project=emi --module jobid.api-cpp
-make
-
-
-%check
-make check
-
-
-%install
-rm -rf $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
-find $RPM_BUILD_ROOT -name '*.la' -exec rm -rf {} \;
-find $RPM_BUILD_ROOT -name '*.a' -exec rm -rf {} \;
-
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
-%files devel
-%defattr(-,root,root)
-%dir /usr/include/glite
-%dir /usr/include/glite/jobid
-/usr/include/glite/jobid/JobId.h
-
-
-%changelog
-* @SPEC_DATE@ @MAINTAINER@ - @MAJOR@.@MINOR@.@REVISION@-@AGE@%{?dist}
-- automatically generated package
+++ /dev/null
-C++ API handling gLite jobid. It is a thin wrapper of the C implementation (glite-jobid-api-c).
+++ /dev/null
-C++ API handling gLite jobid
+++ /dev/null
-# : /cvs/glite/org.glite.jobid.api-cpp/project/version.properties,v 1.1 2009/01/16 08:48:52 zsustr Exp $
-module.version=1.2.0
-module.age=5
+++ /dev/null
-top_srcdir=.
-stagedir=../stage
-
--include Makefile.inc
-
-ANT_ARGS=-f ${top_srcdir}/build.xml -Dfile.reference.commons-codec.jar=${jakarta-commons-codec_jar} -Dsrc.dir=${top_srcdir}/src -Dbuild.dir=$(shell pwd)/build -Ddist.dir=$(shell pwd)/dist
-
-all compile:
- ${ant_prefix}/bin/ant ${ANT_ARGS}
-
-stage:
- $(MAKE) install PREFIX=${stagedir}
-
-install:
- mkdir -p ${DESTDIR}${PREFIX}${prefix}/share/java
- cp dist/jobid-api-java.jar ${DESTDIR}${PREFIX}${prefix}/share/java
-
-check:
-
-clean:
- ${ant_prefix}/bin/ant ${ANT_ARGS} clean
-
-distclean:
- rm -rvf Makefile.inc *.spec debian/
-
-.PHONY: all compile stage install check clean distclean
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- You may freely edit this file. See commented blocks below for -->
-<!-- some examples of how to customize the build. -->
-<!-- (If you delete it and reopen the project it will be recreated.) -->
-<project name="jobid-api-java" default="default" basedir=".">
- <description>Builds, tests, and runs the project jobid-api-java.</description>
- <import file="nbproject/build-impl.xml"/>
- <!--
-
- There exist several targets which are by default empty and which can be
- used for execution of your tasks. These targets are usually executed
- before and after some main targets. They are:
-
- -pre-init: called before initialization of project properties
- -post-init: called after initialization of project properties
- -pre-compile: called before javac compilation
- -post-compile: called after javac compilation
- -pre-compile-single: called before javac compilation of single file
- -post-compile-single: called after javac compilation of single file
- -pre-compile-test: called before javac compilation of JUnit tests
- -post-compile-test: called after javac compilation of JUnit tests
- -pre-compile-test-single: called before javac compilation of single JUnit test
- -post-compile-test-single: called after javac compilation of single JUunit test
- -pre-jar: called before JAR building
- -post-jar: called after JAR building
- -post-clean: called after cleaning build products
-
- (Targets beginning with '-' are not intended to be called on their own.)
-
- Example of inserting an obfuscator after compilation could look like this:
-
- <target name="-post-compile">
- <obfuscate>
- <fileset dir="${build.classes.dir}"/>
- </obfuscate>
- </target>
-
- For list of available properties check the imported
- nbproject/build-impl.xml file.
-
-
- Another way to customize the build is by overriding existing main targets.
- The targets of interest are:
-
- -init-macrodef-javac: defines macro for javac compilation
- -init-macrodef-junit: defines macro for junit execution
- -init-macrodef-debug: defines macro for class debugging
- -init-macrodef-java: defines macro for class execution
- -do-jar-with-manifest: JAR building (if you are using a manifest)
- -do-jar-without-manifest: JAR building (if you are not using a manifest)
- run: execution of project
- -javadoc-build: Javadoc generation
- test-report: JUnit report generation
-
- An example of overriding the target for project execution could look like this:
-
- <target name="run" depends="jobid-api-java-impl.jar">
- <exec dir="bin" executable="launcher.exe">
- <arg file="${dist.jar}"/>
- </exec>
- </target>
-
- Notice that the overridden target depends on the jar target and not only on
- the compile target as the regular run target does. Again, for a list of available
- properties which you can use, check the target you are overriding in the
- nbproject/build-impl.xml file.
-
- -->
-</project>
+++ /dev/null
-#!/usr/bin/perl
-
-# WARNING: Don't edit this file unless it is the master copy in org.glite.lb
-#
-# For the purpose of standalone builds of lb/jobid/lbjp-common components
-# it is copied on tagging
-
-# $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.
-#
-
-use Getopt::Long;
-use POSIX qw(locale_h strftime);
-
-my $pwd = `pwd`; chomp $pwd;
-my $prefix = '/usr';
-my $stagedir = undef;
-my $root = $pwd.'/stage';
-my $sysroot = '';
-my $sysconfdir;
-my $localstatedir;
-my $staged;
-my $module;
-my $thrflavour = 'gcc64dbgpthr';
-my $nothrflavour = 'gcc64dbg';
-my $mode = 'build';
-my $help = 0;
-my $listmodules;
-my ($version, $force_version);
-my $branch;
-my $output;
-my $lb_tag = '';
-my $lbjp_tag = '';
-my $jp_tag = '';
-my $jobid_tag = '';
-my $libdir = getlibdir();
-my $project = 'emi';
-my $project_version;
-my (%projects, %project);
-my $debug = 0;
-my $pkg_config_env = (defined $ENV{PKG_CONFIG_PATH}) ? "$ENV{PKG_CONFIG_PATH}:" : '';
-
-my @nodes = qw/client server logger logger-msg nagios utils client-java doc ws-test db jpprimary jpindex jpclient harvester lb px proxyrenewal/;
-my @default_nodes = qw/lb px proxyrenewal nagios/;
-my %enable_nodes;
-my %disable_nodes;
-my %default_nodes; @default_nodes{@default_nodes} = (1) x ($#default_nodes + 1);
-
-my %package = (
- 'maintainer' => 'CESNET Product Teams <emi-lb@metacentrum.cz>',
- 'uploaders' => 'František Dvořák <valtri@civ.zcu.cz>',
- 'url' => 'http://glite.cern.ch',
- 'debian_vcs' => 'Vcs-Cvs: :pserver:anonymous@jra1mw.cvs.cern.ch:/cvs/jra1mw
-Vcs-Browser: http://jra1mw.cvs.cern.ch/cgi-bin/jra1mw.cgi',
-);
-
-# key: internal package name (arguments, ...)
-# 'pkg': pkg-config name
-# 'prefix': used when pkg-config fails
-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-devel' => {
- prefix=> '/opt/globus',
- pkg => 'myproxy'
- },
- 'myproxy-server' => {
- prefix=> '',
- },
- 'myproxy-admin' => {
- prefix=> '',
- },
- gsoap => {
- prefix=> '/usr',
- pkg => 'gsoap'
- },
- gsoapxx => {
- prefix=> '/usr',
- pkg => 'gsoap++'
- },
- mysql => {
- prefix=> '/usr'
- },
- 'mysql-devel' => {
- prefix=> ''
- },
- 'mysql-server' => {
- prefix => ''
- },
- voms => {
- prefix => '/opt/glite',
- pkg => 'voms-2.0'
- },
- gridsite => {
- prefix => '/opt/glite'
- },
- lcas => {
- prefix => '/opt/glite',
- pkg => 'lcas'
- },
- trustmanager => {
- prefix => '/opt/glite'
- },
- trustmanager_axis => {
- prefix => '/opt/glite'
- },
- utiljava => {
- prefix=> '/opt/glite'
- },
- ant => {
- prefix=> '/usr'
- },
- jdk => {
- prefix=> '/usr/java/latest',
- locations => [ '/usr/lib/jvm/java', '/usr/lib/jvm/default-java', '/usr/java/latest' ],
- },
- libtar => {
- prefix=> '/usr'
- },
- axis => {
- prefix=> '/usr'
- },
- log4c => {
- prefix=> '/usr'
- },
- postgresql => {
- prefix=> '/usr'
- },
- activemq => {
- prefix=>'/opt/activemq-cpp-library',
- pkg => 'activemq-cpp'
- },
-);
-
-my %jar = (
- 'jakarta-commons-codec' => '/usr/share/java/commons-codec.jar',
- 'jakarta-commons-lang' => '/usr/share/java/commons-lang.jar',
-);
-
-
-my %glite_prefix;
-my %need_externs;
-my %need_externs_type;
-my %need_jars;
-my %extrafull;
-my %extranodmod;
-my %deps;
-my %deps_type;
-my %buildroot;
-my (%etics_externs, %etics_projects);
-
-#
-# modules of the subsystems
-#
-# additional modules from $project{modules} are automatically added
-#
-my %lbmodules = (
- 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim logger-msg nagios client-devel client-progs common-devel logger-devel state-machine-devel/],
- 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin db-devel log-devel maildir-devel server-bones-devel trio-devel jp-interface-devel gss-devel gsoap-plugin-devel/],
- 'jobid' => [qw/api-c api-c-devel api-cpp api-cpp-devel api-java/],
- 'jp' => [ qw/client doc index primary server-common ws-interface/ ],
- 'gridsite' => [ qw/apache libs commands core devel slashgrid services service-clients gsexec/ ],
- 'px' => [ qw/proxyrenewal myproxy-yaim proxyrenewal-devel proxyrenewal-progs/ ],
- 'canl' => [ qw/c c-devel/ ],
- );
-
-#
-# sub-packages
-#
-# modify %lbmodules, %deps_aux, %extrafull, and %properties accodingly
-#
-my %subpackages = (
- 'jobid.api-c-devel' => 'jobid.api-c',
- 'jobid.api-cpp-devel' => 'jobid.api-cpp',
- 'lbjp-common.db-devel' => 'lbjp-common.db',
- 'lbjp-common.gsoap-plugin-devel' => 'lbjp-common.gsoap-plugin',
- 'lbjp-common.gss-devel' => 'lbjp-common.gss',
- 'lbjp-common.jp-interface-devel' => 'lbjp-common.jp-interface',
- 'lbjp-common.log-devel' => 'lbjp-common.log',
- 'lbjp-common.maildir-devel' => 'lbjp-common.maildir',
- 'lbjp-common.server-bones-devel' => 'lbjp-common.server-bones',
- 'lbjp-common.trio-devel' => 'lbjp-common.trio',
- 'lb.client-progs' => 'lb.client',
- 'lb.client-devel' => 'lb.client',
- 'lb.common-devel' => 'lb.common',
- 'lb.logger-devel' => 'lb.logger',
- 'lb.state-machine-devel' => 'lb.state-machine',
- 'px.proxyrenewal-devel' => 'px.proxyrenewal',
- 'px.proxyrenewal-progs' => 'px.proxyrenewal',
- 'canl.c-devel' => 'canl.c',
-);
-
-my @opts = (
- 'prefix:s' => \$prefix,
- 'staged=s' => \$staged,
- 'module=s' => \$module,
- 'thrflavour:s' => \$thrflavour,
- 'nothrflavour:s' => \$nothrflavour,
- 'mode=s' => \$mode,
- 'listmodules=s' => \$listmodules,
- 'version=s' => \$force_version,
- 'branch=s' => \$branch,
- 'output=s' => \$output,
- 'stage=s' => \$stagedir,
- 'root:s' => \$root,
- 'sysroot:s' => \$sysroot,
- 'sysconfdir=s' => \$sysconfdir,
- 'localstatedir=s' => \$localstatedir,
- 'lb-tag=s' => \$lb_tag,
- 'lbjp-common-tag=s' => \$lbjp_tag,
- 'jp-tag=s' => \$jp_tag,
- 'jobid-tag=s' => \$jobid_tag,
- 'canl-tag=s' => \$canl_tag,
- 'help' => \$help,
- 'libdir=s' => \$libdir,
- 'project=s' => \$project,
- 'debug' => \$debug,
-);
-
-for (@nodes) {
- $enable_nodes{$_} = 0;
- $disable_nodes{$_} = 0;
-
- push @opts,"disable-$_",\$disable_nodes{$_};
- push @opts,"enable-$_",\$enable_nodes{$_};
-}
-
-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";
-$prefix=~s/\/$//;
-$root=~s/\/$//;
-$sysroot=~s/\/$//;
-if (not $sysconfdir) { $sysconfdir = $prefix eq '/usr' ? '/etc' : "$prefix/etc"; }
-if (not $localstatedir) { $localstatedir = $prefix eq '/usr' ? '/var' : "$prefix/var"; }
-$sysconfdir=~s/\/$//;
-$localstatedir=~s/\/$//;
-
-$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq '';
-$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq '';
-$externs{'gsoapxx'}{prefix}=$externs{gsoap}{prefix} if $externs{'gsoapxx'}{prefix} eq '';
-
-$externs{'mysql-server'}{withprefix}=$externs{mysql}{withprefix} if $externs{'mysql-server'}{withprefix} eq '';
-$externs{'mysql-devel'}{wihtprefix}=$externs{mysql}{withprefix} if $externs{'mysql-devel'}{withprefix} eq '';
-$externs{'gsoapxx'}{withprefix}=$externs{gsoap}{withprefix} if $externs{'gsoapxx'}{withprefix} eq '';
-
-if ($project =~ /^([^0-9]*)(.*)$/) {
- $project = $1;
- $project_version = $2;
-}
-%project = %{$projects{$project}};
-$project_version = $project{current_version} unless $project_version;
-for my $platform (keys %{$project{etics_externs}}) {
- for $_ (keys %{$project{etics_externs}{$platform}}) {
- $etics_externs{$platform}{$_} = $project{etics_externs}{$platform}{$_};
- }
-}
-reshuffle_platforms(\%etics_externs, $project{supported_platforms});
-reshuffle_platforms(\%{$project{etics_externs_devel}}, $project{supported_platforms});
-for $_ (keys %{$project{etics_projects}}) {
- $etics_projects{$_} = $project{etics_projects}{$_};
-}
-for $_ (keys %{$project{need_externs_aux}}) {
- $need_externs_aux{$_} = $project{need_externs_aux}{$_};
-}
-for my $ext (keys %need_externs_aux) {
- for (@{$need_externs_aux{$ext}}) {
- my ($pkg, $type) =/([^:]*)(?::(.*))?/;
- $type = 'BR' unless ($type);
-
- push @{$need_externs{$ext}},$pkg;
- $need_externs_type{$ext}->{$pkg} = $type;
- }
-}
-if ($project eq 'emi') {
- $extranodmod{lb} = 'lb.emi-lb';
- $extranodmod{px} = 'px.emi-px';
-}
-for $_ (keys %{$project{modules}}) {
- push @{$lbmodules{$_}},@{$project{modules}{$_}};
-}
-
-
-if ($help) { usage(); exit 0; }
-
-if ($listmodules) {
- my $name_prefix = ($listmodules eq 'gridsite' and $project eq 'glite') ? 'org' : $project{etics_name};
- my @m;
-
- if (exists $lbmodules{$listmodules}) {
- @m = map exists $subpackages{$listmodules . '.' . $_} ? "" : "$name_prefix.$listmodules.$_",@{$lbmodules{$listmodules}};
- } else {
- if ($project eq 'emi' and $project_version == 1) {
- # no sub-packages in EMI-1
- } else {
- for my $sub (keys %subpackages) {
- push @m, $sub if ($subpackages{$sub} eq $listmodules);
- }
- }
- }
- print map $_ eq "" ? "" : "$_ ", @m;
- print "\n";
- exit 0;
-}
-
-warn "$0: --branch and --output make sense only in --mode=etics\n"
- if ($output || $branch) && $mode ne 'etics';
-
-my $en;
-for (keys %enable_nodes) { $en = 1 if $enable_nodes{$_}; }
-
-my $dis;
-for (keys %disable_nodes) { $dis = 1 if $disable_nodes{$_}; }
-
-die "--enable-* and --disable-* are mutually exclusive\n"
- if $en && $dis;
-
-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{jp}};
-
-if ($dis) {
- for (@nodes) {
- $enable_nodes{$_} = 1 unless ($disable_nodes{$_} or not $default_nodes{$_});
- }
-}
-
-if (!$en && !$dis) { for (@nodes) { $enable_nodes{$_} = 1 if ($default_nodes{$_}) } };
-
-for (keys %enable_nodes) { delete $enable_nodes{$_} unless $enable_nodes{$_}; }
-
-$stagedir = $root unless $stagedir;
-$stagedir=~s/\/$// if ($stagedir);
-
-if ($mode eq 'build') { for my $ext (keys %externs) {
- if (defined $externs{$ext} and defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; }
- elsif (defined $externs{$ext}{pkg}) {
- my ($flag, $env, $cmd, $ret);
- my $pkg = $externs{$ext}{pkg};
- my $flagname = uc $externs{$ext}{pkg};
- $flagname =~ s/-[0-9\.]*$//;
- $flagname =~ y/-\+/_X/;
-
- print "Checking $pkg ... ";
- $env = "PKG_CONFIG_PATH=$pkg_config_env$stagedir$prefix/$libdir/pkgconfig";
- $cmd = "$env pkg-config $pkg --exists >/dev/null";
- `$cmd`; $ret = $?;
- print "('$cmd' => $ret)\n" if ($debug);
- if ($ret == 0) {
- $externs{$ext}{prefix}=`$env pkg-config $pkg --variable=prefix`;
- chomp $externs{$ext}{prefix};
- print "$externs{$ext}{prefix}\n";
-
- $flag=`$env pkg-config $pkg --cflags`;
- $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag);
- $flag=`$env pkg-config $pkg --libs`;
- $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag);
- } else {
- print "(using default $externs{$ext}{prefix})\n";
- }
- print "\n" if ($debug);
- }
- elsif ($ext eq 'jdk') {
- my $jdk_prefix;
-
- print "Looking for some caffein ... ";
- if (defined $ENV{'JDK_HOME'}) {
- $jdk_prefix = $ENV{'JDK_HOME'};
- print "JDK_HOME=$jdk_prefix\n";
- } elsif (defined $ENV{'JAVA_HOME'}) {
- $jdk_prefix = $ENV{'JAVA_HOME'};
- print "JAVA_HOME=$jdk_prefix\n";
- } else {
- foreach my $i (0..$#{$externs{$ext}{locations}}) {
- if (-e $externs{$ext}{locations}[$i]) {
- $jdk_prefix=$externs{$ext}{locations}[$i];
- print "(found directory $jdk_prefix)\n";
- last;
- }
- }
- print "(using default $externs{$ext}{prefix})\n" unless ($jdk_prefix);
- }
- $externs{$ext}{prefix} = $jdk_prefix if ($jdk_prefix);
- }
-} }
-
-if ($mode eq 'build') {
- print "Writing config.status\n";
- open CONF,">config.status" or die "config.status: $!\n";
- for ('JDK_HOME', 'JAVA_HOME', 'PKG_CONFIG_PATH') {
- print CONF "$_=$ENV{$_} " if (defined $ENV{$_});
- }
- print CONF "$0 @keeparg\n";
- close CONF;
-}
-
-
-my @modules;
-my %aux;
-
-if ($module) {
-# push @modules,split(/[,.]+/,$module);
- push @modules,$module;
-}
-else {
- @modules = map(($extranodmod{$_} ? $extranodmod{$_} : 'lb.'.$_),(keys %enable_nodes));
-
- my $n;
-
- do {
- local $"="\n";
- $n = $#modules;
- push @modules,(map @{$deps{$_}},@modules);
-
- undef %aux; @aux{@modules} = (1) x ($#modules+1);
- @modules = keys %aux;
- } while ($#modules > $n);
-}
-
-@aux{@modules} = (1) x ($#modules+1);
-delete $aux{$_} for (split /,/,$staged);
-@modules = keys %aux;
-
-mode_build() if $mode eq 'build';
-mode_checkout() if $mode eq 'checkout';
-mode_etics($module) if $mode eq 'etics';
-
-sub mode_build {
- print "\nBuilding modules: @modules\n";
- print "Mode: "; print $module ? "single module" : "multiple modules"; print "\n";
-
- my @ext = map @{$need_externs{$_}},@modules;
- my @myjars = map @{$need_jars{$_}},@modules;
- undef %aux; @aux{@ext} = 1;
- @ext = keys %aux;
- undef %aux; @aux{@myjars} = (1) x ($#myjars+1);
- @myjars = keys %aux;
-
- print "\nRequired externals:\n";
- print "\t$_: ".($externs{$_}{prefix}?$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;
-
- if ($module) {
- print "Not creating summary Makefile\n" if $debug;
- } else {
- print "Creating Makefile\n";
-
- open MAK,">Makefile" or die "Makefile: $!\n";
-
- print MAK "all: @modules\n\n";
- print MAK "stage: ".(join '-stage ', @modules)."-stage\n\n";
- print MAK "clean check install:\n";
-
- for (@modules) {
- my $full = full($_);
- print MAK "\tcd $full/$buildroot{$_} && \${MAKE} \$@\n"
- }
-
- print MAK "\ndistclean:\n";
-
- for (@modules) {
- my $full = full($_);
- print MAK $buildroot{$_} eq '' ?
- "\tcd $full && \${MAKE} distclean\n" :
- "\trm -rf $full/$buildroot{$_}\n"
- }
-
- print MAK "\n";
-
- for (@modules) {
- my %ldeps; undef %ldeps;
- @ldeps{@{$deps{$_}}} = 1;
- for my $x (split /,/,$staged) { delete $ldeps{$x}; }
- my @dnames = $module ? () : keys %ldeps;
- my $snames = $#dnames == -1 ? '' : join('-stage ', @dnames).'-stage';
-
- my $full = full($_);
- my $build = $buildroot{$_};
-
- print MAK "$_: @dnames\n\tcd $full/$build && \${MAKE} && \${MAKE} install\n\n";
- print MAK "$_-stage: $snames\n\tcd $full/$build && \${MAKE} && \${MAKE} stage\n\n";
- }
-
- close MAK;
- }
-}
-
-sub mode_checkout() {
- for (@modules) {
- my $module = $_;
- my $tag = "";
- if ($lb_tag){
- for (@{$lbmodules{lb}}){
- if ("lb.".$_ eq $module){
- $tag = '-r '.$lb_tag;
- }
- }
- }
- if ($lbjp_tag) {
- for (@{$lbmodules{'lbjp-common'}}){
- if ("lbjp-common.".$_ eq $module){
- $tag = '-r '.$lbjp_tag;
- }
- }
- }
- if ($jp_tag){
- for (@{$lbmodules{'jp'}}){
- if ("jp.".$_ eq $module){
- $tag = '-r '.$jp_tag;
- }
- }
- }
- if ($jobid_tag){
- for (@{$lbmodules{jobid}}){
- if ("jobid.".$_ eq $module){
- $tag = '-r '.$jobid_tag;
- }
- }
- }
- if ($canl_tag) {
- for (@{$lbmodules{'canl'}}){
- if ("canl.".$_ eq $module){
- $tag = '-r '.$canl_tag;
- }
- }
- }
- #if (grep {"lb.".$_ eq $module} @{$lbmodules{lb}}){
- # print "found";
- #}
- $_ = full($_);
- print "\n*** Checking out $_\n";
- system("cvs checkout $tag $_") == 0 or die "cvs checkout $tag $_: $?\n";
- }
-}
-
-BEGIN{
-%etics_externs = (
- default => {
- 'myproxy-devel'=>'myproxy-devel',
- 'myproxy-server'=>'myproxy-server',
- 'myproxy-admin'=>'myproxy-admin',
- cares=>'c-ares',
- utiljava=>'org.glite.security.util-java',
- gpt=>'gpt',
- fetchcrl=>'fetch-crl',
- activemq=>'activemq-cpp-library',
- },
-);
-
-%etics_projects = (
-);
-
-%need_externs_aux = (
- 'lb.client' => [ qw/cppunit:B classads libtool:B globus:B/ ],
- 'lb.common' => [ qw/expat cares:B cppunit:B classads libtool:B globus:B/ ],
- 'lb.doc' => [ qw/tetex-latex:B/ ],
- 'lb.logger' => [ qw/cppunit:B libtool:B globus:B/ ],
- 'lb.logger-msg' => [ qw/cppunit:B activemq libtool:B globus:B/ ],
- 'lb.nagios' => [ qw/globus_proxy_utils:R/ ],
- 'lb.server' => [ qw/globus_essentials:R globus:B expat cares mysql-server:R cppunit:B gsoap:B classads voms:B lcas gridsite:B bison:B libtool:B libxml2 flex:B/ ],
- 'lb.state-machine' => [ qw/classads libtool:B libxslt:B expat:B globus:B/ ],
- 'lb.utils' => [ qw/cppunit:B libtool:B globus:B/ ],
- 'lb.ws-interface' => [ qw/libxslt:B tidy:B/ ],
- 'lb.ws-test' => [ qw/gsoap:B libtool:B globus:B/ ],
- 'lb.types' => [ qw// ],
- 'lb.harvester' => [ qw/docbook-utils:B libtool:B globus:B/ ],
- 'lbjp-common.db' => [ qw/mysql-devel:B postgresql:B cppunit:B log4c:B libtool:B/ ],
- 'lbjp-common.log' => [ qw/log4c libtool:B/ ],
- 'lbjp-common.maildir' => [ qw/libtool:B/ ],
- 'lbjp-common.server-bones' => [ qw/libtool:B/ ],
- 'lbjp-common.trio' => [ qw/cppunit:B libtool:B/ ],
- 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B libtool:B/ ],
- 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B libtool:B/ ],
- 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap gsoapxx libtool:B/ ],
- 'jobid.api-c' => [ qw/cppunit:B libtool:B openssl:B/ ],
- 'jobid.api-cpp' => [ qw/cppunit:B libtool:B/ ],
- 'jobid.api-java' => [ qw/ant:B jdk:B/ ],
- 'jp.client' => [ qw/gsoap libtar globus_essentials:R globus:B/ ],
- 'jp.doc' => [],
- 'jp.index' => [ qw/gsoap globus_essentials:R globus:B mysql-server:R/ ],
- 'jp.primary' => [ qw/classads gsoap libtar globus_essentials:R globus:B mysql-server:R/ ],
- 'jp.server-common' => [],
- 'jp.ws-interface' => [],
- 'gridsite.core' => [ qw/httpd-devel:B gsoap:B globus:B curl:B doxygen:B fuse-devel:B libxml2:B openssl:B doxygen:B/ ],
- 'gridsite.commands' => [ qw/curl:R openssl:R/ ],
- 'gridsite.apache' => [ qw/libxml2:R openssl:R curl:R/ ],
- 'gridsite.libs' => [ qw/libxml2:R openssl:R/ ],
- 'gridsite.devel' => [ qw// ],
- 'gridsite.slashgrid' => [ qw/curl:R fuse:R/],
- 'gridsite.services' => [ qw/curl:R gsoap:R/ ],
- 'gridsite.service-clients' => [ qw/curl:R gsoap:R gsoapxx:R/ ],
- 'gridsite.gsexec' => [ qw// ],
- 'gridsite.1.5-compat' => [ qw/httpd-devel:B gsoap:B globus:B curl:B doxygen:B fuse-devel:B libxml2:B openssl:B doxygen:B/ ],
- 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-devel:B voms:B libtool:B/ ],
- 'px.myproxy-config' => [ qw/myproxy-admin:R/ ], # in myproxy-config.spec
- 'canl.c' => [ qw/cares:B openssl:B libtool:B bison:B flex:B krb5-devel:B/ ],
-);
-
-%need_jars = (
- 'jobid.api-java' => [ qw/jakarta-commons-codec/ ],
- 'lb.client-java' => [ qw/jakarta-commons-lang/ ],
-);
-
-for my $jar (keys %need_jars) {
- for (@{$need_jars{$jar}}) {
- $need_externs_type{$jar}->{$_} = 'BR'; # XXX
- }
-}
-
-%deps_aux = (
- 'lb.client' => [ qw/
- lb.types:B lb.common
- lbjp-common.trio
- jobid.api-cpp:B jobid.api-c
- lbjp-common.gss
- / ],
- 'lb.client-java' => [ qw/
- lb.types:B
- lb.ws-interface:B
- jobid.api-java
- / ],
- 'lb.common' => [ qw/
- jobid.api-cpp:B jobid.api-c
- lb.types:B lbjp-common.trio lbjp-common.gss
- / ],
- 'lb.doc' => [ qw/lb.types:B/ ],
- 'lb.logger' => [ qw/
- lbjp-common.trio
- lbjp-common.log
- jobid.api-c
- lb.common
- lbjp-common.gss
- / ],
- 'lb.logger-msg' => [ qw/
- lb.logger:B
- / ],
- 'lb.nagios' => [ qw/
- lb.client:R
- lb.ws-test:R
- lb.utils:R
- / ],
- 'lb.server' => [ qw/
- lb.ws-interface lb.types:B lb.common lb.state-machine lb.utils:R
- lbjp-common.db lbjp-common.server-bones lbjp-common.trio lbjp-common.maildir lbjp-common.log
- jobid.api-c
- lbjp-common.gsoap-plugin lbjp-common.gss
- / ],
- 'lb.state-machine' => [ qw/lb.types:B lb.common lbjp-common.jp-interface lbjp-common.gss/ ],
- 'lb.utils' => [ qw/
- lbjp-common.jp-interface
- jobid.api-c
- lbjp-common.trio lbjp-common.maildir
- lb.client lb.state-machine lb.types:B
- / ],
- 'lb.ws-test' => [ qw/lbjp-common.gsoap-plugin lb.ws-interface/ ],
- 'lb.ws-interface' => [ qw/lb.types:B/ ],
- 'lb.types' => [ qw// ],
- 'lb.harvester' => [ qw/
- jobid.api-c lbjp-common.trio lbjp-common.db lb.common lb.client
- lbjp-common.gss lbjp-common.log
- / ],
- 'lb.yaim' => [ qw// ],
- 'lb.glite-LB' => [ qw/
- lb.logger:R lb.server:R lb.utils:R lb.doc:R
- lb.ws-test:R lb.harvester:R lb.yaim:R lb.client-java:R
- lb.logger-msg:R
- / ],
- 'lb.emi-lb' => [ qw/
- lb.logger:R lb.server:R lb.utils:R lb.doc:R
- lb.ws-test:R lb.harvester:R lb.yaim:R lb.client-java:R
- lb.logger-msg:R
- / ],
- 'lbjp-common.db' => [ qw/lbjp-common.trio lbjp-common.log/ ],
- 'lbjp-common.maildir' => [ qw// ],
- 'lbjp-common.log' => [ qw// ],
- 'lbjp-common.server-bones' => [ qw/lbjp-common.log/ ],
- 'lbjp-common.trio' => [ qw// ],
- 'lbjp-common.gss' => [ qw// ],
- 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ],
- 'jobid.api-c' => [ qw// ],
- 'jobid.api-cpp' => [ qw/jobid.api-c/ ],
- 'jobid.api-java' => [ qw// ],
-
- 'lbjp-common.jp-interface' => [ qw/lbjp-common.trio lbjp-common.db jobid.api-c/ ],
-
- 'jp.client' => [ qw/
- jp.ws-interface
- lbjp-common.jp-interface lbjp-common.maildir
- jobid.api-c
- lbjp-common.gsoap-plugin
- / ],
- 'jp.doc' => [ qw// ],
- 'jp.index' => [ qw/
- jp.server-common jp.ws-interface
- lbjp-common.jp-interface lbjp-common.trio lbjp-common.db lbjp-common.server-bones
- lbjp-common.gsoap-plugin
- / ],
- 'jp.primary' => [ qw/
- jobid.api-c
- jp.server-common jp.ws-interface
- lb.state-machine
- lbjp-common.jp-interface lbjp-common.trio lbjp-common.db lbjp-common.server-bones
- lbjp-common.gsoap-plugin
- / ],
- 'jp.server-common' => [ qw/
- lbjp-common.jp-interface lbjp-common.db
- / ],
- 'jp.ws-interface' => [ qw// ],
-
- 'gridsite.core' => [ qw// ],
- 'gridsite.commands' => [ qw/gridsite.core:B/ ],
- 'gridsite.apache' => [ qw/gridsite.core:B/ ],
- 'gridsite.libs' => [ qw/gridsite.core:B / ],
- 'gridsite.devel' => [ qw/gridsite.core:B/ ],
- 'gridsite.slashgrid' => [ qw/gridsite.core:B/],
- 'gridsite.services' => [ qw/gridsite.core:B/ ],
- 'gridsite.service-clients' => [ qw/gridsite.core:B/ ],
- 'gridsite.gsexec' => [ qw/gridsite.core:B/ ],
-
- 'px.proxyrenewal' => [ qw// ],
- 'px.glite-PX' => [qw/px.myproxy-yaim:R/],
- 'px.emi-px' => [qw/px.myproxy-yaim:R/],
- 'px.myproxy-yaim' => [ qw// ],
- 'px.myproxy-config' => [],
-
- 'canl.c' => [],
-
- # sub-packages (virtual ETICS components depending on the main)
- 'jobid.api-c-devel' => [ qw/jobid.api-c:B/ ],
- 'jobid.api-cpp-devel' => [ qw/jobid.api-cpp:B/ ],
- 'lbjp-common.db-devel' => [ qw/lbjp-common.db:B/ ],
- 'lbjp-common.gsoap-plugin-devel' => [ qw/lbjp-common.gsoap-plugin:B/ ],
- 'lbjp-common.gss-devel' => [ qw/lbjp-common.gss:B/ ],
- 'lbjp-common.jp-interface-devel' => [ qw/lbjp-common.jp-interface:B/ ],
- 'lbjp-common.log-devel' => [ qw/lbjp-common.log:B/ ],
- 'lbjp-common.maildir-devel' => [ qw/lbjp-common.maildir:B/ ],
- 'lbjp-common.server-bones-devel' => [ qw/lbjp-common.server-bones:B/ ],
- 'lbjp-common.trio-devel' => [ qw/lbjp-common.trio:B/ ],
- 'lb.client-progs' => [ qw/lb.client:B/ ],
- 'lb.client-devel' => [ qw/lb.client:B/ ],
- 'lb.common-devel' => [ qw/lb.common:B/ ],
- 'lb.logger-devel' => [ qw/lb.logger:B/ ],
- 'lb.state-machine-devel' => [ qw/lb.state-machine:B/ ],
- 'px.proxyrenewal-devel' => [ qw/px.proxyrenewal:B/ ],
- 'px.proxyrenewal-progs' => [ qw/px.proxyrenewal:B/ ],
- 'canl.c-devel' => [ qw/canl.c:B/ ],
-);
-
-for my $ext (keys %deps_aux) {
- for (@{$deps_aux{$ext}}) {
- /([^:]*)(?::(.*))?/;
- push @{$deps{$ext}},$1;
- my $type = $2 ? $2 : 'BR';
- $deps_type{$ext}->{$1} = $type;
- }
-}
-
-
-%extrafull = (
- gridsite=>'org.gridsite.core',
- 'canl.c' => 'emi.canl.canl-c',
- 'canl.c-devel' => 'emi.canl.canl-c',
- 'jobid.api-c-devel' => 'org.glite.jobid.api-c',
- 'jobid.api-cpp-devel' => 'org.glite.jobid.api-cpp',
- 'lbjp-common.db-devel' => 'org.glite.lbjp-common.db',
- 'lbjp-common.gsoap-plugin-devel' => 'org.glite.lbjp-common.gsoap-plugin',
- 'lbjp-common.gss-devel' => 'org.glite.lbjp-common.gss',
- 'lbjp-common.jp-interface-devel' => 'org.glite.lbjp-common.jp-interface',
- 'lbjp-common.log-devel' => 'org.glite.lbjp-common.log',
- 'lbjp-common.maildir-devel' => 'org.glite.lbjp-common.maildir',
- 'lbjp-common.server-bones-devel' => 'org.glite.lbjp-common.server-bones',
- 'lbjp-common.trio-devel' => 'org.glite.lbjp-common.trio',
- 'lb.client-devel' => 'org.glite.lb.client',
- 'lb.client-progs' => 'org.glite.lb.client',
- 'lb.common-devel' => 'org.glite.lb.common',
- 'lb.logger-devel' => 'org.glite.lb.logger',
- 'lb.state-machine-devel' => 'org.glite.lb.state-machine',
- 'px.proxyrenewal-devel' => 'org.glite.px.proxyrenewal',
- 'px.proxyrenewal-progs' => 'org.glite.px.proxyrenewal',
-);
-
-#( java => 'client-java' );
-%extranodmod = (
- db => 'lbjp-common.db',
- jpprimary => 'jp.primary',
- jpindex => 'jp.index',
- jpclient => 'jp.client',
- lb => 'lb.glite-LB',
- px => 'px.glite-PX',
- proxyrenewal => 'px.proxyrenewal',
- canl => 'canl.c',
-);
-
-%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/ ],
-);
-
-%conflicts = (
-);
-
-%provides = (
- 'lbjp-common.gss' => [ qq/glite-security-gss/ ],
- 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ],
- 'lb.nagios' => [ qq/glite-lb-nagios-plugins/ ],
-);
-
-%cvs_prefix = (
- 'lb' => 'org.glite',
- 'jp' => 'org.glite',
- 'jobid' => 'org.glite',
- 'lbjp-common' => 'org.glite',
- 'gridsite' => 'org',
- 'px' => 'org.glite',
- 'canl' => 'emi',
-);
-
-%cvs_tag_prefix = (
- 'lb' => 'glite-',
- 'jp' => 'glite-',
- 'jobid' => 'glite-',
- 'lbjp-common' => 'glite-',
- 'gridsite' => '',
- 'px' => 'glite-',
- 'canl' => 'emi-',
-);
-
-# ==== projects specification ====
-# etics_name ........... ETICS project name
-# conf_prefix .......... ETICS configurations name prefix
-# tag_prefix ........... VCS tag prefix
-# local_prefix ......... prefix (relative to stage)
-# etics_externs ........ ETICS modules names of externals
-# (${NAME.location}, ETICS conf. dependencies)
-# etics_projects ....... ETICS project names of externals
-# etics_externs_devel .. ETICS modules names of devel versions of externals
-# etics_locations ...... ETICS locations in ${NAME.location} properties
-# need_externs_aux ..... project-specific external dependencies
-# supported_platforms .. platforms supported by the project
-# modules .............. additional modules in subsystems
-%projects = (
- glite => {
- current_version => 3,
- etics_name => 'org.glite',
- conf_prefix => { %cvs_tag_prefix },
- tag_prefix => { %cvs_tag_prefix },
- flavours => '--thrflavour=${globus.thr.flavor} --nothrflavour=${globus.nothr.flavor}',
- local_prefix => '',
- etics_externs => {
- default => {
- globus_essentials=>'vdt_globus_essentials',
- globus=>'globus',
- globus_proxy_utils=>'vdt_globus_essentials',
- gridsite=>'org.gridsite.libs',
- yaim_core=>'org.glite.yaim.core',
- gip_release=>'glite-info-provider-release',
- gip_service=>'glite-info-provider-service',
- bdii=>'bdii',
- glite_version=>'glite-version',
- glite_info_templates=>'glite-info-templates',
- glue_schema=>'glue-schema',
- trustmanager=>'org.glite.security.trustmanager',
- axis=>'axis',
- lcas=>'org.glite.security.lcas',
- gsoapxx=>'-',
- jdk=>'jdk',
- voms=>'org.glite.security.voms-api-cpp',
- },
- },
- etics_externs_devel => {
- default => {
- gridsite=>'org.gridsite.devel',
- voms=>'org.glite.security.voms-api',
- },
- },
- etics_projects => {
- vdt=>[qw/globus globus_essentials globus_proxy_utils gpt/],
- 'org.glite'=>[qw/voms gridsite lcas gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/],
- },
- etics_locations => {
- '*' => '',
- },
- need_externs_aux => {
- 'lb.client-java' => [ qw/ant:B jdk:B axis:B trustmanager utiljava libtool:B/ ],
- 'lb.glite-LB' => [ qw/fetchcrl:R gpt:R gip_release:R gip_service:R bdii:R glite_version:R glite_info_templates:R glue_schema:R/ ],
- 'lb.yaim' => [ qw/yaim_core:R/ ],
- 'px.glite-PX' => [qw/myproxy-server:R myproxy-admin:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/],
- 'px.myproxy-yaim' => [ qw/yaim_core:R/ ],
- },
- supported_platforms => {
- sl5_x86_64_gcc412 => 1,
- sl5_ia32_gcc412 => 1,
- deb5_x86_64_gcc432 => 1,
- deb5_ia32_gcc432 => 1,
- slc4_x86_64_gcc346 => 1,
- slc4_ia32_gcc346 => 1,
- },
- modules => {
- 'lb' => [ qw/glite-LB/ ],
- 'px' => [ qw/glite-PX/ ],
- },
- },
-
- emi => {
- current_version => 2,
- etics_name => 'emi',
- conf_prefix => {
- 'lb' => 'emi-',
- 'jp' => 'emi-',
- 'jobid' => 'emi-',
- 'lbjp-common' => 'emi-',
- 'gridsite' => 'emi-',
- 'px' => 'emi-',
- 'canl' => 'emi-',
- },
- tag_prefix => { %cvs_tag_prefix },
- flavours => '--thrflavour= --nothrflavour=',
- local_prefix => '/usr',
- etics_externs => {
- default => {
- globus_essentials=>'globus-gssapi-gsi',
- globus=>'globus-gssapi-gsi-devel',
- globus_proxy_utils=>'globus-proxy-utils',
- gridsite=>'emi.gridsite.libs',
- yaim_core=>'emi.yaim.yaim-core',
- yaim_bdii=>'emi.bdii.yaim-bdii',
- gip_service=>'emi.bdii.glite-info-provider-service',
- bdii=>'emi.bdii.core',
- glite_version=>'emi.emi-version',
- glue_schema=>'emi.bdii.glue-schema',
- trustmanager=>'emi.java-security.trustmanager',
- trustmanager_axis=>'emi.java-security.trustmanager-axis',
- axis=>'axis1.4',
- lcas=>'emi.sac.lcas',
- gsoapxx=>'-',
- jdk=>'java',
- voms => 'emi.voms.voms-api',
- },
- sl5_x86_64_gcc412EPEL => {
- 'myproxy-devel' => 'myproxy-devel.x86_64',
- },
- sl6_x86_64_gcc446EPEL => {
- 'myproxy-devel' => 'myproxy-devel.x86_64',
- },
- deb6_x86_64_gcc445 => {
- axis => 'axis1.4',
- # mappings in ETICS project configuration
- #globus_essentials => 'libglobus-gssapi-gsi4',
- #globus => 'libglobus-gssapi-gsi-dev',
- #axis => 'libaxis-java',
- #cares => 'libc-ares2',
- #cppunit => 'libcppunit',
- #expat => 'libexpat1',
- #log4c => 'liblog4c3',
- #curl => 'libcurl3',
- #'mysql' => 'libmysqlclient16',
- #'mysql-devel' => 'libmysqlclient-dev',
- #libxslt => 'xsltproc',
- #'jakarta-commons-codec' => 'libcommons-codec-java',
- #'jakarta-commons-lang' => 'libcommons-lang-java',
- #'tetex-latex' => 'texlive-latex-extra',
- #'perl-LDAP' => 'libnet-ldap-perl',
- #'fuse-lib' => 'libfuse2',
- #'fuse' => 'fuse-utils',
- },
- },
- etics_externs_devel => {
- default => {
- cares => 'c-ares-devel',
- classads => 'classads-devel',
- cppunit => 'cppunit-devel',
- expat => 'expat-devel',
- gsoap => 'gsoap-devel',
- voms => 'emi.voms.voms-api-devel',
- libtar => 'libtar-devel',
- log4c => 'log4c-devel',
- postgresql => 'postgresql-devel',
- curl => 'curl-devel',
- libxml2 => 'libxml2-devel',
- openssl => 'openssl-devel',
- gridsite=>'emi.gridsite.devel',
- jdk=>'java-devel',
- },
- deb6_x86_64_gcc445 => {
- # mappings in ETICS project configuration
- #cares => 'libc-ares-dev',
- #cppunit => 'libcppunit-dev',
- #expat => 'libexpat1-dev',
- #libtar => 'libtar-dev',
- #log4c => 'liblog4c-dev',
- #postgresql => 'libpq-dev',
- #curl => 'libcurl4-openssl-dev',
- #libxml2 => 'libxml2-dev',
- #openssl => 'libssl-dev',
- #'tetex-latex' => 'texlive-latex-extra',
- #libxslt=>'xsltproc',
- #'httpd-devel' => 'apache2-prefork-dev',
- #'fuse-devel' => 'libfuse-dev',
- #gsoap => 'gsoap',
- #'krb5-devel' => 'libkrb5-dev',
- },
- },
- etics_projects => {
- 'emi'=>[qw/voms voms-devel gridsite lcas gip_service bdii glite_version glue_schema yaim_core yaim_bdii trustmanager trustmanager_axis/],
- },
- etics_locations => {
- axis => 'axis',
- },
- need_externs_aux => {
- 'lb.client-java' => [ qw/ant:B jdk:B axis:B trustmanager trustmanager_axis libtool:B/ ],
- 'lb.emi-lb' => [ qw/fetchcrl:R gip_service:R bdii:R glite_version:R glue_schema:R/ ],
- 'lb.yaim' => [ qw/yaim_core:R yaim_bdii:R/ ],
- 'px.emi-px' => [qw/myproxy-server:R myproxy-admin:R fetchcrl:R gip_service:R bdii:R glite_version:R glue_schema:R/],
- 'px.myproxy-yaim' => [ qw/yaim_core:R yaim_bdii:R/ ],
- },
- supported_platforms => {
- sl5_x86_64_gcc412EPEL => 1,
- sl5_ia32_gcc412EPEL => 1,
- sl6_x86_64_gcc446EPEL => 1,
- deb6_x86_64_gcc445 => 1,
- },
- modules => {
- 'lb' => [ qw/emi-lb/ ],
- 'px' => [ qw/emi-px/ ],
- },
- },
-);
-
-%platform_properties = (
- 'jobid.api-java' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.types' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.doc' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.ws-interface' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.yaim' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.nagios' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'px.yaim' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'px.myproxy-config' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'gridsite.devel' => {
- default => { 'packageName' => 'gridsite-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libgridsite-dev' },
- },
- 'canl.c-devel' => {
- default => { 'packageName' => 'canl-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libcanl-dev' },
- },
- 'jobid.api-c-devel' => {
- default => { 'packageName' => 'glite-jobid-api-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-jobid-dev' },
- },
- 'jobid.api-cpp-devel' => {
- default => { 'packageName' => 'glite-jobid-api-cpp-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-jobid-cpp-dev' },
- },
- 'lbjp-common.db-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-db-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-db-dev' },
- },
- 'lbjp-common.gsoap-plugin-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-gsoap-plugin-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-gsoap-plugin-dev' },
- },
- 'lbjp-common.gss-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-gss-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-gss-dev' },
- },
- 'lbjp-common.jp-interface-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-jp-interface-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-jp-interface-dev' },
- },
- 'lbjp-common.log-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-log-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-log-dev' },
- },
- 'lbjp-common.maildir-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-maildir-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-maildir-dev' },
- },
- 'lbjp-common.server-bones-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-server-bones-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-server-bones-dev' },
- },
- 'lbjp-common.trio-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-trio-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-trio-dev' },
- },
- 'lb.client-devel' => {
- default => { 'packageName' => 'glite-lb-client-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-client-dev' },
- },
- 'lb.common-devel' => {
- default => { 'packageName' => 'glite-lb-common-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-common-dev' },
- },
- 'lb.state-machine-devel' => {
- default => { 'packageName' => 'glite-lb-state-machine-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-state-machine-dev' },
- },
- 'lb.logger-devel' => {
- default => { 'packageName' => 'glite-lb-logger-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-logger-dev' },
- },
- 'px.proxyrenewal-devel' => {
- default => { 'packageName' => 'glite-px-proxyrenewal-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-security-proxyrenewal-dev' },
- },
- 'canl.c-devel' => {
- default => { 'packageName' => 'canl-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libcanl-c-dev' },
- },
-);
-
-my @k = keys %deps_aux;
-@buildroot{@k} = ('') x ($#k+1);
-
-$buildroot{'gridsite.core'} = 'src';
-}
-
-sub full
-{
- my ($short) = @_;
- my $subsys = $short;
- $subsys =~ s/\..*//;
-
- my $cvs_prefix = exists $cvs_prefix{$subsys} ? $cvs_prefix{$subsys} : 'org.glite';
- return $extrafull{$short} ? $extrafull{$short} : "$cvs_prefix.$short";
-}
-
-sub get_version
-{
- my ($fmod, $top_srcdir) = @_;
-
- my ($subsys,$mod) = split /\./,$fmod,2;
- my ($major,$minor,$rev,$age);
- my $old_;
-
- if ($force_version) {
- $force_version =~ /([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)-(.+)/;
- ($major,$minor,$rev,$age) = ($1,$2,$3,$4);
- }
- else {
- my $path = "$top_srcdir/project";
- if ($subsys eq 'gridsite') {
- $path = "$cvs_prefix{$subsys}.$subsys.core/project";
- }
- open V,"$path/version.properties"
- or die "$path/version.properties: $!\n";
-
- $old_ = $_;
- while (<V>) {
- chomp;
- ($major,$minor,$rev) = ($1,$2,$3) if /module\.version\s*=\s*([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/;
- $age = $1 if /module\.age\s*=\s*([[:digit:]]+)/;
- }
- close V;
- $_ = $old_;
- }
- $version = "$major.$minor.$rev-$age";
-
- return ($major, $minor, $rev, $age);
-}
-
-sub get_description
-{
- my ($top_srcdir) = @_;
-
- my $cvs_module = $top_srcdir;
- my $package_description = "";
- my $package_summary = "";
-
- if (-e "$cvs_module/project/package.description") {
- open V, "$cvs_module/project/package.description";
- $package_description = join ("", <V>);
- close V;
- chomp $package_description;
- }
- else {
- print STDERR "package.description not found for $subsys.$module!\n"; }
-
- if (-e "$cvs_module/project/package.summary") {
- open V, "$cvs_module/project/package.summary";
- $package_summary = join ("", <V>);
- close V;
- chomp $package_summary;
- $package_summary =~ s/\n/\\n/g;
- }
- else {
- print STDERR "package.summary not found for $subsys.$module!\n"; }
-
- return ($package_summary, $package_description);
-}
-
-sub mkinc
-{
- my %aux;
- undef %aux;
- my @m=qw/
-lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.nagios lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lb.emi-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
-px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config px.emi-px
-canl.c
-/;
- @aux{@m} = (1) x ($#m+1);
-
- my ($short) = @_;
- my $full = full $short;
- my ($subsys,$mod) = split /\./,$short,2;
- my $packageName = "$project{tag_prefix}{$subsys}$subsys-${mod}";
-
- unless ($aux{$short}) {
- print "Makefile.inc not needed in $full\n";
- return;
- }
-
- my $top_srcdir = '.';
- my $abs_srcdir = '';
- my $build = '';
-
- if ($module) {
- $top_srcdir = $0;
- $top_srcdir =~ s,/?[^/]*$,,;
- $abs_srcdir = $top_srcdir;
- $top_srcdir =~ s,^$,\.,;
- } else {
- $build = "$full/";
- $abs_srcdir = "$full/";
- unless ($buildroot{$_} eq '') {
- $top_srcdir = '..';
- $build .= "$buildroot{$_}/";
- unless (-d "$build") {
- mkdir "$build" or die "mkdir $build: $!\n";
- }
- }
- }
-
- my ($major, $minor, $rev, $age) = get_version $short, $abs_srcdir;
- my ($package_summary, $package_description) = get_description $abs_srcdir;
- if ($package_description) { $package_description =~ s/(.{1,78}\S|\S+)\s+/$1\n/mg; }
- my $package_description_debian = $package_description;
- $package_description_debian =~ s/^/ /mg;
-
- my ($old_locale, $specdate, $debdate);
-
- # files for ETICS always in root source directory
- mkdir $abs_srcdir."project" unless (-d $abs_srcdir."project");
- open PKGCHL,">".$abs_srcdir."project/changelog"
- or die $abs_srcdir."project/changelog: $!\n";
- $old_locale = setlocale(LC_TIME);
- setlocale(LC_TIME, "C");
- $specdate = strftime("%a %b %d %Y", gmtime());
- $debdate = strftime("%a, %d %b %Y %H:%M:%S %z", gmtime());
- setlocale(LC_TIME, $old_locale);
- print PKGCHL qq{* $specdate CESNET team <emi-lb\@metacentrum.cz>
-- automatically generated package
-};
- close PKGCHL;
-
- unless ($top_srcdir eq '.') {
- unlink $build."Makefile";
- symlink "$top_srcdir/Makefile",$build."Makefile" or die "symlink $top_srcdir/Makefile ".$build."Makefile: $!\n";
- }
-
- open MKINC,">".$build."Makefile.inc"
- or die $build."Makefile.inc: $!\n";
-
- print "Creating ".$build."Makefile.inc\n";
-
- print MKINC qq{project = $project
-PREFIX = $root
-prefix = $prefix
-stagedir = $stagedir
-sysroot = $sysroot
-sysconfdir = $sysconfdir
-localstatedir = $localstatedir
-thrflavour = $thrflavour
-nothrflavour = $nothrflavour
-libdir = $libdir
-top_srcdir = $top_srcdir
-};
-
- for (@{$need_externs{$short}}) {
- next unless defined $externs{$_} and defined $externs{$_}{prefix};
- print MKINC "${_}_prefix = $externs{$_}{prefix}\n";
- print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags};
- }
-
- for (@{$need_jars{$short}}) {
- print MKINC "${_}_jar = $jar{$_}\n"
- }
-
- my $need_gsoap = 0;
- for (@{$need_externs{$short}}) { $need_gsoap = 1 if $_ eq 'gsoap'; }
-
- print MKINC "gsoap_default_version=".gsoap_version()."\n" if $need_gsoap;
-
- close MKINC;
-
- my $dh;
- my $debian = 0;
-
- opendir $dh, "$abs_srcdir/project" || die "Can't open $abs_srcdir/project: $!";
- for my $dir (readdir $dh) {
- if ($dir=~/^(.*)\.spec$/) {
- if ($1 ne $packageName) {
- printf STDERR "Changed RPM name: $packageName --> $1\n" if ($debug);;
- $packageName=$1;
- }
- last;
- }
- }
- closedir $dh;
-
- for my $file ("$packageName.spec", "debian.rules", "debian.control", "debian.changelog", "debian.copyright") {
- if (-f "$abs_srcdir/project/$file") {
- my $old_ = $_;
- printf STDERR "Creating $build$file\n" if ($debug);;
- open DST, ">$build$file";
- open SRC, "<$abs_srcdir/project/$file";
- while (<SRC>) {
- if (/\@MODULE\@/) { s/\@MODULE\@/$full/g; }
- if (/\@URL\@/) { s/\@URL\@/$package{url}/g; }
- if (/\@SUMMARY\@/) { s/\@SUMMARY\@/$package_summary/g; }
- if (/\@DESCRIPTION\@/) { s/\@DESCRIPTION\@/$package_description/g; }
- if (/\@DEBIAN_DESCRIPTION\@/) { s/\@DEBIAN_DESCRIPTION\@/$package_description_debian/g; }
- if (/\@VERSION\@/) { s/\@VERSION\@/$version/g; }
- if (/\@MAJOR\@/) { s/\@MAJOR\@/$major/g; }
- if (/\@MINOR\@/) { s/\@MINOR\@/$minor/g; }
- if (/\@REVISION\@/) { s/\@REVISION\@/$rev/g; }
- if (/\@AGE\@/) { s/\@AGE\@/$age/g; }
- if (/\@MAINTAINER\@/) { s/\@MAINTAINER\@/$package{maintainer}/g; }
- if (/\@UPLOADERS\@/) { s/\@UPLOADERS\@/$package{uploaders}/g; }
- if (/\@DEBIAN_VCS\@/) { s/\@DEBIAN_VCS\@/$package{debian_vcs}/g; }
- if (/\@DEBIAN_DATE\@/) { s/\@DEBIAN_DATE\@/$debdate/g; }
- if (/\@SPEC_DATE\@/) { s/\@SPEC_DATE\@/$specdate/g; }
- if (/^\s*.+\/configure\s/ and $force_version) {
- print "Version forced to $version\n" if ($debug);;
- s/--version\s+\S+\s?//;
- s/$/ --version $version/;
- }
- printf DST "%s", "$_";
- }
- close SRC;
- close DST;
- $_ = $old_;
- }
- }
-
- print "Creating ${build}debian/\n" if ($debug);;
-
- `rm -rfv ${build}debian`;
- mkdir $build."debian" or die $!;
- `cp $abs_srcdir/project/debian.* ${build}debian/ 2>/dev/null`;
- `mv ${build}debian.* ${build}debian/ 2>/dev/null`;
- `rm -f ${build}debian/*.orig`;
- opendir $dh, "${build}debian" || die "Can't open ${build}debian: $!";
- for $_ (readdir $dh) {
- if (/^debian\.(.*)/) {
- `mv ${build}debian/$_ ${build}debian/$1`;
- $debian = 1;
- }
- }
- closedir $dh;
-
- if ($debian) {
- my ($dir, $file);
-
- chmod 0755, "${build}debian/rules";
- $file="${build}debian/docs"; if (not -f $file) { `touch $file`; }
- $dir="${build}debian/source"; if (not -d $dir) { mkdir $dir; }
- $file="${build}debian/source/format"; if (not -f $file) { `echo "3.0 (quilt)" > $file` }
- $file="${build}debian/compat"; if (not -f $file) { `echo "7" > $file` }
- $file="${build}debian/changelog"; if (not -f $file) {
- open FH, ">$file" or die $!;
- print FH qq{$packageName ($major.$minor.$rev-$age) unstable; urgency=low
-
- * Automatically generated package
-
- -- $package{maintainer} $debdate
-};
- close FH;
- }
-
- } else {
- `rm -rf ${build}debian`;
- }
-}
-
-BEGIN{
-};
-
-sub mode_etics_packaging {
- my ($fmod, $cmd, $rpmprepare, $debprepare) = @_;
- my ($workspaceDir, $srcPackageName, $srcAge, $topDir);
-
- # old-school packaging by ETICS for EMI-1
- if ($project eq 'emi' and $project_version == 1) { return; }
-
- if ($fmod eq 'gridsite.core') {
- $workspaceDir = '..';
- $srcPackageName = 'gridsite';
- $srcAge = '';
- $topDir = '../';
- } else {
- $workspaceDir = '${workspaceDir}';
- $srcPackageName = '${packageName}';
- $srcAge = '-${age}';
- $topDir = '';
- }
-
- $cmd->{clean} = 'make clean
- rm -rfv ${package.tgzLocation} ${package.SRPMSLocation}';
- $cmd->{default}{packaging} = $rpmprepare;
- $cmd->{default}{packaging} .= "dir=\${workspaceDir}/rpm_build_src_\$\$
- mkdir -p \${package.tgzLocation} \${package.SRPMSLocation} \$dir/{BUILD,RPMS,SOURCES,SRPMS} 2>/dev/null || true
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \${package.tgzLocation}/
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \$dir/SOURCES/
- rpmbuild -bs --nodeps --define \"_topdir \$dir\" $srcPackageName.spec
- cp -v \$dir/SRPMS/*.src.rpm \${package.SRPMSLocation}/
- rm -rf \$dir";
-
- for my $p ('deb5_x86_64_gcc432', 'deb5_ia32_gcc432', 'deb6_x86_64_gcc445', 'deb6_ia32_gcc445') {
- for my $c (keys %{$cmd->{default}}) { $cmd->{$p}{$c} = $cmd->{default}{$c}; }
- $cmd->{$p}{clean} = 'make clean
- rm -rfv ${package.tgzLocation} ${package.SDEBSLocation}';
- $cmd->{$p}{packaging} = $debprepare;
- $cmd->{$p}{packaging} .= "dir=\${workspaceDir}/dpkg_build_src_\$\$
- mkdir -p \${package.tgzLocation} \${package.SDEBSLocation} \$dir 2>/dev/null || true
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \${package.tgzLocation}/
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \$dir/${srcPackageName}_\${version}.orig.tar.gz
- tar xzf \$dir/${srcPackageName}_\${version}.orig.tar.gz -C \$dir
- cp -rf ${topDir}debian/ \$dir/$srcPackageName-\${version}/
- cd \$dir/$srcPackageName-\${version}
- dpkg-buildpackage -S -d -nc
- cd -
- cp -v \$dir/*.tar.gz \$dir/*.dsc \${package.SDEBSLocation}/
- rm -rf \$dir";
- }
-}
-
-sub mode_etics {
- $fmod = shift;
-
- die "$0: --module required with --etics\n" unless $fmod;
-
- my ($subsys,$module) = split /\./,$fmod,2;
- my $full = full "$subsys.$module";
-
- my ($major,$minor,$rev,$age) = get_version $fmod, $full;
-
- # XXX: --with ignored for platform-dependend packages
- my @copts = ();
- my %ge;
- @ge{@{$etics_projects{$project{etics_name}}}} = (1) x ($#{$etics_projects{$project{etics_name}}}+1);
-
- for (@{$need_externs{"$subsys.$module"}}) {
- if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/ and (defined $externs{$_} or defined $jar{$_})) {
- my $eext = $etics_externs{default}{$_} ? $etics_externs{default}{$_} : $_;
- next if ($eext eq '-');
- if (defined $project{etics_locations}{'*'} or defined $project{etics_locations}{$_}) {
- $eext = $project{etics_locations}{$_} if ($project{etics_locations}{$_});
- push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}";
- } else {
- if ($ge{$_} and not defined $externs{$_}{pkg}) {
- push @copts, "--with-$_=\${stageDir}";
- }
- }
- }
- }
-
- for (@{$need_jars{"$subsys.$module"}}) {
- my $eext = $etics_externs{default}{$_} ? $etics_externs{default}{$_} : $_;
-
- push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (defined $project{etics_locations}{'*'} or defined $project{etics_locations}{$_});
- }
-
- my $conf;
- my $conftag;
- my ($confprefix, $nameprefix, $packageName);
-
- $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n";
-
- $confprefix = $project{conf_prefix}{$subsys};
- $nameprefix = $confprefix;
- $nameprefix =~ s/-$//;
- $nameprefix =~ s/-/\./g;
- $packageName = "$project{tag_prefix}{$subsys}$subsys-${module}";
-
- if ($branch) {
- $conf = "$confprefix${subsys}-${module}_$branch";
- $conftag = $branch;
- # forced low age number
- $age = $branch eq 'HEAD' ? '0head' : '0dev';
- push @copts, '--version ${version}-${age}';
- }
- else {
- $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}";
-# XXX: gridsite hack
- $conftag = $subsys eq 'gridsite' ? "$project{tag_prefix}{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" :
- "$project{tag_prefix}{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}";
-
- # lowering age for older packaging
- if ($project eq 'emi' and $project_version == 1) {
- $age = $age - 1;
- }
- }
-
- # emi1 suffix for older packaging
- if ($project eq 'emi' and $project_version == 1) {
- $age = $age.$project.$project_version;
- $conf = $conf.$project.$project_version;
- }
-
- my $file = $output ? $output : "$conf.ini";
- open C,">$file" or die "$file: $!\n";
-
- my $buildroot = $buildroot{"$subsys.$module"} eq '' ? '#no build.root' : "build.root = " . $buildroot{"$subsys.$module"};
-
- my $confdir = $buildroot{"$subsys.$module"} eq '' ? '.' : '..';
-
- my $cvs_module = full "$subsys.$module";
- my ($package_summary, $package_description) = get_description $cvs_module;
- if ($package_description) {
- $package_description =~ s/\n/\\n/g;
- $package_description = "package.description = $package_description\n";
- }
- if ($package_summary) {
- $package_summary = "package.summary = $package_summary\n";
- }
-
- my %cmd;
- $cmd_vcs{checkout} = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_module 2>/dev/null";
- #$cmd_vcs{checkout} = "((test -d jra1mw/.git && (cd jra1mw; git pull)) || (git clone -q http://scientific.zcu.cz/git/jra1mw.git";
- #$cmd_vcs{checkout} .= " && (cd jra1mw; git checkout -b \${tag} --track origin/\${tag})" unless ($conftag eq /HEAD/);
- #$cmd_vcs{checkout} .= ")) && (test -d \${moduleName} || ln -s jra1mw/$cvs_module \${moduleName})";
- $cmd_vcs{checkout} .= "\n\ttest -f \${packageName}-\${version}-\${age}.src.tar.gz || (ln -s \${moduleName} \${packageName}-\${version}; tar -chf - \${packageName}-\${version} --exclude CVS --exclude .git --exclude .etics | gzip --best > \${packageName}-\${version}-\${age}.src.tar.gz; rm \${packageName}-\${version})";
- $cmd_vcs{tag} = "cvs -d \${vcsroot} tag -R \${tag} ${moduleName}";
-
- $cmd{default}{init} = 'None';
- $cmd{default}{configure} = 'None';
- $cmd{default}{compile} = 'None';
- $cmd{default}{test} = 'None';
- $cmd{default}{install} = 'None';
- $cmd{default}{packaging} = 'None';
- $cmd{default}{clean} = 'make clean';
-
- if (exists $subpackages{$fmod}) {
- $cmd{default}{clean} = 'None';
- $cmd{default}{packaging} = "echo building nothing, $subpackages{$fmod} will build this package";
- $cmd_vcs{checkout} = "mkdir -v \${moduleName} 2>/dev/null || true";
- } elsif ($subsys eq 'gridsite') {
- $cmd_vcs{tag} = 'None';
-
- if ($module eq 'core') {
- my $flags;
-
- if ($project ne 'glite') {
- # don't evaluate pkg-config calls to get them into source package
- $flags = 'RELEASE_VERSION=${age}
- GSOAPDIR=\`pkg-config gsoap --variable=prefix\`
- OPENSSL_GLOBUS_FLAGS=\`pkg-config globus-openssl --cflags\`
- OPENSSL_GLOBUS_LIBS=\`pkg-config globus-openssl --libs\`';
- } else {
- $flags = 'RELEASE_VERSION=${age}
- GSOAPDIR=${gsoap.location}
- OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor}
- OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}
- HTTPD_FLAGS=-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-1 -I${httpd-devel.location}/include/apr-1.0 -I${httpd-devel.location}/include/apr-0 -I${httpd-devel.location}/include/pcre';
- }
-
- $cmd{default}{configure} = "cat > Makefile.inc <<EOF
- project = $project
- top_srcdir = ..
- $flags
- EOF";
- $cmd{default}{compile} = "make prefix=\${prefix}$project{local_prefix} libdir=\${libdir}";
- $cmd{default}{install} = "make prefix=\${prefix}$project{local_prefix} libdir=\${libdir} install";
- mode_etics_packaging($fmod, \%cmd,
- "make prefix=\${prefix}$project{local_prefix} rpm-prepare
- cp gridsite.spec ../\n\t",
- "chmod +x \${moduleDir}/src/make-debian-files || true
- make prefix=\${prefix}$project{local_prefix} deb-prepare\n\t"
- );
- }
- elsif ($module eq '1.5-compat') {
- $cmd_vcs{checkout} = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.core 2>/dev/null";
- $cmd{default}{init} = 'echo "/sbin/ldconfig" > project/.post
- echo "/sbin/ldconfig" > project/.postun';
- $cmd{default}{configure} = "cat > src/Makefile.inc <<EOF
- project = emi
- libdir = \${libdir}
- MAJOR_VERSION=1
- MINOR_VERSION=1.5
- PATCH_VERSION=1.5.0
- VERSION=\\\$(PATCH_VERSION)
- RELEASE_VERSION=\${age}
- GSOAPDIR=\\`pkg-config gsoap --variable=prefix\\`
- OPENSSL_GLOBUS_FLAGS=\\`pkg-config globus-openssl --cflags\\`
- OPENSSL_GLOBUS_LIBS=\\`pkg-config globus-openssl --libs\\`
- EOF";
- $cmd{default}{compile} = "make -C src prefix=\${prefix}$project{local_prefix}
- rm -fv project/debian.changelog";
- $cmd{default}{install} = "make -C src prefix=\${prefix}$project{local_prefix} install-lib
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.so.1
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.so
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.a";
- $cmd{default}{packaging} = "None";
- }
- else {
- $cmd{default}{clean} = 'None';
- $cmd{default}{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this";
- $cmd_vcs{checkout} = "mkdir -v \${moduleName} 2>/dev/null || true";
- }
- }
- elsif ($subsys eq 'px' and $module eq 'myproxy-config') {
- $cmd{default}{configure} = "/usr/bin/perl $confdir/configure --root=\${prefix} --prefix= --stage=\${stageDir} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts";
- $cmd{default}{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config";
- }
- else {
- $cmd{default}{configure} = "/usr/bin/perl $confdir/configure $project{flavours} --root=\${prefix} --prefix=$project{local_prefix} --stage=\${stageDir} --sysroot=\${package.prefix} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts";
- $cmd{default}{compile} = 'make';
- $cmd{default}{test} = 'make check';
- $cmd{default}{install} = 'make install';
- if ($subsys eq 'lb' and $module eq 'client') {
- $cmd{default}{compile} = "make rpath=$project{local_prefix}/\${libdir}";
- $cmd{default}{install} = "make install post-install rpath=$project{local_prefix}/\${libdir}";
- }
- mode_etics_packaging($fmod, \%cmd);
- }
-
- 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 = $project{etics_name}.$subsys.$module
-displayName = $conf
-description = $cvs_prefix{$subsys}.$subsys.$module
-projectName = $project{etics_name}
-age = $age
-deploymentType = None
-vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite
-tag = $conftag
-version = $major.$minor.$rev
-$dwpath
-[Platform-default:VcsCommand]
-displayName = None
-description = None
-tag = $cmd_vcs{tag}
-branch = None
-commit = None
-checkout = $cmd_vcs{checkout}
-
-};
-
- for my $p (keys %cmd) {
- next if $p ne 'default' and exists $project{supported_platforms} and not exists $project{supported_platforms}{$p};
-
- print C qq{[Platform-$p:BuildCommand]
-postpublish = None
-packaging = $cmd{$p}{packaging}
-displayName = None
-description = None
-doc = None
-prepublish = None
-publish = None
-compile = $cmd{$p}{compile}
-init = $cmd{$p}{init}
-install = $cmd{$p}{install}
-clean = $cmd{$p}{clean}
-test = $cmd{$p}{test}
-configure = $cmd{$p}{configure}
-checkstyle = None
-
-};
- }
-
- print C qq{[Platform-default:Property]
-$buildroot
-package.preserve.libtool = false
-$package_description$package_summary$defprops};
-
- for (@{$obsoletes{"$subsys.$module"}}) {
- print C "package.obsoletes = $_\n";
- print C "package.replaces = $_\n";
- }
- for (@{$conflicts{"$subsys.$module"}}) {
- print C "package.conflicts = $_\n";
- }
- for (@{$provides{"$subsys.$module"}}) {
- print C "package.provides = $_\n";
- }
- print C "\n";
-
- for my $pp (keys %{$platform_properties{"$subsys.$module"}}) {
- next if $pp eq 'default';
- next if exists $project{supported_platforms} and not exists $project{supported_platforms}{$pp};
-
- print C "[Platform-$pp:Property]\n$buildroot\n";
-
- for my $p (keys %{$platform_properties{"$subsys.$module"}->{$pp}}) {
- print C $p . ' = ' . $platform_properties{"$subsys.$module"}->{$pp}->{$p} . "\n";
- }
- print C "$package_description$package_summary\n";
- }
-
- for my $platform ('default', keys %{$project{supported_platforms}}) {
- my $used = 0;
- my $output = '';
-
- for (@{$need_externs{"$subsys.$module"}},@{$need_jars{"$subsys.$module"}}) {
- my $eext = $etics_externs{$platform}{$_};
- my $edev = $project{etics_externs_devel}{$platform}{$_};
-
- # for the default platform using package of the same
- # name for runtime dependency
- if (not $eext) {
- if ($platform eq 'default') {
-#print "default runtime $_ on default\n";
- $eext = $_; }
- else {
-#print "no runtime $_ on $platform\n";
- $eext = '-'; }
- }
- if ($eext eq '-' and $edev eq '-') {
-#print "skipping $_ on $platform\n";
- next;
- }
-
- my $proj = 'externals';
- for my $p (keys %etics_projects) {
- for $m (@{$etics_projects{$p}}) {
- $proj = $p if $m eq $_;
- }
- }
-
- my $type = $need_externs_type{"$subsys.$module"}->{$_};
-
- if ($edev) {
- if ($type eq 'B') {
- # no runtime - change to devel pkg
- $eext = $edev;
- } elsif ($type eq 'BR' or $type eq 'RB') {
- # additional devel pkg
- if ($edev ne '-') { $output .= "$proj|$edev = B\n"; }
- }
- }
- if ($eext ne '-') { $output .= "$proj|$eext = $type\n"; }
- }
-
- if ($platform eq 'default') {
- for (@{$deps{"$subsys.$module"}}) {
- my $type = $deps_type{"$subsys.$module"}->{$_};
- if (not $used) {
- $used = 1;
- }
- $output .= "$project{etics_name}|$project{etics_name}.$_ = $type\n";
- }
- }
-
- if ($output) {
- print C qq{
-[Platform-$platform:DynamicDependency]
-$output};
- }
- }
-
- close C;
-
- for $file ("$cvs_module/project/debian.rules", "$cvs_module/project/$packageName.spec") {
- my $lib;
- my $main_module;
- @copts = ();
-
- if ($file =~ /debian\.rules$/) { $lib = 'lib'; }
- else { $lib = '%{_lib}'; }
-
- my $main_module = "$subsys.$module";
- if (exists $subpackages{$main_module}) { $main_module = $subpackages{$main_module}; }
-
- # locations hacks
- if ($file =~ /$packageName\.spec$/) {
- if ($fmod eq 'lb.client-java') {
- push @copts, '';
- push @copts, '--with-axis=/usr/local/axis1.4';
- }
- }
-
- if (-f $file) {
- open DST,">$file.new" or die "$file.new: $!\n";
- open SRC,"<$file" or die "$file: $!\n";
- while (<SRC>) {
- if (/^(\s*).+\/configure\s/) {
- printf DST "%s", "$1";
- printf DST "/usr/bin/perl $confdir/configure $project{flavours} --root=/ --prefix=$project{local_prefix} --libdir=$lib --project=$project --module $main_module@copts\n";
- } else {
- printf DST "%s", "$_";
- }
- }
- close SRC;
- close DST;
-
- `diff -b "$file" "$file.new"`;
- if ($? == 0) {
- print STDERR "($file not changed)\n";
- unlink "$file.new";
- } else {
- print STDERR "Writing $file\n";
- rename "$file", "$file.orig" unless -f "$file.orig";
- rename "$file.new", "$file";
- }
- }
- }
-}
-
-sub gsoap_version {
- local $_;
- my $gsoap_version;
- open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n";
-
- while ($_ = <S>) {
- 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;
-}
-
-sub getlibdir {
- if ( -e "/etc/debian_version") { # We are on Debian
- $lib64="lib";
- $lib32="lib32"; }
- else { # Another distribution
- $lib64="lib64";
- $lib32="lib"; }
- $libdir=$lib32;
-
- open INP, "uname -s | "; # Check kernel name
- $kname= <INP>;
- chomp($kname);
- close INP;
-
- if ( $kname eq "Linux") {
- $arch = ("x86_64\npowerpc\nppc64\n");
-
- open INP, "uname -p | "; # Check processor type
- $procname= <INP>;
- chomp($procname);
- close INP;
-
- if ($arch =~/^$procname\n/) {
- return ($lib64); }
-
- open INP, "uname -m | "; # Check machine hardware
- $machname= <INP>;
- chomp($machname);
- close INP;
-
- if ($arch =~/^$machname\n/) {
- return ($lib64); }
-
- # special cases (hyperlink lib64, Debian)
- if (-l "/usr/lib64") {
- $libdir=$lib32; }
-
- # if /usr/lib64 doesn't exist at all (AIX)
- unless ( -e "/usr/lib64" ) {
- $libdir=$lib32; }
- }
-
- if ( $kname eq "SunOS") {
- if (-e "/usr/lib/64") {
- $libdir="lib/64"; }
- }
-
- return $libdir;
-}
-
-sub reshuffle_platforms($$) {
- my ($data, $platforms) = @_;
- my ($platform, %blacklist, $value);
-
- return if not $platforms;
-
- for $platform (keys %$data) {
-#print "plat: $platform: $data->{$platform}\n";
- next if $platform eq 'default';
- for $_ (keys %{$data->{$platform}}) {
-#print " blacklist: $_ = $data->{$platform}{$_}\n";
- $blacklist{$_} = 1;
- }
- }
-
- for $_ (keys %blacklist) {
- $value = $data->{default}{$_} ? $data->{default}{$_} : $_;
- for $platform (keys %$platforms) {
- next if $platform eq 'default';
- if (not defined $data->{$platform}{$_}) {
- $data->{$platform}{$_} = $value;
-#print "added $value to $platform\n"
- }
- }
- $data->{default}{$_} = '-';
-#print "deleted $_ from default\n";
- }
-
- # merge dependencies across the supported platforms
- %blacklist = [];
- for $platform (keys %$platforms) {
- next if $platform eq 'default';
- for $_ (keys %{$data->{$platform}}) {
- $blacklist{$_} = 1;
- }
- }
- for $_ (keys %blacklist) {
- $value = undef;
- $same = 1;
- for $platform (keys %$platforms) {
- if (not $value) { $value = $data->{$platform}{$_}; }
- if (not $data->{$platform}{$_} or $value ne $data->{$platform}{$_}) {
- $same = 0;
- last;
- }
- }
- if ($same and $value) {
-#print "merged dependency $_\n";
- $data->{default}{$_} = $value;
- for $platform (keys %$platforms) {
- delete $data->{$platform}{$_};
- }
- }
- }
-}
-
-sub usage {
- my @ext = keys %externs;
- my @myjars = keys %jar;
-
- print STDERR qq{
-Usage: $0 options
-
-General options (defaults in []):
- --prefix=PREFIX destination directory [./stage]
- --stage=DIR staging directory [./stage]
- --root=DIR installation root (custom relocation root -> sysroot) [./stage]
- --sysroot=DIR system root (custom relocation root -> sysroot) []
- --sysconfdir=DIR system configuration directory [PREFIX/etc]
- --staged=module,module,... what is already in PREFIX (specify without org.glite.)
- --thrflavour=flavour
- --nothrflavour=flavour threaded and non-treaded flavours [gcc64dbgpthr,gcc64dbg]
- --listmodules=subsys list modules of a subsystem
- --listmodules=module list subpackages of a module
- --version=maj.min.rev-age version used instead of reading version.properties
- --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...)
- --libdir=libdir typically [lib,lib64] postfix
- --project=PROJECT build or generate etics for a project (glite/emi1/emi) [emi]
- --debug print more details
-
-Mode of operation:
- --mode=\{checkout|build|etics\} what to do [build]
-
-What to build:
- --module=module build this module only
- --enable-NODE build this "node" (set of modules) only
- --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
- --jobid-tag=tag checkout jobid modules with specific tag
- --canl-tag=tag checkout canl modules with specific tag
-
-Dependencies (summary of what will be used is always printed):
- --with-EXTERNAL=PATH where to look for an external [autodetect]
- --with-JAR=JAR where to look for jars
-
-Available nodes:
- @nodes
-
-Default nodes:
- @default_nodes
-
-Externals (not all for all modules) are:
- @ext
-
-External jars are:
- @myjars
-
-};
-
-}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-*** GENERATED FROM project.xml - DO NOT EDIT ***
-*** EDIT ../build.xml INSTEAD ***
-
-For the purpose of easier reading the script
-is divided into following sections:
-
- - initialization
- - compilation
- - jar
- - execution
- - debugging
- - javadoc
- - junit compilation
- - junit execution
- - junit debugging
- - applet
- - cleanup
-
- -->
-<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject2="http://www.netbeans.org/ns/j2se-project/2" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="jobid-api-java-impl">
- <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
- <!--
- ======================
- INITIALIZATION SECTION
- ======================
- -->
- <target name="-pre-init">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="-pre-init" name="-init-private">
- <property file="nbproject/private/config.properties"/>
- <property file="nbproject/private/configs/${config}.properties"/>
- <property file="nbproject/private/private.properties"/>
- </target>
- <target depends="-pre-init,-init-private" name="-init-user">
- <property file="${user.properties.file}"/>
- <!-- The two properties below are usually overridden -->
- <!-- by the active platform. Just a fallback. -->
- <property name="default.javac.source" value="1.4"/>
- <property name="default.javac.target" value="1.4"/>
- </target>
- <target depends="-pre-init,-init-private,-init-user" name="-init-project">
- <property file="nbproject/configs/${config}.properties"/>
- <property file="nbproject/project.properties"/>
- </target>
- <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
- <available file="${manifest.file}" property="manifest.available"/>
- <condition property="manifest.available+main.class">
- <and>
- <isset property="manifest.available"/>
- <isset property="main.class"/>
- <not>
- <equals arg1="${main.class}" arg2="" trim="true"/>
- </not>
- </and>
- </condition>
- <condition property="manifest.available+main.class+mkdist.available">
- <and>
- <istrue value="${manifest.available+main.class}"/>
- <isset property="libs.CopyLibs.classpath"/>
- </and>
- </condition>
- <condition property="have.tests">
- <or>
- <available file="${test.src.dir}"/>
- </or>
- </condition>
- <condition property="have.sources">
- <or>
- <available file="${src.dir}"/>
- </or>
- </condition>
- <condition property="netbeans.home+have.tests">
- <and>
- <isset property="netbeans.home"/>
- <isset property="have.tests"/>
- </and>
- </condition>
- <condition property="no.javadoc.preview">
- <and>
- <isset property="javadoc.preview"/>
- <isfalse value="${javadoc.preview}"/>
- </and>
- </condition>
- <property name="run.jvmargs" value=""/>
- <property name="javac.compilerargs" value=""/>
- <property name="work.dir" value="${basedir}"/>
- <condition property="no.deps">
- <and>
- <istrue value="${no.dependencies}"/>
- </and>
- </condition>
- <property name="javac.debug" value="true"/>
- <property name="javadoc.preview" value="true"/>
- <property name="application.args" value=""/>
- <property name="source.encoding" value="${file.encoding}"/>
- <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
- <and>
- <isset property="javadoc.encoding"/>
- <not>
- <equals arg1="${javadoc.encoding}" arg2=""/>
- </not>
- </and>
- </condition>
- <property name="javadoc.encoding.used" value="${source.encoding}"/>
- <property name="includes" value="**"/>
- <property name="excludes" value=""/>
- <property name="do.depend" value="false"/>
- <condition property="do.depend.true">
- <istrue value="${do.depend}"/>
- </condition>
- <condition property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${jaxws.endorsed.dir}'">
- <and>
- <isset property="jaxws.endorsed.dir"/>
- <available file="nbproject/jaxws-build.xml"/>
- </and>
- </condition>
- </target>
- <target name="-post-init">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
- <fail unless="src.dir">Must set src.dir</fail>
- <fail unless="test.src.dir">Must set test.src.dir</fail>
- <fail unless="build.dir">Must set build.dir</fail>
- <fail unless="dist.dir">Must set dist.dir</fail>
- <fail unless="build.classes.dir">Must set build.classes.dir</fail>
- <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
- <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
- <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
- <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
- <fail unless="dist.jar">Must set dist.jar</fail>
- </target>
- <target name="-init-macrodef-property">
- <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
- <attribute name="name"/>
- <attribute name="value"/>
- <sequential>
- <property name="@{name}" value="${@{value}}"/>
- </sequential>
- </macrodef>
- </target>
- <target name="-init-macrodef-javac">
- <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${src.dir}" name="srcdir"/>
- <attribute default="${build.classes.dir}" name="destdir"/>
- <attribute default="${javac.classpath}" name="classpath"/>
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="${javac.debug}" name="debug"/>
- <attribute default="" name="sourcepath"/>
- <element name="customize" optional="true"/>
- <sequential>
- <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" sourcepath="@{sourcepath}" srcdir="@{srcdir}">
- <classpath>
- <path path="@{classpath}"/>
- </classpath>
- <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
- <customize/>
- </javac>
- </sequential>
- </macrodef>
- <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${src.dir}" name="srcdir"/>
- <attribute default="${build.classes.dir}" name="destdir"/>
- <attribute default="${javac.classpath}" name="classpath"/>
- <sequential>
- <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
- <classpath>
- <path path="@{classpath}"/>
- </classpath>
- </depend>
- </sequential>
- </macrodef>
- <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${build.classes.dir}" name="destdir"/>
- <sequential>
- <fail unless="javac.includes">Must set javac.includes</fail>
- <pathconvert pathsep="," property="javac.includes.binary">
- <path>
- <filelist dir="@{destdir}" files="${javac.includes}"/>
- </path>
- <globmapper from="*.java" to="*.class"/>
- </pathconvert>
- <delete>
- <files includes="${javac.includes.binary}"/>
- </delete>
- </sequential>
- </macrodef>
- </target>
- <target name="-init-macrodef-junit">
- <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <sequential>
- <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
- <batchtest todir="${build.test.results.dir}">
- <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
- <filename name="@{testincludes}"/>
- </fileset>
- </batchtest>
- <classpath>
- <path path="${run.test.classpath}"/>
- </classpath>
- <syspropertyset>
- <propertyref prefix="test-sys-prop."/>
- <mapper from="test-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <formatter type="brief" usefile="false"/>
- <formatter type="xml"/>
- <jvmarg line="${run.jvmargs}"/>
- </junit>
- </sequential>
- </macrodef>
- </target>
- <target name="-init-macrodef-nbjpda">
- <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
- <attribute default="${main.class}" name="name"/>
- <attribute default="${debug.classpath}" name="classpath"/>
- <attribute default="" name="stopclassname"/>
- <sequential>
- <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="dt_socket">
- <classpath>
- <path path="@{classpath}"/>
- </classpath>
- </nbjpdastart>
- </sequential>
- </macrodef>
- <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
- <attribute default="${build.classes.dir}" name="dir"/>
- <sequential>
- <nbjpdareload>
- <fileset dir="@{dir}" includes="${fix.includes}*.class"/>
- </nbjpdareload>
- </sequential>
- </macrodef>
- </target>
- <target name="-init-debug-args">
- <property name="version-output" value="java version "${ant.java.version}"/>
- <condition property="have-jdk-older-than-1.4">
- <or>
- <contains string="${version-output}" substring="java version "1.0"/>
- <contains string="${version-output}" substring="java version "1.1"/>
- <contains string="${version-output}" substring="java version "1.2"/>
- <contains string="${version-output}" substring="java version "1.3"/>
- </or>
- </condition>
- <condition property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
- <istrue value="${have-jdk-older-than-1.4}"/>
- </condition>
- </target>
- <target depends="-init-debug-args" name="-init-macrodef-debug">
- <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${main.class}" name="classname"/>
- <attribute default="${debug.classpath}" name="classpath"/>
- <element name="customize" optional="true"/>
- <sequential>
- <java classname="@{classname}" dir="${work.dir}" fork="true">
- <jvmarg line="${debug-args-line}"/>
- <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
- <jvmarg line="${run.jvmargs}"/>
- <classpath>
- <path path="@{classpath}"/>
- </classpath>
- <syspropertyset>
- <propertyref prefix="run-sys-prop."/>
- <mapper from="run-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <customize/>
- </java>
- </sequential>
- </macrodef>
- </target>
- <target name="-init-macrodef-java">
- <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
- <attribute default="${main.class}" name="classname"/>
- <element name="customize" optional="true"/>
- <sequential>
- <java classname="@{classname}" dir="${work.dir}" fork="true">
- <jvmarg line="${run.jvmargs}"/>
- <classpath>
- <path path="${run.classpath}"/>
- </classpath>
- <syspropertyset>
- <propertyref prefix="run-sys-prop."/>
- <mapper from="run-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <customize/>
- </java>
- </sequential>
- </macrodef>
- </target>
- <target name="-init-presetdef-jar">
- <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
- <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
- <j2seproject1:fileset dir="${build.classes.dir}"/>
- </jar>
- </presetdef>
- </target>
- <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar" name="init"/>
- <!--
- ===================
- COMPILATION SECTION
- ===================
- -->
- <target depends="init" name="deps-jar" unless="no.deps"/>
- <target depends="init,deps-jar" name="-pre-pre-compile">
- <mkdir dir="${build.classes.dir}"/>
- </target>
- <target name="-pre-compile">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target if="do.depend.true" name="-compile-depend">
- <j2seproject3:depend/>
- </target>
- <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
- <j2seproject3:javac/>
- <copy todir="${build.classes.dir}">
- <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
- </copy>
- </target>
- <target name="-post-compile">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
- <target name="-pre-compile-single">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
- <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
- <j2seproject3:force-recompile/>
- <j2seproject3:javac excludes="" includes="${javac.includes}" sourcepath="${src.dir}"/>
- </target>
- <target name="-post-compile-single">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
- <!--
- ====================
- JAR BUILDING SECTION
- ====================
- -->
- <target depends="init" name="-pre-pre-jar">
- <dirname file="${dist.jar}" property="dist.jar.dir"/>
- <mkdir dir="${dist.jar.dir}"/>
- </target>
- <target name="-pre-jar">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-without-manifest" unless="manifest.available">
- <j2seproject1:jar/>
- </target>
- <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
- <j2seproject1:jar manifest="${manifest.file}"/>
- </target>
- <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
- <j2seproject1:jar manifest="${manifest.file}">
- <j2seproject1:manifest>
- <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
- </j2seproject1:manifest>
- </j2seproject1:jar>
- <echo>To run this application from the command line without Ant, try:</echo>
- <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
- <property location="${dist.jar}" name="dist.jar.resolved"/>
- <pathconvert property="run.classpath.with.dist.jar">
- <path path="${run.classpath}"/>
- <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
- </pathconvert>
- <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
- </target>
- <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries">
- <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
- <pathconvert property="run.classpath.without.build.classes.dir">
- <path path="${run.classpath}"/>
- <map from="${build.classes.dir.resolved}" to=""/>
- </pathconvert>
- <pathconvert pathsep=" " property="jar.classpath">
- <path path="${run.classpath.without.build.classes.dir}"/>
- <chainedmapper>
- <flattenmapper/>
- <globmapper from="*" to="lib/*"/>
- </chainedmapper>
- </pathconvert>
- <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
- <copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
- <fileset dir="${build.classes.dir}"/>
- <manifest>
- <attribute name="Main-Class" value="${main.class}"/>
- <attribute name="Class-Path" value="${jar.classpath}"/>
- </manifest>
- </copylibs>
- <echo>To run this application from the command line without Ant, try:</echo>
- <property location="${dist.jar}" name="dist.jar.resolved"/>
- <echo>java -jar "${dist.jar.resolved}"</echo>
- </target>
- <target name="-post-jar">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
- <!--
- =================
- EXECUTION SECTION
- =================
- -->
- <target depends="init,compile" description="Run a main class." name="run">
- <j2seproject1:java>
- <customize>
- <arg line="${application.args}"/>
- </customize>
- </j2seproject1:java>
- </target>
- <target name="-do-not-recompile">
- <property name="javac.includes.binary" value=""/>
- </target>
- <target depends="init,-do-not-recompile,compile-single" name="run-single">
- <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
- <j2seproject1:java classname="${run.class}"/>
- </target>
- <!--
- =================
- DEBUGGING SECTION
- =================
- -->
- <target depends="init" if="netbeans.home" name="-debug-start-debugger">
- <j2seproject1:nbjpdastart name="${debug.class}"/>
- </target>
- <target depends="init,compile" name="-debug-start-debuggee">
- <j2seproject3:debug>
- <customize>
- <arg line="${application.args}"/>
- </customize>
- </j2seproject3:debug>
- </target>
- <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
- <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
- <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
- </target>
- <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
- <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
- <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
- <j2seproject3:debug classname="${debug.class}"/>
- </target>
- <target depends="init,-do-not-recompile,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
- <target depends="init" name="-pre-debug-fix">
- <fail unless="fix.includes">Must set fix.includes</fail>
- <property name="javac.includes" value="${fix.includes}.java"/>
- </target>
- <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
- <j2seproject1:nbjpdareload/>
- </target>
- <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
- <!--
- ===============
- JAVADOC SECTION
- ===============
- -->
- <target depends="init" name="-javadoc-build">
- <mkdir dir="${dist.javadoc.dir}"/>
- <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
- <classpath>
- <path path="${javac.classpath}"/>
- </classpath>
- <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
- <filename name="**/*.java"/>
- </fileset>
- </javadoc>
- </target>
- <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
- <nbbrowse file="${dist.javadoc.dir}/index.html"/>
- </target>
- <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
- <!--
- =========================
- JUNIT COMPILATION SECTION
- =========================
- -->
- <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
- <mkdir dir="${build.test.classes.dir}"/>
- </target>
- <target name="-pre-compile-test">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target if="do.depend.true" name="-compile-test-depend">
- <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
- </target>
- <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
- <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
- <copy todir="${build.test.classes.dir}">
- <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
- </copy>
- </target>
- <target name="-post-compile-test">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
- <target name="-pre-compile-test-single">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
- <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
- <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
- <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
- <copy todir="${build.test.classes.dir}">
- <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
- </copy>
- </target>
- <target name="-post-compile-test-single">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
- <!--
- =======================
- JUNIT EXECUTION SECTION
- =======================
- -->
- <target depends="init" if="have.tests" name="-pre-test-run">
- <mkdir dir="${build.test.results.dir}"/>
- </target>
- <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
- <j2seproject3:junit testincludes="**/*Test.java"/>
- </target>
- <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
- <fail if="tests.failed">Some tests failed; see details above.</fail>
- </target>
- <target depends="init" if="have.tests" name="test-report"/>
- <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
- <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
- <target depends="init" if="have.tests" name="-pre-test-run-single">
- <mkdir dir="${build.test.results.dir}"/>
- </target>
- <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
- <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
- <j2seproject3:junit excludes="" includes="${test.includes}"/>
- </target>
- <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
- <fail if="tests.failed">Some tests failed; see details above.</fail>
- </target>
- <target depends="init,-do-not-recompile,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
- <!--
- =======================
- JUNIT DEBUGGING SECTION
- =======================
- -->
- <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
- <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
- <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
- <delete file="${test.report.file}"/>
- <mkdir dir="${build.test.results.dir}"/>
- <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
- <customize>
- <syspropertyset>
- <propertyref prefix="test-sys-prop."/>
- <mapper from="test-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <arg value="${test.class}"/>
- <arg value="showoutput=true"/>
- <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
- <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
- </customize>
- </j2seproject3:debug>
- </target>
- <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
- <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
- </target>
- <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
- <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
- <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
- </target>
- <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
- <!--
- =========================
- APPLET EXECUTION SECTION
- =========================
- -->
- <target depends="init,compile-single" name="run-applet">
- <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
- <j2seproject1:java classname="sun.applet.AppletViewer">
- <customize>
- <arg value="${applet.url}"/>
- </customize>
- </j2seproject1:java>
- </target>
- <!--
- =========================
- APPLET DEBUGGING SECTION
- =========================
- -->
- <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
- <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
- <j2seproject3:debug classname="sun.applet.AppletViewer">
- <customize>
- <arg value="${applet.url}"/>
- </customize>
- </j2seproject3:debug>
- </target>
- <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
- <!--
- ===============
- CLEANUP SECTION
- ===============
- -->
- <target depends="init" name="deps-clean" unless="no.deps"/>
- <target depends="init" name="-do-clean">
- <delete dir="${build.dir}"/>
- <delete dir="${dist.dir}"/>
- </target>
- <target name="-post-clean">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
-</project>
+++ /dev/null
-build.xml.data.CRC32=dbd878b7
-build.xml.script.CRC32=3fb96f09
-build.xml.stylesheet.CRC32=be360661
-# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
-# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=dbd878b7
-nbproject/build-impl.xml.script.CRC32=02cb42d1
-nbproject/build-impl.xml.stylesheet.CRC32=f1d9da08
+++ /dev/null
-do.depend=false
-do.jar=true
-javac.debug=true
-javadoc.preview=true
-jaxws.endorsed.dir=/home/pavel/netbeans-6.0.1/java1/modules/ext/jaxws21/api
-user.properties.file=/home/pavel/.netbeans/6.0/build.properties
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
- <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
-</project-private>
+++ /dev/null
-application.title=jobid-api-java
-application.vendor=xpiskac
-build.classes.dir=${build.dir}/classes
-build.classes.excludes=**/*.java,**/*.form
-# This directory is removed when the project is cleaned:
-build.dir=build
-build.generated.dir=${build.dir}/generated
-# Only compile against the classpath explicitly listed here:
-build.sysclasspath=ignore
-build.test.classes.dir=${build.dir}/test/classes
-build.test.results.dir=${build.dir}/test/results
-debug.classpath=\
- ${run.classpath}
-debug.test.classpath=\
- ${run.test.classpath}
-# This directory is removed when the project is cleaned:
-dist.dir=dist
-dist.jar=${dist.dir}/jobid-api-java.jar
-dist.javadoc.dir=${dist.dir}/javadoc
-excludes=
-# file.reference.commons-codec-1.3.jar=/home/etics/repository/externals/commons-codec/1.3.0/noarch/
-includes=**
-jar.compress=false
-jar.index=true
-javac.classpath=\
- ${file.reference.commons-codec.jar}
-# Space-separated list of extra javac options
-javac.compilerargs=
-javac.deprecation=false
-javac.source=
-javac.target=
-javac.test.classpath=\
- ${javac.classpath}:\
- ${build.classes.dir}
-javadoc.additionalparam=
-javadoc.author=false
-javadoc.encoding=${source.encoding}
-javadoc.noindex=false
-javadoc.nonavbar=false
-javadoc.notree=false
-javadoc.private=false
-javadoc.splitindex=true
-javadoc.use=true
-javadoc.version=false
-javadoc.windowtitle=
-main.class=org.glite.test.Test
-manifest.file=manifest.mf
-meta.inf.dir=${src.dir}/META-INF
-platform.active=default_platform
-run.classpath=\
- ${javac.classpath}:\
- ${build.classes.dir}
-# Space-separated list of JVM arguments used when running the project
-# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
-# or test-sys-prop.name=value to set system properties for unit tests):
-run.jvmargs=
-run.test.classpath=\
- ${javac.test.classpath}:\
- ${build.test.classes.dir}
-source.encoding=UTF-8
-src.dir=src
-test.src.dir=test
-javac.compilerargs.jaxws=
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://www.netbeans.org/ns/project/1">
- <type>org.netbeans.modules.java.j2seproject</type>
- <configuration>
- <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
- <name>jobid-api-java</name>
- <minimum-ant-version>1.6.5</minimum-ant-version>
- <source-roots>
- <root id="src.dir"/>
- </source-roots>
- <test-roots>
- <root id="test.src.dir"/>
- </test-roots>
- </data>
- <references xmlns="http://www.netbeans.org/ns/ant-project-references/1"/>
- </configuration>
-</project>
+++ /dev/null
-1.0.1-1
-- Initial release of the api-java module
-
-1.0.2-1
-- Fixed target 'clean' in the Makefile
-
-1.0.3-1
-- Target 'clean' fixed to handle debian builds as well
-
-1.0.3-2
-- Module rebuilt
-
-1.0.4-1
-- Makefile using external modules jakarta-commons-*
-
-1.1.0-1
-- Fixes for parallel release in EMI & gLite
-
-1.1.0-2
-- Module rebuilt
-
-1.1.1-1
-- DESTDIR in makefiles
-
-1.1.2-1
-- Building JAR file indexes
-
-1.1.3-1
-- Relocatable build directory.
-
-1.1.3-2
-- Module rebuilt
-
-1.1.3-3
-- Module rebuilt
-
-1.1.3-4
-- Module rebuilt
-
-1.1.3-5
-- Module rebuilt
-
-1.1.3-6
-- Module rebuilt
-
-1.1.3-7
-- Module rebuilt
-
-1.2.0-1
-- Preparation for a new multiplatform release
-
-1.2.0-2
-- Module rebuilt
-
-1.2.0-3
-- Module rebuilt
-
-1.2.0-4
-- Module rebuilt
-
-1.2.0-5
-- Module rebuilt
-
+++ /dev/null
-Source: glite-jobid-api-java
-Priority: extra
-Maintainer: @MAINTAINER@
-Uploaders: @UPLOADERS@
-Build-Depends: debhelper (>= 7.0.50~), ant, libcommons-codec-java, default-jdk
-Standards-Version: 3.9.1
-Section: libs
-Homepage: @URL@
-DM-Upload-Allowed: yes
-@DEBIAN_VCS@
-
-Package: glite-jobid-api-java
-Section: libs
-Architecture: all
-Depends: libcommons-codec-java, ${misc:Depends}
-Description: @SUMMARY@
-@DEBIAN_DESCRIPTION@
+++ /dev/null
-This work was packaged for Debian by:
-
- @MAINTAINER@ on Thu, 08 Dec 2011 00:46:07 +0100
-
-It was downloaded from:
-
- @URL@
-
-Upstream Author(s):
-
- @MAINTAINER@
-
-Copyright:
-
- <Copyright (C) 2004-2011 Members of the EGEE Collaboration>
-
-License:
-
- 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.
-
-On Debian systems, the complete text of the Apache version 2.0 license
-can be found in "/usr/share/common-licenses/Apache-2.0".
-
-The Debian packaging is:
-
- Copyright (C) 2004-2011 Members of the EGEE Collaboration
-
-and is licensed under the Apache License, Version 2.0.
+++ /dev/null
-usr/share/java
+++ /dev/null
-usr/share/java/*
+++ /dev/null
-#!/usr/bin/make -f
-# -*- makefile -*-
-
--include /usr/share/dpkg/buildflags.mk
-
-# Uncomment this to turn on verbose mode.
-export DH_VERBOSE=1
-
-configure: configure-stamp
-configure-stamp:
- dh_testdir
- /usr/bin/perl ./configure --thrflavour= --nothrflavour= --root=/ --prefix=/usr --libdir=lib --project=emi --module jobid.api-java
- touch $@
-
-build: build-indep
-
-build-indep: build-stamp
-
-build-stamp: configure-stamp
- dh_testdir
- CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE)
- CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) check
- touch $@
-
-clean: configure-stamp
- dh_testdir
- dh_testroot
- rm -f configure-stamp build-stamp
- $(MAKE) clean
- rm -f Makefile.inc config.status
- dh_clean
-
-install: build-stamp
- dh_testdir
- dh_testroot
- dh_prep
- dh_installdirs
- $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
-
-binary-indep: install
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_installexamples
- dh_installman
- dh_installlogrotate
- dh_installcron
- dh_install --fail-missing
- dh_link
- dh_compress
- dh_fixperms
- dh_makeshlibs
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-indep
+++ /dev/null
-%global distver %(rpm -q --quiet redhat-release && rpm -q --queryformat "%{VERSION}" redhat-release || rpm -q --quiet centos-release && rpm -q --queryformat "%{VERSION}" centos-release || rpm -q --quiet sl-release && rpm -q --queryformat "%{VERSION}" sl-release | sed 's/^\\([0-9]*\\).*/\\1/')
-
-Summary: @SUMMARY@
-Name: glite-jobid-api-java
-Version: @MAJOR@.@MINOR@.@REVISION@
-Release: @AGE@%{?dist}
-Url: @URL@
-License: ASL 2.0
-Vendor: EMI
-Group: System Environment/Libraries
-BuildArch: noarch
-BuildRequires: ant
-BuildRequires: jakarta-commons-codec
-%if 0%{?distver} >= 6
-BuildRequires: java-1.6.0-openjdk-devel%{?_isa}
-%else
-BuildRequires: java-devel
-%endif
-Requires: jakarta-commons-codec
-BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
-AutoReqProv: yes
-Source: http://eticssoft.web.cern.ch/eticssoft/repository/emi/emi.jobid.api-java/%{version}/src/%{name}-@VERSION@.src.tar.gz
-
-
-%description
-@DESCRIPTION@
-
-
-%prep
-%setup -q
-
-
-%build
-/usr/bin/perl ./configure --thrflavour= --nothrflavour= --root=/ --prefix=/usr --libdir=%{_lib} --project=emi --module jobid.api-java
-make
-
-
-%check
-make check
-
-
-%install
-rm -rf $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
-find $RPM_BUILD_ROOT -name '*.la' -exec rm -rf {} \;
-find $RPM_BUILD_ROOT -name '*.a' -exec rm -rf {} \;
-
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
-%files
-%defattr(-,root,root)
-/usr/share/java/jobid-api-java.jar
-
-
-%changelog
-* @SPEC_DATE@ @MAINTAINER@ - @MAJOR@.@MINOR@.@REVISION@-@AGE@%{?dist}
-- automatically generated package
+++ /dev/null
-JAVA implementation of handling gLite jobid
+++ /dev/null
-JAVA implementation of handling gLite jobid
+++ /dev/null
-# : /cvs/glite/org.glite.jobid.api-java/project/version.properties,v 1.5 2009/01/20 17:25:13 akrenek Exp $
-module.version=1.2.0
-module.age=5
+++ /dev/null
-/*
-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.
-*/
-
-package org.glite.jobid;
-
-/**
- * This class shows how Jobid works and how to work with it.
- * @author Pavel Piskac
- */
-public class ExampleJobid {
-
- public static void main(String[] args) {
- //how Jobid class works
- //unique part is automatically generated
- Jobid jobid1 = new Jobid("https://somewhere.cz", 5000);
- System.out.println("bkserver "+ jobid1.getBkserver());
- System.out.println("port "+ jobid1.getPort());
- System.out.println("unique "+ jobid1.getUnique());
- System.out.println("-------------------");
-
- //unique part is set by user
- Jobid jobid2 = new Jobid("https://somewhere.cz", 5000, "my_unique_part");
- System.out.println("bkserver "+ jobid2.getBkserver());
- System.out.println("port "+ jobid2.getPort());
- System.out.println("unique "+ jobid2.getUnique());
- System.out.println("-------------------");
-
- //whole jobid is set by user and then parsed
- Jobid jobid3 = new Jobid("https://somewhere.cz:5000/my_unique_part");
- System.out.println("bkserver "+ jobid3.getBkserver());
- System.out.println("port "+ jobid3.getPort());
- System.out.println("unique "+ jobid3.getUnique());
- System.out.println("-------------------");
-
- //each part is set separately
- Jobid jobid4 = new Jobid();
- jobid4.setBkserver("https://somewhere.cz");
- jobid4.setPort(5000);
- jobid4.setUnique("my_unique_part");
- System.out.println("bkserver "+ jobid4.getBkserver());
- System.out.println("port "+ jobid4.getPort());
- System.out.println("unique "+ jobid4.getUnique());
- System.out.println("-------------------");
- }
-
-}
+++ /dev/null
-/*
-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.
-*/
-
-package org.glite.jobid;
-
-import java.net.UnknownHostException;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.Calendar;
-import java.util.Random;
-//import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.codec.binary.Base64;
-
-/**
- * Class representing jobId
- *
- * @author Pavel Piskac (173297@mail.muni.cz)
- * @version 15. 3. 2008
- */
-public class Jobid {
-
- String unique;
- String bkserver;
- int port;
-
- /**
- * Creates new instance of Jobid class.
- */
- public Jobid() {
- }
-
- /**
- * Creates new instace of JobId with BK server address and port number, unique part
- * is generated. If some exception is catched during generating the unique part, then
- * System.exit(-1); is called.
- *
- * @param bkserver BK server address
- * @param port BK server port
- * @throws java.land.IllegalArgumentException if bkserver is null
- * @throws java.lang.IllegalArgumentException if port is lower than 1 or
- * bigger than 65535
- */
-
- public Jobid(String bkserver, int port) {
- if (bkserver == null) {
- throw new IllegalArgumentException("Jobid bkserver");
- }
-
- if (port < 1 || port > 65535) {
- throw new IllegalArgumentException("Jobid port");
- }
-
- if (bkserver.indexOf("https://") == -1)
- this.bkserver = "https://" + bkserver;
- else this.bkserver = bkserver;
-
- this.port = port;
-
- MessageDigest digest = null;
-
- try {
- String hostname = "";
- try {
- hostname = java.net.InetAddress.getLocalHost().getHostName();
- } catch (UnknownHostException ex) {
- System.err.println(ex);
- }
-
- digest = java.security.MessageDigest.getInstance("MD5");
- unique = hostname + bkserver + port + Calendar.getInstance().getTimeInMillis() +
- new Random().nextInt(999999);
-
- digest.update(unique.getBytes(),0,unique.length());
- Base64 base64 = new Base64();
- byte[] tmp = base64.encode(digest.digest());
- unique = new String(tmp, 0, tmp.length-2);
- unique = unique.replaceAll("/", "_");
- unique = unique.replaceAll("\\+", "-");
- } catch (NoSuchAlgorithmException ex) {
- System.err.println(ex);
- System.exit(-1);
- }
- }
-
- /**
- * Creates new instace of Jobid with BK server address, port number and
- * unique part as parameters.
- *
- * @param bkserver BK server address
- * @param port BK server port
- * @param unique unique part of jobid
- * @throws java.lang.IllegalArgumentException if bkserver is null
- * @throws java.lang.IllegalArgumentException if port is lower than 1 or
- * bigger than 65535
- * @throws java.lang.IllegalArgumentException if unique is null
- */
- public Jobid(String bkserver, int port, String unique) {
- if (bkserver == null) {
- throw new IllegalArgumentException("Jobid bkserver");
- }
-
- if (port < 1 || port > 65535) {
- throw new IllegalArgumentException("Jobid port");
- }
-
- if (unique == null) {
- throw new IllegalArgumentException("Jobid unique");
- }
-
- if (bkserver.indexOf("https://") == -1)
- this.bkserver = "https://" + bkserver;
- else this.bkserver = bkserver;
-
- this.port = port;
- this.unique = unique;
- }
-
- /**
- * Creates new instace of Jobid from string which represents jobid
- *
- * @param jobidString jobid string representation
- * @throws java.lang.IllegalArgumentException if jobidString is null
- */
- public Jobid(String jobidString) {
- if (jobidString == null) {
- throw new IllegalArgumentException("Jobid jobidString");
- }
-
- int doubleSlashPosition = jobidString.indexOf("https://");
- if (doubleSlashPosition == -1) {
- throw new IllegalArgumentException("wrong jobid https");
- }
-
- int colonPosition = jobidString.indexOf(":", doubleSlashPosition + 8);
- if (colonPosition == -1) {
- throw new IllegalArgumentException("wrong jobid colon");
- }
-
- int dashAfterPort = jobidString.indexOf("/", colonPosition);
- String bkserverS = jobidString.substring(0, colonPosition);
- Integer portS = new Integer(jobidString.substring(colonPosition+1,
- dashAfterPort));
- String uniqueS = jobidString.substring(dashAfterPort+1, jobidString.length());
-
- this.bkserver = bkserverS;
- this.port = portS.intValue();
- this.unique = uniqueS;
- }
-
- /**
- * Returns BK server address
- *
- * @return bkserver BK server address
- */
- public String getBkserver() {
- return bkserver;
- }
-
- /**
- * Sets BK server address
- *
- * @param bkserver BK server address
- * @throws java.lang.IllegalArgumentException if bkserver is null
- */
- public void setBkserver(String bkserver) {
-
- if (bkserver == null) {
- throw new IllegalArgumentException("Jobid bkserver");
- }
-
- this.bkserver = bkserver;
- }
-
- /**
- * Returns unique part of jobId
- *
- * @return unique part of jobId
- */
- public String getUnique() {
- return unique;
- }
-
- /**
- * Sets unique part of jobId
- *
- * @param unique
- * @throws java.lang.IllegalArgumentException if unique is null
- */
- public void setUnique(String unique) {
-
- if (unique == null) {
- throw new IllegalArgumentException("Jobid unique");
- }
-
- this.unique = unique;
- }
-
- /**
- * Returns port number
- *
- * @return port number
- */
- public int getPort() {
- return port;
- }
-
- /**
- * Sets port number
- *
- * @param port number
- * @throws java.lang.IllegalArgumentException if port is lower than 0 or
- * bigger than 65535
- */
- public void setPort(int port) {
-
- if (port <= 0 || port >= 65536) {
- throw new IllegalArgumentException("Jobid port");
- }
-
- this.port = port;
- }
-
- /**
- * Returns Jobid string representation in format bkserver:port/unique
- *
- * @return Jobid string representation in format bkserver:port/unique
- */
- public String toString() {
- return bkserver + ":" + port + "/" + unique;
- }
-}
+++ /dev/null
-# : /cvs/jra1mw/org.glite.jobid.api-c/project/version.properties,v 1.1 2009/01/16 08:48:52 zsustr Exp $
-module.version=2.1.2
-module.age=2
echo -n "."
# createuser $PG_ARGS -A -D "$RTM_NAME" >/dev/null 2>&1
# echo -n "."
- createdb $PG_ARGS --encoding "UTF-8" --template template0 --owner "$RTM_USER" "$RTM_NAME" >psql-create.log 2>&1 || return $?
+ createdb $PG_ARGS --encoding "UTF-8" --owner "$RTM_USER" "$RTM_NAME" >psql-create.log 2>&1 || return $?
rm psql-create.log
echo -n "."
rtm_db_created="1"
$conftag = $branch;
# forced low age number
$age = $branch eq 'HEAD' ? '0head' : '0dev';
- # add project major version number
- $age .= '.'.$project_version;
push @copts, '--version ${version}-${age}';
}
else {
if ($project eq 'emi' and $project_version == 1) {
$age = $age - 1;
}
-
- # '.emi1' suffix for older packaging
- if ($project eq 'emi' and $project_version == 1) {
- $age = $age.'.'.$project.$project_version;
- }
}
+
+ # emi1 suffix for older packaging
if ($project eq 'emi' and $project_version == 1) {
+ $age = $age.$project.$project_version;
$conf = $conf.$project.$project_version;
}
`diff -b "$file" "$file.new"`;
if ($? == 0) {
- print STDERR "($file not changed)\n" if ($debug);
+ print STDERR "($file not changed)\n";
unlink "$file.new";
} else {
print STDERR "Writing $file\n";
+++ /dev/null
-build
-doc
-reports
+++ /dev/null
-LICENSE file for EGEE Middleware
-================================
-
-Copyright (c) 2004 on behalf of the EU EGEE Project:
-The European Organization for Nuclear Research (CERN),
-Istituto Nazionale di Fisica Nucleare (INFN), Italy
-Datamat Spa, Italy
-Centre National de la Recherche Scientifique (CNRS), France
-CS Systeme d'Information (CSSI), France
-Royal Institute of Technology, Center for Parallel Computers (KTH-PDC), Sweden
-Universiteit van Amsterdam (UvA), Netherlands
-University of Helsinki (UH.HIP), Finlan
-University of Bergen (UiB), Norway
-Council for the Central Laboratory of the Research Councils (CCLRC), United Kingdom
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-1. Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-
-3. The end-user documentation included with the redistribution, if
-any, must include the following acknowledgment: "This product includes
-software developed by The EU EGEE Project (http://cern.ch/eu-egee/)."
-Alternatively, this acknowledgment may appear in the software itself, if
-and wherever such third-party acknowledgments normally appear.
-
-4. The names EGEE and the EU EGEE Project must not be
-used to endorse or promote products derived from this software without
-prior written permission. For written permission, please contact
-<email address>.
-
-5. You are under no obligation whatsoever to provide anyone with any
-bug fixes, patches, or upgrades to the features, functionality or
-performance of the Software ("Enhancements") that you may develop over
-time; however, if you choose to provide your Enhancements to The EU
-EGEE Project, or if you choose to otherwise publish or distribute your
-Enhancements, in source code form without contemporaneously requiring
-end users of The EU EGEE Proejct to enter into a separate written license
-agreement for such Enhancements, then you hereby grant The EU EGEE Project
-a non-exclusive, royalty-free perpetual license to install, use, copy,
-modify, prepare derivative works, incorporate into the EGEE Middleware
-or any other computer software, distribute, and sublicense your
-Enhancements or derivative works thereof, in binary and source code
-form (if any), whether developed by The EU EGEE Project or third parties.
-
-THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL PROJECT OR ITS CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-This software consists of voluntary contributions made by many
-individuals on behalf of the EU EGEE Prject. For more information on The
-EU EGEE Project, please see http://cern.ch/eu-egee/. For more information on
-EGEE Middleware, please see http://egee-jra1.web.cern.ch/egee-jra1/
-
-
+++ /dev/null
-# defaults
-top_srcdir=..
-builddir=build
-stagedir=.
-distdir=.
-globalprefix=glite
-lbutilsprefix=lbu
-package=glite-lbjp-common-db
-PREFIX=/opt/glite
-prefix=
-
-mysql-devel_prefix=/opt/mysql
-postgresql_prefix=/usr
-cppunit_prefix=/opt/cppunit
-thrflavour=gcc32pthr
-nothrflavour=gcc32
-
--include Makefile.inc
--include ${top_srcdir}/project/version.properties
-
-version=${module.version}
-
-CC=gcc
-
-VPATH=${top_srcdir}/interface:${top_srcdir}/src:${top_srcdir}/examples:${top_srcdir}/test
-
-DEBUG:=-g -O0 -W -Wall
-
-CFLAGS:= ${CFLAGS} \
- ${DEBUG} \
- -DVERSION=\"${version}\" \
- -I${stagedir}${prefix}/include -I${top_srcdir}/src -I. \
- -I${top_srcdir}/interface \
- ${COVERAGE_FLAGS} \
- -D_GNU_SOURCE \
- -DHAVE_SYSLOG_H=1
-
-ifdef LBS_DB_PROFILE
- CFLAGS:=${CFLAGS} -DLBS_DB_PROFILE
-endif
-ifneq (${mysql-devel_prefix},no)
- OBJS:=${OBJS} db-mysql.o
- CFLAGS:=${CFLAGS} -DMYSQL_ENABLED=1
- MYSQL_CFLAGS?=-I${mysql-devel_prefix}/include -I${mysql-devel_prefix}/include/mysql
- MYSQL_LIBS?=-L${mysql-devel_prefix}/${libdir} -L${mysql-devel_prefix}/${libdir}/mysql -lmysqlclient
-endif
-ifneq (${postgresql_prefix},no)
- OBJS:=${OBJS} db-pg.o
- CFLAGS:=${CFLAGS} -DPSQL_ENABLED=1
- PSQL_CFLAGS?=-I${postgresql_prefix}/include -I${postgresql_prefix}/include/postgresql
- PSQL_LIBS?=-L${postgresql_prefix}/${libdir} -lpq
-endif
-
-TEST_LIBS:=-L${cppunit_prefix}/${libdir} -lcppunit
-TEST_INC:=-I${cppunit_prefix}/include
-
-LDFLAGS:=${LDFLAGS} -L${stagedir}${prefix}/${libdir} ${COVERAGE_FLAGS}
-
-COMPILE:=libtool --mode=compile ${CC} ${CFLAGS}
-COMPILEXX:=libtool --mode=compile ${CXX} ${CFLAGS}
-LINK:=libtool --mode=link ${CC} -rpath ${stagedir}${prefix}/${libdir} ${LDFLAGS}
-LINKXX:=libtool --mode=link ${CXX} -rpath ${stagedir}${prefix}/${libdir} ${LDFLAGS}
-INSTALL:=libtool --mode=install install
-
-EXT_LIBS:=-lglite_lbu_trio -lglite_lbu_log ${MYSQL_LIBS} ${PSQL_LIBS}
-TESTOBJS:=${OBJS} dbtest.o
-OBJS:=${OBJS} db.o
-HDRS:=db.h
-LOBJS:=${OBJS:.o=.lo}
-LTESTOBJS:=${TESTOBJS:.o=.lo}
-
-# In order to use libtool versioning correcty, we must have:
-#
-# current = major + minor + offset
-# revision = patch
-# age = minor
-#
-# where offset is a sum of maximal released minor's of all previous major's
-#
-
-# counted minors: 1.0, 2.0
-offset=0
-
-version_info:=-version-info ${shell \
- perl -e '$$,=":"; @F=split "\\.","${version}"; print $$F[0]+$$F[1]+${offset},$$F[2],$$F[1]' }
-
-default all: compile doc
-
-libglite_lbu_db.la: ${LOBJS}
- ${LINK} ${version_info} -o $@ $+ ${EXT_LIBS}
-
-libglite_lbu_dbtest.la: ${LTESTOBJS}
- ${LINK} ${version_info} -o $@ $+ ${EXT_LIBS}
-
-dbtest.lo dbtest.o: db.c db.h
- ${COMPILE} -DGLITE_LBU_DEFAULT_RESULT_BUFFER_LENGTH=10 -c $< -o $@
-
-db_test_mysql: db_test_mysql.lo libglite_lbu_dbtest.la
- ${LINK} -o $@ $+
-
-db_test_psql: db_test_psql.lo libglite_lbu_dbtest.la
- ${LINK} -o $@ $+
-
-db_expire: db_expire.lo libglite_lbu_dbtest.la
- ${LINK} -o $@ $+
-
-timezone: timezone.lo libglite_lbu_db.la
- ${LINKXX} -o $@ $+ ${TEST_LIBS}
-
-compile: libglite_lbu_db.la
-
-check: timezone
- LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${log4c_prefix}/${libdir} ./timezone
-
-test_coverage:
- -mkdir coverage
- cd coverage && $(MAKE) -f ../Makefile top_srcdir=../../ COVERAGE_FLAGS="-fprofile-arcs -ftest-coverage" check
- cd coverage && for i in `echo ${OBJS} | tr ' ' '\012' | sort -u`; do gcov $$i ; done
-
-examples: db_test_mysql db_test_psql db_expire
-
-doc:
-
-olddoc:
- cp ${top_srcdir}/doc/*.dox .
- echo "PROJECT_NUMBER = ${version}" >> C.dox
- doxygen C.dox
-
-stage: compile
- $(MAKE) install PREFIX=${stagedir} DOSTAGE=yes
-
-dist: distsrc distbin
-
-distsrc:
- mkdir -p ${top_srcdir}/${package}-${version}
- cd ${top_srcdir} && GLOBIGNORE="${package}-${version}" && cp -Rf * ${package}-${version}
- cd ${top_srcdir} && tar -czf ${distdir}/${package}-${version}_src.tar.gz --exclude-from=project/tar_exclude ${package}-${version}
- rm -rf ${top_srcdir}/${package}-${version}
-
-distbin:
- $(MAKE) install PREFIX=`pwd`/tmpbuilddir${stagedir}
- save_dir=`pwd`; cd tmpbuilddir${stagedir}${prefix} && tar -czf $$save_dir/${top_srcdir}/${distdir}/${package}-${version}_bin.tar.gz *; cd $$save_dir
- rm -rf tmpbuilddir
-
-install: all
- -mkdir -p ${DESTDIR}${PREFIX}${prefix}/${libdir}
- -mkdir -p ${DESTDIR}${PREFIX}${prefix}/share/doc/${package}-${version}
- -mkdir -p ${DESTDIR}${PREFIX}${prefix}/include/${globalprefix}/${lbutilsprefix}
- ${INSTALL} -m 644 ${top_srcdir}/LICENSE ${DESTDIR}${PREFIX}${prefix}/share/doc/${package}-${version}
- -cp -r C ${DESTDIR}${PREFIX}${prefix}/share/doc/${package}-${version}
- ${INSTALL} -m 755 "libglite_lbu_db.la" "${DESTDIR}${PREFIX}${prefix}/${libdir}/libglite_lbu_db.la"; \
- ${INSTALL} -m 644 ${top_srcdir}/interface/${HDRS} ${DESTDIR}${PREFIX}${prefix}/include/${globalprefix}/${lbutilsprefix}
-
-clean:
- rm -rvf *.o *.lo *.loT .libs lib* *.c *.h *.dox C/ CPP/
- rm -rvf db_expire db_test db_test_mysql db_test_psql timezone
-
-distclean:
- rm -rvf Makefile.inc *.spec debian/
-
-db-mysql.o db-mysql.lo: db-mysql.c
- ${COMPILE} ${MYSQL_CFLAGS} -c $<
-
-db-pg.o db-pg.lo: db-pg.c
- ${COMPILE} ${PSQL_CFLAGS} -c $<
-
-db_test_mysql.o db_test_mysql.lo: db_test.c
- ${COMPILE} -DMYSQL_BACKEND=1 -c $< -o $@
-
-db_test_psql.o db_test_psql.lo: db_test.c
- ${COMPILE} -DPSQL_BACKEND=1 -c $< -o $@
-
-timezone.o timezone.lo: timezone.cpp
- ${COMPILEXX} -c $< -o $@ ${TEST_INC}
-
-%.o %.lo: %.c
- ${COMPILE} -c $<
-
-db.lo: db.c db.h db-int.h
-db_test_psql.lo: libglite_lbu_dbtest.la db.h db-int.h db_test.c
-db_test_mysql.lo: libglite_lbu_dbtest.la db.h db-int.h db_test.c
-db-mysql.lo: db-mysql.c db-int.h db.h
-db-pg.lo: db-pg.c db-int.h db.h
-
-.PHONY: default all compile check examples doc stage dist distsrc distbin install clean test_coverage distclean
+++ /dev/null
-#!/usr/bin/perl
-
-# WARNING: Don't edit this file unless it is the master copy in org.glite.lb
-#
-# For the purpose of standalone builds of lb/jobid/lbjp-common components
-# it is copied on tagging
-
-# $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.
-#
-
-use Getopt::Long;
-use POSIX qw(locale_h strftime);
-
-my $pwd = `pwd`; chomp $pwd;
-my $prefix = '/usr';
-my $stagedir = undef;
-my $root = $pwd.'/stage';
-my $sysroot = '';
-my $sysconfdir;
-my $localstatedir;
-my $staged;
-my $module;
-my $thrflavour = 'gcc64dbgpthr';
-my $nothrflavour = 'gcc64dbg';
-my $mode = 'build';
-my $help = 0;
-my $listmodules;
-my ($version, $force_version);
-my $branch;
-my $output;
-my $lb_tag = '';
-my $lbjp_tag = '';
-my $jp_tag = '';
-my $jobid_tag = '';
-my $libdir = getlibdir();
-my $project = 'emi';
-my $project_version;
-my (%projects, %project);
-my $debug = 0;
-my $pkg_config_env = (defined $ENV{PKG_CONFIG_PATH}) ? "$ENV{PKG_CONFIG_PATH}:" : '';
-
-my @nodes = qw/client server logger logger-msg nagios utils client-java doc ws-test db jpprimary jpindex jpclient harvester lb px proxyrenewal/;
-my @default_nodes = qw/lb px proxyrenewal nagios/;
-my %enable_nodes;
-my %disable_nodes;
-my %default_nodes; @default_nodes{@default_nodes} = (1) x ($#default_nodes + 1);
-
-my %package = (
- 'maintainer' => 'CESNET Product Teams <emi-lb@metacentrum.cz>',
- 'uploaders' => 'František Dvořák <valtri@civ.zcu.cz>',
- 'url' => 'http://glite.cern.ch',
- 'debian_vcs' => 'Vcs-Cvs: :pserver:anonymous@jra1mw.cvs.cern.ch:/cvs/jra1mw
-Vcs-Browser: http://jra1mw.cvs.cern.ch/cgi-bin/jra1mw.cgi',
-);
-
-# key: internal package name (arguments, ...)
-# 'pkg': pkg-config name
-# 'prefix': used when pkg-config fails
-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-devel' => {
- prefix=> '/opt/globus',
- pkg => 'myproxy'
- },
- 'myproxy-server' => {
- prefix=> '',
- },
- 'myproxy-admin' => {
- prefix=> '',
- },
- gsoap => {
- prefix=> '/usr',
- pkg => 'gsoap'
- },
- gsoapxx => {
- prefix=> '/usr',
- pkg => 'gsoap++'
- },
- mysql => {
- prefix=> '/usr'
- },
- 'mysql-devel' => {
- prefix=> ''
- },
- 'mysql-server' => {
- prefix => ''
- },
- voms => {
- prefix => '/opt/glite',
- pkg => 'voms-2.0'
- },
- gridsite => {
- prefix => '/opt/glite'
- },
- lcas => {
- prefix => '/opt/glite',
- pkg => 'lcas'
- },
- trustmanager => {
- prefix => '/opt/glite'
- },
- trustmanager_axis => {
- prefix => '/opt/glite'
- },
- utiljava => {
- prefix=> '/opt/glite'
- },
- ant => {
- prefix=> '/usr'
- },
- jdk => {
- prefix=> '/usr/java/latest',
- locations => [ '/usr/lib/jvm/java', '/usr/lib/jvm/default-java', '/usr/java/latest' ],
- },
- libtar => {
- prefix=> '/usr'
- },
- axis => {
- prefix=> '/usr'
- },
- log4c => {
- prefix=> '/usr'
- },
- postgresql => {
- prefix=> '/usr'
- },
- activemq => {
- prefix=>'/opt/activemq-cpp-library',
- pkg => 'activemq-cpp'
- },
-);
-
-my %jar = (
- 'jakarta-commons-codec' => '/usr/share/java/commons-codec.jar',
- 'jakarta-commons-lang' => '/usr/share/java/commons-lang.jar',
-);
-
-
-my %glite_prefix;
-my %need_externs;
-my %need_externs_type;
-my %need_jars;
-my %extrafull;
-my %extranodmod;
-my %deps;
-my %deps_type;
-my %buildroot;
-my (%etics_externs, %etics_projects);
-
-#
-# modules of the subsystems
-#
-# additional modules from $project{modules} are automatically added
-#
-my %lbmodules = (
- 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim logger-msg nagios client-devel client-progs common-devel logger-devel state-machine-devel/],
- 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin db-devel log-devel maildir-devel server-bones-devel trio-devel jp-interface-devel gss-devel gsoap-plugin-devel/],
- 'jobid' => [qw/api-c api-c-devel api-cpp api-cpp-devel api-java/],
- 'jp' => [ qw/client doc index primary server-common ws-interface/ ],
- 'gridsite' => [ qw/apache libs commands core devel slashgrid services service-clients gsexec/ ],
- 'px' => [ qw/proxyrenewal myproxy-yaim proxyrenewal-devel proxyrenewal-progs/ ],
- 'canl' => [ qw/c c-devel/ ],
- );
-
-#
-# sub-packages
-#
-# modify %lbmodules, %deps_aux, %extrafull, and %properties accodingly
-#
-my %subpackages = (
- 'jobid.api-c-devel' => 'jobid.api-c',
- 'jobid.api-cpp-devel' => 'jobid.api-cpp',
- 'lbjp-common.db-devel' => 'lbjp-common.db',
- 'lbjp-common.gsoap-plugin-devel' => 'lbjp-common.gsoap-plugin',
- 'lbjp-common.gss-devel' => 'lbjp-common.gss',
- 'lbjp-common.jp-interface-devel' => 'lbjp-common.jp-interface',
- 'lbjp-common.log-devel' => 'lbjp-common.log',
- 'lbjp-common.maildir-devel' => 'lbjp-common.maildir',
- 'lbjp-common.server-bones-devel' => 'lbjp-common.server-bones',
- 'lbjp-common.trio-devel' => 'lbjp-common.trio',
- 'lb.client-progs' => 'lb.client',
- 'lb.client-devel' => 'lb.client',
- 'lb.common-devel' => 'lb.common',
- 'lb.logger-devel' => 'lb.logger',
- 'lb.state-machine-devel' => 'lb.state-machine',
- 'px.proxyrenewal-devel' => 'px.proxyrenewal',
- 'px.proxyrenewal-progs' => 'px.proxyrenewal',
- 'canl.c-devel' => 'canl.c',
-);
-
-my @opts = (
- 'prefix:s' => \$prefix,
- 'staged=s' => \$staged,
- 'module=s' => \$module,
- 'thrflavour:s' => \$thrflavour,
- 'nothrflavour:s' => \$nothrflavour,
- 'mode=s' => \$mode,
- 'listmodules=s' => \$listmodules,
- 'version=s' => \$force_version,
- 'branch=s' => \$branch,
- 'output=s' => \$output,
- 'stage=s' => \$stagedir,
- 'root:s' => \$root,
- 'sysroot:s' => \$sysroot,
- 'sysconfdir=s' => \$sysconfdir,
- 'localstatedir=s' => \$localstatedir,
- 'lb-tag=s' => \$lb_tag,
- 'lbjp-common-tag=s' => \$lbjp_tag,
- 'jp-tag=s' => \$jp_tag,
- 'jobid-tag=s' => \$jobid_tag,
- 'canl-tag=s' => \$canl_tag,
- 'help' => \$help,
- 'libdir=s' => \$libdir,
- 'project=s' => \$project,
- 'debug' => \$debug,
-);
-
-for (@nodes) {
- $enable_nodes{$_} = 0;
- $disable_nodes{$_} = 0;
-
- push @opts,"disable-$_",\$disable_nodes{$_};
- push @opts,"enable-$_",\$enable_nodes{$_};
-}
-
-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";
-$prefix=~s/\/$//;
-$root=~s/\/$//;
-$sysroot=~s/\/$//;
-if (not $sysconfdir) { $sysconfdir = $prefix eq '/usr' ? '/etc' : "$prefix/etc"; }
-if (not $localstatedir) { $localstatedir = $prefix eq '/usr' ? '/var' : "$prefix/var"; }
-$sysconfdir=~s/\/$//;
-$localstatedir=~s/\/$//;
-
-$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq '';
-$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq '';
-$externs{'gsoapxx'}{prefix}=$externs{gsoap}{prefix} if $externs{'gsoapxx'}{prefix} eq '';
-
-$externs{'mysql-server'}{withprefix}=$externs{mysql}{withprefix} if $externs{'mysql-server'}{withprefix} eq '';
-$externs{'mysql-devel'}{wihtprefix}=$externs{mysql}{withprefix} if $externs{'mysql-devel'}{withprefix} eq '';
-$externs{'gsoapxx'}{withprefix}=$externs{gsoap}{withprefix} if $externs{'gsoapxx'}{withprefix} eq '';
-
-if ($project =~ /^([^0-9]*)(.*)$/) {
- $project = $1;
- $project_version = $2;
-}
-%project = %{$projects{$project}};
-$project_version = $project{current_version} unless $project_version;
-for my $platform (keys %{$project{etics_externs}}) {
- for $_ (keys %{$project{etics_externs}{$platform}}) {
- $etics_externs{$platform}{$_} = $project{etics_externs}{$platform}{$_};
- }
-}
-reshuffle_platforms(\%etics_externs, $project{supported_platforms});
-reshuffle_platforms(\%{$project{etics_externs_devel}}, $project{supported_platforms});
-for $_ (keys %{$project{etics_projects}}) {
- $etics_projects{$_} = $project{etics_projects}{$_};
-}
-for $_ (keys %{$project{need_externs_aux}}) {
- $need_externs_aux{$_} = $project{need_externs_aux}{$_};
-}
-for my $ext (keys %need_externs_aux) {
- for (@{$need_externs_aux{$ext}}) {
- my ($pkg, $type) =/([^:]*)(?::(.*))?/;
- $type = 'BR' unless ($type);
-
- push @{$need_externs{$ext}},$pkg;
- $need_externs_type{$ext}->{$pkg} = $type;
- }
-}
-if ($project eq 'emi') {
- $extranodmod{lb} = 'lb.emi-lb';
- $extranodmod{px} = 'px.emi-px';
-}
-for $_ (keys %{$project{modules}}) {
- push @{$lbmodules{$_}},@{$project{modules}{$_}};
-}
-
-
-if ($help) { usage(); exit 0; }
-
-if ($listmodules) {
- my $name_prefix = ($listmodules eq 'gridsite' and $project eq 'glite') ? 'org' : $project{etics_name};
- my @m;
-
- if (exists $lbmodules{$listmodules}) {
- @m = map exists $subpackages{$listmodules . '.' . $_} ? "" : "$name_prefix.$listmodules.$_",@{$lbmodules{$listmodules}};
- } else {
- if ($project eq 'emi' and $project_version == 1) {
- # no sub-packages in EMI-1
- } else {
- for my $sub (keys %subpackages) {
- push @m, $sub if ($subpackages{$sub} eq $listmodules);
- }
- }
- }
- print map $_ eq "" ? "" : "$_ ", @m;
- print "\n";
- exit 0;
-}
-
-warn "$0: --branch and --output make sense only in --mode=etics\n"
- if ($output || $branch) && $mode ne 'etics';
-
-my $en;
-for (keys %enable_nodes) { $en = 1 if $enable_nodes{$_}; }
-
-my $dis;
-for (keys %disable_nodes) { $dis = 1 if $disable_nodes{$_}; }
-
-die "--enable-* and --disable-* are mutually exclusive\n"
- if $en && $dis;
-
-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{jp}};
-
-if ($dis) {
- for (@nodes) {
- $enable_nodes{$_} = 1 unless ($disable_nodes{$_} or not $default_nodes{$_});
- }
-}
-
-if (!$en && !$dis) { for (@nodes) { $enable_nodes{$_} = 1 if ($default_nodes{$_}) } };
-
-for (keys %enable_nodes) { delete $enable_nodes{$_} unless $enable_nodes{$_}; }
-
-$stagedir = $root unless $stagedir;
-$stagedir=~s/\/$// if ($stagedir);
-
-if ($mode eq 'build') { for my $ext (keys %externs) {
- if (defined $externs{$ext} and defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; }
- elsif (defined $externs{$ext}{pkg}) {
- my ($flag, $env, $cmd, $ret);
- my $pkg = $externs{$ext}{pkg};
- my $flagname = uc $externs{$ext}{pkg};
- $flagname =~ s/-[0-9\.]*$//;
- $flagname =~ y/-\+/_X/;
-
- print "Checking $pkg ... ";
- $env = "PKG_CONFIG_PATH=$pkg_config_env$stagedir$prefix/$libdir/pkgconfig";
- $cmd = "$env pkg-config $pkg --exists >/dev/null";
- `$cmd`; $ret = $?;
- print "('$cmd' => $ret)\n" if ($debug);
- if ($ret == 0) {
- $externs{$ext}{prefix}=`$env pkg-config $pkg --variable=prefix`;
- chomp $externs{$ext}{prefix};
- print "$externs{$ext}{prefix}\n";
-
- $flag=`$env pkg-config $pkg --cflags`;
- $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag);
- $flag=`$env pkg-config $pkg --libs`;
- $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag);
- } else {
- print "(using default $externs{$ext}{prefix})\n";
- }
- print "\n" if ($debug);
- }
- elsif ($ext eq 'jdk') {
- my $jdk_prefix;
-
- print "Looking for some caffein ... ";
- if (defined $ENV{'JDK_HOME'}) {
- $jdk_prefix = $ENV{'JDK_HOME'};
- print "JDK_HOME=$jdk_prefix\n";
- } elsif (defined $ENV{'JAVA_HOME'}) {
- $jdk_prefix = $ENV{'JAVA_HOME'};
- print "JAVA_HOME=$jdk_prefix\n";
- } else {
- foreach my $i (0..$#{$externs{$ext}{locations}}) {
- if (-e $externs{$ext}{locations}[$i]) {
- $jdk_prefix=$externs{$ext}{locations}[$i];
- print "(found directory $jdk_prefix)\n";
- last;
- }
- }
- print "(using default $externs{$ext}{prefix})\n" unless ($jdk_prefix);
- }
- $externs{$ext}{prefix} = $jdk_prefix if ($jdk_prefix);
- }
-} }
-
-if ($mode eq 'build') {
- print "Writing config.status\n";
- open CONF,">config.status" or die "config.status: $!\n";
- for ('JDK_HOME', 'JAVA_HOME', 'PKG_CONFIG_PATH') {
- print CONF "$_=$ENV{$_} " if (defined $ENV{$_});
- }
- print CONF "$0 @keeparg\n";
- close CONF;
-}
-
-
-my @modules;
-my %aux;
-
-if ($module) {
-# push @modules,split(/[,.]+/,$module);
- push @modules,$module;
-}
-else {
- @modules = map(($extranodmod{$_} ? $extranodmod{$_} : 'lb.'.$_),(keys %enable_nodes));
-
- my $n;
-
- do {
- local $"="\n";
- $n = $#modules;
- push @modules,(map @{$deps{$_}},@modules);
-
- undef %aux; @aux{@modules} = (1) x ($#modules+1);
- @modules = keys %aux;
- } while ($#modules > $n);
-}
-
-@aux{@modules} = (1) x ($#modules+1);
-delete $aux{$_} for (split /,/,$staged);
-@modules = keys %aux;
-
-mode_build() if $mode eq 'build';
-mode_checkout() if $mode eq 'checkout';
-mode_etics($module) if $mode eq 'etics';
-
-sub mode_build {
- print "\nBuilding modules: @modules\n";
- print "Mode: "; print $module ? "single module" : "multiple modules"; print "\n";
-
- my @ext = map @{$need_externs{$_}},@modules;
- my @myjars = map @{$need_jars{$_}},@modules;
- undef %aux; @aux{@ext} = 1;
- @ext = keys %aux;
- undef %aux; @aux{@myjars} = (1) x ($#myjars+1);
- @myjars = keys %aux;
-
- print "\nRequired externals:\n";
- print "\t$_: ".($externs{$_}{prefix}?$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;
-
- if ($module) {
- print "Not creating summary Makefile\n" if $debug;
- } else {
- print "Creating Makefile\n";
-
- open MAK,">Makefile" or die "Makefile: $!\n";
-
- print MAK "all: @modules\n\n";
- print MAK "stage: ".(join '-stage ', @modules)."-stage\n\n";
- print MAK "clean check install:\n";
-
- for (@modules) {
- my $full = full($_);
- print MAK "\tcd $full/$buildroot{$_} && \${MAKE} \$@\n"
- }
-
- print MAK "\ndistclean:\n";
-
- for (@modules) {
- my $full = full($_);
- print MAK $buildroot{$_} eq '' ?
- "\tcd $full && \${MAKE} distclean\n" :
- "\trm -rf $full/$buildroot{$_}\n"
- }
-
- print MAK "\n";
-
- for (@modules) {
- my %ldeps; undef %ldeps;
- @ldeps{@{$deps{$_}}} = 1;
- for my $x (split /,/,$staged) { delete $ldeps{$x}; }
- my @dnames = $module ? () : keys %ldeps;
- my $snames = $#dnames == -1 ? '' : join('-stage ', @dnames).'-stage';
-
- my $full = full($_);
- my $build = $buildroot{$_};
-
- print MAK "$_: @dnames\n\tcd $full/$build && \${MAKE} && \${MAKE} install\n\n";
- print MAK "$_-stage: $snames\n\tcd $full/$build && \${MAKE} && \${MAKE} stage\n\n";
- }
-
- close MAK;
- }
-}
-
-sub mode_checkout() {
- for (@modules) {
- my $module = $_;
- my $tag = "";
- if ($lb_tag){
- for (@{$lbmodules{lb}}){
- if ("lb.".$_ eq $module){
- $tag = '-r '.$lb_tag;
- }
- }
- }
- if ($lbjp_tag) {
- for (@{$lbmodules{'lbjp-common'}}){
- if ("lbjp-common.".$_ eq $module){
- $tag = '-r '.$lbjp_tag;
- }
- }
- }
- if ($jp_tag){
- for (@{$lbmodules{'jp'}}){
- if ("jp.".$_ eq $module){
- $tag = '-r '.$jp_tag;
- }
- }
- }
- if ($jobid_tag){
- for (@{$lbmodules{jobid}}){
- if ("jobid.".$_ eq $module){
- $tag = '-r '.$jobid_tag;
- }
- }
- }
- if ($canl_tag) {
- for (@{$lbmodules{'canl'}}){
- if ("canl.".$_ eq $module){
- $tag = '-r '.$canl_tag;
- }
- }
- }
- #if (grep {"lb.".$_ eq $module} @{$lbmodules{lb}}){
- # print "found";
- #}
- $_ = full($_);
- print "\n*** Checking out $_\n";
- system("cvs checkout $tag $_") == 0 or die "cvs checkout $tag $_: $?\n";
- }
-}
-
-BEGIN{
-%etics_externs = (
- default => {
- 'myproxy-devel'=>'myproxy-devel',
- 'myproxy-server'=>'myproxy-server',
- 'myproxy-admin'=>'myproxy-admin',
- cares=>'c-ares',
- utiljava=>'org.glite.security.util-java',
- gpt=>'gpt',
- fetchcrl=>'fetch-crl',
- activemq=>'activemq-cpp-library',
- },
-);
-
-%etics_projects = (
-);
-
-%need_externs_aux = (
- 'lb.client' => [ qw/cppunit:B classads libtool:B globus:B/ ],
- 'lb.common' => [ qw/expat cares:B cppunit:B classads libtool:B globus:B/ ],
- 'lb.doc' => [ qw/tetex-latex:B/ ],
- 'lb.logger' => [ qw/cppunit:B libtool:B globus:B/ ],
- 'lb.logger-msg' => [ qw/cppunit:B activemq libtool:B globus:B/ ],
- 'lb.nagios' => [ qw/globus_proxy_utils:R/ ],
- 'lb.server' => [ qw/globus_essentials:R globus:B expat cares mysql-server:R cppunit:B gsoap:B classads voms:B lcas gridsite:B bison:B libtool:B libxml2 flex:B/ ],
- 'lb.state-machine' => [ qw/classads libtool:B libxslt:B expat:B globus:B/ ],
- 'lb.utils' => [ qw/cppunit:B libtool:B globus:B/ ],
- 'lb.ws-interface' => [ qw/libxslt:B tidy:B/ ],
- 'lb.ws-test' => [ qw/gsoap:B libtool:B globus:B/ ],
- 'lb.types' => [ qw// ],
- 'lb.harvester' => [ qw/docbook-utils:B libtool:B globus:B/ ],
- 'lbjp-common.db' => [ qw/mysql-devel:B postgresql:B cppunit:B log4c:B libtool:B/ ],
- 'lbjp-common.log' => [ qw/log4c libtool:B/ ],
- 'lbjp-common.maildir' => [ qw/libtool:B/ ],
- 'lbjp-common.server-bones' => [ qw/libtool:B/ ],
- 'lbjp-common.trio' => [ qw/cppunit:B libtool:B/ ],
- 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B libtool:B/ ],
- 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B libtool:B/ ],
- 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap gsoapxx libtool:B/ ],
- 'jobid.api-c' => [ qw/cppunit:B libtool:B openssl:B/ ],
- 'jobid.api-cpp' => [ qw/cppunit:B libtool:B/ ],
- 'jobid.api-java' => [ qw/ant:B jdk:B/ ],
- 'jp.client' => [ qw/gsoap libtar globus_essentials:R globus:B/ ],
- 'jp.doc' => [],
- 'jp.index' => [ qw/gsoap globus_essentials:R globus:B mysql-server:R/ ],
- 'jp.primary' => [ qw/classads gsoap libtar globus_essentials:R globus:B mysql-server:R/ ],
- 'jp.server-common' => [],
- 'jp.ws-interface' => [],
- 'gridsite.core' => [ qw/httpd-devel:B gsoap:B globus:B curl:B doxygen:B fuse-devel:B libxml2:B openssl:B doxygen:B/ ],
- 'gridsite.commands' => [ qw/curl:R openssl:R/ ],
- 'gridsite.apache' => [ qw/libxml2:R openssl:R curl:R/ ],
- 'gridsite.libs' => [ qw/libxml2:R openssl:R/ ],
- 'gridsite.devel' => [ qw// ],
- 'gridsite.slashgrid' => [ qw/curl:R fuse:R/],
- 'gridsite.services' => [ qw/curl:R gsoap:R/ ],
- 'gridsite.service-clients' => [ qw/curl:R gsoap:R gsoapxx:R/ ],
- 'gridsite.gsexec' => [ qw// ],
- 'gridsite.1.5-compat' => [ qw/httpd-devel:B gsoap:B globus:B curl:B doxygen:B fuse-devel:B libxml2:B openssl:B doxygen:B/ ],
- 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-devel:B voms:B libtool:B/ ],
- 'px.myproxy-config' => [ qw/myproxy-admin:R/ ], # in myproxy-config.spec
- 'canl.c' => [ qw/cares:B openssl:B libtool:B bison:B flex:B krb5-devel:B/ ],
-);
-
-%need_jars = (
- 'jobid.api-java' => [ qw/jakarta-commons-codec/ ],
- 'lb.client-java' => [ qw/jakarta-commons-lang/ ],
-);
-
-for my $jar (keys %need_jars) {
- for (@{$need_jars{$jar}}) {
- $need_externs_type{$jar}->{$_} = 'BR'; # XXX
- }
-}
-
-%deps_aux = (
- 'lb.client' => [ qw/
- lb.types:B lb.common
- lbjp-common.trio
- jobid.api-cpp:B jobid.api-c
- lbjp-common.gss
- / ],
- 'lb.client-java' => [ qw/
- lb.types:B
- lb.ws-interface:B
- jobid.api-java
- / ],
- 'lb.common' => [ qw/
- jobid.api-cpp:B jobid.api-c
- lb.types:B lbjp-common.trio lbjp-common.gss
- / ],
- 'lb.doc' => [ qw/lb.types:B/ ],
- 'lb.logger' => [ qw/
- lbjp-common.trio
- lbjp-common.log
- jobid.api-c
- lb.common
- lbjp-common.gss
- / ],
- 'lb.logger-msg' => [ qw/
- lb.logger:B
- / ],
- 'lb.nagios' => [ qw/
- lb.client:R
- lb.ws-test:R
- lb.utils:R
- / ],
- 'lb.server' => [ qw/
- lb.ws-interface lb.types:B lb.common lb.state-machine lb.utils:R
- lbjp-common.db lbjp-common.server-bones lbjp-common.trio lbjp-common.maildir lbjp-common.log
- jobid.api-c
- lbjp-common.gsoap-plugin lbjp-common.gss
- / ],
- 'lb.state-machine' => [ qw/lb.types:B lb.common lbjp-common.jp-interface lbjp-common.gss/ ],
- 'lb.utils' => [ qw/
- lbjp-common.jp-interface
- jobid.api-c
- lbjp-common.trio lbjp-common.maildir
- lb.client lb.state-machine lb.types:B
- / ],
- 'lb.ws-test' => [ qw/lbjp-common.gsoap-plugin lb.ws-interface/ ],
- 'lb.ws-interface' => [ qw/lb.types:B/ ],
- 'lb.types' => [ qw// ],
- 'lb.harvester' => [ qw/
- jobid.api-c lbjp-common.trio lbjp-common.db lb.common lb.client
- lbjp-common.gss lbjp-common.log
- / ],
- 'lb.yaim' => [ qw// ],
- 'lb.glite-LB' => [ qw/
- lb.logger:R lb.server:R lb.utils:R lb.doc:R
- lb.ws-test:R lb.harvester:R lb.yaim:R lb.client-java:R
- lb.logger-msg:R
- / ],
- 'lb.emi-lb' => [ qw/
- lb.logger:R lb.server:R lb.utils:R lb.doc:R
- lb.ws-test:R lb.harvester:R lb.yaim:R lb.client-java:R
- lb.logger-msg:R
- / ],
- 'lbjp-common.db' => [ qw/lbjp-common.trio lbjp-common.log/ ],
- 'lbjp-common.maildir' => [ qw// ],
- 'lbjp-common.log' => [ qw// ],
- 'lbjp-common.server-bones' => [ qw/lbjp-common.log/ ],
- 'lbjp-common.trio' => [ qw// ],
- 'lbjp-common.gss' => [ qw// ],
- 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ],
- 'jobid.api-c' => [ qw// ],
- 'jobid.api-cpp' => [ qw/jobid.api-c/ ],
- 'jobid.api-java' => [ qw// ],
-
- 'lbjp-common.jp-interface' => [ qw/lbjp-common.trio lbjp-common.db jobid.api-c/ ],
-
- 'jp.client' => [ qw/
- jp.ws-interface
- lbjp-common.jp-interface lbjp-common.maildir
- jobid.api-c
- lbjp-common.gsoap-plugin
- / ],
- 'jp.doc' => [ qw// ],
- 'jp.index' => [ qw/
- jp.server-common jp.ws-interface
- lbjp-common.jp-interface lbjp-common.trio lbjp-common.db lbjp-common.server-bones
- lbjp-common.gsoap-plugin
- / ],
- 'jp.primary' => [ qw/
- jobid.api-c
- jp.server-common jp.ws-interface
- lb.state-machine
- lbjp-common.jp-interface lbjp-common.trio lbjp-common.db lbjp-common.server-bones
- lbjp-common.gsoap-plugin
- / ],
- 'jp.server-common' => [ qw/
- lbjp-common.jp-interface lbjp-common.db
- / ],
- 'jp.ws-interface' => [ qw// ],
-
- 'gridsite.core' => [ qw// ],
- 'gridsite.commands' => [ qw/gridsite.core:B/ ],
- 'gridsite.apache' => [ qw/gridsite.core:B/ ],
- 'gridsite.libs' => [ qw/gridsite.core:B / ],
- 'gridsite.devel' => [ qw/gridsite.core:B/ ],
- 'gridsite.slashgrid' => [ qw/gridsite.core:B/],
- 'gridsite.services' => [ qw/gridsite.core:B/ ],
- 'gridsite.service-clients' => [ qw/gridsite.core:B/ ],
- 'gridsite.gsexec' => [ qw/gridsite.core:B/ ],
-
- 'px.proxyrenewal' => [ qw// ],
- 'px.glite-PX' => [qw/px.myproxy-yaim:R/],
- 'px.emi-px' => [qw/px.myproxy-yaim:R/],
- 'px.myproxy-yaim' => [ qw// ],
- 'px.myproxy-config' => [],
-
- 'canl.c' => [],
-
- # sub-packages (virtual ETICS components depending on the main)
- 'jobid.api-c-devel' => [ qw/jobid.api-c:B/ ],
- 'jobid.api-cpp-devel' => [ qw/jobid.api-cpp:B/ ],
- 'lbjp-common.db-devel' => [ qw/lbjp-common.db:B/ ],
- 'lbjp-common.gsoap-plugin-devel' => [ qw/lbjp-common.gsoap-plugin:B/ ],
- 'lbjp-common.gss-devel' => [ qw/lbjp-common.gss:B/ ],
- 'lbjp-common.jp-interface-devel' => [ qw/lbjp-common.jp-interface:B/ ],
- 'lbjp-common.log-devel' => [ qw/lbjp-common.log:B/ ],
- 'lbjp-common.maildir-devel' => [ qw/lbjp-common.maildir:B/ ],
- 'lbjp-common.server-bones-devel' => [ qw/lbjp-common.server-bones:B/ ],
- 'lbjp-common.trio-devel' => [ qw/lbjp-common.trio:B/ ],
- 'lb.client-progs' => [ qw/lb.client:B/ ],
- 'lb.client-devel' => [ qw/lb.client:B/ ],
- 'lb.common-devel' => [ qw/lb.common:B/ ],
- 'lb.logger-devel' => [ qw/lb.logger:B/ ],
- 'lb.state-machine-devel' => [ qw/lb.state-machine:B/ ],
- 'px.proxyrenewal-devel' => [ qw/px.proxyrenewal:B/ ],
- 'px.proxyrenewal-progs' => [ qw/px.proxyrenewal:B/ ],
- 'canl.c-devel' => [ qw/canl.c:B/ ],
-);
-
-for my $ext (keys %deps_aux) {
- for (@{$deps_aux{$ext}}) {
- /([^:]*)(?::(.*))?/;
- push @{$deps{$ext}},$1;
- my $type = $2 ? $2 : 'BR';
- $deps_type{$ext}->{$1} = $type;
- }
-}
-
-
-%extrafull = (
- gridsite=>'org.gridsite.core',
- 'canl.c' => 'emi.canl.canl-c',
- 'canl.c-devel' => 'emi.canl.canl-c',
- 'jobid.api-c-devel' => 'org.glite.jobid.api-c',
- 'jobid.api-cpp-devel' => 'org.glite.jobid.api-cpp',
- 'lbjp-common.db-devel' => 'org.glite.lbjp-common.db',
- 'lbjp-common.gsoap-plugin-devel' => 'org.glite.lbjp-common.gsoap-plugin',
- 'lbjp-common.gss-devel' => 'org.glite.lbjp-common.gss',
- 'lbjp-common.jp-interface-devel' => 'org.glite.lbjp-common.jp-interface',
- 'lbjp-common.log-devel' => 'org.glite.lbjp-common.log',
- 'lbjp-common.maildir-devel' => 'org.glite.lbjp-common.maildir',
- 'lbjp-common.server-bones-devel' => 'org.glite.lbjp-common.server-bones',
- 'lbjp-common.trio-devel' => 'org.glite.lbjp-common.trio',
- 'lb.client-devel' => 'org.glite.lb.client',
- 'lb.client-progs' => 'org.glite.lb.client',
- 'lb.common-devel' => 'org.glite.lb.common',
- 'lb.logger-devel' => 'org.glite.lb.logger',
- 'lb.state-machine-devel' => 'org.glite.lb.state-machine',
- 'px.proxyrenewal-devel' => 'org.glite.px.proxyrenewal',
- 'px.proxyrenewal-progs' => 'org.glite.px.proxyrenewal',
-);
-
-#( java => 'client-java' );
-%extranodmod = (
- db => 'lbjp-common.db',
- jpprimary => 'jp.primary',
- jpindex => 'jp.index',
- jpclient => 'jp.client',
- lb => 'lb.glite-LB',
- px => 'px.glite-PX',
- proxyrenewal => 'px.proxyrenewal',
- canl => 'canl.c',
-);
-
-%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/ ],
-);
-
-%conflicts = (
-);
-
-%provides = (
- 'lbjp-common.gss' => [ qq/glite-security-gss/ ],
- 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ],
- 'lb.nagios' => [ qq/glite-lb-nagios-plugins/ ],
-);
-
-%cvs_prefix = (
- 'lb' => 'org.glite',
- 'jp' => 'org.glite',
- 'jobid' => 'org.glite',
- 'lbjp-common' => 'org.glite',
- 'gridsite' => 'org',
- 'px' => 'org.glite',
- 'canl' => 'emi',
-);
-
-%cvs_tag_prefix = (
- 'lb' => 'glite-',
- 'jp' => 'glite-',
- 'jobid' => 'glite-',
- 'lbjp-common' => 'glite-',
- 'gridsite' => '',
- 'px' => 'glite-',
- 'canl' => 'emi-',
-);
-
-# ==== projects specification ====
-# etics_name ........... ETICS project name
-# conf_prefix .......... ETICS configurations name prefix
-# tag_prefix ........... VCS tag prefix
-# local_prefix ......... prefix (relative to stage)
-# etics_externs ........ ETICS modules names of externals
-# (${NAME.location}, ETICS conf. dependencies)
-# etics_projects ....... ETICS project names of externals
-# etics_externs_devel .. ETICS modules names of devel versions of externals
-# etics_locations ...... ETICS locations in ${NAME.location} properties
-# need_externs_aux ..... project-specific external dependencies
-# supported_platforms .. platforms supported by the project
-# modules .............. additional modules in subsystems
-%projects = (
- glite => {
- current_version => 3,
- etics_name => 'org.glite',
- conf_prefix => { %cvs_tag_prefix },
- tag_prefix => { %cvs_tag_prefix },
- flavours => '--thrflavour=${globus.thr.flavor} --nothrflavour=${globus.nothr.flavor}',
- local_prefix => '',
- etics_externs => {
- default => {
- globus_essentials=>'vdt_globus_essentials',
- globus=>'globus',
- globus_proxy_utils=>'vdt_globus_essentials',
- gridsite=>'org.gridsite.libs',
- yaim_core=>'org.glite.yaim.core',
- gip_release=>'glite-info-provider-release',
- gip_service=>'glite-info-provider-service',
- bdii=>'bdii',
- glite_version=>'glite-version',
- glite_info_templates=>'glite-info-templates',
- glue_schema=>'glue-schema',
- trustmanager=>'org.glite.security.trustmanager',
- axis=>'axis',
- lcas=>'org.glite.security.lcas',
- gsoapxx=>'-',
- jdk=>'jdk',
- voms=>'org.glite.security.voms-api-cpp',
- },
- },
- etics_externs_devel => {
- default => {
- gridsite=>'org.gridsite.devel',
- voms=>'org.glite.security.voms-api',
- },
- },
- etics_projects => {
- vdt=>[qw/globus globus_essentials globus_proxy_utils gpt/],
- 'org.glite'=>[qw/voms gridsite lcas gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/],
- },
- etics_locations => {
- '*' => '',
- },
- need_externs_aux => {
- 'lb.client-java' => [ qw/ant:B jdk:B axis:B trustmanager utiljava libtool:B/ ],
- 'lb.glite-LB' => [ qw/fetchcrl:R gpt:R gip_release:R gip_service:R bdii:R glite_version:R glite_info_templates:R glue_schema:R/ ],
- 'lb.yaim' => [ qw/yaim_core:R/ ],
- 'px.glite-PX' => [qw/myproxy-server:R myproxy-admin:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/],
- 'px.myproxy-yaim' => [ qw/yaim_core:R/ ],
- },
- supported_platforms => {
- sl5_x86_64_gcc412 => 1,
- sl5_ia32_gcc412 => 1,
- deb5_x86_64_gcc432 => 1,
- deb5_ia32_gcc432 => 1,
- slc4_x86_64_gcc346 => 1,
- slc4_ia32_gcc346 => 1,
- },
- modules => {
- 'lb' => [ qw/glite-LB/ ],
- 'px' => [ qw/glite-PX/ ],
- },
- },
-
- emi => {
- current_version => 2,
- etics_name => 'emi',
- conf_prefix => {
- 'lb' => 'emi-',
- 'jp' => 'emi-',
- 'jobid' => 'emi-',
- 'lbjp-common' => 'emi-',
- 'gridsite' => 'emi-',
- 'px' => 'emi-',
- 'canl' => 'emi-',
- },
- tag_prefix => { %cvs_tag_prefix },
- flavours => '--thrflavour= --nothrflavour=',
- local_prefix => '/usr',
- etics_externs => {
- default => {
- globus_essentials=>'globus-gssapi-gsi',
- globus=>'globus-gssapi-gsi-devel',
- globus_proxy_utils=>'globus-proxy-utils',
- gridsite=>'emi.gridsite.libs',
- yaim_core=>'emi.yaim.yaim-core',
- yaim_bdii=>'emi.bdii.yaim-bdii',
- gip_service=>'emi.bdii.glite-info-provider-service',
- bdii=>'emi.bdii.core',
- glite_version=>'emi.emi-version',
- glue_schema=>'emi.bdii.glue-schema',
- trustmanager=>'emi.java-security.trustmanager',
- trustmanager_axis=>'emi.java-security.trustmanager-axis',
- axis=>'axis1.4',
- lcas=>'emi.sac.lcas',
- gsoapxx=>'-',
- jdk=>'java',
- voms => 'emi.voms.voms-api',
- },
- sl5_x86_64_gcc412EPEL => {
- 'myproxy-devel' => 'myproxy-devel.x86_64',
- },
- sl6_x86_64_gcc446EPEL => {
- 'myproxy-devel' => 'myproxy-devel.x86_64',
- },
- deb6_x86_64_gcc445 => {
- axis => 'axis1.4',
- # mappings in ETICS project configuration
- #globus_essentials => 'libglobus-gssapi-gsi4',
- #globus => 'libglobus-gssapi-gsi-dev',
- #axis => 'libaxis-java',
- #cares => 'libc-ares2',
- #cppunit => 'libcppunit',
- #expat => 'libexpat1',
- #log4c => 'liblog4c3',
- #curl => 'libcurl3',
- #'mysql' => 'libmysqlclient16',
- #'mysql-devel' => 'libmysqlclient-dev',
- #libxslt => 'xsltproc',
- #'jakarta-commons-codec' => 'libcommons-codec-java',
- #'jakarta-commons-lang' => 'libcommons-lang-java',
- #'tetex-latex' => 'texlive-latex-extra',
- #'perl-LDAP' => 'libnet-ldap-perl',
- #'fuse-lib' => 'libfuse2',
- #'fuse' => 'fuse-utils',
- },
- },
- etics_externs_devel => {
- default => {
- cares => 'c-ares-devel',
- classads => 'classads-devel',
- cppunit => 'cppunit-devel',
- expat => 'expat-devel',
- gsoap => 'gsoap-devel',
- voms => 'emi.voms.voms-api-devel',
- libtar => 'libtar-devel',
- log4c => 'log4c-devel',
- postgresql => 'postgresql-devel',
- curl => 'curl-devel',
- libxml2 => 'libxml2-devel',
- openssl => 'openssl-devel',
- gridsite=>'emi.gridsite.devel',
- jdk=>'java-devel',
- },
- deb6_x86_64_gcc445 => {
- # mappings in ETICS project configuration
- #cares => 'libc-ares-dev',
- #cppunit => 'libcppunit-dev',
- #expat => 'libexpat1-dev',
- #libtar => 'libtar-dev',
- #log4c => 'liblog4c-dev',
- #postgresql => 'libpq-dev',
- #curl => 'libcurl4-openssl-dev',
- #libxml2 => 'libxml2-dev',
- #openssl => 'libssl-dev',
- #'tetex-latex' => 'texlive-latex-extra',
- #libxslt=>'xsltproc',
- #'httpd-devel' => 'apache2-prefork-dev',
- #'fuse-devel' => 'libfuse-dev',
- #gsoap => 'gsoap',
- #'krb5-devel' => 'libkrb5-dev',
- },
- },
- etics_projects => {
- 'emi'=>[qw/voms voms-devel gridsite lcas gip_service bdii glite_version glue_schema yaim_core yaim_bdii trustmanager trustmanager_axis/],
- },
- etics_locations => {
- axis => 'axis',
- },
- need_externs_aux => {
- 'lb.client-java' => [ qw/ant:B jdk:B axis:B trustmanager trustmanager_axis libtool:B/ ],
- 'lb.emi-lb' => [ qw/fetchcrl:R gip_service:R bdii:R glite_version:R glue_schema:R/ ],
- 'lb.yaim' => [ qw/yaim_core:R yaim_bdii:R/ ],
- 'px.emi-px' => [qw/myproxy-server:R myproxy-admin:R fetchcrl:R gip_service:R bdii:R glite_version:R glue_schema:R/],
- 'px.myproxy-yaim' => [ qw/yaim_core:R yaim_bdii:R/ ],
- },
- supported_platforms => {
- sl5_x86_64_gcc412EPEL => 1,
- sl5_ia32_gcc412EPEL => 1,
- sl6_x86_64_gcc446EPEL => 1,
- deb6_x86_64_gcc445 => 1,
- },
- modules => {
- 'lb' => [ qw/emi-lb/ ],
- 'px' => [ qw/emi-px/ ],
- },
- },
-);
-
-%platform_properties = (
- 'jobid.api-java' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.types' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.doc' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.ws-interface' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.yaim' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.nagios' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'px.yaim' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'px.myproxy-config' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'gridsite.devel' => {
- default => { 'packageName' => 'gridsite-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libgridsite-dev' },
- },
- 'canl.c-devel' => {
- default => { 'packageName' => 'canl-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libcanl-dev' },
- },
- 'jobid.api-c-devel' => {
- default => { 'packageName' => 'glite-jobid-api-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-jobid-dev' },
- },
- 'jobid.api-cpp-devel' => {
- default => { 'packageName' => 'glite-jobid-api-cpp-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-jobid-cpp-dev' },
- },
- 'lbjp-common.db-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-db-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-db-dev' },
- },
- 'lbjp-common.gsoap-plugin-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-gsoap-plugin-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-gsoap-plugin-dev' },
- },
- 'lbjp-common.gss-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-gss-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-gss-dev' },
- },
- 'lbjp-common.jp-interface-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-jp-interface-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-jp-interface-dev' },
- },
- 'lbjp-common.log-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-log-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-log-dev' },
- },
- 'lbjp-common.maildir-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-maildir-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-maildir-dev' },
- },
- 'lbjp-common.server-bones-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-server-bones-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-server-bones-dev' },
- },
- 'lbjp-common.trio-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-trio-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-trio-dev' },
- },
- 'lb.client-devel' => {
- default => { 'packageName' => 'glite-lb-client-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-client-dev' },
- },
- 'lb.common-devel' => {
- default => { 'packageName' => 'glite-lb-common-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-common-dev' },
- },
- 'lb.state-machine-devel' => {
- default => { 'packageName' => 'glite-lb-state-machine-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-state-machine-dev' },
- },
- 'lb.logger-devel' => {
- default => { 'packageName' => 'glite-lb-logger-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-logger-dev' },
- },
- 'px.proxyrenewal-devel' => {
- default => { 'packageName' => 'glite-px-proxyrenewal-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-security-proxyrenewal-dev' },
- },
- 'canl.c-devel' => {
- default => { 'packageName' => 'canl-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libcanl-c-dev' },
- },
-);
-
-my @k = keys %deps_aux;
-@buildroot{@k} = ('') x ($#k+1);
-
-$buildroot{'gridsite.core'} = 'src';
-}
-
-sub full
-{
- my ($short) = @_;
- my $subsys = $short;
- $subsys =~ s/\..*//;
-
- my $cvs_prefix = exists $cvs_prefix{$subsys} ? $cvs_prefix{$subsys} : 'org.glite';
- return $extrafull{$short} ? $extrafull{$short} : "$cvs_prefix.$short";
-}
-
-sub get_version
-{
- my ($fmod, $top_srcdir) = @_;
-
- my ($subsys,$mod) = split /\./,$fmod,2;
- my ($major,$minor,$rev,$age);
- my $old_;
-
- if ($force_version) {
- $force_version =~ /([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)-(.+)/;
- ($major,$minor,$rev,$age) = ($1,$2,$3,$4);
- }
- else {
- my $path = "$top_srcdir/project";
- if ($subsys eq 'gridsite') {
- $path = "$cvs_prefix{$subsys}.$subsys.core/project";
- }
- open V,"$path/version.properties"
- or die "$path/version.properties: $!\n";
-
- $old_ = $_;
- while (<V>) {
- chomp;
- ($major,$minor,$rev) = ($1,$2,$3) if /module\.version\s*=\s*([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/;
- $age = $1 if /module\.age\s*=\s*([[:digit:]]+)/;
- }
- close V;
- $_ = $old_;
- }
- $version = "$major.$minor.$rev-$age";
-
- return ($major, $minor, $rev, $age);
-}
-
-sub get_description
-{
- my ($top_srcdir) = @_;
-
- my $cvs_module = $top_srcdir;
- my $package_description = "";
- my $package_summary = "";
-
- if (-e "$cvs_module/project/package.description") {
- open V, "$cvs_module/project/package.description";
- $package_description = join ("", <V>);
- close V;
- chomp $package_description;
- }
- else {
- print STDERR "package.description not found for $subsys.$module!\n"; }
-
- if (-e "$cvs_module/project/package.summary") {
- open V, "$cvs_module/project/package.summary";
- $package_summary = join ("", <V>);
- close V;
- chomp $package_summary;
- $package_summary =~ s/\n/\\n/g;
- }
- else {
- print STDERR "package.summary not found for $subsys.$module!\n"; }
-
- return ($package_summary, $package_description);
-}
-
-sub mkinc
-{
- my %aux;
- undef %aux;
- my @m=qw/
-lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.nagios lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lb.emi-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
-px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config px.emi-px
-canl.c
-/;
- @aux{@m} = (1) x ($#m+1);
-
- my ($short) = @_;
- my $full = full $short;
- my ($subsys,$mod) = split /\./,$short,2;
- my $packageName = "$project{tag_prefix}{$subsys}$subsys-${mod}";
-
- unless ($aux{$short}) {
- print "Makefile.inc not needed in $full\n";
- return;
- }
-
- my $top_srcdir = '.';
- my $abs_srcdir = '';
- my $build = '';
-
- if ($module) {
- $top_srcdir = $0;
- $top_srcdir =~ s,/?[^/]*$,,;
- $abs_srcdir = $top_srcdir;
- $top_srcdir =~ s,^$,\.,;
- } else {
- $build = "$full/";
- $abs_srcdir = "$full/";
- unless ($buildroot{$_} eq '') {
- $top_srcdir = '..';
- $build .= "$buildroot{$_}/";
- unless (-d "$build") {
- mkdir "$build" or die "mkdir $build: $!\n";
- }
- }
- }
-
- my ($major, $minor, $rev, $age) = get_version $short, $abs_srcdir;
- my ($package_summary, $package_description) = get_description $abs_srcdir;
- if ($package_description) { $package_description =~ s/(.{1,78}\S|\S+)\s+/$1\n/mg; }
- my $package_description_debian = $package_description;
- $package_description_debian =~ s/^/ /mg;
-
- my ($old_locale, $specdate, $debdate);
-
- # files for ETICS always in root source directory
- mkdir $abs_srcdir."project" unless (-d $abs_srcdir."project");
- open PKGCHL,">".$abs_srcdir."project/changelog"
- or die $abs_srcdir."project/changelog: $!\n";
- $old_locale = setlocale(LC_TIME);
- setlocale(LC_TIME, "C");
- $specdate = strftime("%a %b %d %Y", gmtime());
- $debdate = strftime("%a, %d %b %Y %H:%M:%S %z", gmtime());
- setlocale(LC_TIME, $old_locale);
- print PKGCHL qq{* $specdate CESNET team <emi-lb\@metacentrum.cz>
-- automatically generated package
-};
- close PKGCHL;
-
- unless ($top_srcdir eq '.') {
- unlink $build."Makefile";
- symlink "$top_srcdir/Makefile",$build."Makefile" or die "symlink $top_srcdir/Makefile ".$build."Makefile: $!\n";
- }
-
- open MKINC,">".$build."Makefile.inc"
- or die $build."Makefile.inc: $!\n";
-
- print "Creating ".$build."Makefile.inc\n";
-
- print MKINC qq{project = $project
-PREFIX = $root
-prefix = $prefix
-stagedir = $stagedir
-sysroot = $sysroot
-sysconfdir = $sysconfdir
-localstatedir = $localstatedir
-thrflavour = $thrflavour
-nothrflavour = $nothrflavour
-libdir = $libdir
-top_srcdir = $top_srcdir
-};
-
- for (@{$need_externs{$short}}) {
- next unless defined $externs{$_} and defined $externs{$_}{prefix};
- print MKINC "${_}_prefix = $externs{$_}{prefix}\n";
- print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags};
- }
-
- for (@{$need_jars{$short}}) {
- print MKINC "${_}_jar = $jar{$_}\n"
- }
-
- my $need_gsoap = 0;
- for (@{$need_externs{$short}}) { $need_gsoap = 1 if $_ eq 'gsoap'; }
-
- print MKINC "gsoap_default_version=".gsoap_version()."\n" if $need_gsoap;
-
- close MKINC;
-
- my $dh;
- my $debian = 0;
-
- opendir $dh, "$abs_srcdir/project" || die "Can't open $abs_srcdir/project: $!";
- for my $dir (readdir $dh) {
- if ($dir=~/^(.*)\.spec$/) {
- if ($1 ne $packageName) {
- printf STDERR "Changed RPM name: $packageName --> $1\n" if ($debug);;
- $packageName=$1;
- }
- last;
- }
- }
- closedir $dh;
-
- for my $file ("$packageName.spec", "debian.rules", "debian.control", "debian.changelog", "debian.copyright") {
- if (-f "$abs_srcdir/project/$file") {
- my $old_ = $_;
- printf STDERR "Creating $build$file\n" if ($debug);;
- open DST, ">$build$file";
- open SRC, "<$abs_srcdir/project/$file";
- while (<SRC>) {
- if (/\@MODULE\@/) { s/\@MODULE\@/$full/g; }
- if (/\@URL\@/) { s/\@URL\@/$package{url}/g; }
- if (/\@SUMMARY\@/) { s/\@SUMMARY\@/$package_summary/g; }
- if (/\@DESCRIPTION\@/) { s/\@DESCRIPTION\@/$package_description/g; }
- if (/\@DEBIAN_DESCRIPTION\@/) { s/\@DEBIAN_DESCRIPTION\@/$package_description_debian/g; }
- if (/\@VERSION\@/) { s/\@VERSION\@/$version/g; }
- if (/\@MAJOR\@/) { s/\@MAJOR\@/$major/g; }
- if (/\@MINOR\@/) { s/\@MINOR\@/$minor/g; }
- if (/\@REVISION\@/) { s/\@REVISION\@/$rev/g; }
- if (/\@AGE\@/) { s/\@AGE\@/$age/g; }
- if (/\@MAINTAINER\@/) { s/\@MAINTAINER\@/$package{maintainer}/g; }
- if (/\@UPLOADERS\@/) { s/\@UPLOADERS\@/$package{uploaders}/g; }
- if (/\@DEBIAN_VCS\@/) { s/\@DEBIAN_VCS\@/$package{debian_vcs}/g; }
- if (/\@DEBIAN_DATE\@/) { s/\@DEBIAN_DATE\@/$debdate/g; }
- if (/\@SPEC_DATE\@/) { s/\@SPEC_DATE\@/$specdate/g; }
- if (/^\s*.+\/configure\s/ and $force_version) {
- print "Version forced to $version\n" if ($debug);;
- s/--version\s+\S+\s?//;
- s/$/ --version $version/;
- }
- printf DST "%s", "$_";
- }
- close SRC;
- close DST;
- $_ = $old_;
- }
- }
-
- print "Creating ${build}debian/\n" if ($debug);;
-
- `rm -rfv ${build}debian`;
- mkdir $build."debian" or die $!;
- `cp $abs_srcdir/project/debian.* ${build}debian/ 2>/dev/null`;
- `mv ${build}debian.* ${build}debian/ 2>/dev/null`;
- `rm -f ${build}debian/*.orig`;
- opendir $dh, "${build}debian" || die "Can't open ${build}debian: $!";
- for $_ (readdir $dh) {
- if (/^debian\.(.*)/) {
- `mv ${build}debian/$_ ${build}debian/$1`;
- $debian = 1;
- }
- }
- closedir $dh;
-
- if ($debian) {
- my ($dir, $file);
-
- chmod 0755, "${build}debian/rules";
- $file="${build}debian/docs"; if (not -f $file) { `touch $file`; }
- $dir="${build}debian/source"; if (not -d $dir) { mkdir $dir; }
- $file="${build}debian/source/format"; if (not -f $file) { `echo "3.0 (quilt)" > $file` }
- $file="${build}debian/compat"; if (not -f $file) { `echo "7" > $file` }
- $file="${build}debian/changelog"; if (not -f $file) {
- open FH, ">$file" or die $!;
- print FH qq{$packageName ($major.$minor.$rev-$age) unstable; urgency=low
-
- * Automatically generated package
-
- -- $package{maintainer} $debdate
-};
- close FH;
- }
-
- } else {
- `rm -rf ${build}debian`;
- }
-}
-
-BEGIN{
-};
-
-sub mode_etics_packaging {
- my ($fmod, $cmd, $rpmprepare, $debprepare) = @_;
- my ($workspaceDir, $srcPackageName, $srcAge, $topDir);
-
- # old-school packaging by ETICS for EMI-1
- if ($project eq 'emi' and $project_version == 1) { return; }
-
- if ($fmod eq 'gridsite.core') {
- $workspaceDir = '..';
- $srcPackageName = 'gridsite';
- $srcAge = '';
- $topDir = '../';
- } else {
- $workspaceDir = '${workspaceDir}';
- $srcPackageName = '${packageName}';
- $srcAge = '-${age}';
- $topDir = '';
- }
-
- $cmd->{clean} = 'make clean
- rm -rfv ${package.tgzLocation} ${package.SRPMSLocation}';
- $cmd->{default}{packaging} = $rpmprepare;
- $cmd->{default}{packaging} .= "dir=\${workspaceDir}/rpm_build_src_\$\$
- mkdir -p \${package.tgzLocation} \${package.SRPMSLocation} \$dir/{BUILD,RPMS,SOURCES,SRPMS} 2>/dev/null || true
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \${package.tgzLocation}/
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \$dir/SOURCES/
- rpmbuild -bs --nodeps --define \"_topdir \$dir\" $srcPackageName.spec
- cp -v \$dir/SRPMS/*.src.rpm \${package.SRPMSLocation}/
- rm -rf \$dir";
-
- for my $p ('deb5_x86_64_gcc432', 'deb5_ia32_gcc432', 'deb6_x86_64_gcc445', 'deb6_ia32_gcc445') {
- for my $c (keys %{$cmd->{default}}) { $cmd->{$p}{$c} = $cmd->{default}{$c}; }
- $cmd->{$p}{clean} = 'make clean
- rm -rfv ${package.tgzLocation} ${package.SDEBSLocation}';
- $cmd->{$p}{packaging} = $debprepare;
- $cmd->{$p}{packaging} .= "dir=\${workspaceDir}/dpkg_build_src_\$\$
- mkdir -p \${package.tgzLocation} \${package.SDEBSLocation} \$dir 2>/dev/null || true
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \${package.tgzLocation}/
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \$dir/${srcPackageName}_\${version}.orig.tar.gz
- tar xzf \$dir/${srcPackageName}_\${version}.orig.tar.gz -C \$dir
- cp -rf ${topDir}debian/ \$dir/$srcPackageName-\${version}/
- cd \$dir/$srcPackageName-\${version}
- dpkg-buildpackage -S -d -nc
- cd -
- cp -v \$dir/*.tar.gz \$dir/*.dsc \${package.SDEBSLocation}/
- rm -rf \$dir";
- }
-}
-
-sub mode_etics {
- $fmod = shift;
-
- die "$0: --module required with --etics\n" unless $fmod;
-
- my ($subsys,$module) = split /\./,$fmod,2;
- my $full = full "$subsys.$module";
-
- my ($major,$minor,$rev,$age) = get_version $fmod, $full;
-
- # XXX: --with ignored for platform-dependend packages
- my @copts = ();
- my %ge;
- @ge{@{$etics_projects{$project{etics_name}}}} = (1) x ($#{$etics_projects{$project{etics_name}}}+1);
-
- for (@{$need_externs{"$subsys.$module"}}) {
- if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/ and (defined $externs{$_} or defined $jar{$_})) {
- my $eext = $etics_externs{default}{$_} ? $etics_externs{default}{$_} : $_;
- next if ($eext eq '-');
- if (defined $project{etics_locations}{'*'} or defined $project{etics_locations}{$_}) {
- $eext = $project{etics_locations}{$_} if ($project{etics_locations}{$_});
- push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}";
- } else {
- if ($ge{$_} and not defined $externs{$_}{pkg}) {
- push @copts, "--with-$_=\${stageDir}";
- }
- }
- }
- }
-
- for (@{$need_jars{"$subsys.$module"}}) {
- my $eext = $etics_externs{default}{$_} ? $etics_externs{default}{$_} : $_;
-
- push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (defined $project{etics_locations}{'*'} or defined $project{etics_locations}{$_});
- }
-
- my $conf;
- my $conftag;
- my ($confprefix, $nameprefix, $packageName);
-
- $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n";
-
- $confprefix = $project{conf_prefix}{$subsys};
- $nameprefix = $confprefix;
- $nameprefix =~ s/-$//;
- $nameprefix =~ s/-/\./g;
- $packageName = "$project{tag_prefix}{$subsys}$subsys-${module}";
-
- if ($branch) {
- $conf = "$confprefix${subsys}-${module}_$branch";
- $conftag = $branch;
- # forced low age number
- $age = $branch eq 'HEAD' ? '0head' : '0dev';
- push @copts, '--version ${version}-${age}';
- }
- else {
- $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}";
-# XXX: gridsite hack
- $conftag = $subsys eq 'gridsite' ? "$project{tag_prefix}{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" :
- "$project{tag_prefix}{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}";
-
- # lowering age for older packaging
- if ($project eq 'emi' and $project_version == 1) {
- $age = $age - 1;
- }
- }
-
- # emi1 suffix for older packaging
- if ($project eq 'emi' and $project_version == 1) {
- $age = $age.$project.$project_version;
- $conf = $conf.$project.$project_version;
- }
-
- my $file = $output ? $output : "$conf.ini";
- open C,">$file" or die "$file: $!\n";
-
- my $buildroot = $buildroot{"$subsys.$module"} eq '' ? '#no build.root' : "build.root = " . $buildroot{"$subsys.$module"};
-
- my $confdir = $buildroot{"$subsys.$module"} eq '' ? '.' : '..';
-
- my $cvs_module = full "$subsys.$module";
- my ($package_summary, $package_description) = get_description $cvs_module;
- if ($package_description) {
- $package_description =~ s/\n/\\n/g;
- $package_description = "package.description = $package_description\n";
- }
- if ($package_summary) {
- $package_summary = "package.summary = $package_summary\n";
- }
-
- my %cmd;
- $cmd_vcs{checkout} = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_module 2>/dev/null";
- #$cmd_vcs{checkout} = "((test -d jra1mw/.git && (cd jra1mw; git pull)) || (git clone -q http://scientific.zcu.cz/git/jra1mw.git";
- #$cmd_vcs{checkout} .= " && (cd jra1mw; git checkout -b \${tag} --track origin/\${tag})" unless ($conftag eq /HEAD/);
- #$cmd_vcs{checkout} .= ")) && (test -d \${moduleName} || ln -s jra1mw/$cvs_module \${moduleName})";
- $cmd_vcs{checkout} .= "\n\ttest -f \${packageName}-\${version}-\${age}.src.tar.gz || (ln -s \${moduleName} \${packageName}-\${version}; tar -chf - \${packageName}-\${version} --exclude CVS --exclude .git --exclude .etics | gzip --best > \${packageName}-\${version}-\${age}.src.tar.gz; rm \${packageName}-\${version})";
- $cmd_vcs{tag} = "cvs -d \${vcsroot} tag -R \${tag} ${moduleName}";
-
- $cmd{default}{init} = 'None';
- $cmd{default}{configure} = 'None';
- $cmd{default}{compile} = 'None';
- $cmd{default}{test} = 'None';
- $cmd{default}{install} = 'None';
- $cmd{default}{packaging} = 'None';
- $cmd{default}{clean} = 'make clean';
-
- if (exists $subpackages{$fmod}) {
- $cmd{default}{clean} = 'None';
- $cmd{default}{packaging} = "echo building nothing, $subpackages{$fmod} will build this package";
- $cmd_vcs{checkout} = "mkdir -v \${moduleName} 2>/dev/null || true";
- } elsif ($subsys eq 'gridsite') {
- $cmd_vcs{tag} = 'None';
-
- if ($module eq 'core') {
- my $flags;
-
- if ($project ne 'glite') {
- # don't evaluate pkg-config calls to get them into source package
- $flags = 'RELEASE_VERSION=${age}
- GSOAPDIR=\`pkg-config gsoap --variable=prefix\`
- OPENSSL_GLOBUS_FLAGS=\`pkg-config globus-openssl --cflags\`
- OPENSSL_GLOBUS_LIBS=\`pkg-config globus-openssl --libs\`';
- } else {
- $flags = 'RELEASE_VERSION=${age}
- GSOAPDIR=${gsoap.location}
- OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor}
- OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}
- HTTPD_FLAGS=-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-1 -I${httpd-devel.location}/include/apr-1.0 -I${httpd-devel.location}/include/apr-0 -I${httpd-devel.location}/include/pcre';
- }
-
- $cmd{default}{configure} = "cat > Makefile.inc <<EOF
- project = $project
- top_srcdir = ..
- $flags
- EOF";
- $cmd{default}{compile} = "make prefix=\${prefix}$project{local_prefix} libdir=\${libdir}";
- $cmd{default}{install} = "make prefix=\${prefix}$project{local_prefix} libdir=\${libdir} install";
- mode_etics_packaging($fmod, \%cmd,
- "make prefix=\${prefix}$project{local_prefix} rpm-prepare
- cp gridsite.spec ../\n\t",
- "chmod +x \${moduleDir}/src/make-debian-files || true
- make prefix=\${prefix}$project{local_prefix} deb-prepare\n\t"
- );
- }
- elsif ($module eq '1.5-compat') {
- $cmd_vcs{checkout} = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.core 2>/dev/null";
- $cmd{default}{init} = 'echo "/sbin/ldconfig" > project/.post
- echo "/sbin/ldconfig" > project/.postun';
- $cmd{default}{configure} = "cat > src/Makefile.inc <<EOF
- project = emi
- libdir = \${libdir}
- MAJOR_VERSION=1
- MINOR_VERSION=1.5
- PATCH_VERSION=1.5.0
- VERSION=\\\$(PATCH_VERSION)
- RELEASE_VERSION=\${age}
- GSOAPDIR=\\`pkg-config gsoap --variable=prefix\\`
- OPENSSL_GLOBUS_FLAGS=\\`pkg-config globus-openssl --cflags\\`
- OPENSSL_GLOBUS_LIBS=\\`pkg-config globus-openssl --libs\\`
- EOF";
- $cmd{default}{compile} = "make -C src prefix=\${prefix}$project{local_prefix}
- rm -fv project/debian.changelog";
- $cmd{default}{install} = "make -C src prefix=\${prefix}$project{local_prefix} install-lib
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.so.1
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.so
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.a";
- $cmd{default}{packaging} = "None";
- }
- else {
- $cmd{default}{clean} = 'None';
- $cmd{default}{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this";
- $cmd_vcs{checkout} = "mkdir -v \${moduleName} 2>/dev/null || true";
- }
- }
- elsif ($subsys eq 'px' and $module eq 'myproxy-config') {
- $cmd{default}{configure} = "/usr/bin/perl $confdir/configure --root=\${prefix} --prefix= --stage=\${stageDir} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts";
- $cmd{default}{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config";
- }
- else {
- $cmd{default}{configure} = "/usr/bin/perl $confdir/configure $project{flavours} --root=\${prefix} --prefix=$project{local_prefix} --stage=\${stageDir} --sysroot=\${package.prefix} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts";
- $cmd{default}{compile} = 'make';
- $cmd{default}{test} = 'make check';
- $cmd{default}{install} = 'make install';
- if ($subsys eq 'lb' and $module eq 'client') {
- $cmd{default}{compile} = "make rpath=$project{local_prefix}/\${libdir}";
- $cmd{default}{install} = "make install post-install rpath=$project{local_prefix}/\${libdir}";
- }
- mode_etics_packaging($fmod, \%cmd);
- }
-
- 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 = $project{etics_name}.$subsys.$module
-displayName = $conf
-description = $cvs_prefix{$subsys}.$subsys.$module
-projectName = $project{etics_name}
-age = $age
-deploymentType = None
-vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite
-tag = $conftag
-version = $major.$minor.$rev
-$dwpath
-[Platform-default:VcsCommand]
-displayName = None
-description = None
-tag = $cmd_vcs{tag}
-branch = None
-commit = None
-checkout = $cmd_vcs{checkout}
-
-};
-
- for my $p (keys %cmd) {
- next if $p ne 'default' and exists $project{supported_platforms} and not exists $project{supported_platforms}{$p};
-
- print C qq{[Platform-$p:BuildCommand]
-postpublish = None
-packaging = $cmd{$p}{packaging}
-displayName = None
-description = None
-doc = None
-prepublish = None
-publish = None
-compile = $cmd{$p}{compile}
-init = $cmd{$p}{init}
-install = $cmd{$p}{install}
-clean = $cmd{$p}{clean}
-test = $cmd{$p}{test}
-configure = $cmd{$p}{configure}
-checkstyle = None
-
-};
- }
-
- print C qq{[Platform-default:Property]
-$buildroot
-package.preserve.libtool = false
-$package_description$package_summary$defprops};
-
- for (@{$obsoletes{"$subsys.$module"}}) {
- print C "package.obsoletes = $_\n";
- print C "package.replaces = $_\n";
- }
- for (@{$conflicts{"$subsys.$module"}}) {
- print C "package.conflicts = $_\n";
- }
- for (@{$provides{"$subsys.$module"}}) {
- print C "package.provides = $_\n";
- }
- print C "\n";
-
- for my $pp (keys %{$platform_properties{"$subsys.$module"}}) {
- next if $pp eq 'default';
- next if exists $project{supported_platforms} and not exists $project{supported_platforms}{$pp};
-
- print C "[Platform-$pp:Property]\n$buildroot\n";
-
- for my $p (keys %{$platform_properties{"$subsys.$module"}->{$pp}}) {
- print C $p . ' = ' . $platform_properties{"$subsys.$module"}->{$pp}->{$p} . "\n";
- }
- print C "$package_description$package_summary\n";
- }
-
- for my $platform ('default', keys %{$project{supported_platforms}}) {
- my $used = 0;
- my $output = '';
-
- for (@{$need_externs{"$subsys.$module"}},@{$need_jars{"$subsys.$module"}}) {
- my $eext = $etics_externs{$platform}{$_};
- my $edev = $project{etics_externs_devel}{$platform}{$_};
-
- # for the default platform using package of the same
- # name for runtime dependency
- if (not $eext) {
- if ($platform eq 'default') {
-#print "default runtime $_ on default\n";
- $eext = $_; }
- else {
-#print "no runtime $_ on $platform\n";
- $eext = '-'; }
- }
- if ($eext eq '-' and $edev eq '-') {
-#print "skipping $_ on $platform\n";
- next;
- }
-
- my $proj = 'externals';
- for my $p (keys %etics_projects) {
- for $m (@{$etics_projects{$p}}) {
- $proj = $p if $m eq $_;
- }
- }
-
- my $type = $need_externs_type{"$subsys.$module"}->{$_};
-
- if ($edev) {
- if ($type eq 'B') {
- # no runtime - change to devel pkg
- $eext = $edev;
- } elsif ($type eq 'BR' or $type eq 'RB') {
- # additional devel pkg
- if ($edev ne '-') { $output .= "$proj|$edev = B\n"; }
- }
- }
- if ($eext ne '-') { $output .= "$proj|$eext = $type\n"; }
- }
-
- if ($platform eq 'default') {
- for (@{$deps{"$subsys.$module"}}) {
- my $type = $deps_type{"$subsys.$module"}->{$_};
- if (not $used) {
- $used = 1;
- }
- $output .= "$project{etics_name}|$project{etics_name}.$_ = $type\n";
- }
- }
-
- if ($output) {
- print C qq{
-[Platform-$platform:DynamicDependency]
-$output};
- }
- }
-
- close C;
-
- for $file ("$cvs_module/project/debian.rules", "$cvs_module/project/$packageName.spec") {
- my $lib;
- my $main_module;
- @copts = ();
-
- if ($file =~ /debian\.rules$/) { $lib = 'lib'; }
- else { $lib = '%{_lib}'; }
-
- my $main_module = "$subsys.$module";
- if (exists $subpackages{$main_module}) { $main_module = $subpackages{$main_module}; }
-
- # locations hacks
- if ($file =~ /$packageName\.spec$/) {
- if ($fmod eq 'lb.client-java') {
- push @copts, '';
- push @copts, '--with-axis=/usr/local/axis1.4';
- }
- }
-
- if (-f $file) {
- open DST,">$file.new" or die "$file.new: $!\n";
- open SRC,"<$file" or die "$file: $!\n";
- while (<SRC>) {
- if (/^(\s*).+\/configure\s/) {
- printf DST "%s", "$1";
- printf DST "/usr/bin/perl $confdir/configure $project{flavours} --root=/ --prefix=$project{local_prefix} --libdir=$lib --project=$project --module $main_module@copts\n";
- } else {
- printf DST "%s", "$_";
- }
- }
- close SRC;
- close DST;
-
- `diff -b "$file" "$file.new"`;
- if ($? == 0) {
- print STDERR "($file not changed)\n";
- unlink "$file.new";
- } else {
- print STDERR "Writing $file\n";
- rename "$file", "$file.orig" unless -f "$file.orig";
- rename "$file.new", "$file";
- }
- }
- }
-}
-
-sub gsoap_version {
- local $_;
- my $gsoap_version;
- open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n";
-
- while ($_ = <S>) {
- 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;
-}
-
-sub getlibdir {
- if ( -e "/etc/debian_version") { # We are on Debian
- $lib64="lib";
- $lib32="lib32"; }
- else { # Another distribution
- $lib64="lib64";
- $lib32="lib"; }
- $libdir=$lib32;
-
- open INP, "uname -s | "; # Check kernel name
- $kname= <INP>;
- chomp($kname);
- close INP;
-
- if ( $kname eq "Linux") {
- $arch = ("x86_64\npowerpc\nppc64\n");
-
- open INP, "uname -p | "; # Check processor type
- $procname= <INP>;
- chomp($procname);
- close INP;
-
- if ($arch =~/^$procname\n/) {
- return ($lib64); }
-
- open INP, "uname -m | "; # Check machine hardware
- $machname= <INP>;
- chomp($machname);
- close INP;
-
- if ($arch =~/^$machname\n/) {
- return ($lib64); }
-
- # special cases (hyperlink lib64, Debian)
- if (-l "/usr/lib64") {
- $libdir=$lib32; }
-
- # if /usr/lib64 doesn't exist at all (AIX)
- unless ( -e "/usr/lib64" ) {
- $libdir=$lib32; }
- }
-
- if ( $kname eq "SunOS") {
- if (-e "/usr/lib/64") {
- $libdir="lib/64"; }
- }
-
- return $libdir;
-}
-
-sub reshuffle_platforms($$) {
- my ($data, $platforms) = @_;
- my ($platform, %blacklist, $value);
-
- return if not $platforms;
-
- for $platform (keys %$data) {
-#print "plat: $platform: $data->{$platform}\n";
- next if $platform eq 'default';
- for $_ (keys %{$data->{$platform}}) {
-#print " blacklist: $_ = $data->{$platform}{$_}\n";
- $blacklist{$_} = 1;
- }
- }
-
- for $_ (keys %blacklist) {
- $value = $data->{default}{$_} ? $data->{default}{$_} : $_;
- for $platform (keys %$platforms) {
- next if $platform eq 'default';
- if (not defined $data->{$platform}{$_}) {
- $data->{$platform}{$_} = $value;
-#print "added $value to $platform\n"
- }
- }
- $data->{default}{$_} = '-';
-#print "deleted $_ from default\n";
- }
-
- # merge dependencies across the supported platforms
- %blacklist = [];
- for $platform (keys %$platforms) {
- next if $platform eq 'default';
- for $_ (keys %{$data->{$platform}}) {
- $blacklist{$_} = 1;
- }
- }
- for $_ (keys %blacklist) {
- $value = undef;
- $same = 1;
- for $platform (keys %$platforms) {
- if (not $value) { $value = $data->{$platform}{$_}; }
- if (not $data->{$platform}{$_} or $value ne $data->{$platform}{$_}) {
- $same = 0;
- last;
- }
- }
- if ($same and $value) {
-#print "merged dependency $_\n";
- $data->{default}{$_} = $value;
- for $platform (keys %$platforms) {
- delete $data->{$platform}{$_};
- }
- }
- }
-}
-
-sub usage {
- my @ext = keys %externs;
- my @myjars = keys %jar;
-
- print STDERR qq{
-Usage: $0 options
-
-General options (defaults in []):
- --prefix=PREFIX destination directory [./stage]
- --stage=DIR staging directory [./stage]
- --root=DIR installation root (custom relocation root -> sysroot) [./stage]
- --sysroot=DIR system root (custom relocation root -> sysroot) []
- --sysconfdir=DIR system configuration directory [PREFIX/etc]
- --staged=module,module,... what is already in PREFIX (specify without org.glite.)
- --thrflavour=flavour
- --nothrflavour=flavour threaded and non-treaded flavours [gcc64dbgpthr,gcc64dbg]
- --listmodules=subsys list modules of a subsystem
- --listmodules=module list subpackages of a module
- --version=maj.min.rev-age version used instead of reading version.properties
- --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...)
- --libdir=libdir typically [lib,lib64] postfix
- --project=PROJECT build or generate etics for a project (glite/emi1/emi) [emi]
- --debug print more details
-
-Mode of operation:
- --mode=\{checkout|build|etics\} what to do [build]
-
-What to build:
- --module=module build this module only
- --enable-NODE build this "node" (set of modules) only
- --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
- --jobid-tag=tag checkout jobid modules with specific tag
- --canl-tag=tag checkout canl modules with specific tag
-
-Dependencies (summary of what will be used is always printed):
- --with-EXTERNAL=PATH where to look for an external [autodetect]
- --with-JAR=JAR where to look for jars
-
-Available nodes:
- @nodes
-
-Default nodes:
- @default_nodes
-
-Externals (not all for all modules) are:
- @ext
-
-External jars are:
- @myjars
-
-};
-
-}
+++ /dev/null
-PROJECT_NAME = "Glite LBJP Common: DB module"
-OUTPUT_DIRECTORY = C
-OPTIMIZE_OUTPUT_FOR_C = YES
-INPUT = \
- ../interface/db.h
-SHOW_DIRECTORIES = NO
-FULL_PATH_NAMES = NO
-EXTRACT_ALL = YES
-PDF_HYPERLINKS = YES
-USE_PDFLATEX = YES
-MACRO_EXPANSION = YES
-EXPAND_ONLY_PREDEF = YES
-#PREDEFINED = _EDG_WLL_EVENT_COMMON
-HAVE_DOT = NO
-GENERATE_MAN = YES
-MAN_LINKS = NO
+++ /dev/null
-/*
-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.
-*/
-
-/*
- * Example (and quick test) of prepared statements expirations.
- * Use 'SET GLOBAL wait_timeout=...' for experimenting.
- *
- * Requires existing database with appropriate access and example table:
- *
- * mysqladmin -u root -p create test
- * mysql -u root -p -e 'GRANT ALL on test.* to testuser@localhost'
- * ./db_test
- *
- * Then you can launch:
- *
- * ./db_expire
- *
- * Use CS environment variable for different user/pwd@machine:dbname.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "db.h"
-
-#define CS "testuser/@localhost:test"
-#define SELECT_CMD "SELECT id, user, info FROM data WHERE user = ?"
-
-#define dprintf(ARGS) { printf("%s: ", name); printf ARGS; }
-
-
-static void print_blob(unsigned long len, char *blob) {
- unsigned int i;
-
- for (i = 0; i < len; i++) printf("%02X ", blob[i]);
- printf("(='");
- for (i = 0; i < len; i++) printf("%c", blob[i]);
- printf("')");
-}
-
-
-static void print_free_result(const char *name, unsigned long *lens, char **res) {
- dprintf((" id='%s'=%d\n", res[0], atoi(res[0])));
-
- dprintf((" user='%s'\n", res[1]));
-
- dprintf((" blob="));
- if (res[2] && lens) print_blob(lens[2], res[2]);
- else printf("null");
- printf("\n");
-
- free(res[0]);
- free(res[1]);
- free(res[2]);
-}
-
-
-static void print_error(glite_lbu_DBContext ctx) {
- if (ctx) {
- char *t, *d;
-
- if (glite_lbu_DBError(ctx, &t, &d)) {
- printf("Error %s: %s\n", t, d);
- free(t); free(d);
- }
- }
-}
-
-
-int main(int argn __attribute((unused)), char *argv[]) {
- char *name, *user;
- const char *cs;
- glite_lbu_DBContext ctx;
- glite_lbu_Statement stmt;
- int caps, nr, c;
- unsigned long lens[3];
- char *res[3];
-
- if ((name = strrchr(argv[0], '/')) != NULL) name++;
- else name = argv[0];
- if ((cs = getenv("CS")) == NULL) cs = CS;
-
- // init
- dprintf(("connecting to %s...\n", cs));
- if (glite_lbu_InitDBContext(&ctx, GLITE_LBU_DB_BACKEND_MYSQL, NULL) != 0) {
- print_error(ctx);
- goto failctx;
- }
- if (glite_lbu_DBConnect(ctx, cs) != 0) {
- print_error(ctx);
- goto failctx;
- }
- if ((caps = glite_lbu_DBQueryCaps(ctx)) == -1) {
- print_error(ctx);
- goto failcon;
- }
- if ((caps & GLITE_LBU_DB_CAP_PREPARED) == 0) {
- print_error(ctx);
- dprintf(("can't do prepared commands, exiting."));
- goto failcon;
- }
- // caps
- glite_lbu_DBSetCaps(ctx, caps | GLITE_LBU_DB_CAP_ERRORS);
- dprintf(("capabilities: %d\n", caps));
-
- user = NULL;
- dprintf(("preparing '%s'...\n", user));
- if ((glite_lbu_PrepareStmt(ctx, SELECT_CMD, &stmt)) != 0) {
- print_error(ctx);
- goto failcon;
- }
-
- do {
- user = "cicomexocitl.civ";
- dprintf(("executing '%s'...\n", user));
- if (glite_lbu_ExecPreparedStmt(stmt, 1, GLITE_LBU_DB_TYPE_VARCHAR, user) == -1) {
- print_error(ctx);
- goto failstmt;
- }
- dprintf(("fetching '%s'...\n", user));
- while ((nr = glite_lbu_FetchRow(stmt, 3, lens, res)) > 0) {
- dprintf(("Result: n=%d, res=%p\n", nr, res));
- print_free_result(name, lens, res);
- }
- if (nr < 0) {
- dprintf(("fetch '%s' failed\n", user));
- break;
- }
- dprintf(("\n"));
-
- c = fgetc(stdin);
- } while (c != -1 && (c == '\r' || c == '\n'));
-
- dprintf(("closing...\n"));
- glite_lbu_DBClose(ctx);
- glite_lbu_FreeDBContext(ctx);
- return 0;
-
-failstmt:
- printf("closing stmt...\n");
- glite_lbu_FreeStmt(&stmt);
-failcon:
- dprintf(("closing...\n"));
- glite_lbu_DBClose(ctx);
-failctx:
- glite_lbu_FreeDBContext(ctx);
- dprintf(("failed\n"));
- return 1;
-}
+++ /dev/null
-/*
-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.
-*/
-
-/*
- * Example (and quick test) of this DB module.
- *
- * Requires existing database with appropriate access:
- *
- * mysqladmin -u root -p create test
- * mysql -u root -p -e 'GRANT ALL on test.* to testuser@localhost'
- *
- * Or postgres:
- *
- * createuser -U postgres testuser
- * createdb -U postgres --owner testuser test
- *
- * Use CS environment variable when using different user/pwd@machine:dbname.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <glite/lbu/trio.h>
-
-#include "db.h"
-
-#define CS "testuser/@localhost:test"
-
-#ifdef PSQL_BACKEND
-#define CREATE_CMD "CREATE TABLE \"data\" (\n\
- \"id\" INTEGER NOT NULL,\n\
- \"user\" VARCHAR(32) NOT NULL,\n\
- \"info\" BYTEA,\n\
- PRIMARY KEY (\"id\")\n\
-)"
-#define AMP "\""
-#define INSERT_CMD "INSERT INTO " AMP "data" AMP " (" AMP "id" AMP ", " AMP "user" AMP ", " AMP "info" AMP ") VALUES ($1, $2, $3)"
-#define SELECT_CMD "SELECT " AMP "id" AMP ", " AMP "user" AMP ", " AMP "info" AMP " FROM " AMP "data" AMP " WHERE " AMP "user" AMP " = $1"
-#define DB_TEST_BACKEND GLITE_LBU_DB_BACKEND_PSQL
-
-#else
-
-#define CREATE_CMD "CREATE TABLE data (\n\
- `id` INT NOT NULL,\n\
- `user` VARCHAR(32) NOT NULL,\n\
- `info` BLOB,\n\
- PRIMARY KEY (id),\n\
- INDEX(`user`)\n\
-) engine=innodb"
-#define AMP "`"
-#define INSERT_CMD "INSERT INTO " AMP "data" AMP " (" AMP "id" AMP ", " AMP "user" AMP ", " AMP "info" AMP ") VALUES (?, ?, ?)"
-#define SELECT_CMD "SELECT " AMP "id" AMP ", " AMP "user" AMP ", " AMP "info" AMP " FROM " AMP "data" AMP " WHERE " AMP "user" AMP " = ?"
-#define DB_TEST_BACKEND GLITE_LBU_DB_BACKEND_MYSQL
-#endif
-
-#define DROP_CMD "DROP TABLE " AMP "data" AMP
-#define INSERT_TRIO_CMD "INSERT INTO " AMP "data" AMP " (" AMP "id" AMP ", " AMP "user" AMP ", " AMP "info" AMP ") VALUES (%d, %s, %s)"
-#define SELECT_TRIO_CMD "SELECT " AMP "id" AMP ", " AMP "user" AMP ", " AMP "info" AMP " FROM " AMP "data" AMP " WHERE " AMP "user" AMP " = '%s'"
-
-#define dprintf(ARGS) { printf("%s: ", name); printf ARGS; }
-
-
-static void print_blob(unsigned long len, char *blob) {
- unsigned int i;
-
- for (i = 0; i < len; i++) printf("%02X ", blob[i]);
- printf("(='");
- for (i = 0; i < len; i++) printf("%c", blob[i]);
- printf("')");
-}
-
-
-static void print_free_result(const char *name, unsigned long *lens, char **res) {
- dprintf((" id='%s'=%d\n", res[0], atoi(res[0])));
-
- dprintf((" user='%s'\n", res[1]));
-
- dprintf((" blob="));
- if (res[2] && lens) print_blob(lens[2], res[2]);
- else printf("null");
- printf("\n");
-
- free(res[0]);
- free(res[1]);
- free(res[2]);
-}
-
-
-int main(int argn __attribute((unused)), char *argv[]) {
- char *name, *cmd;
- const char *cs;
- glite_lbu_DBContext ctx;
- glite_lbu_Statement stmt;
- int caps;
-
-#ifndef NO_PREPARED
- char blob1[] = "Guess: blob or _string?"; blob1[15] = 0;
- char blob2[] = {0, 1, 2, 3, 4, 5};
-#endif
-
- int nr;
- char *res[3];
- unsigned long lens[3];
-
- if ((name = strrchr(argv[0], '/')) != NULL) name++;
- else name = argv[0];
- if ((cs = getenv("CS")) == NULL) cs = CS;
- cmd = NULL;
-
- // init
- dprintf(("connecting to %s...\n", cs));
- if (glite_lbu_InitDBContext(&ctx, DB_TEST_BACKEND, NULL) != 0) goto failctx;
- if (glite_lbu_DBConnect(ctx, cs) != 0) goto failctx;
- if ((caps = glite_lbu_DBQueryCaps(ctx)) == -1) goto failcon;
-#ifndef NO_PREPARED
- if ((caps & GLITE_LBU_DB_CAP_PREPARED) == 0) {
- dprintf(("can't do prepared commands, exiting."));
- goto failcon;
- }
-#endif
- // caps
- glite_lbu_DBSetCaps(ctx, caps | GLITE_LBU_DB_CAP_ERRORS);
- dprintf(("capabilities: %d\n", caps));
- // create all needed tables and data
- dprintf(("creating tables...\n"));
- glite_lbu_ExecSQL(ctx, DROP_CMD, NULL);
- if (glite_lbu_ExecSQL(ctx, CREATE_CMD, NULL) == -1) goto failcon;
- // trio-insert
- dprintf(("trio-insert...\n"));
- asprintf(&cmd, INSERT_TRIO_CMD, 1, "'hyperochus'", "NULL");
- if (glite_lbu_ExecSQL(ctx, cmd, NULL) != 1) goto failcon;
- free(cmd); cmd = NULL;
-#ifndef NO_PREPARED
- // prepared-insert
- dprintf(("prepare-insert...\n"));
- if (glite_lbu_PrepareStmt(ctx, INSERT_CMD, &stmt) != 0) goto failcon;
- dprintf(("execute 1. insert...\n"));
- if (glite_lbu_ExecPreparedStmt(stmt, 3,
- GLITE_LBU_DB_TYPE_INT, 2,
- GLITE_LBU_DB_TYPE_VARCHAR, "cicomexocitl.civ",
- GLITE_LBU_DB_TYPE_BLOB, blob1, sizeof(blob1) - 1) != 1) goto failstmt;
- dprintf(("execute 2. insert...\n"));
- if (glite_lbu_ExecPreparedStmt(stmt, 3,
- GLITE_LBU_DB_TYPE_INT, 3,
- GLITE_LBU_DB_TYPE_VARCHAR, "tartarus",
- GLITE_LBU_DB_TYPE_NULL) != 1) goto failstmt;
- dprintf(("execute 3. insert...\n"));
- if (glite_lbu_ExecPreparedStmt(stmt, 3,
- GLITE_LBU_DB_TYPE_INT, 4,
- GLITE_LBU_DB_TYPE_VARCHAR, "harpia",
- GLITE_LBU_DB_TYPE_BLOB, blob2, sizeof(blob2)) != 1) goto failstmt;
- glite_lbu_FreeStmt(&stmt);
- dprintf(("\n"));
-#endif
-
- // trio-query
-{
- const char *user;
-
- user = "harpia";
- dprintf(("selecting '%s'...\n", user));
- asprintf(&cmd, SELECT_TRIO_CMD, user);
- if (glite_lbu_ExecSQL(ctx, cmd, &stmt) == -1) goto failcon;
- free(cmd); cmd = NULL;
- dprintf(("fetching '%s'...\n", user));
- while ((nr = glite_lbu_FetchRow(stmt, 3, lens, res)) > 0) {
- dprintf(("Result: n=%d, res=%p\n", nr, res));
- print_free_result(name, lens, res);
- }
- if (nr < 0) dprintf(("fetch '%s' failed\n", user));
- dprintf(("closing stmt...\n"));
- glite_lbu_FreeStmt(&stmt);
- dprintf(("\n"));
-
- user = "hyperochus";
- dprintf(("selecting '%s'...\n", user));
- asprintf(&cmd, SELECT_TRIO_CMD, user);
- if (glite_lbu_ExecSQL(ctx, cmd, &stmt) == -1) goto failcon;
- free(cmd); cmd = NULL;
- dprintf(("fetching '%s'...\n", user));
- while ((nr = glite_lbu_FetchRow(stmt, 3, lens, res)) > 0) {
- dprintf(("Result: n=%d, res=%p\n", nr, res));
- print_free_result(name, lens, res);
- }
- if (nr < 0) dprintf(("fetch '%s' failed\n", user));
- dprintf(("closing stmt...\n"));
- glite_lbu_FreeStmt(&stmt);
- dprintf(("\n"));
-
- user = "nobody";
- dprintf(("selecting '%s'...\n", user));
- asprintf(&cmd, SELECT_TRIO_CMD, user);
- if (glite_lbu_ExecSQL(ctx, cmd, &stmt) == -1) goto failcon;
- free(cmd); cmd = NULL;
- dprintf(("fetching '%s'...\n", user));
- while ((nr = glite_lbu_FetchRow(stmt, 3, lens, res)) > 0) {
- dprintf(("Result: n=%d, res=%p\n", nr, res));
- print_free_result(name, lens, res);
- }
- if (nr < 0) dprintf(("fetch '%s' failed\n", user));
- dprintf(("closing stmt...\n"));
- glite_lbu_FreeStmt(&stmt);
- dprintf(("\n"));
-
- dprintf(("nonsese...\n"));
- if (glite_lbu_ExecSQL(ctx, "nonsense", NULL) == -1) {
- dprintf(("was error, OK\n"));
- } else {
- dprintf(("this should file\n"));
- goto failcon;
- }
-}
-
-#ifndef NO_PREPARED
- // "param" queries
-{
- const char *user = NULL;
-
- dprintf(("preparing '%s'...\n", user));
- if ((glite_lbu_PrepareStmt(ctx, SELECT_CMD, &stmt)) != 0) goto failcon;
-
- user = "cicomexocitl.civ";
- dprintf(("executing '%s'...\n", user));
- if (glite_lbu_ExecPreparedStmt(stmt, 1, GLITE_LBU_DB_TYPE_VARCHAR, user) == -1) goto failstmt;
- dprintf(("fetching '%s'...\n", user));
- while ((nr = glite_lbu_FetchRow(stmt, 3, lens, res)) > 0) {
- dprintf(("Result: n=%d, res=%p\n", nr, res));
- print_free_result(name, lens, res);
- }
- if (nr < 0) dprintf(("fetch '%s' failed\n", user));
- dprintf(("\n"));
-
- dprintf(("closing stmt...\n"));
- glite_lbu_FreeStmt(&stmt);
- dprintf(("\n"));
-}
-#endif
-
- dprintf(("closing...\n"));
- glite_lbu_DBClose(ctx);
- glite_lbu_FreeDBContext(ctx);
- return 0;
-
-#ifndef NO_PREPARED
-failstmt:
- dprintf(("closing stmt...\n"));
- glite_lbu_FreeStmt(&stmt);
-#endif
-failcon:
- dprintf(("closing...\n"));
- glite_lbu_DBClose(ctx);
-failctx:
- if (ctx) {
- char *t, *d;
-
- glite_lbu_DBError(ctx, &t, &d);
- printf("Error %s: %s\n", t, d);
- free(t); free(d);
- }
- glite_lbu_FreeDBContext(ctx);
- free(cmd);
- dprintf(("failed\n"));
- return 1;
-}
+++ /dev/null
-/*
-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.
-*/
-
-#ifdef WIN32
-#define asprintf(STR, FMT...) trio_asprintf((STR), ##FMT)
-#define vasprintf(STR, FMT, VARGS) trio_asprintf((STR), (FMT), (VARGS))
-#define strcasestr(H,N) strstr((H), (N))
-#endif
-
-#define dprintf(CTX, FMT...) if ((CTX)->caps & GLITE_LBU_DB_CAP_ERRORS) fprintf(stderr, ##FMT)
-
-struct glite_lbu_DBContext_s {
- int backend;
- struct {
- int code;
- char *desc;
- } err;
- int caps;
- char *log_category;
- char *connection_string;
-};
-typedef struct glite_lbu_DBContext_s glite_lbu_DBContext_t;
-
-struct glite_lbu_Statement_s {
- glite_lbu_DBContext ctx;
-};
-typedef struct glite_lbu_Statement_s glite_lbu_Statement_t;
-
-
-
-typedef struct {
- int backend;
-
- int (*initContext)(glite_lbu_DBContext *ctx);
- void (*freeContext)(glite_lbu_DBContext ctx);
- int (*connect)(glite_lbu_DBContext ctx, const char *cs);
- void (*close)(glite_lbu_DBContext ctx);
- int (*queryCaps)(glite_lbu_DBContext ctx);
- void (*setCaps)(glite_lbu_DBContext ctx, int caps);
-
- int (*transaction)(glite_lbu_DBContext ctx);
- int (*commit)(glite_lbu_DBContext ctx);
- int (*rollback)(glite_lbu_DBContext ctx);
-
- int (*fetchRow)(glite_lbu_Statement stmt, unsigned int n, unsigned long *lengths, char **results);
- void (*freeStmt)(glite_lbu_Statement *stmt);
-
- int (*queryIndices)(glite_lbu_DBContext ctx, const char *table, char ***key_names, char ****column_names);
- int (*execSQL)(glite_lbu_DBContext ctx, const char *cmd, glite_lbu_Statement *stmt);
- int (*queryColumns)(glite_lbu_Statement stmt_gen, char **cols);
-
- int (*prepareStmt)(glite_lbu_DBContext ctx, const char *sql, glite_lbu_Statement *stmt);
- int (*execPreparedStmt_v)(glite_lbu_Statement stmt, int n, va_list ap);
- long int (*lastid)(glite_lbu_Statement stmt);
-
- void (*timeToDB)(time_t, char **str);
- void (*timestampToDB)(double t, char **str);
- time_t (*DBToTime)(const char *str);
- double (*DBToTimestamp)(const char *str);
-} glite_lbu_DBBackend_t;
-
-int glite_lbu_DBSetError(glite_lbu_DBContext ctx, int code, const char *func, int line, const char *desc, ...);
-
-void glite_lbu_TimeToStrGeneric(time_t t, char **str, const char *amp);
-void glite_lbu_TimestampToStrGeneric(double t, char **str, const char *amp);
+++ /dev/null
-#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.
-*/
-
-#ifndef GLITE_LBU_DB_H
-#define GLITE_LBU_DB_H
-
-#include <time.h>
-#include <stdarg.h>
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/**
- * \file db.h
- * \defgroup database Database module
- *
- * Database modul module API (LB & JP Utils).
- *
- * There are two ways to access DB here:
- *
- * - simple:
- * SQL commands as single string. All values are incorporated in the SQL command strings. Proper escaping is required.
- *
- * - enhanced:
- * Prepared SQL commands with separated parameters, functions PrepareStmt() and ExecPreparedStmt(). All values are delivered in separated buffers. Its faster for multiple using and more secure.
- *
- * @{
- */
-
-
-/**
- * Enable transaction support if available.
- *
- * With disabled transaction can be used transaction functions, they are just ignored.
- */
-#define GLITE_LBU_DB_CAP_TRANSACTIONS 1
-
-/**
- * Check prepared parameters support.
- */
-#define GLITE_LBU_DB_CAP_PREPARED 2
-
-/**
- * Check for getting indexes support.
- *
- * Needed for QueryIndices call.
- */
-#define GLITE_LBU_DB_CAP_INDEX 4
-
-
-/**
- * Print all errors.
- *
- * Not returned from detection of capabilities.
- */
-#define GLITE_LBU_DB_CAP_ERRORS 8
-
-
-/**
- * Database connection context.
- */
-typedef struct glite_lbu_DBContext_s *glite_lbu_DBContext;
-
-
-/**
- * Prepared statement, used for SQL statement with parameters.
- */
-typedef struct glite_lbu_Statement_s *glite_lbu_Statement;
-
-
-/**
- * Structure holds date for multi-rows insert.
- */
-typedef struct glite_lbu_bufInsert_s *glite_lbu_bufInsert;
-
-
-
-/**
- * All types of parameteres, they match to the SQL types.
- */
-typedef enum {
- GLITE_LBU_DB_TYPE_NULL = 0,
- GLITE_LBU_DB_TYPE_TINYINT = 1,
- GLITE_LBU_DB_TYPE_INT = 2,
- GLITE_LBU_DB_TYPE_TINYBLOB = 3,
- GLITE_LBU_DB_TYPE_TINYTEXT = 4,
- GLITE_LBU_DB_TYPE_BLOB = 5,
- GLITE_LBU_DB_TYPE_TEXT = 6,
- GLITE_LBU_DB_TYPE_MEDIUMBLOB = 7,
- GLITE_LBU_DB_TYPE_MEDIUMTEXT = 8,
- GLITE_LBU_DB_TYPE_LONGBLOB = 9,
- GLITE_LBU_DB_TYPE_LONGTEXT = 10,
- GLITE_LBU_DB_TYPE_VARCHAR = 11,
- GLITE_LBU_DB_TYPE_CHAR = 12,
- GLITE_LBU_DB_TYPE_DATE = 13,
- GLITE_LBU_DB_TYPE_TIME = 14,
- GLITE_LBU_DB_TYPE_DATETIME = 15,
- GLITE_LBU_DB_TYPE_TIMESTAMP = 16,
- GLITE_LBU_DB_TYPE_BOOLEAN = 17,
- GLITE_LBU_DB_TYPE_LAST = 18
-} glite_lbu_DBType;
-
-
-
-/**
- * Supported DB backends.
- */
-typedef enum {
- GLITE_LBU_DB_BACKEND_MYSQL = 0,
- GLITE_LBU_DB_BACKEND_PSQL,
- GLITE_LBU_DB_BACKEND_LAST
-} glite_lbu_DBBackendNo;
-
-
-/**
- * Get error state from DB context.
- *
- * \param[in] ctx context to work with
- * \param[out] text error name
- * \param[out] desc error description
- */
-int glite_lbu_DBError(glite_lbu_DBContext ctx, char **text, char **desc);
-
-
-/**
- * Clear the error from DB context.
- *
- * \param[in] ctx context to work with
- */
-int glite_lbu_DBClearError(glite_lbu_DBContext ctx);
-
-
-/**
- * Initialize the database context.
- *
- * \param[out] ctx result context
- * \param[in] backend required database backend
- * \return error code
- */
-int glite_lbu_InitDBContext(glite_lbu_DBContext *ctx, int backend, char *log_category);
-
-
-/**
- * Free database context.
- */
-void glite_lbu_FreeDBContext(glite_lbu_DBContext ctx);
-
-
-/**
- * Connect to the given database.
- *
- * \param[out] ctx context to work with
- * \param[in] cs connect string user/password\@host:database
- *
- * \return error code, 0 = OK
- */
-int glite_lbu_DBConnect(glite_lbu_DBContext ctx, const char *cs);
-
-
-/**
- * Close the connection.
- *
- * \param[in,out] ctx context to work with
- */
-void glite_lbu_DBClose(glite_lbu_DBContext ctx);
-
-
-/**
- * Check database version and capabilities.
- *
- * \param[in,out] ctx context to work with
- *
- * \return capabilities
- * \retval -1 error occured
- */
-int glite_lbu_DBQueryCaps(glite_lbu_DBContext ctx);
-
-
-/**
- * Set the database capabilities on already initialized context.
- *
- * It should be find out by DBQueryCaps() first.
- *
- * \param[in,out] ctx context to work with
- * \param[in] caps capabilities to use, should be found out by QueryCaps()
- */
-void glite_lbu_DBSetCaps(glite_lbu_DBContext ctx, int caps);
-
-
-/**
- * Start transaction.
- */
-int glite_lbu_Transaction(glite_lbu_DBContext ctx);
-
-
-/**
- * Commit (end) transaction.
- */
-int glite_lbu_Commit(glite_lbu_DBContext ctx);
-
-
-/**
- * Cancel transaction.
- */
-int glite_lbu_Rollback(glite_lbu_DBContext ctx);
-
-
-/**
- * \param[in,out] stmt executed SQL statement
- * \param[in] n number of items for sure there is enough space in lengths and results
- * \param[out] lengths array with lengths (good for data blobs), may be NULL
- * \param[out] results array with results, all items are allocated
- *
- * \retval >0 number of fields of the retrieved row
- * \retval 0 no more rows
- * \retval -1 error
- */
-int glite_lbu_FetchRow(glite_lbu_Statement stmt, unsigned int n, unsigned long *lengths, char **results);
-
-
-/**
- * Free the statement structure and destroy its parameters.
- *
- * Statement will be set to NULL and multiple calls are allowed.
- *
- * \param[in,out] stmt statement
- */
-void glite_lbu_FreeStmt(glite_lbu_Statement *stmt);
-
-
-/**
- * Parse and execute one simple SQL statement.
- * All values are incorporated int the SQL command string.
- *
- * \param[in,out] ctx context to work with
- * \param[in] cmd SQL command
- * \param[out] stmt statement handle with results (makes sense for selects only)
- *
- * \return number of rows selected, created or affected by update, -1 on error
- */
-int glite_lbu_ExecSQL(glite_lbu_DBContext ctx, const char *cmd, glite_lbu_Statement *stmt);
-
-
-/**
- * Query for column names of the statement.
- *
- * It work only for simple API, so only after ExecSQL().
- *
- * \param[in,out] stmt the statement handle
- * \param[out] cols result array of names
- *
- * \return error code
- */
-int glite_lbu_QueryColumns(glite_lbu_Statement stmt, char **cols);
-
-
-/**
- * Retrieve column names of a query simple SQL statement.
- *
- * \param[in,out] ctx context to work with
- * \param[in] table table name
- * \param[out] key_names one-dimensional index names array
- * \param[out] column_names two-dimensional column names array
- *
- * \return 0 if OK, nonzero on error
- */
-int glite_lbu_QueryIndices(glite_lbu_DBContext ctx, const char *table, char ***key_names, char ****column_names);
-
-
-/**
- * Convert time_t into database-specific time string.
- *
- * The result string can be used directly in SQL commands.
- *
- * \param[in] t the converted time
- * \param[out] str result allocated string
- */
-void glite_lbu_TimeToDB(glite_lbu_DBContext ctx, time_t t, char **str);
-
-
-/**
- * Convert double into database-specific time string.
- *
- * The result string can be used directly in SQL commands.
- *
- * \param[in] t the converted time
- * \param[out] str result allocated string
- */
-void glite_lbu_TimestampToDB(glite_lbu_DBContext ctx, double t, char **str);
-
-
-/**
- * Convert database-specific time string to time_t.
- *
- * String is expected in database for (ISO format).
- *
- * \param[in] ctx context to work with
- * \param[in] str the converted string
- * \return result time
- */
-time_t glite_lbu_DBToTime(glite_lbu_DBContext ctx, const char *str);
-
-
-/**
- * Convert database-specific time string to time (double).
- *
- * \param[in] ctx context to work with
- * \param[in] str the converted string
- * \return result time
- * */
-double glite_lbu_DBToTimestamp(glite_lbu_DBContext ctx, const char *str);
-
-
-/**
- * Get the connection string into the database
- *
- * \return newly allocated connection string
- * */
-char *glite_lbu_DBGetConnectionString(glite_lbu_DBContext ctx);
-
-
-/**
- * Get the hostname of the database
- *
- * \return newly allocated host
-* */
-char *glite_lbu_DBGetHost(glite_lbu_DBContext ctx);
-
-
-/**
- * Get the name of the database
- *
- * \return newly allocated name
-* */
-char *glite_lbu_DBGetName(glite_lbu_DBContext ctx);
-
-
-/* Generic helper time convert functions. */
-void glite_lbu_TimeToStr(time_t t, char **str);
-void glite_lbu_TimestampToStr(double t, char **str);
-time_t glite_lbu_StrToTime(const char *str);
-double glite_lbu_StrToTimestamp(const char *str);
-
-
-/**
- * Init data structure for buffered insert
- *
- * takes table_name and columns string for future multirow insert
- * when insert string oversize size_limit or number of rows to be inserted
- * overcome record_limit, the real insert is triggered
- */
-int glite_lbu_bufferedInsertInit(glite_lbu_DBContext ctx, glite_lbu_bufInsert *bi, const char *table_name, long size_limit, long record_limit, const char * columns);
-
-
-/**
- * adds row of n values into n columns into an insert buffer
- * if num. of rows or size of data oversteps the limits, real
- * multi-row insert is done
- */
-int glite_lbu_bufferedInsert(glite_lbu_bufInsert bi, const char *row);
-
-
-/**
- * Flush buffered data and free bi structure.
- */
-int glite_lbu_bufferedInsertClose(glite_lbu_bufInsert bi);
-
-
-/**
- * Prepare the SQL statement. Use glite_lbu_FreeStmt() to free it.
- *
- * \param[in,out] ctx context to work with
- * \param[in] sql SQL command
- * \param[out] stmt returned SQL statement
- *
- * \return error code
- */
-int glite_lbu_PrepareStmt(glite_lbu_DBContext ctx, const char *sql, glite_lbu_Statement *stmt);
-
-
-/**
- * Bind input parameters and execute prepared SQL statement.
- * Results can be fetched via glite_lbu_FetchRow.
- *
- * \param[in,out] stmt SQL statement
- * \param[in] n number of items
- *
- * Variable parameters (n-times):
- *
- * always:
- *
- * \param type DB item type
- *
- * then one of them:
- *
- * \param GLITE_LBU_DB_TYPE_TINYINT int c
- * \param GLITE_LBU_DB_TYPE_INT long int i
- * \param GLITE_LBU_DB_TYPE_...BLOB/TEXT void *b, unsigned long len
- * \param GLITE_LBU_DB_TYPE_[VAR]CHAR char *str
- * \param GLITE_LBU_DB_TYPE_DATE/TIME/DATETIME time_t t
- * \param GLITE_LBU_DB_TYPE_TIMESTAMP double t
- * \param GLITE_LBU_DB_TYPE_BOOLEAN int b
- * \param GLITE_LBU_DB_TYPE_NULL -
- *
- * \return number of affected rows, -1 on error
- */
-int glite_lbu_ExecPreparedStmt(glite_lbu_Statement stmt, int n, ...);
-
-
-/**
- * "va_list version" of glite_lbu_ExecPreparedStmt().
- */
-int glite_lbu_ExecPreparedStmt_v(glite_lbu_Statement stmt, int n, va_list ap);
-
-
-/**
- * Returns the last automatically generated id, if any.
- */
-long int glite_lbu_Lastid(glite_lbu_Statement stmt);
-
-
-/**
- * @} database group
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
+++ /dev/null
-/sbin/ldconfig
+++ /dev/null
-/sbin/ldconfig
+++ /dev/null
-1.0.0-2
-- initial version
-
-1.0.0-3
-- distinguish stage from prefix (etics build)
-
-1.0.0-4
-- configure script update (globus flavors added to configure call)
-
-1.0.0-5
-- configure script and Makefile update (splitting mysql dependency into separate run-time and build-time deps)
-
-1.0.0-6
-- configure script update (fixed 'mysql-devel' handling)
-
-1.0.0-7
-- Makefile fixes - streamlining the 'clean' target, fixing MySQL library detection
-
-1.0.0-8
-- Soname detection logic moved from the Makefille to a shell-out script
-
-1.0.1-1
-- Using second fractions in timestamps
-
-1.0.1-2
-- Makefile relies on the libdir variable
-- New configure script
-
-1.0.1-3
-- Module repacked.
-
-1.0.1-4
-- install libraries into $libdir
-
-2.0.0-1
-- Multiple DB backends supported
- - support for postgresql (only used by LB Harvester)
-- API enhanced to support multiple database backends
-
-2.0.0-2
-- Repacked, configuration depends on newer postgres version
-
-2.0.1-1
-- Minor enhancements
-- Repacked for new lbjp-common release
-
-2.0.2-1
-- Fixed timezone handling
-
-2.0.3-1
-- More timezone handling fixes and optimization
-- Unit test
-
-2.0.3-2
-- Module rebuilt
-
-2.0.4-1
-- Fixed target 'clean' in the Makefile
-
-2.0.4-2
-- Module rebuilt
-
-2.0.4-3
-- Module rebuilt
-
-2.0.5-1
-- Fixed build-time warnings in logging calls
-
-2.0.5-2
-- Module rebuilt
-
-2.0.5-3
-- Module rebuilt
-
-3.0.0-1
-- Fixes for parallel release in EMI & gLite
-- Notice allocation failures in database fetch.
-- Version numbering fixed
-
-3.0.0-2
-- Module rebuilt
-
-3.0.1-1
-- Root directory option (ETICS performs own files relocation)
-- Prefix option as prefix inside stage
-- Sysconfdir option (for /etc vs /usr)
-- DESTDIR in makefiles
-
-3.0.2-1
-
-- Relocatable build directory
-
-3.0.2-2
-- Module rebuilt
-
-3.0.2-3
-- Module rebuilt
-
-3.0.2-4
-- Module rebuilt
-
-3.0.3-1
-- Fixed library names to resolve broken database backends
-
-3.0.3-2
-- Module rebuilt
-
-3.0.3-3
-- Module rebuilt
-
-3.1.0-1
-- Preparation for a new multiplatform release
-
-3.1.0-2
-- Module rebuilt
-
-3.1.1-1
-- Connection string is stored in db context
-- License string as recognized by rpmlint and packaging guidelines
-
-3.1.2-1
-- Remove dynamic load of DB libraries
- - Originally added because of conflicting dependencies with globus
- - Adds explicit runtime dependency on mysql and postgresql (SB #91944)
-- DB dependencies update
-- Fixed reaction to DB initialization errors
-
-3.1.2-2
-- Module rebuilt
-
+++ /dev/null
-Source: glite-lbjp-common-db
-Priority: extra
-Maintainer: @MAINTAINER@
-Uploaders: @UPLOADERS@
-Build-Depends: debhelper (>= 7.0.50~), chrpath, libcppunit-dev, liblog4c-dev, libglite-lbjp-common-trio-dev, libglite-lbjp-common-log-dev, libmysqlclient-dev, libpq-dev, libtool
-Standards-Version: 3.9.1
-Section: libs
-Homepage: @URL@
-DM-Upload-Allowed: yes
-@DEBIAN_VCS@
-
-Package: libglite-lbu-db3
-Section: libs
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: @SUMMARY@
-@DEBIAN_DESCRIPTION@
-
-Package: libglite-lbjp-common-db-dev
-Section: libdevel
-Architecture: any
-Provides: glite-lbjp-common-db
-Depends: libglite-lbu-db3 (= ${binary:Version}), ${misc:Depends}
-Description: Development files for gLite L&B/JP common db module
- This package contains development libraries and header files for gLite L&B/JP
- common db module.
-
-Package: glite-lbjp-common-db-dbg
-Section: debug
-Architecture: any
-Priority: extra
-Depends: libglite-lbu-db3 (= ${binary:Version}), ${misc:Depends}
-Description: gLite L&B/JP common db module debugging symbols
- This package contains debugging symbols for gLite L&B/JP common db module.
+++ /dev/null
-This work was packaged for Debian by:
-
- @MAINTAINER@ on Thu, 08 Dec 2011 00:46:07 +0100
-
-It was downloaded from:
-
- @URL@
-
-Upstream Author(s):
-
- @MAINTAINER@
-
-Copyright:
-
- <Copyright (C) 2004-2011 Members of the EGEE Collaboration>
-
-License:
-
- 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.
-
-On Debian systems, the complete text of the Apache version 2.0 license
-can be found in "/usr/share/common-licenses/Apache-2.0".
-
-The Debian packaging is:
-
- Copyright (C) 2004-2011 Members of the EGEE Collaboration
-
-and is licensed under the Apache License, Version 2.0.
+++ /dev/null
-usr/include/glite/lbu
-usr/lib
+++ /dev/null
-usr/include/glite/lbu/*.h
-usr/lib/lib*.so
+++ /dev/null
-usr/lib/lib*.so.*
+++ /dev/null
-#!/usr/bin/make -f
-# -*- makefile -*-
-
--include /usr/share/dpkg/buildflags.mk
-
-# Uncomment this to turn on verbose mode.
-export DH_VERBOSE=1
-
-configure: configure-stamp
-configure-stamp:
- dh_testdir
- /usr/bin/perl ./configure --thrflavour= --nothrflavour= --root=/ --prefix=/usr --libdir=lib --project=emi --module lbjp-common.db
- touch $@
-
-build: build-arch build-indep
-
-build-arch build-indep: build-stamp
-
-build-stamp: configure-stamp
- dh_testdir
- CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE)
- CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) check
- touch $@
-
-clean: configure-stamp
- dh_testdir
- dh_testroot
- rm -f configure-stamp build-stamp
- $(MAKE) clean
- rm -f Makefile.inc config.status
- dh_clean
-
-install: build-stamp
- dh_testdir
- dh_testroot
- dh_prep
- dh_installdirs
- $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
- rm -rvf $(CURDIR)/debian/tmp/usr/share
- rm -vf $(CURDIR)/debian/tmp/usr/lib/*.la
- rm -vf $(CURDIR)/debian/tmp/usr/lib/*.a
- find $(CURDIR)/debian/tmp -name '*' -print | xargs -I {} -i bash -c "chrpath -d {} > /dev/null 2>&1" || echo 'Stripped RPATH'
-
-binary-indep:
-
-binary-arch: install
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_installexamples
- dh_installman
- dh_installlogrotate
- dh_installcron
- dh_install --fail-missing
- dh_link
- dh_strip --dbg-package=glite-lbjp-common-db-dbg
- dh_compress
- dh_fixperms
- dh_makeshlibs
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-arch binary-indep
+++ /dev/null
-Summary: @SUMMARY@
-Name: glite-lbjp-common-db
-Version: @MAJOR@.@MINOR@.@REVISION@
-Release: @AGE@%{?dist}
-Url: @URL@
-License: ASL 2.0
-Vendor: EMI
-Group: System Environment/Libraries
-BuildRequires: cppunit-devel
-BuildRequires: chrpath
-BuildRequires: log4c-devel
-BuildRequires: mysql-devel
-BuildRequires: glite-lbjp-common-trio-devel
-BuildRequires: glite-lbjp-common-log-devel
-BuildRequires: libtool
-BuildRequires: postgresql-devel
-BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
-AutoReqProv: yes
-Source: http://eticssoft.web.cern.ch/eticssoft/repository/emi/emi.lbjp-common.db/%{version}/src/%{name}-@VERSION@.src.tar.gz
-
-
-%description
-@DESCRIPTION@
-
-
-%package devel
-Summary: Development files for gLite L&B/JP common DB module
-Group: Development/Libraries
-Requires: %{name}%{?_isa} = %{version}-%{release}
-
-
-%description devel
-This package contains development libraries and header files for gLite L&B/JP
-common DB module.
-
-
-%prep
-%setup -q
-
-
-%build
-/usr/bin/perl ./configure --thrflavour= --nothrflavour= --root=/ --prefix=/usr --libdir=%{_lib} --project=emi --module lbjp-common.db
-make
-
-
-%check
-make check
-
-
-%install
-rm -rf $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
-find $RPM_BUILD_ROOT -name '*.la' -exec rm -rf {} \;
-find $RPM_BUILD_ROOT -name '*.a' -exec rm -rf {} \;
-find $RPM_BUILD_ROOT -name '*' -print | xargs -I {} -i bash -c "chrpath -d {} > /dev/null 2>&1" || echo 'Stripped RPATH'
-
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
-%post -p /sbin/ldconfig
-
-
-%postun -p /sbin/ldconfig
-
-
-%files
-%defattr(-,root,root)
-%dir /usr/share/doc/%{name}-%{version}
-%doc /usr/share/doc/%{name}-%{version}/LICENSE
-/usr/%{_lib}/libglite_lbu_db.so.@MAJOR@.@MINOR@.@REVISION@
-/usr/%{_lib}/libglite_lbu_db.so.@MAJOR@
-
-
-%files devel
-%defattr(-,root,root)
-%dir /usr/include/glite
-%dir /usr/include/glite/lbu
-/usr/include/glite/lbu/db.h
-/usr/%{_lib}/libglite_lbu_db.so
-
-
-%changelog
-* @SPEC_DATE@ @MAINTAINER@ - @MAJOR@.@MINOR@.@REVISION@-@AGE@%{?dist}
-- automatically generated package
+++ /dev/null
-Database engine abstraction wrapper used in L&B and JP services.
+++ /dev/null
-Database engine abstraction wrapper used in L&B and JP services
+++ /dev/null
-: /cvs/jra1mw/org.glite.lbjp-common.db/project/version.properties,v 1.2 2009/01/21 10:44:34 zsustr Exp $
-module.version=3.1.2
-module.age=2
+++ /dev/null
-/*
-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 <sys/types.h>
-#ifdef LBS_DB_PROFILE
-#include <sys/time.h>
-#endif
-#include <unistd.h>
-#include <time.h>
-#include <assert.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdarg.h>
-
-#include <mysql.h>
-#include <mysqld_error.h>
-#include <mysql_version.h>
-#include <errmsg.h>
-
-#include "glite/lbu/trio.h"
-#include "glite/lbu/log.h"
-#include "db.h"
-#include "db-int.h"
-
-
-#define GLITE_LBU_MYSQL_INDEX_VERSION 40001
-#define GLITE_LBU_MYSQL_PREPARED_VERSION 40102
-#define BUF_INSERT_ROW_ALLOC_BLOCK 1000
-#ifndef GLITE_LBU_DEFAULT_RESULT_BUFFER_LENGTH
-#define GLITE_LBU_DEFAULT_RESULT_BUFFER_LENGTH 256
-#endif
-
-#define CLR_ERR(CTX) glite_lbu_DBClearError((glite_lbu_DBContext)(CTX))
-#define ERR(CTX, CODE, ARGS...) glite_lbu_DBSetError((glite_lbu_DBContext)((CTX)), (CODE), __FUNCTION__, __LINE__, ##ARGS)
-#define STATUS(CTX) glite_lbu_DBError((glite_lbu_DBContext)((CTX)), NULL, NULL)
-#define MY_ERR(CTX) myerr((CTX), __FUNCTION__, __LINE__)
-#define MY_ERRSTMT(STMT) myerrstmt((STMT), __FUNCTION__, __LINE__)
-#define MY_ISOKSTMT(STMT, RETRY) myisokstmt((STMT), __FUNCTION__, __LINE__, (RETRY))
-
-#define USE_TRANS(CTX) ((CTX->generic.caps & GLITE_LBU_DB_CAP_TRANSACTIONS) != 0)
-
-
-
-struct glite_lbu_DBContextMysql_s {
- struct glite_lbu_DBContext_s generic;
- int in_transaction; /* this flag is set whenever we are in DB transaction */
- MYSQL *mysql;
-};
-typedef struct glite_lbu_DBContextMysql_s *glite_lbu_DBContextMysql;
-
-
-struct glite_lbu_StatementMysql_s {
- glite_lbu_Statement_t generic;
-
- /* for simple commands */
- MYSQL_RES *result;
-
- /* for prepared commands */
- MYSQL_STMT *stmt;
- unsigned long nrfields;
- char *sql;
-};
-typedef struct glite_lbu_StatementMysql_s *glite_lbu_StatementMysql;
-
-
-/*
- * mapping glite DB types to mysql types
- */
-int glite_type_to_mysql[] = {
- MYSQL_TYPE_NULL,
- MYSQL_TYPE_TINY,
- MYSQL_TYPE_LONG,
- MYSQL_TYPE_TINY_BLOB,
- MYSQL_TYPE_TINY_BLOB,
- MYSQL_TYPE_BLOB,
- MYSQL_TYPE_BLOB,
- MYSQL_TYPE_MEDIUM_BLOB,
- MYSQL_TYPE_MEDIUM_BLOB,
- MYSQL_TYPE_LONG_BLOB,
- MYSQL_TYPE_LONG_BLOB,
- MYSQL_TYPE_VAR_STRING,
- MYSQL_TYPE_STRING,
- MYSQL_TYPE_DATE,
- MYSQL_TYPE_TIME,
- MYSQL_TYPE_DATETIME,
- MYSQL_TYPE_TIMESTAMP,
-};
-
-
-/* backend module declaration */
-int glite_lbu_InitDBContextMysql(glite_lbu_DBContext *ctx_gen);
-void glite_lbu_FreeDBContextMysql(glite_lbu_DBContext ctx_gen);
-int glite_lbu_DBConnectMysql(glite_lbu_DBContext ctx_gen, const char *cs);
-void glite_lbu_DBCloseMysql(glite_lbu_DBContext ctx_gen);
-int glite_lbu_DBQueryCapsMysql(glite_lbu_DBContext ctx_gen);
-void glite_lbu_DBSetCapsMysql(glite_lbu_DBContext commmon_ctx, int caps);
-int glite_lbu_TransactionMysql(glite_lbu_DBContext ctx_gen);
-int glite_lbu_CommitMysql(glite_lbu_DBContext ctx_gen);
-int glite_lbu_RollbackMysql(glite_lbu_DBContext ctx_gen);
-int glite_lbu_FetchRowMysql(glite_lbu_Statement stmt, unsigned int n, unsigned long *lengths, char **results);
-void glite_lbu_FreeStmtMysql(glite_lbu_Statement *stmt);
-int glite_lbu_QueryIndicesMysql(glite_lbu_DBContext ctx_gen, const char *table, char ***key_names, char ****column_names);
-int glite_lbu_ExecSQLMysql(glite_lbu_DBContext ctx_gen, const char *cmd, glite_lbu_Statement *stmt);
-int glite_lbu_QueryColumnsMysql(glite_lbu_Statement stmt_gen, char **cols);
-int glite_lbu_PrepareStmtMysql(glite_lbu_DBContext ctx_gen, const char *sql, glite_lbu_Statement *stmt_gen);
-int glite_lbu_ExecPreparedStmtMysql_v(glite_lbu_Statement stmt_gen, int n, va_list ap);
-long int glite_lbu_LastidMysql(glite_lbu_Statement stmt_gen);
-
-glite_lbu_DBBackend_t mysql_backend = {
- backend: GLITE_LBU_DB_BACKEND_MYSQL,
-
- initContext: glite_lbu_InitDBContextMysql,
- freeContext: glite_lbu_FreeDBContextMysql,
- connect: glite_lbu_DBConnectMysql,
- close: glite_lbu_DBCloseMysql,
- queryCaps: glite_lbu_DBQueryCapsMysql,
- setCaps: glite_lbu_DBSetCapsMysql,
- transaction: glite_lbu_TransactionMysql,
- commit: glite_lbu_CommitMysql,
- rollback: glite_lbu_RollbackMysql,
- fetchRow: glite_lbu_FetchRowMysql,
- freeStmt: glite_lbu_FreeStmtMysql,
- queryIndices: glite_lbu_QueryIndicesMysql,
- execSQL: glite_lbu_ExecSQLMysql,
- queryColumns: glite_lbu_QueryColumnsMysql,
-
- timeToDB: glite_lbu_TimeToStr,
- timestampToDB: glite_lbu_TimestampToStr,
- DBToTime: glite_lbu_StrToTime,
- DBToTimestamp: glite_lbu_StrToTimestamp,
-
- prepareStmt: glite_lbu_PrepareStmtMysql,
- execPreparedStmt_v: glite_lbu_ExecPreparedStmtMysql_v,
- lastid: glite_lbu_LastidMysql,
-};
-
-
-static int myerr(glite_lbu_DBContextMysql ctx, const char *source, int line);
-static int myerrstmt(glite_lbu_StatementMysql stmt, const char *source, int line);
-static int myisokstmt(glite_lbu_StatementMysql stmt, const char *source, int line, int *retry);
-static int db_connect(glite_lbu_DBContextMysql ctx, const char *cs, MYSQL **mysql);
-static void db_close(MYSQL *mysql);
-static int transaction_test(glite_lbu_DBContext ctx, int *caps);
-static int FetchRowSimple(glite_lbu_DBContextMysql ctx, MYSQL_RES *result, unsigned long *lengths, char **results);
-static int FetchRowPrepared(glite_lbu_DBContextMysql ctx, glite_lbu_StatementMysql stmt, unsigned int n, unsigned long *lengths, char **results);
-static void set_time(MYSQL_TIME *mtime, const double time);
-static void glite_lbu_FreeStmt_int(glite_lbu_StatementMysql stmt);
-
-
-/* ---- common ---- */
-
-
-
-int glite_lbu_InitDBContextMysql(glite_lbu_DBContext *ctx_gen) {
- glite_lbu_DBContextMysql ctx;
-
- ctx = calloc(1, sizeof *ctx);
- if (!ctx) return ENOMEM;
- *ctx_gen = (glite_lbu_DBContext)ctx;
-
- return 0;
-}
-
-
-void glite_lbu_FreeDBContextMysql(glite_lbu_DBContext ctx_gen) {
- glite_lbu_DBContextMysql ctx = (glite_lbu_DBContextMysql)ctx_gen;
-
- if (ctx) {
- assert(ctx->mysql == NULL);
- free(ctx);
- }
-}
-
-
-int glite_lbu_DBConnectMysql(glite_lbu_DBContext ctx_gen, const char *cs) {
- glite_lbu_DBContextMysql ctx = (glite_lbu_DBContextMysql)ctx_gen;
-
- if (db_connect(ctx, cs, &ctx->mysql) != 0 ||
- glite_lbu_ExecSQLMysql(ctx_gen, "SET AUTOCOMMIT=1", NULL) < 0 ||
- glite_lbu_ExecSQLMysql(ctx_gen, "SET TRANSACTION ISOLATION LEVEL REPEATABLE READ", NULL) < 0)
- return STATUS(ctx);
- else
- return 0;
-}
-
-
-void glite_lbu_DBCloseMysql(glite_lbu_DBContext ctx_gen) {
- glite_lbu_DBContextMysql ctx = (glite_lbu_DBContextMysql)ctx_gen;
-
- db_close(ctx->mysql);
- ctx->mysql = NULL;
- CLR_ERR(ctx);
-}
-
-
-int glite_lbu_DBQueryCapsMysql(glite_lbu_DBContext ctx_gen) {
- glite_lbu_DBContextMysql ctx = (glite_lbu_DBContextMysql)ctx_gen;
- MYSQL *m = ctx->mysql;
- int major,minor,sub,version,caps;
- const char *ver_s;
-
- caps = 0;
-
- ver_s = mysql_get_server_info(m);
- if (!ver_s || 3 != sscanf(ver_s,"%d.%d.%d",&major,&minor,&sub))
- return ERR(ctx, EINVAL, "problem retreiving MySQL version");
- version = 10000*major + 100*minor + sub;
-
- if (version >= GLITE_LBU_MYSQL_INDEX_VERSION) caps |= GLITE_LBU_DB_CAP_INDEX;
- if (version >= GLITE_LBU_MYSQL_PREPARED_VERSION) caps |= GLITE_LBU_DB_CAP_PREPARED;
-
- CLR_ERR(ctx);
- transaction_test(ctx_gen, &caps);
-
- if (STATUS(ctx) == 0) return caps;
- else return -1;
-}
-
-
-void glite_lbu_DBSetCapsMysql(glite_lbu_DBContext ctx_gen, int caps) {
- ctx_gen->caps = caps;
-}
-
-
-int glite_lbu_TransactionMysql(glite_lbu_DBContext ctx_gen) {
- glite_lbu_DBContextMysql ctx = (glite_lbu_DBContextMysql)ctx_gen;
-
- CLR_ERR(ctx);
- if (USE_TRANS(ctx)) {
- if (glite_lbu_ExecSQLMysql(ctx_gen, "SET AUTOCOMMIT=0", NULL) < 0) goto err;
- if (glite_lbu_ExecSQLMysql(ctx_gen, "BEGIN", NULL) < 0) goto err;
- ctx->in_transaction = 1;
- }
-err:
- return STATUS(ctx);
-}
-
-
-int glite_lbu_CommitMysql(glite_lbu_DBContext ctx_gen) {
- glite_lbu_DBContextMysql ctx = (glite_lbu_DBContextMysql)ctx_gen;
-
- CLR_ERR(ctx);
- if (USE_TRANS(ctx)) {
- if (glite_lbu_ExecSQLMysql(ctx_gen, "COMMIT", NULL) < 0) goto err;
- if (glite_lbu_ExecSQLMysql(ctx_gen, "SET AUTOCOMMIT=1", NULL) < 0) goto err;
- ctx->in_transaction = 0;
- }
-err:
- return STATUS(ctx);
-}
-
-
-int glite_lbu_RollbackMysql(glite_lbu_DBContext ctx_gen) {
- glite_lbu_DBContextMysql ctx = (glite_lbu_DBContextMysql)ctx_gen;
-
- CLR_ERR(ctx);
- if (USE_TRANS(ctx)) {
- if (glite_lbu_ExecSQLMysql(ctx_gen, "ROLLBACK", NULL) < 0) goto err;
- if (glite_lbu_ExecSQLMysql(ctx_gen, "SET AUTOCOMMIT=1", NULL) < 0) goto err;
- ctx->in_transaction = 0;
- }
-err:
- return STATUS(ctx);
-}
-
-
-int glite_lbu_FetchRowMysql(glite_lbu_Statement stmt_gen, unsigned int n, unsigned long *lengths, char **results) {
- glite_lbu_StatementMysql stmt = (glite_lbu_StatementMysql)stmt_gen;
- glite_lbu_DBContextMysql ctx = (glite_lbu_DBContextMysql)stmt->generic.ctx;
-
- memset(results, 0, n * sizeof(*results));
- if (stmt->result) return FetchRowSimple(ctx, stmt->result, lengths, results);
- else return FetchRowPrepared(ctx, stmt, n, lengths, results);
-}
-
-
-static void glite_lbu_FreeStmt_int(glite_lbu_StatementMysql stmt) {
- if (stmt) {
- if (stmt->result) mysql_free_result(stmt->result);
- if (stmt->stmt) mysql_stmt_close(stmt->stmt);
- free(stmt->sql);
- }
-}
-
-
-void glite_lbu_FreeStmtMysql(glite_lbu_Statement *stmt_gen) {
- glite_lbu_StatementMysql *stmt = (glite_lbu_StatementMysql*)stmt_gen;
-
- glite_lbu_FreeStmt_int(*stmt);
- free(*stmt);
- *stmt = NULL;
-}
-
-
-int glite_lbu_QueryIndicesMysql(glite_lbu_DBContext ctx_gen, const char *table, char ***key_names, char ****column_names) {
- glite_lbu_DBContextMysql ctx = (glite_lbu_DBContextMysql)ctx_gen;
- glite_lbu_Statement stmt;
-
- size_t i,j,ret;
-
-/* XXX: "show index from" columns. Matches at least MySQL 4.0.11 */
- char *sql, *showcol[13];
- int Key_name,Seq_in_index,Column_name,Sub_part;
-
- char **keys = NULL;
- size_t *cols = NULL;
- char **col_names = NULL;
-
- size_t nkeys = 0;
-
- char ***idx = NULL;
-
- Key_name = Seq_in_index = Column_name = Sub_part = -1;
-
- asprintf(&sql, "show index from %s", table);
- 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);
- }
- free(sql);
-
- while ((ret = glite_lbu_FetchRowMysql(stmt,sizeof(showcol)/sizeof(showcol[0]),NULL,showcol)) > 0) {
- assert(ret <= (int)(sizeof showcol/sizeof showcol[0]));
-
- if (!col_names) {
- col_names = malloc(ret * sizeof col_names[0]);
- glite_lbu_QueryColumnsMysql(stmt,col_names);
- for (i=0; i<ret; i++)
- if (!strcasecmp(col_names[i],"Key_name")) Key_name = i;
- else if (!strcasecmp(col_names[i],"Seq_in_index")) Seq_in_index = i;
- else if (!strcasecmp(col_names[i],"Column_name")) Column_name = i;
- else if (!strcasecmp(col_names[i],"Sub_part")) Sub_part = i;
-
- assert(Key_name >= 0 && Seq_in_index >= 0 &&
- Column_name >= 0 && Sub_part >= 0);
-
- }
-
- for (i=0; i<nkeys && strcasecmp(showcol[Key_name],keys[i]); i++);
-
- if (i == nkeys) {
- keys = realloc(keys,(i+2) * sizeof keys[0]);
- keys[i] = strdup(showcol[Key_name]);
-//printf("** KEY [%d] %s\n", i, keys[i]);
- keys[i+1] = NULL;
- cols = realloc(cols,(i+1) * sizeof cols[0]);
- cols[i] = 0;
- idx = realloc(idx,(i+2) * sizeof idx[0]);
- idx[i] = idx[i+1] = NULL;
- nkeys++;
- }
-
- j = atoi(showcol[Seq_in_index])-1;
- if (cols[i] <= j) {
- cols[i] = j+1;
- idx[i] = realloc(idx[i],(j+2)*sizeof idx[i][0]);
- memset(&idx[i][j+1],0,sizeof idx[i][0]);
- }
- idx[i][j] = strdup(showcol[Column_name]);
-//printf("****** [%d, %d] %s\n", i, j, idx[i][j]);
-//FIXME: needed?idx[i][j].value.i = atoi(showcol[Sub_part]);
- for (i = 0; i<ret; i++) free(showcol[i]);
- }
-
- glite_lbu_FreeStmtMysql(&stmt);
- free(cols);
- free(col_names);
-
- if (ret == 0) CLR_ERR(ctx);
- else {
- free(keys);
- keys = NULL;
- for (i = 0; idx[i]; i++) {
- for (j = 0; idx[i][j]; j++) free(idx[i][j]);
- free(idx[i]);
- }
- free(idx);
- idx = NULL;
- }
-
- if (key_names) *key_names = keys;
- else {
- for (i = 0; keys[i]; i++) free(keys[i]);
- free(keys);
- }
- *column_names = idx;
-
- return STATUS(ctx);
-}
-
-
-/* ---- simple ---- */
-
-int glite_lbu_ExecSQLMysql(glite_lbu_DBContext ctx_gen, const char *cmd, glite_lbu_Statement *stmt_gen) {
- glite_lbu_DBContextMysql ctx = (glite_lbu_DBContextMysql)ctx_gen;
- glite_lbu_StatementMysql stmt;
- int merr;
- int retry_nr = 0;
- int do_reconnect = 0;
-#ifdef LBS_DB_PROFILE
- struct timeval start,end;
- int pid;
-
- static struct timeval sum = {
- tv_sec: 0,
- tv_usec: 0
- };
-#endif
-
- CLR_ERR(ctx);
-
- if (stmt_gen) *stmt_gen = NULL;
- stmt = NULL;
-
-#ifdef LBS_DB_PROFILE
- gettimeofday(&start,NULL);
-#endif
-
- while (retry_nr == 0 || do_reconnect) {
- do_reconnect = 0;
- if (mysql_query(ctx->mysql, cmd)) {
- /* error occured */
- switch (merr = mysql_errno(ctx->mysql)) {
- case 0:
- break;
- case ER_DUP_ENTRY:
- ERR(ctx, EEXIST, mysql_error(ctx->mysql));
- return -1;
- break;
- case CR_SERVER_LOST:
- case CR_SERVER_GONE_ERROR:
- if (ctx->in_transaction) {
- ERR(ctx, ENOTCONN, mysql_error(ctx->mysql));
- return -1;
- }
- else if (retry_nr <= 0)
- do_reconnect = 1;
- break;
- case ER_LOCK_DEADLOCK:
- ERR(ctx, EDEADLK, mysql_error(ctx->mysql));
- return -1;
- break;
- default:
- MY_ERR(ctx);
- return -1;
- break;
- }
- }
- retry_nr++;
- }
-
- if (stmt_gen) {
- stmt = calloc(1, sizeof(*stmt));
- if (!stmt) {
- ERR(ctx, ENOMEM, NULL);
- return -1;
- }
- stmt->generic.ctx = ctx_gen;
- stmt->result = mysql_store_result(ctx->mysql);
- if (!stmt->result) {
- if (mysql_errno(ctx->mysql)) {
- MY_ERR(ctx);
- free(stmt);
- return -1;
- }
- }
- *stmt_gen = (glite_lbu_Statement)stmt;
- } else {
- MYSQL_RES *r = mysql_store_result(ctx->mysql);
- mysql_free_result(r);
- }
-#ifdef LBS_DB_PROFILE
- pid = getpid();
- gettimeofday(&end,NULL);
- end.tv_usec -= start.tv_usec;
- end.tv_sec -= start.tv_sec;
- if (end.tv_usec < 0) { end.tv_sec--; end.tv_usec += 1000000; }
-
- sum.tv_usec += end.tv_usec;
- sum.tv_sec += end.tv_sec + sum.tv_usec / 1000000;
- sum.tv_usec -= 1000000 * (sum.tv_usec / 1000000);
- fprintf(stderr,"[%d] %s\n[%d] %3ld.%06ld (sum: %3ld.%06ld)\n",pid,cmd,pid,end.tv_sec,end.tv_usec,sum.tv_sec,sum.tv_usec);
-#endif
-
- return mysql_affected_rows(ctx->mysql);
-}
-
-
-int glite_lbu_QueryColumnsMysql(glite_lbu_Statement stmt_gen, char **cols)
-{
- glite_lbu_StatementMysql stmt = (glite_lbu_StatementMysql)stmt_gen;
- int i = 0;
- MYSQL_FIELD *f;
-
- CLR_ERR(stmt->generic.ctx);
- if (!stmt->result) return ERR(stmt->generic.ctx, ENOTSUP, "QueryColumns implemented only for simple API");
- while ((f = mysql_fetch_field(stmt->result))) cols[i++] = f->name;
- return i == 0;
-}
-
-
-/* ---- prepared --- */
-
-int glite_lbu_PrepareStmtMysql(glite_lbu_DBContext ctx_gen, const char *sql, glite_lbu_Statement *stmt_gen) {
- glite_lbu_DBContextMysql ctx = (glite_lbu_DBContextMysql)ctx_gen;
- glite_lbu_StatementMysql stmt;
- int ret, retry;
- MYSQL_RES *meta;
-
- // init
- stmt = calloc(1, sizeof(*stmt));
- stmt->generic.ctx = ctx_gen;
- *stmt_gen = NULL;
-
- // create the SQL command
- if ((stmt->stmt = mysql_stmt_init(ctx->mysql)) == NULL)
- return STATUS(ctx);
-
- // prepare the SQL command
- retry = 1;
- do {
- mysql_stmt_prepare(stmt->stmt, sql, strlen(sql));
- ret = MY_ISOKSTMT(stmt, &retry);
- } while (ret == 0);
- if (ret == -1) goto failed;
-
- // number of fields (0 for no results)
- if ((meta = mysql_stmt_result_metadata(stmt->stmt)) != NULL) {
- stmt->nrfields = mysql_num_fields(meta);
- mysql_free_result(meta);
- } else
- stmt->nrfields = 0;
-
- // remember the command
- stmt->sql = strdup(sql);
-
- *stmt_gen = (glite_lbu_Statement)stmt;
- return CLR_ERR(ctx);
-
-failed:
- glite_lbu_FreeStmt_int(stmt);
- free(stmt);
- return STATUS(ctx);
-}
-
-
-int glite_lbu_ExecPreparedStmtMysql_v(glite_lbu_Statement stmt_gen, int n, va_list ap) {
- glite_lbu_StatementMysql stmt = (glite_lbu_StatementMysql)stmt_gen;
- int i, prepare_retry;
- glite_lbu_DBType type;
- char *pchar;
- int *pint;
- long int *plint;
- MYSQL_TIME *ptime;
- int ret, retry;
- MYSQL_BIND *binds = NULL;
- void **data = NULL;
- unsigned long *lens;
- glite_lbu_Statement newstmt;
-
- // gather parameters
- if (n) {
- binds = calloc(n, sizeof(MYSQL_BIND));
- data = calloc(n, sizeof(void *));
- lens = calloc(n, sizeof(unsigned long *));
- }
- for (i = 0; i < n; i++) {
- type = va_arg(ap, glite_lbu_DBType);
- switch (type) {
- case GLITE_LBU_DB_TYPE_TINYINT:
- pchar = binds[i].buffer = data[i] = malloc(sizeof(char));
- *pchar = va_arg(ap, int);
- break;
-
- case GLITE_LBU_DB_TYPE_INT:
- plint = binds[i].buffer = data[i] = malloc(sizeof(long int));
- *plint = va_arg(ap, long int);
- break;
-
- case GLITE_LBU_DB_TYPE_BOOLEAN:
- pint = binds[i].buffer = data[i] = malloc(sizeof(int));
- *pint = va_arg(ap, int) ? 1 : 0;
- break;
-
- case GLITE_LBU_DB_TYPE_TINYBLOB:
- case GLITE_LBU_DB_TYPE_TINYTEXT:
- case GLITE_LBU_DB_TYPE_BLOB:
- case GLITE_LBU_DB_TYPE_TEXT:
- case GLITE_LBU_DB_TYPE_MEDIUMBLOB:
- case GLITE_LBU_DB_TYPE_MEDIUMTEXT:
- case GLITE_LBU_DB_TYPE_LONGBLOB:
- case GLITE_LBU_DB_TYPE_LONGTEXT:
- binds[i].buffer = va_arg(ap, void *);
- binds[i].length = &lens[i];
- lens[i] = va_arg(ap, unsigned long);
- break;
-
- case GLITE_LBU_DB_TYPE_VARCHAR:
- case GLITE_LBU_DB_TYPE_CHAR:
- binds[i].buffer = va_arg(ap, char *);
- binds[i].length = &lens[i];
- lens[i] = binds[i].buffer ? strlen((char *)binds[i].buffer) : 0;
- break;
-
- case GLITE_LBU_DB_TYPE_DATE:
- case GLITE_LBU_DB_TYPE_TIME:
- case GLITE_LBU_DB_TYPE_DATETIME:
- ptime = binds[i].buffer = data[i] = malloc(sizeof(MYSQL_TIME));
- set_time(ptime, va_arg(ap, time_t));
- break;
-
- case GLITE_LBU_DB_TYPE_TIMESTAMP:
- ptime = binds[i].buffer = data[i] = malloc(sizeof(MYSQL_TIME));
- set_time(ptime, va_arg(ap, double));
- break;
-
- case GLITE_LBU_DB_TYPE_NULL:
- break;
-
- default:
- assert("unimplemented parameter assign" == NULL);
- break;
- }
- binds[i].buffer_type = glite_type_to_mysql[type];
- }
-
- prepare_retry = 2;
- do {
- // bind parameters
- if (n) {
- if (mysql_stmt_bind_param(stmt->stmt, binds) != 0) {
- MY_ERRSTMT(stmt);
- ret = -1;
- goto statement_failed;
- }
- }
-
- // run
- retry = 1;
- do {
- mysql_stmt_execute(stmt->stmt);
- ret = MY_ISOKSTMT(stmt, &retry);
- } while (ret == 0);
- statement_failed:
- if (ret == -1) {
- if (mysql_stmt_errno(stmt->stmt) == ER_UNKNOWN_STMT_HANDLER) {
- // expired the prepared command ==> restore it
- if (glite_lbu_PrepareStmtMysql(stmt->generic.ctx, stmt->sql, &newstmt) == -1) goto failed;
- glite_lbu_FreeStmt_int(stmt);
- memcpy(stmt, newstmt, sizeof(struct glite_lbu_StatementMysql_s));
- prepare_retry--;
- ret = 0;
- } else goto failed;
- }
- } while (ret == 0 && prepare_retry > 0);
-
- // result
- retry = 1;
- do {
- mysql_stmt_store_result(stmt->stmt);
- ret = MY_ISOKSTMT(stmt, &retry);
- } while (ret == 0);
- if (ret == -1) goto failed;
-
- // free params
- if (n) {
- for (i = 0; i < n; i++) free(data[i]);
- free(data);
- free(binds);
- free(lens);
- }
- CLR_ERR(stmt->generic.ctx);
- return mysql_stmt_affected_rows(stmt->stmt);
-
-failed:
- for (i = 0; i < n; i++) free(data[i]);
- free(data);
- free(binds);
- free(lens);
- return -1;
-}
-
-
-long int glite_lbu_LastidMysql(glite_lbu_Statement stmt_gen) {
- glite_lbu_StatementMysql stmt = (glite_lbu_StatementMysql)stmt_gen;
- my_ulonglong i;
-
- CLR_ERR(stmt_gen->ctx);
- i = mysql_stmt_insert_id(stmt->stmt);
- assert(i < ((unsigned long int)-1) >> 1);
- return (long int)i;
-}
-
-
-/*
- * helping function: find oud mysql error and sets on the context
- */
-static int myerr(glite_lbu_DBContextMysql ctx, const char *source, int line) {
- return glite_lbu_DBSetError(&ctx->generic, EIO, source, line, mysql_error(ctx->mysql));
-}
-
-
-/*
- * helping function: find oud mysql stmt error and sets on the context
- */
-static int myerrstmt(glite_lbu_StatementMysql stmt, const char *source, int line) {
- return glite_lbu_DBSetError(stmt->generic.ctx, EIO, source, line, mysql_stmt_error(stmt->stmt));
-}
-
-
-/*
- * helping function: error handle
- *
- * \return -1 failed
- * \return 0 retry
- * \return 1 OK
- */
-static int myisokstmt(glite_lbu_StatementMysql stmt, const char *source, int line, int *retry) {
- switch (mysql_stmt_errno(stmt->stmt)) {
- case 0:
- return 1;
- break;
- case ER_DUP_ENTRY:
- glite_lbu_DBSetError(stmt->generic.ctx, EEXIST, source, line, mysql_stmt_error(stmt->stmt));
- return -1;
- break;
- case CR_SERVER_LOST:
- case CR_SERVER_GONE_ERROR:
- if (*retry > 0) {
- (*retry)--;
- return 0;
- } else {
- myerrstmt(stmt, source, line);
- return -1;
- }
- break;
- default:
- myerrstmt(stmt, source, line);
- return -1;
- break;
- }
-}
-
-
-/*
- * mysql connect
- */
-static int db_connect(glite_lbu_DBContextMysql ctx, const char *cs, MYSQL **mysql) {
- char *buf = NULL;
- char *host,*user,*pw,*db;
- char *slash,*at,*colon;
- int ret;
-#if MYSQL_VERSION_ID >= 50013
- my_bool reconnect = 1;
-#endif
-
- // needed for SQL result parameters
- assert(sizeof(int) >= sizeof(my_bool));
-
- if (!cs) return ERR(ctx, EINVAL, "connect string not specified");
-
- if (!(*mysql = mysql_init(NULL))) return ERR(ctx, ENOMEM, NULL);
-
- mysql_options(*mysql, MYSQL_READ_DEFAULT_FILE, "my");
-#if MYSQL_VERSION_ID >= 50013
- /* XXX: may result in weird behaviour in the middle of transaction */
- mysql_options(*mysql, MYSQL_OPT_RECONNECT, &reconnect);
-#endif
-
- host = user = pw = db = NULL;
-
- buf = strdup(cs);
- slash = strchr(buf,'/');
- at = strrchr(buf,'@');
- colon = strrchr(buf,':');
-
- if (!slash || !at || !colon) {
- free(buf);
- db_close(*mysql);
- *mysql = NULL;
- return ERR(ctx, EINVAL, "Invalid DB connect string");
- }
-
- *slash = *at = *colon = 0;
- host = at+1;
- user = buf;
- pw = slash+1;
- db = colon+1;
-
- /* ljocha: CLIENT_FOUND_ROWS added to make authorization check
- * working in update_notif().
- * Hope it does not break anything else */
- if (!mysql_real_connect(*mysql,host,user,pw,db,0,NULL,CLIENT_FOUND_ROWS)) {
- ret = MY_ERR(ctx);
- db_close(*mysql);
- *mysql = NULL;
- free(buf);
- return ret;
- }
- free(buf);
-
- return CLR_ERR(ctx);
-}
-
-
-/*
- * mysql close
- */
-static void db_close(MYSQL *mysql) {
- if (mysql) mysql_close(mysql);
-}
-
-
-/*
- * test transactions capability:
- */
-static int transaction_test(glite_lbu_DBContext ctx, int *caps) {
- glite_lbu_Statement stmt;
- char *table[1] = { NULL }, *res[2] = { NULL, NULL }, *cmd = NULL;
- int retval;
-
- (*caps) &= ~GLITE_LBU_DB_CAP_TRANSACTIONS;
-
- glite_common_log(ctx->log_category, LOG_PRIORITY_DEBUG, "SHOW TABLES");
- if ((retval = glite_lbu_ExecSQLMysql(ctx, "SHOW TABLES", &stmt)) <= 0 || glite_lbu_FetchRowMysql(stmt, 1, NULL, table) < 0) goto quit;
- glite_lbu_FreeStmtMysql(&stmt);
-
- trio_asprintf(&cmd, "SHOW CREATE TABLE %|Ss", table[0]);
- 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");
- goto quit;
- }
-
- if (strstr(res[1],"ENGINE=InnoDB"))
- (*caps) |= GLITE_LBU_DB_CAP_TRANSACTIONS;
-
-#ifdef LBS_DB_PROFILE
- fprintf(stderr, "[%d] use_transactions = %d\n", getpid(), USE_TRANS(ctx));
-#endif
-
-quit:
- glite_lbu_FreeStmtMysql(&stmt);
- free(table[0]);
- free(res[0]);
- free(res[1]);
- free(cmd);
- return STATUS(ctx);
-}
-
-
-/*
- * simple version of the fetch
- */
-static int FetchRowSimple(glite_lbu_DBContextMysql ctx, MYSQL_RES *result, unsigned long *lengths, char **results) {
- MYSQL_ROW row;
- unsigned int nr, i;
- unsigned long *len;
-
- CLR_ERR(ctx);
-
- if (!(row = mysql_fetch_row(result))) {
- if (mysql_errno((MYSQL *) ctx->mysql)) {
- MY_ERR(ctx);
- return -1;
- } else return 0;
- }
-
- nr = mysql_num_fields(result);
- len = mysql_fetch_lengths(result);
- for (i=0; i<nr; i++) {
- if (lengths) lengths[i] = len[i];
- if (len[i]) {
- if ((results[i] = malloc(len[i] + 1)) == NULL)
- goto nomem;
- memcpy(results[i], row[i], len[i]);
- results[i][len[i]] = '\000';
- } else {
- if ((results[i] = strdup("")) == NULL)
- goto nomem;
- }
- }
-
- return nr;
-nomem:
- for (nr = i, i = 0; i < nr; i++) {
- free(results[i]);
- results[i] = NULL;
- }
- ERR(ctx, ENOMEM, "insufficient memory for field data");
- return -1;
-}
-
-
-/*
- * prepared version of the fetch
- */
-static int FetchRowPrepared(glite_lbu_DBContextMysql ctx, glite_lbu_StatementMysql stmt, unsigned int n, unsigned long *lengths, char **results) {
- int ret, retry;
- unsigned int i;
- MYSQL_BIND *binds = NULL;
- unsigned long *lens = NULL;
-
- if (n != stmt->nrfields) {
- ERR(ctx, EINVAL, "bad number of result fields");
- return -1;
- }
-
- // space for results
- if (n) binds = calloc(n, sizeof(MYSQL_BIND));
- if (!lengths) {
- lens = calloc(n, sizeof(unsigned long));
- lengths = lens;
- }
- for (i = 0; i < n; i++) {
- binds[i].buffer_type = MYSQL_TYPE_VAR_STRING;
- binds[i].buffer_length = GLITE_LBU_DEFAULT_RESULT_BUFFER_LENGTH - 1;
- binds[i].length = &lengths[i];
- if ((binds[i].buffer = results[i] = calloc(1, GLITE_LBU_DEFAULT_RESULT_BUFFER_LENGTH)) == NULL) {
- ERR(ctx, ENOMEM, "insufficient memory for field data");
- goto failed;
- }
- }
- if (mysql_stmt_bind_result(stmt->stmt, binds) != 0) goto failedstmt;
-
- // fetch data, all can be truncated
- retry = 1;
- do {
- switch(mysql_stmt_fetch(stmt->stmt)) {
-#ifdef MYSQL_DATA_TRUNCATED
- case MYSQL_DATA_TRUNCATED:
-#endif
- case 0:
- ret = 1; break;
- case 1: ret = MY_ISOKSTMT(stmt, &retry); break;
- case MYSQL_NO_DATA: ret = 0; goto quit; /* it's OK */
- default: ERR(ctx, EIO, "other fetch error"); goto failed;
- }
- } while (ret == 0);
- if (ret == -1) goto failed;
-
- // check if all fileds had enough buffer space
- for (i = 0; i < n; i++) {
- // fetch the rest if needed
- if (lengths[i] > binds[i].buffer_length) {
- unsigned int fetched;
-
- fetched = binds[i].buffer_length;
- if ((results[i] = realloc(results[i], lengths[i] + 1)) == NULL) {
- ERR(ctx, ENOMEM, "insufficient memory for field data");
- goto failed;
- }
- results[i][lengths[i]] = '\000';
- binds[i].buffer = results[i] + fetched;
- binds[i].buffer_length = lengths[i] - fetched;
-
- retry = 1;
- do {
- switch (mysql_stmt_fetch_column(stmt->stmt, binds + i, i, fetched)) {
- case 0: ret = 1; break;
- case 1: ret = MY_ISOKSTMT(stmt, &retry); break;
- case MYSQL_NO_DATA: ret = 0; goto quit; /* it's OK */
- default: ERR(ctx, EIO, "other fetch error"); goto failed;
- }
- } while (ret == 0);
- if (ret == -1) goto failed;
- }
- }
-
- CLR_ERR(ctx);
- free(binds);
- free(lens);
- return n;
-
-failedstmt:
- MY_ERRSTMT(stmt);
-failed:
- ret = -1;
-quit:
- free(binds);
- free(lens);
- for (i = 0; i < n; i++) {
- free(results[i]);
- results[i] = NULL;
- }
- return ret;
-}
-
-
-static void set_time(MYSQL_TIME *mtime, const double time) {
- struct tm tm;
- time_t itime;
-
- itime = time;
- gmtime_r(&itime, &tm);
- memset(mtime, 0, sizeof *mtime);
- mtime->year = tm.tm_year + 1900;
- mtime->month = tm.tm_mon + 1;
- mtime->day = tm.tm_mday;
- mtime->hour = tm.tm_hour;
- mtime->minute = tm.tm_min;
- mtime->second = tm.tm_sec;
- mtime->second_part = (time - itime) * 1000;
-}
+++ /dev/null
-/*
-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.
-*/
-
-/**
- * Simple postgres module with org.glite.lbjp-common.db interface.
- *
- * PostgreSQL limitations:
- * - prepared commands requires server >= 8.2
- * - binary data need to be handled manually (libpq limitation)
- */
-
-#include <sys/types.h>
-#include <assert.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
-
-#include <libpq-fe.h>
-
-#include "glite/lbu/trio.h"
-#include "glite/lbu/log.h"
-#include "db.h"
-#include "db-int.h"
-
-#ifdef WIN32
-#define STDCALL __stdcall
-#else
-#define STDCALL
-#endif
-
-#define DB_CONNECT_TIMEOUT "20"
-
-/*#ifdef LOG
- #define lprintf(FMT...) fprintf(stdout, "[db-pg] %s: ", __FUNCTION__); fprintf(stdout, ##FMT);
-#else
- #define lprintf(FMT...)
-#endif*/
-
-#define set_error(CTX, CODE, DESC...) glite_lbu_DBSetError((glite_lbu_DBContext)(CTX), (CODE), __FUNCTION__, __LINE__, ##DESC)
-
-
-struct glite_lbu_DBContextPsql_s {
- struct glite_lbu_DBContext_s generic;
- PGconn *conn;
- int prepared_counts[4];
-};
-typedef struct glite_lbu_DBContextPsql_s *glite_lbu_DBContextPsql;
-
-struct glite_lbu_StatementPsql_s {
- glite_lbu_Statement_t generic;
- PGresult *res;
- int row, nrows;
- char *sql, *name;
-};
-typedef struct glite_lbu_StatementPsql_s *glite_lbu_StatementPsql;
-
-
-/* backend module declaration */
-int glite_lbu_InitDBContextPsql(glite_lbu_DBContext *ctx_gen);
-void glite_lbu_FreeDBContextPsql(glite_lbu_DBContext ctx_gen);
-int glite_lbu_DBConnectPsql(glite_lbu_DBContext ctx_gen, const char *cs);
-void glite_lbu_DBClosePsql(glite_lbu_DBContext ctx_gen);
-int glite_lbu_DBQueryCapsPsql(glite_lbu_DBContext ctx_gen);
-void glite_lbu_DBSetCapsPsql(glite_lbu_DBContext commmon_ctx, int caps);
-int glite_lbu_TransactionPsql(glite_lbu_DBContext ctx_gen);
-int glite_lbu_CommitPsql(glite_lbu_DBContext ctx_gen);
-int glite_lbu_RollbackPsql(glite_lbu_DBContext ctx_gen);
-int glite_lbu_FetchRowPsql(glite_lbu_Statement stmt, unsigned int n, unsigned long *lengths, char **results);
-void glite_lbu_FreeStmtPsql(glite_lbu_Statement *stmt);
-//int glite_lbu_QueryIndicesPsql(glite_lbu_DBContext ctx_gen, const char *table, char ***key_names, char ****column_names);
-int glite_lbu_ExecSQLPsql(glite_lbu_DBContext ctx_gen, const char *cmd, glite_lbu_Statement *stmt);
-int glite_lbu_QueryColumnsPsql(glite_lbu_Statement stmt_gen, char **cols);
-int glite_lbu_PrepareStmtPsql(glite_lbu_DBContext ctx_gen, const char *sql, glite_lbu_Statement *stmt_gen);
-int glite_lbu_ExecPreparedStmtPsql_v(glite_lbu_Statement stmt_gen, int n, va_list ap);
-//long int glite_lbu_LastidPsql(glite_lbu_Statement stmt_gen);
-
-glite_lbu_DBBackend_t psql_backend = {
- backend: GLITE_LBU_DB_BACKEND_PSQL,
-
- initContext: glite_lbu_InitDBContextPsql,
- freeContext: glite_lbu_FreeDBContextPsql,
- connect: glite_lbu_DBConnectPsql,
- close: glite_lbu_DBClosePsql,
- queryCaps: glite_lbu_DBQueryCapsPsql,
- setCaps: glite_lbu_DBSetCapsPsql,
- transaction: glite_lbu_TransactionPsql,
- commit: glite_lbu_CommitPsql,
- rollback: glite_lbu_RollbackPsql,
- fetchRow: glite_lbu_FetchRowPsql,
- freeStmt: glite_lbu_FreeStmtPsql,
- queryIndices: NULL /*glite_lbu_QueryIndicesPsql*/,
- execSQL: glite_lbu_ExecSQLPsql,
- queryColumns: glite_lbu_QueryColumnsPsql,
-
- timeToDB: glite_lbu_TimeToStr,
- timestampToDB: glite_lbu_TimestampToStr,
- DBToTime: glite_lbu_StrToTime,
- DBToTimestamp: glite_lbu_StrToTimestamp,
-
- prepareStmt: glite_lbu_PrepareStmtPsql,
- execPreparedStmt_v: glite_lbu_ExecPreparedStmtPsql_v,
- lastid: NULL/*glite_lbu_LastidPsql*/,
-};
-
-
-/* nicer identifiers in PREPARE/EXECUTE commands */
-static const char *prepared_names[4] = {"select", "update", "insert", "other"};
-
-
-int glite_lbu_InitDBContextPsql(glite_lbu_DBContext *ctx_gen) {
- glite_lbu_DBContextPsql ctx;
- int err = 0;
-
- ctx = calloc(1, sizeof *ctx);
- if (!ctx) return ENOMEM;
- *ctx_gen = (glite_lbu_DBContext)ctx;
-
- return 0;
-}
-
-
-void glite_lbu_FreeDBContextPsql(glite_lbu_DBContext ctx_gen) {
- glite_lbu_DBContextPsql ctx = (glite_lbu_DBContextPsql)ctx_gen;
-
- if (ctx) {
- assert(ctx->conn == NULL);
- free(ctx);
- }
-}
-
-
-int glite_lbu_DBConnectPsql(glite_lbu_DBContext ctx_gen, const char *cs) {
- glite_lbu_DBContextPsql ctx = (glite_lbu_DBContextPsql)ctx_gen;
- char *buf, *slash, *at, *colon, *host, *user, *pw, *db, *pgcsbuf, *pgcs;
- char *err;
-
- host = user = pw = db = NULL;
- buf = strdup(cs);
- slash = strchr(buf,'/');
- at = strrchr(buf,'@');
- colon = strrchr(buf,':');
- if (!slash || !at || !colon) {
- free(buf);
- return set_error(ctx, EINVAL, "Invalid DB connect string");
- }
- *slash = *at = *colon = 0;
- host = at+1;
- user = buf;
- pw = slash+1;
- db = colon+1;
-
- trio_asprintf(&pgcsbuf, "host='%|Ss' dbname='%|Ss' user='%|Ss' password='%|Ss' connect_timeout=" DB_CONNECT_TIMEOUT, host, db, user, pw);
- /* simulate socket acces via localhost similar to MySQL */
- if (strcmp(host, "localhost") == 0) pgcs = pgcsbuf + strlen("host='localhost' ");
- else pgcs = pgcsbuf;
- free(buf);
-
- glite_common_log(ctx_gen->log_category, LOG_PRIORITY_DEBUG,
- "connection string = %s\n", pgcs);
- ctx->conn = PQconnectdb(pgcs);
- free(pgcsbuf);
- if (!ctx->conn) return ENOMEM;
-
-
-
- if (PQstatus(ctx->conn) != CONNECTION_OK) {
- asprintf(&err, "Can't connect, %s", PQerrorMessage(ctx->conn));
- PQfinish(ctx->conn);
- ctx->conn = NULL;
- set_error(ctx, EIO, err);
- free(err);
- return EIO;
- }
-
- return 0;
-}
-
-
-void glite_lbu_DBClosePsql(glite_lbu_DBContext ctx_gen) {
- glite_lbu_DBContextPsql ctx = (glite_lbu_DBContextPsql)ctx_gen;
-
- if (ctx->conn) {
- PQfinish(ctx->conn);
- ctx->conn = NULL;
- }
-}
-
-
-int glite_lbu_DBQueryCapsPsql(glite_lbu_DBContext ctx_gen) {
- glite_lbu_DBContextPsql ctx = (glite_lbu_DBContextPsql)ctx_gen;
- glite_lbu_Statement stmt;
- int major, minor, sub, version;
- int has_prepared = 0;
- char *res = NULL;
-
- glite_common_log(ctx_gen->log_category, LOG_PRIORITY_DEBUG, "SHOW server_version");
- if (glite_lbu_ExecSQLPsql(ctx_gen, "SHOW server_version", &stmt) == -1) return -1;
- switch (glite_lbu_FetchRowPsql(stmt, 1, NULL, &res)) {
- case 1:
- break;
- case -1:
- has_prepared = -1;
- goto quit;
- default:
- goto quit;
- }
- if (sscanf(res, "%d.%d.%d", &major, &minor, &sub) != 3) {
- set_error(ctx, EIO, "can't parse PostgreSQL version string");
- goto quit;
- }
- version = 10000*major + 100*minor + sub;
- has_prepared = version >= 80200 ? GLITE_LBU_DB_CAP_PREPARED : 0;
-
-quit:
- free(res);
- glite_lbu_FreeStmtPsql(&stmt);
- return has_prepared;
-}
-
-
-void glite_lbu_DBSetCapsPsql(glite_lbu_DBContext ctx_gen, int caps) {
- ctx_gen->caps = caps;
-}
-
-
-int glite_lbu_TransactionPsql(glite_lbu_DBContext ctx_gen __attribute((unused))) {
- return 0;
-}
-
-
-int glite_lbu_CommitPsql(glite_lbu_DBContext ctx_gen __attribute((unused))) {
- return 0;
-}
-
-
-int glite_lbu_RollbackPsql(glite_lbu_DBContext ctx_gen __attribute((unused))) {
- return 0;
-}
-
-
-int glite_lbu_FetchRowPsql(glite_lbu_Statement stmt_gen, unsigned int maxn, unsigned long *lengths, char **results) {
- glite_lbu_StatementPsql stmt = (glite_lbu_StatementPsql)stmt_gen;
- unsigned int i, n;
- char *s;
-
- if (stmt->row >= stmt->nrows) return 0;
-
- n = PQnfields(stmt->res);
- if (n <= 0) {
- set_error(stmt->generic.ctx, EINVAL, "Result set w/o columns");
- return -1;
- }
- if (n > maxn) {
- set_error(stmt->generic.ctx, EINVAL, "Not enough room for the result");
- return -1;
- }
- for (i = 0; i < n; i++) {
- /* sanity check for internal error (NULL when invalid row) */
- s = PQgetvalue(stmt->res, stmt->row, i) ? : "";
- if ((results[i] = strdup(s)) == NULL)
- goto nomem;
- if (lengths) lengths[i] = strlen(s);
- }
-
- stmt->row++;
- return n;
-nomem:
- for (n = i, i = 0; i < n; i++) {
- free(results[i]);
- results[i] = NULL;
- }
- set_error(stmt->generic.ctx, ENOMEM, "insufficient memory for field data");
- return -1;
-}
-
-
-void glite_lbu_FreeStmtPsql(glite_lbu_Statement *stmt_gen) {
- glite_lbu_DBContextPsql ctx;
- glite_lbu_StatementPsql stmt;
- char *sql;
-
- if (!*stmt_gen) return;
- stmt = (glite_lbu_StatementPsql)(*stmt_gen);
- ctx = (glite_lbu_DBContextPsql)stmt->generic.ctx;
- if (stmt->res) PQclear(stmt->res);
- if (stmt->name) {
- asprintf(&sql, "DEALLOCATE %s", stmt->name);
- glite_common_log_msg(ctx->generic.log_category, LOG_PRIORITY_DEBUG, sql);
- stmt->res = PQexec(ctx->conn, sql);
- free(sql);
- PQclear(stmt->res);
- }
- free(stmt->name);
- free(stmt->sql);
- free(stmt);
- *stmt_gen = NULL;
-}
-
-
-int glite_lbu_ExecSQLPsql(glite_lbu_DBContext ctx_gen, const char *cmd, glite_lbu_Statement *stmt_out) {
- glite_lbu_DBContextPsql ctx = (glite_lbu_DBContextPsql)ctx_gen;
- glite_lbu_StatementPsql stmt = NULL;
- int status, n;
- char *nstr, *errmsg, *pos;
- PGresult *res;
-
- //lprintf("command = %s\n", cmd);
- glite_common_log(ctx_gen->log_category, LOG_PRIORITY_DEBUG, "command = %s\n", cmd);
- if (stmt_out) *stmt_out = NULL;
- if ((res = PQexec(ctx->conn, cmd)) == NULL) {
- ctx->generic.err.code = ENOMEM;
- return -1;
- }
-
- status = PQresultStatus(res);
- if (status != PGRES_COMMAND_OK && status != PGRES_TUPLES_OK) {
- errmsg = PQresultErrorMessage(res);
- if (errmsg) {
- errmsg = strdup(errmsg);
- if ((pos = strrchr(errmsg, '\n')) != NULL) pos[0] = '\0';
- }
- set_error(ctx, EIO, errmsg);
- free(errmsg);
- PQclear(res);
- return -1;
- }
-
- nstr = PQcmdTuples(res);
- if (nstr && nstr[0]) n = atoi(nstr);
- else n = PQntuples(res);
- if (stmt_out) {
- stmt = calloc(1, sizeof(*stmt));
- stmt->generic.ctx = ctx_gen;
- stmt->res = res;
- stmt->nrows = n;
- *stmt_out = (glite_lbu_Statement)stmt;
- } else {
- PQclear(res);
- }
- return n;
-}
-
-
-int glite_lbu_QueryColumnsPsql(glite_lbu_Statement stmt_gen, char **cols) {
- glite_lbu_StatementPsql stmt = (glite_lbu_StatementPsql)stmt_gen;
- int n, i;
-
- n = PQnfields(stmt->res);
- for (i = 0; i < n; i++) {
- cols[i] = PQfname(stmt->res, i);
- }
- return -1;
-}
-
-
-int glite_lbu_PrepareStmtPsql(glite_lbu_DBContext ctx_gen, const char *sql, glite_lbu_Statement *stmt_out) {
- glite_lbu_DBContextPsql ctx = (glite_lbu_DBContextPsql)ctx_gen;
- int i, retval = -1;
- const char *selectp, *updatep, *insertp, *minp;
- char *sqlPrep = NULL, *s = NULL;
- glite_lbu_StatementPsql stmt;
- PGresult *res = NULL;
-
- // init
- stmt = calloc(1, sizeof(*stmt));
- stmt->generic.ctx = ctx_gen;
- stmt->sql = strdup(sql);
-
- // name of the prepared command used as ID in postgres
- i = -1;
- minp = stmt->sql + strlen(stmt->sql);
- selectp = strcasestr(stmt->sql, "SELECT");
- updatep = strcasestr(stmt->sql, "UPDATE");
- insertp = strcasestr(stmt->sql, "INSERT");
- if (selectp && selectp < minp) { minp = selectp; i = 0; }
- if (updatep && updatep < minp) { minp = updatep; i = 1; }
- if (insertp && insertp < minp) { minp = insertp; i = 2; }
- if (i == -1 || minp[0] == '\0') i = 3;
- 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_msg(ctx_gen->log_category, LOG_PRIORITY_DEBUG, sqlPrep);
- res = PQexec(ctx->conn, sqlPrep);
- if (PQresultStatus(res) != PGRES_COMMAND_OK) {
- asprintf(&s, "error preparing command: %s", PQerrorMessage(ctx->conn));
- set_error(ctx, EIO, s);
- free(s); s = NULL;
- goto quit;
- }
-
- *stmt_out = (glite_lbu_Statement)stmt;
- retval = 0;
-
-quit:
- free(sqlPrep);
- if (res) PQclear(res);
- if (!retval) return 0;
-
- free(stmt->name);
- free(stmt->sql);
- free(stmt);
- return retval;
-}
-
-
-int glite_lbu_ExecPreparedStmtPsql_v(glite_lbu_Statement stmt_gen, int n, va_list ap) {
- glite_lbu_StatementPsql stmt = (glite_lbu_StatementPsql)stmt_gen;
- glite_lbu_DBContextPsql ctx = (glite_lbu_DBContextPsql)stmt_gen->ctx;
- int i, retval = -1, status;
- char **tmpdata = NULL;
- char *sql = NULL, *s, *nstr;
- size_t data_len = 0;
-
- glite_lbu_DBType type;
-
- if (!stmt || !stmt->sql || !stmt->name)
- return set_error(ctx, EINVAL, "PrepareStmt() not called");
-
- if (stmt->res) {
- PQclear(stmt->res);
- stmt->res = NULL;
- }
-
- // gather parameters
- if (n) {
- tmpdata = calloc(n, sizeof(char *));
- }
- for (i = 0; i < n; i++) {
- type = va_arg(ap, glite_lbu_DBType);
-
- switch(type) {
- case GLITE_LBU_DB_TYPE_TINYINT:
- asprintf(&tmpdata[i], "%d", va_arg(ap, int));
- break;
-
- case GLITE_LBU_DB_TYPE_INT:
- asprintf(&tmpdata[i], "%ld", va_arg(ap, long int));
- break;
-
- case GLITE_LBU_DB_TYPE_TINYBLOB:
- case GLITE_LBU_DB_TYPE_TINYTEXT:
- case GLITE_LBU_DB_TYPE_BLOB:
- case GLITE_LBU_DB_TYPE_TEXT:
- case GLITE_LBU_DB_TYPE_MEDIUMBLOB:
- case GLITE_LBU_DB_TYPE_MEDIUMTEXT:
- case GLITE_LBU_DB_TYPE_LONGBLOB:
- case GLITE_LBU_DB_TYPE_LONGTEXT: {
- char *tmp, *s;
- unsigned long binary_len;
-
- s = va_arg(ap, char *);
- binary_len = va_arg(ap, unsigned long);
- glite_common_log(ctx->generic.log_category, LOG_PRIORITY_DEBUG,
- "blob, len = %lu, ptr = %p\n", binary_len, s);
- if (s) {
- tmp = malloc(2*binary_len + 1);
- PQescapeStringConn(ctx->conn, tmp, s, binary_len, NULL);
- asprintf(&tmpdata[i], "'%s'", tmp);
- glite_common_log(ctx->generic.log_category, LOG_PRIORITY_DEBUG, "escaped: '%s'\n", tmpdata[i]);
- free(tmp);
- } else
- tmpdata[i] = strdup("NULL");
- break;
- }
-
-
- case GLITE_LBU_DB_TYPE_VARCHAR:
- case GLITE_LBU_DB_TYPE_CHAR:
- s = va_arg(ap, char *);
- if (s) trio_asprintf(&tmpdata[i], "'%|Ss'", s);
- else tmpdata[i] = strdup("NULL");
- break;
-
- case GLITE_LBU_DB_TYPE_DATE:
- case GLITE_LBU_DB_TYPE_TIME:
- case GLITE_LBU_DB_TYPE_DATETIME:
- glite_lbu_TimeToStr(va_arg(ap, time_t), &tmpdata[i]);
- break;
-
- case GLITE_LBU_DB_TYPE_TIMESTAMP:
- glite_lbu_TimestampToStr(va_arg(ap, double), &tmpdata[i]);
- break;
-
- case GLITE_LBU_DB_TYPE_NULL:
- tmpdata[i] = strdup("NULL");
- break;
-
- case GLITE_LBU_DB_TYPE_BOOLEAN:
- tmpdata[i] = strdup(va_arg(ap, int) ? "true" : "false");
- break;
-
- default:
- glite_common_log(ctx->generic.log_category, LOG_PRIORITY_DEBUG,
- "unknown type %d\n", type);
- set_error(ctx, EINVAL, "unimplemented type");
- goto quit;
- }
-
- data_len += strlen(tmpdata[i]);
- }
-
- asprintf(&sql, "EXECUTE %s", stmt->name);
- s = realloc(sql, strlen(sql) + (2 * n - 2) + strlen(" ()") + data_len + 1);
- if (!s) goto quit;
- sql = s;
- for (i = 0; i < n; i++) {
- strcat(sql, i ? ", " : " (" ); s += 2;
- strcat(sql, tmpdata[i]);
- }
- if (n) strcat(sql, ")");
-
- glite_common_log_msg(ctx->generic.log_category, LOG_PRIORITY_DEBUG, sql);
- stmt->res = PQexec(ctx->conn, sql);
- status = PQresultStatus(stmt->res);
- if (status != PGRES_COMMAND_OK && status != PGRES_TUPLES_OK) {
- asprintf(&s, "error executing prepared command '%s' parameters '%s': %s", stmt->sql, sql, PQerrorMessage(ctx->conn));
- set_error(ctx, EIO, s);
- free(s); s = NULL;
- goto quit;
- }
- nstr = PQcmdTuples(stmt->res);
- //lprintf("cmdtuples: '%s'\n", nstr);
- if (nstr && nstr[0]) retval = atoi(nstr);
- else retval = PQntuples(stmt->res);
- stmt->nrows = retval;
- stmt->row = 0;
- //lprintf("ntuples/retval: %d\n", retval);
-
-quit:
- for (i = 0; i < n; i++) free(tmpdata[i]);
- free(tmpdata);
- free(sql);
- return retval;
-}
+++ /dev/null
-#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 <sys/types.h>
-#include <errno.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <glite/lbu/trio.h>
-#include "glite/lbu/log.h"
-
-#include "db.h"
-#include "db-int.h"
-
-
-#define VALID(BACKEND) ((BACKEND) >= 0 && (BACKEND) < GLITE_LBU_DB_BACKEND_LAST)
-
-
-struct glite_lbu_bufInsert_s {
- glite_lbu_DBContext ctx;
- char *table_name;
- char *columns; /* names of columns to be inserted into
- * (values separated with commas) */
- char **rows; /* each row hold string of one row to be inserted
- * (values separated with commas) */
- long rec_num, /* actual number of rows in structure */
- rec_size; /* approx. size of a real insert string */
- long size_limit, /* size and # of records limit which trigger */
- record_limit; /* real insert; zero means unlimitted */
-};
-
-
-/* possible backends */
-#ifdef MYSQL_ENABLED
-extern glite_lbu_DBBackend_t mysql_backend;
-#else
-#define mysql_backend no_backend
-#endif
-#ifdef PSQL_ENABLED
-extern glite_lbu_DBBackend_t psql_backend;
-#else
-#define psql_backend no_backend
-#endif
-
-glite_lbu_DBBackend_t no_backend = {
- backend: -1,
-
- /* functions unspecified */
-};
-
-glite_lbu_DBBackend_t *backends[GLITE_LBU_DB_BACKEND_LAST] = {
- &mysql_backend,
- &psql_backend
-};
-
-
-/* --- internal functions ---- */
-
-int glite_lbu_DBClearError(glite_lbu_DBContext ctx) {
- ctx->err.code = 0;
- if (ctx->err.desc) {
- free(ctx->err.desc);
- ctx->err.desc = NULL;
- }
- return 0;
-}
-
-
-int glite_lbu_DBSetError(glite_lbu_DBContext ctx, int code, const char *func, int line, const char *desc, ...) {
- va_list ap;
-
- if (!code) return ctx->err.code;
-
- ctx->err.code = code;
- free(ctx->err.desc);
- if (desc) {
- va_start(ap, desc);
- vasprintf(&ctx->err.desc, desc, ap);
- va_end(ap);
- } else
- ctx->err.desc = NULL;
- glite_common_log(ctx->log_category, LOG_PRIORITY_WARN,
- "[db %d] %s:%d %s\n", getpid(), func, line, ctx->err.desc);
- return code;
-}
-
-
-void glite_lbu_TimeToStrGeneric(time_t t, char **str, const char *amp) {
- struct tm *tm = gmtime(&t);
-
- asprintf(str,"%s%4d-%02d-%02d %02d:%02d:%02d%s",amp,tm->tm_year+1900,tm->tm_mon+1,
- tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,amp);
-}
-
-
-void glite_lbu_TimeToStr(time_t t, char **str) {
- glite_lbu_TimeToStrGeneric(t, str, "'");
-}
-
-
-void glite_lbu_TimestampToStrGeneric(double t, char **str, const char *amp) {
- time_t tsec = t;
- struct tm *tm = gmtime(&tsec);
-
- t = t - tsec + tm->tm_sec;
- asprintf(str,"%s%4d-%02d-%02d %02d:%02d:%02.09f%s",amp,tm->tm_year+1900,tm->tm_mon+1,
- tm->tm_mday,tm->tm_hour,tm->tm_min,t,amp);
-}
-
-
-void glite_lbu_TimestampToStr(double t, char **str) {
- glite_lbu_TimestampToStrGeneric(t, str, "'");
-}
-
-
-static time_t tm2time(struct tm *tm) {
- static struct tm tm_last = { tm_year:0, tm_mon:0 };
- static time_t t = (time_t)-1;
- static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
- char *tz;
-
- pthread_mutex_lock(&lock);
- if (tm->tm_year == tm_last.tm_year && tm->tm_mon == tm_last.tm_mon) {
- t = t + (tm->tm_sec - tm_last.tm_sec)
- + (tm->tm_min - tm_last.tm_min) * 60
- + (tm->tm_hour - tm_last.tm_hour) * 3600
- + (tm->tm_mday - tm_last.tm_mday) * 86400;
- memcpy(&tm_last, tm, sizeof tm_last);
- } else {
- tz = getenv("TZ");
- if (tz) tz = strdup(tz);
- setenv("TZ", "UTC", 1);
- tzset();
-
- t = mktime(tm);
- memcpy(&tm_last, tm, sizeof tm_last);
-
- if (tz) setenv("TZ", tz, 1);
- else unsetenv("TZ");
- free(tz);
- tzset();
- }
- pthread_mutex_unlock(&lock);
-
- return t;
-}
-
-
-time_t glite_lbu_StrToTime(const char *str) {
- struct tm tm;
-
- memset(&tm,0,sizeof(tm));
- sscanf(str,"%4d-%02d-%02d %02d:%02d:%02d",
- &tm.tm_year,&tm.tm_mon,&tm.tm_mday,
- &tm.tm_hour,&tm.tm_min,&tm.tm_sec);
- tm.tm_year -= 1900;
- tm.tm_mon--;
-
- return tm2time(&tm);
-}
-
-
-double glite_lbu_StrToTimestamp(const char *str) {
- struct tm tm;
- double sec;
-
- memset(&tm,0,sizeof(tm));
- sscanf(str,"%4d-%02d-%02d %02d:%02d:%lf",
- &tm.tm_year,&tm.tm_mon,&tm.tm_mday,
- &tm.tm_hour,&tm.tm_min,&sec);
- tm.tm_year -= 1900;
- tm.tm_mon--;
- tm.tm_sec = sec;
-
- return (sec - tm.tm_sec) + tm2time(&tm);
-}
-
-
-/* ---- API ---- */
-
-
-int glite_lbu_DBError(glite_lbu_DBContext ctx, char **text, char **desc) {
- if (text) *text = strdup(strerror(ctx->err.code));
- if (desc) {
- if (ctx->err.desc) *desc = strdup(ctx->err.desc);
- else *desc = NULL;
- }
-
- return ctx->err.code;
-}
-
-
-int glite_lbu_InitDBContext(glite_lbu_DBContext *ctx, int backend, char *log_category) {
- int ret;
-
- if (!VALID(backend)) return EINVAL;
- if (backends[backend]->backend != backend) return ENOTSUP;
- ret = backends[backend]->initContext(ctx);
- if (ctx && *ctx) {
- (*ctx)->backend = backend;
- (*ctx)->log_category = log_category;
- }
-
- return ret;
-}
-
-
-void glite_lbu_FreeDBContext(glite_lbu_DBContext ctx) {
- if (!ctx || !VALID(ctx->backend)) return;
-
- free(ctx->err.desc);
- ctx->err.desc = NULL;
- backends[ctx->backend]->freeContext(ctx);
-}
-
-
-int glite_lbu_DBConnect(glite_lbu_DBContext ctx, const char *cs) {
- if (!VALID(ctx->backend)) return EINVAL;
- ctx->connection_string = strdup(cs);
- return backends[ctx->backend]->connect(ctx, cs);
-}
-
-
-void glite_lbu_DBClose(glite_lbu_DBContext ctx) {
- if (!VALID(ctx->backend)) return;
- backends[ctx->backend]->close(ctx);
-}
-
-
-int glite_lbu_DBQueryCaps(glite_lbu_DBContext ctx) {
- if (!VALID(ctx->backend)) return EINVAL;
- return backends[ctx->backend]->queryCaps(ctx);
-}
-
-
-void glite_lbu_DBSetCaps(glite_lbu_DBContext ctx, int caps) {
- if (!VALID(ctx->backend)) return;
- return backends[ctx->backend]->setCaps(ctx, caps);
-}
-
-
-int glite_lbu_Transaction(glite_lbu_DBContext ctx) {
- if (!VALID(ctx->backend)) return EINVAL;
- return backends[ctx->backend]->transaction(ctx);
-}
-
-
-int glite_lbu_Commit(glite_lbu_DBContext ctx) {
- if (!VALID(ctx->backend)) return EINVAL;
- return backends[ctx->backend]->commit(ctx);
-}
-
-
-int glite_lbu_Rollback(glite_lbu_DBContext ctx) {
- if (!VALID(ctx->backend)) return EINVAL;
- return backends[ctx->backend]->rollback(ctx);
-}
-
-
-int glite_lbu_FetchRow(glite_lbu_Statement stmt, unsigned int n, unsigned long *lengths, char **results) {
- if (!VALID(stmt->ctx->backend)) return EINVAL;
- return backends[stmt->ctx->backend]->fetchRow(stmt, n, lengths, results);
-}
-
-
-void glite_lbu_FreeStmt(glite_lbu_Statement *stmt) {
- if (!stmt || !*stmt || !VALID((*stmt)->ctx->backend)) return;
- return backends[(*stmt)->ctx->backend]->freeStmt(stmt);
-}
-
-
-int glite_lbu_QueryIndices(glite_lbu_DBContext ctx, const char *table, char ***key_names, char ****column_names) {
- if (!VALID(ctx->backend)) return EINVAL;
- return backends[ctx->backend]->queryIndices(ctx, table, key_names, column_names);
-}
-
-
-int glite_lbu_ExecSQL(glite_lbu_DBContext ctx, const char *cmd, glite_lbu_Statement *stmt) {
- if (!VALID(ctx->backend)) return EINVAL;
- return backends[ctx->backend]->execSQL(ctx, cmd, stmt);
-}
-
-
-int glite_lbu_QueryColumns(glite_lbu_Statement stmt, char **cols) {
- if (!VALID(stmt->ctx->backend)) return EINVAL;
- return backends[stmt->ctx->backend]->queryColumns(stmt, cols);
-}
-
-
-int glite_lbu_PrepareStmt(glite_lbu_DBContext ctx, const char *sql, glite_lbu_Statement *stmt) {
- if (!VALID(ctx->backend)) return EINVAL;
- return backends[ctx->backend]->prepareStmt(ctx, sql, stmt);
-}
-
-
-int glite_lbu_ExecPreparedStmt_v(glite_lbu_Statement stmt, int n, va_list ap) {
- if (!VALID(stmt->ctx->backend)) return EINVAL;
- return backends[stmt->ctx->backend]->execPreparedStmt_v(stmt, n, ap);
-}
-
-
-int glite_lbu_ExecPreparedStmt(glite_lbu_Statement stmt, int n, ...) {
- va_list ap;
- int retval;
-
- va_start(ap, n);
- retval = glite_lbu_ExecPreparedStmt_v(stmt, n, ap);
- va_end(ap);
-
- return retval;
-}
-
-
-long int glite_lbu_Lastid(glite_lbu_Statement stmt) {
- if (!VALID(stmt->ctx->backend)) return EINVAL;
- return backends[stmt->ctx->backend]->lastid(stmt);
-}
-
-
-void glite_lbu_TimeToDB(glite_lbu_DBContext ctx, time_t t, char **str) {
- if (!VALID(ctx->backend)) return;
- return backends[ctx->backend]->timeToDB(t, str);
-}
-
-
-void glite_lbu_TimestampToDB(glite_lbu_DBContext ctx, double t, char **str) {
- if (!VALID(ctx->backend)) return;
- return backends[ctx->backend]->timestampToDB(t, str);
-}
-
-
-time_t glite_lbu_DBToTime(glite_lbu_DBContext ctx, const char *str) {
- if (!VALID(ctx->backend)) return (time_t)-1;
- return backends[ctx->backend]->DBToTime(str);
-}
-
-
-double glite_lbu_DBToTimestamp(glite_lbu_DBContext ctx, const char *str) {
- if (!VALID(ctx->backend)) return -1;
- return backends[ctx->backend]->DBToTimestamp(str);
-}
-
-char *glite_lbu_DBGetConnectionString(glite_lbu_DBContext ctx) {
- return strdup(ctx->connection_string);
-}
-
-char *glite_lbu_DBGetHost(glite_lbu_DBContext ctx) {
- //XXX this is same for msql and pg, move it into backends, when some difference occurs
-
- char *host, *buf, *slash, *at, *colon;
- if (! ctx->connection_string)
- return NULL;
-
- buf = strdup(ctx->connection_string);
- slash = strchr(buf,'/');
- at = strrchr(buf,'@');
- colon = strrchr(buf,':');
-
- if (!slash || !at || !colon){
- //XXX should never happen when DB is opened
- free(buf);
- return NULL;
- }
-
- *slash = *at = *colon = 0;
-
- host = strdup(at+1);
- free(buf);
-
- return host;
-}
-
-char *glite_lbu_DBGetName(glite_lbu_DBContext ctx) {
- //XXX this is same for msql and pg, move it into backends, when some difference occurs
-
- char *name, *buf, *slash, *at, *colon;
- if (! ctx->connection_string)
- return NULL;
-
- buf = strdup(ctx->connection_string);
- slash = strchr(buf,'/');
- at = strrchr(buf,'@');
- colon = strrchr(buf,':');
-
- if (!slash || !at || !colon){
- //XXX should never happen when DB is opened
- free(buf);
- return NULL;
- }
-
- *slash = *at = *colon = 0;
-
- name = strdup(colon+1);
- free(buf);
-
- return name;
-}
-
-
-
-#define STATUS(CTX) ((CTX)->err.code)
-#define CLR_ERR(CTX) glite_lbu_DBClearError((CTX))
-int glite_lbu_bufferedInsertInit(glite_lbu_DBContext ctx, glite_lbu_bufInsert *bi, const char *table_name, long size_limit, long record_limit, const char *columns)
-{
- *bi = calloc(1, sizeof(*bi));
- (*bi)->ctx = ctx;
- (*bi)->table_name = strdup(table_name);
- (*bi)->columns = strdup(columns);
- (*bi)->rec_num = 0;
- (*bi)->rec_size = 0;
- (*bi)->rows = calloc(record_limit, sizeof(*((*bi)->rows)) );
- (*bi)->size_limit = size_limit;
- (*bi)->record_limit = record_limit;
-
- return CLR_ERR(ctx);
-}
-
-
-static int flush_bufferd_insert(glite_lbu_bufInsert bi)
-{
- char *stmt, *vals, *temp;
- long i;
-
-
- if (!bi->rec_num)
- return STATUS(bi->ctx);
-
- asprintf(&vals,"(%s)", bi->rows[0]);
- for (i=1; i < bi->rec_num; i++) {
- // XXX: use string add (preallocated memory)
- asprintf(&temp,"%s,(%s)", vals, bi->rows[i]);
- free(vals); vals = temp; temp = NULL;
- free(bi->rows[i]);
- bi->rows[i] = NULL;
- }
-
- trio_asprintf(&stmt, "insert into %|Ss(%|Ss) values %s;",
- bi->table_name, bi->columns, vals);
- 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)
- CLR_ERR(bi->ctx);
- }
-
- /* reset bi counters */
- bi->rec_size = 0;
- bi->rec_num = 0;
-
- free(vals);
- free(stmt);
-
- return STATUS(bi->ctx);
-}
-
-
-int glite_lbu_bufferedInsert(glite_lbu_bufInsert bi, const char *row)
-{
- bi->rows[bi->rec_num++] = strdup(row);
- bi->rec_size += strlen(row);
-
- if ((bi->size_limit && bi->rec_size >= bi->size_limit) ||
- (bi->record_limit && bi->rec_num >= bi->record_limit))
- {
- if (flush_bufferd_insert(bi))
- return STATUS(bi->ctx);
- }
-
- return CLR_ERR(bi->ctx);
-}
-
-
-static void free_buffered_insert(glite_lbu_bufInsert bi) {
- long i;
-
- free(bi->table_name);
- free(bi->columns);
- for (i=0; i < bi->rec_num; i++) {
- free(bi->rows[i]);
- }
- free(bi->rows);
-}
-
-
-int glite_lbu_bufferedInsertClose(glite_lbu_bufInsert bi)
-{
- if (flush_bufferd_insert(bi))
- return STATUS(bi->ctx);
- free_buffered_insert(bi);
-
- return CLR_ERR(bi->ctx);
-}
+++ /dev/null
-/*
-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 <cstdlib>
-#include <cstring>
-#include <cstdio>
-#include <cmath>
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/ui/text/TestRunner.h>
-
-#include "db.h"
-
-#define zoneCheck(tmp) {\
- (tmp) = getenv("TZ"); \
- if (tz == NULL) CPPUNIT_ASSERT((tmp) == NULL);\
- else CPPUNIT_ASSERT((tmp) != NULL && strcmp(tz, (tmp)) == 0);\
-}
-
-static struct {
- time_t t;
- const char *db;
-} data[] = {
- // year of tiger (and day +, day -)
- {t:1266142830, db:"2010-02-14 10:20:30"},
- {t:1266142830-24*3600, db:"2010-02-13 10:20:30"},
- {t:1266142830+24*3600, db:"2010-02-15 10:20:30"},
-
- // two months later (and day +, day -)
- {t:1271240430, db:"2010-04-14 10:20:30"},
- {t:1271240430-24*3600, db:"2010-04-13 10:20:30"},
- {t:1271240430+24*3600, db:"2010-04-15 10:20:30"},
-};
-
-class ZoneTest: public CppUnit::TestFixture
-{
- CPPUNIT_TEST_SUITE(ZoneTest);
- CPPUNIT_TEST(testInitialZoneCheck);
- CPPUNIT_TEST(testTimeZone3);
- CPPUNIT_TEST(testTimeZoneNULL);
- CPPUNIT_TEST(testTimeZoneUTC);
- CPPUNIT_TEST_SUITE_END();
-
-public:
-
- void setUp() {
- tz = tz0 = getenv("TZ");
- }
-
- void tearDown() {
- if (tz0) setenv("TZ", tz0, 1);
- else unsetenv("TZ");
- }
-
- void testInitialZoneCheck() {
- char *tz2;
-
- zoneCheck(tz2);
- }
-
- void testTimeZone3() {
- tz = "Tst 3:00";
- setenv("TZ", tz, 1);
- tzset();
- testInitialZoneCheck();
- convertCheck();
- }
-
- void testTimeZoneNULL() {
- tz = NULL;
- unsetenv("TZ");
- tzset();
- testInitialZoneCheck();
- convertCheck();
- }
-
- void testTimeZoneUTC() {
- tz = "UTC";
- setenv("TZ", tz, 1);
- tzset();
- testInitialZoneCheck();
- convertCheck();
- }
-
-private:
-
-const char *tz0, *tz;
-
-void convertCheck() {
- char *tz2;
-
- time_t tt;
- double st_d;
- char *st_str, *st_dbstr, *t_dbstr;
-
- char *s;
- time_t t;
- double d;
- size_t i;
-
- for (i = 0; i < sizeof(data)/sizeof(data[0]); i++) {
- tt = data[i].t;
- st_d = tt + 0.013;
- asprintf(&t_dbstr, "'%s'", data[i].db);
- asprintf(&st_str, "%s.013", data[i].db);
- asprintf(&st_dbstr, "'%s.013'", data[i].db);
-
- glite_lbu_TimeToStr(tt, &s);
- CPPUNIT_ASSERT(s != NULL);
- CPPUNIT_ASSERT(strcmp(s, t_dbstr) == 0);
- free(s);
- zoneCheck(tz2);
-
- glite_lbu_TimestampToStr(st_d, &s);
- CPPUNIT_ASSERT(s != NULL);
- CPPUNIT_ASSERT(strncmp(s, st_dbstr, 24) == 0);
- free(s);
- zoneCheck(tz2);
-
- t = glite_lbu_StrToTime(data[i].db);
- CPPUNIT_ASSERT(t == tt);
- zoneCheck(tz2);
-
- d = glite_lbu_StrToTimestamp(st_str);
- CPPUNIT_ASSERT(round(1000 * d) == round(1000 * st_d));
- zoneCheck(tz2);
-
- free(st_str);
- free(st_dbstr);
- free(t_dbstr);
- }
-}
-
-};
-
-CPPUNIT_TEST_SUITE_REGISTRATION( ZoneTest );
-
-int
-main ()
-{
- CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
- CppUnit::TextUi::TestRunner runner;
-
- runner.addTest(suite);
- return runner.run() ? 0 : 1;
-}
+++ /dev/null
-LICENSE file for EGEE Middleware\r
-================================\r
-\r
-Copyright (c) 2004 on behalf of the EU EGEE Project: \r
-The European Organization for Nuclear Research (CERN), \r
-Istituto Nazionale di Fisica Nucleare (INFN), Italy\r
-Datamat Spa, Italy\r
-Centre National de la Recherche Scientifique (CNRS), France\r
-CS Systeme d'Information (CSSI), France\r
-Royal Institute of Technology, Center for Parallel Computers (KTH-PDC), Sweden\r
-Universiteit van Amsterdam (UvA), Netherlands\r
-University of Helsinki (UH.HIP), Finlan\r
-University of Bergen (UiB), Norway\r
-Council for the Central Laboratory of the Research Councils (CCLRC), United Kingdom\r
-\r
-Redistribution and use in source and binary forms, with or without\r
-modification, are permitted provided that the following conditions are\r
-met: \r
-\r
-1. Redistributions of source code must retain the above copyright\r
-notice, this list of conditions and the following disclaimer.\r
-\r
-2. Redistributions in binary form must reproduce the above copyright\r
-notice, this list of conditions and the following disclaimer in the\r
-documentation and/or other materials provided with the distribution.\r
-\r
-3. The end-user documentation included with the redistribution, if\r
-any, must include the following acknowledgment: "This product includes\r
-software developed by The EU EGEE Project (http://cern.ch/eu-egee/)."\r
-Alternatively, this acknowledgment may appear in the software itself, if\r
-and wherever such third-party acknowledgments normally appear.\r
-\r
-4. The names EGEE and the EU EGEE Project must not be\r
-used to endorse or promote products derived from this software without\r
-prior written permission. For written permission, please contact\r
-<email address>.\r
-\r
-5. You are under no obligation whatsoever to provide anyone with any\r
-bug fixes, patches, or upgrades to the features, functionality or\r
-performance of the Software ("Enhancements") that you may develop over\r
-time; however, if you choose to provide your Enhancements to The EU\r
-EGEE Project, or if you choose to otherwise publish or distribute your\r
-Enhancements, in source code form without contemporaneously requiring\r
-end users of The EU EGEE Proejct to enter into a separate written license\r
-agreement for such Enhancements, then you hereby grant The EU EGEE Project\r
-a non-exclusive, royalty-free perpetual license to install, use, copy,\r
-modify, prepare derivative works, incorporate into the EGEE Middleware\r
-or any other computer software, distribute, and sublicense your\r
-Enhancements or derivative works thereof, in binary and source code\r
-form (if any), whether developed by The EU EGEE Project or third parties.\r
-\r
-THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED\r
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r
-DISCLAIMED. IN NO EVENT SHALL PROJECT OR ITS CONTRIBUTORS BE LIABLE\r
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\r
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\r
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\r
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\r
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-\r
-This software consists of voluntary contributions made by many\r
-individuals on behalf of the EU EGEE Prject. For more information on The\r
-EU EGEE Project, please see http://cern.ch/eu-egee/. For more information on\r
-EGEE Middleware, please see http://egee-jra1.web.cern.ch/egee-jra1/\r
-\r
-\r
+++ /dev/null
-# defaults
-top_srcdir=..
-builddir=build
-top_builddir=${top_srcdir}/${builddir}
-stagedir=.
-globalprefix=glite
-package=gsoap-plugin
-version=1.0.0
-PREFIX=/opt/glite
-prefix=
-
-glite_location=/opt/glite
-gsoap_prefix=/opt/gsoap
-gsoapxx_prefix?=${gsoap_prefix}
-
-CC=gcc
-
-gsoap_versions_flavours?=${gsoap_default_version}
-
--include Makefile.inc
--include ../Makefile.inc
-
-top_srcdir2?=${top_srcdir}
-include ${top_srcdir2}/project/version.properties
-
-version=${module.version}
-gsoap_versions_flavours:=${shell if ! echo ${gsoap_versions_flavours} | grep '\<${gsoap_default_version}\>' >/dev/null; then echo "${gsoap_default_version} "; else echo ''; fi} ${gsoap_versions_flavours}
-top_srcdir_l2:=$(shell if echo ${top_srcdir} | grep '^/' >/dev/null; then echo "${top_srcdir}"; else echo "../${top_srcdir}"; fi)
-
-GSPLUGIN_DEBUG?=no
-GSPLUGIN_VERSION_CHECKING?=yes
-CC=gcc
-
-# In order to use libtool versioning correcty, we must have:
-#
-# current = major + minor + offset
-# revision = patch
-# age = minor
-#
-# where offset is a sum of maximal released minor's of all previous major's
-#
-
-# counted minors: 1.5, 2.1
-offset=6
-version_info:=-version-info ${shell \
- perl -e '$$,=":"; @F=split "\\.","${version}"; print $$F[0]+$$F[1]+${offset},$$F[2],$$F[1]' }
-
-ext_repository:=${shell if [ -d "${repository}/externals" ]; then \
- echo "${repository}/externals"; \
- else echo "${repository}"; \
- fi}
-
-gsoap_version=${gsoap_default_version}
-gsoap_prefix?=${ext_repository}/${gsoap_name}/${gsoap_version}/${gsoap_platform}
-gsoapxx_prefix?=${gsoap_prefix}
-ifdef lang
-langflavour:=_${lang}
-langsuffix:=.${lang}
-endif
-
-VPATH=${top_srcdir2}/src:${top_srcdir2}/test:${top_srcdir2}/examples:${top_srcdir2}/interface:${top_srcdir2}/project
-
-default: all
-
-DEBUG:=-g -O0 -W -Wall -Wno-unused-parameter
-# not for globus and gsoap: -Werror
-ifeq ($(GSPLUGIN_DEBUG),yes)
- DEBUG:=${DEBUG} -DGSPLUGIN_DEBUG=1
-endif
-# gsoap logs: -DDEBUG
-ifeq ($(GSOAP_DEBUG),yes)
- DEBUG:=${DEBUG} -DDEBUG=1
-endif
-
-#ifeq ($(GSPLUGIN_VERSION_CHECKING),yes)
-# DEBUG:=${DEBUG} -DCHECK_GSOAP_VERSION
-#endif
-
-gsoaplibdir=$(shell if test -d "${gsoap_prefix}/${libdir}"; then echo "${gsoap_prefix}/${libdir}"; else echo "${gsoap_prefix}/lib"; fi)
-gsoapxxlibdir=$(shell if test -d "${gsoapxx_prefix}/${libdir}"; then echo "${gsoapxx_prefix}/${libdir}"; else echo "${gsoapxx_prefix}/lib"; fi)
-GSOAP_CFLAGS?=-I${gsoap_prefix}/include
-GSOAP_LIBS?=-L${gsoaplibdir} -lgsoap
-GSOAPXX_CFLAGS?=-I${gsoapxx_prefix}/include
-GSOAPXX_LIBS?=-L${gsoapxxlibdir} -lgsoap++
-GSOAP_LIBS_lang:=${GSOAP_LIBS}
-ifeq (${lang},c)
-GSOAP_CFLAGS_lang:=${GSOAP_CFLAGS}
-GSOAP_LIBS_lang:=${GSOAP_LIBS}
-endif
-ifeq (${lang},cxx)
-GSOAP_CFLAGS_lang:=${GSOAPXX_CFLAGS}
-GSOAP_LIBS_lang:=${GSOAPXX_LIBS}
-endif
-
-
-CFLAGS:= ${DEBUG} \
- -DVERSION=\"${version}\" \
- -DWITH_NONAMESPACES \
- -I. -I${top_srcdir2}/interface \
- -I${stagedir}${prefix}/include \
- ${COVERAGE_FLAGS} -D_GNU_SOURCE -DDATAGRID_EXTENSION ${CFLAGS}
-
-LDFLAGS:=${LDFLAGS} ${COVERAGE_FLAGS}
-
-COMPILE:=libtool --mode=compile ${CC} ${CFLAGS}
-COMPILEXX:=libtool --mode=compile ${CXX} ${CFLAGS}
-LINK:=libtool --mode=link ${CC} -rpath ${stagedir}${prefix}/${libdir} ${LDFLAGS}
-LINKXX:=libtool --mode=link ${CXX} -rpath ${stagedir}${prefix}/${libdir} ${LDFLAGS}
-INSTALL:=libtool --mode=install install
-LINK_lang:=PATH=${top_srcdir2}/project/libtoolhack:${PATH} libtool --mode=link ${CXX} -rpath ${stagedir}${prefix}/${libdir} ${LDFLAGS}
-ifeq (${lang},c)
-LINK_lang:=${LINK}
-endif
-ifeq (${lang},cxx)
-LINK_lang:=${LINKXX}
-endif
-
-EX_NOTHRLIBS:=-L${stagedir}${prefix}/${libdir} -lglite_security_gss_${nothrflavour}
-EX_THRLIBS:=-L${stagedir}${prefix}/${libdir} -lglite_security_gss_${thrflavour}
-EX_LIBS:=-L${stagedir}${prefix}/${libdir} -lglite_security_gss
-HDRS:=glite_gsplugin.h glite_gsplugin-int.h
-EXAMPLES:=wscalc_clt_ex wscalc_srv_ex wscalc_srv_ex2
-TESTS:=test_cxx
-
-NOTHRSTATICLIB:=libglite_security_gsoap_plugin_${nothrflavour}${langflavour}.a
-THRSTATICLIB:=libglite_security_gsoap_plugin_${thrflavour}${langflavour}.a
-STATICLIB:=libglite_security_gsoap_plugin${langflavour}.a
-NOTHRLTLIB:=libglite_security_gsoap_plugin_${nothrflavour}${langflavour}.la
-THRLTLIB:=libglite_security_gsoap_plugin_${thrflavour}${langflavour}.la
-LTLIB:=libglite_security_gsoap_plugin${langflavour}.la
-
-OBJS:=${GSS_OBJS} glite_gsplugin${langsuffix}.o
-LOBJS:=${OBJS:.o=.lo}
-THROBJS:=${OBJS:.o=.thr.o}
-THRLOBJS:=${OBJS:.o=.thr.lo}
-
-dotless_ver:=${shell echo ${gsoap_version} | tr -d '.'}
-NOTHRSTATICLIB_S:=libglite_security_gsoap_plugin_${dotless_ver}_${nothrflavour}${langflavour}.a
-THRSTATICLIB_S:=libglite_security_gsoap_plugin_${dotless_ver}_${thrflavour}${langflavour}.a
-STATICLIB_S:=libglite_security_gsoap_plugin_${dotless_ver}${langflavour}.a
-NOTHRLTLIB_S:=libglite_security_gsoap_plugin_${dotless_ver}_${nothrflavour}${langflavour}.la
-THRLTLIB_S:=libglite_security_gsoap_plugin_${dotless_ver}_${thrflavour}${langflavour}.la
-LTLIB_S:=libglite_security_gsoap_plugin_${dotless_ver}${langflavour}.la
-
-ifeq (${thrflavour},)
-lib_LTLIBRARIES:=${STATICLIB} ${LTLIB}
-lib_LTLIBRARIES_S:=${LTLIB_S}
-LTLIB_TEST_S:=libglite_security_gsoap_plugin_${dotless_ver}_cxx.la
-default_ltlib_s:=${LTLIB_S}
-else
-lib_LTLIBRARIES:=${NOTHRSTATICLIB} ${NOTHRLTLIB} ${THRSTATICLIB} ${THRLTLIB}
-lib_LTLIBRARIES_S:=${NOTHRLTLIB_S} ${THRLTLIB_S}
-LTLIB_TEST_S:=libglite_security_gsoap_plugin_${dotless_ver}_${nothrflavour}_cxx.la
-default_ltlib_s:=${NOTHRLTLIB_S}
-endif
-
-ifeq (${gsoap_version},${gsoap_default_version})
-OBJS_S:=glite_gsplugin${langsuffix}.o
-GSOAP_DEFAULT_LIBS:=${GSOAP_LIBS_lang}
-GSOAP_DEFAULT_CFLAGS:=${GSOAP_CFLAGS}
-GSOAPXX_DEFAULT_CFLAGS:=${GSOAPXX_CFLAGS}
-else
-OBJS_S:=glite_gsplugin${langsuffix}.o stdsoap2${langsuffix}.o
-GSOAP_DEFAULT_LIBS:=
-GSOAP_DEFAULT_CFLAGS:=-DWITH_IPV6
-GSOAPXX_DEFAULT_CFLAGS:=-DWITH_IPV6
-endif
-LOBJS_S:=${OBJS_S:.o=.lo}
-THROBJS_S:=${OBJS_S:.o=.thr.o}
-THRLOBJS_S:=${OBJS_S:.o=.thr.lo}
-
-PKG_CONFIG_FILES=gsoap-plugin.pc gsoap-plugin++.pc
-
-ifeq (${thrflavour},)
-${STATICLIB}: ${OBJS}
- ar crv $@ ${OBJS}
- ranlib $@
-
-${LTLIB}: ${OBJS}
- ${LINK_lang} ${version_info} -o $@ ${LOBJS} ${EX_LIBS}
-
-${STATICLIB_S}: ${OBJS_S}
- ar crv $@ ${OBJS_S}
- ranlib $@
-
-${LTLIB_S}: ${OBJS_S}
- ${LINK_lang} ${version_info} -o $@ ${LOBJS_S} ${EX_LIBS} ${GSOAP_DEFAULT_LIBS}
-else
-${NOTHRSTATICLIB}: ${OBJS}
- ar crv $@ ${OBJS}
- ranlib $@
-
-${THRSTATICLIB}: ${THROBJS}
- ar crv $@ ${THROBJS}
- ranlib $@
-
-${NOTHRLTLIB}: ${OBJS}
- ${LINK_lang} ${version_info} -o $@ ${LOBJS} ${EX_NOTHRLIBS}
-
-${THRLTLIB}: ${THROBJS}
- ${LINK_lang} ${version_info} -o $@ ${THRLOBJS} ${EX_THRLIBS}
-
-${NOTHRSTATICLIB_S}: ${OBJS_S}
- ar crv $@ ${OBJS_S}
- ranlib $@
-
-${THRSTATICLIB_S}: ${THROBJS_S}
- ar crv $@ ${THROBJS_S}
- ranlib $@
-
-${NOTHRLTLIB_S}: ${OBJS_S}
- ${LINK_lang} ${version_info} -o $@ ${LOBJS_S} ${EX_NOTHRLIBS} ${GSOAP_DEFAULT_LIBS}
-
-${THRLTLIB_S}: ${THROBJS_S}
- ${LINK_lang} ${version_info} -o $@ ${THRLOBJS_S} ${EX_THRLIBS} ${GSOAP_DEFAULT_LIBS}
-endif
-
-all compile: \
- ${lib_LTLIBRARIES} \
- all-libs-with-soap examples glite_gscompat.h pkgconfig
-
-check: check.cxx
-
-# C/C++ compatibility test
-# (C flavour, gsoap 2.7.10 ==> C++ test fails)
-check.cxx:
- ${MAKE} lang=cxx -f ${top_srcdir2}/Makefile ${LTLIB_TEST_S} test_cxx
- LD_LIBRARY_PATH=${cares_prefix}/${libdir}:${LD_LIBRARY_PATH} ./test_cxx
-
-examples: ${EXAMPLES}
-
-all-libs-with-soap:
- for v in ${gsoap_versions_noflavours}; do \
- dir=`echo $$v | tr -d .`; \
- mkdir $$dir; \
- ${MAKE} -C $$dir -f ${top_srcdir_l2}/Makefile gsoap_version=$$v top_srcdir2=${top_srcdir_l2} lang= libs-with-soap || exit $?; \
- done
- for v in ${gsoap_versions_flavours}; do \
- dir=`echo $$v | tr -d .`; \
- mkdir $$dir; \
- ${MAKE} -C $$dir -f ${top_srcdir_l2}/Makefile gsoap_version=$$v top_srcdir2=${top_srcdir_l2} lang=c libs-with-soap || exit $?; \
- ${MAKE} -C $$dir -f ${top_srcdir_l2}/Makefile gsoap_version=$$v top_srcdir2=${top_srcdir_l2} lang=cxx libs-with-soap || exit $?; \
- done
-
-libs-with-soap: ${lib_LTLIBRARIES_S}
-
-gsoap_srcname=gsoap-`echo ${gsoap_version} | cut -d. -f1,2`
-
-link-gsoap:
- if [ ${gsoap_version} = ${gsoap_default_version} ]; then \
- ln -sf ${gsoap_prefix}/include/stdsoap2.h stdsoap2.h; \
- elif [ -f ${top_srcdir2}/src/stdsoap2_${gsoap_version}.c ]; then \
- ln -sf ${top_srcdir2}/src/stdsoap2_${gsoap_version}.c stdsoap2.c; \
- ln -sf ${top_srcdir2}/src/stdsoap2_${gsoap_version}.h stdsoap2.h; \
- elif [ -f ${ext_repository}/${gsoap_name}/${gsoap_version}/src/stdsoap2.c ]; then \
- ln -sf ${ext_repository}/${gsoap_name}/${gsoap_version}/src/stdsoap2.[ch] .; \
- elif [ -f ${ext_repository}/${gsoap_name}/${gsoap_version}/${gsoap_platform}/stdsoap2.c ]; then \
- ln -sf ${ext_repository}/${gsoap_name}/${gsoap_version}/${gsoap_platform}/stdsoap2.[ch] .; \
- elif [ -f ${ext_repository}/${gsoap_name}/${gsoap_version}/${gsoap_platform}/src/stdsoap2.c ]; then \
- ln -sf ${ext_repository}/${gsoap_name}/${gsoap_version}/${gsoap_platform}/src/stdsoap2.c .; \
- ln -sf ${ext_repository}/${gsoap_name}/${gsoap_version}/${gsoap_platform}/include/stdsoap2.h .; \
- elif [ -f ${ext_repository}/${gsoap_name}/${gsoap_version}/src/stdsoap2.c ]; then \
- ln -sf ${ext_repository}/${gsoap_name}/${gsoap_version}/src/stdsoap2.[ch] .; \
- elif [ -f ${ext_repository}/${gsoap_name}/${gsoap_version}/src/${gsoap_srcname}/soapcpp2/stdsoap2.c ]; then \
- ln -sf ${ext_repository}/${gsoap_name}/${gsoap_version}/src/${gsoap_srcname}/soapcpp2/stdsoap2.[ch] .; \
- else false ; \
- fi
-
-stdsoap2.c stdsoap2.h: link-gsoap
-
-GSOAP_FPREFIX:= GSOAP_
-
-WSCALC_CLT_OBJS = wscalc_clt_ex.o ${GSOAP_FPREFIX}C.o ${GSOAP_FPREFIX}Client.o
-WSCALC_SRV_OBJS = wscalc_srv_ex.o ${GSOAP_FPREFIX}C.o ${GSOAP_FPREFIX}Server.o
-WSCALC_SRV2_OBJS = wscalc_srv_ex2.o ${GSOAP_FPREFIX}C.o ${GSOAP_FPREFIX}Server.o
-
-wscalc_clt_ex.o wscalc_srv_ex.o wscalc_srv_ex2.o: ${GSOAP_FPREFIX}H.h
-
-wscalc_clt_ex: ${WSCALC_CLT_OBJS} ${default_ltlib_s}
- ${LINK_lang} -o $@ ${WSCALC_CLT_OBJS} ${default_ltlib_s} ${GSOAP_DEFAULT_LIBS}
-
-wscalc_srv_ex: ${WSCALC_SRV_OBJS} ${default_ltlib_s}
- ${LINK_lang} -o $@ ${WSCALC_SRV_OBJS} ${default_ltlib_s} ${GSOAP_DEFAULT_LIBS}
-
-wscalc_srv_ex2: ${WSCALC_SRV2_OBJS} ${default_ltlib_s}
- ${LINK_lang} -o $@ ${WSCALC_SRV2_OBJS} ${default_ltlib_s} ${GSOAP_DEFAULT_LIBS}
-
-test_cxx: test_gsplugin_cxx.o ${GSOAP_FPREFIX}C.cxx.o
- ${LINKXX} -o $@ $+ ${LTLIB_TEST_S}
-
-soapcpp:=${shell if [ -x ${gsoap_prefix}/bin/soapcpp2 ]; then \
- echo ${gsoap_prefix}/bin/soapcpp2; \
- else echo ${gsoap_prefix}/soapcpp2; \
- fi}
-
-${GSOAP_FPREFIX}H.h ${GSOAP_FPREFIX}C.c ${GSOAP_FPREFIX}Server.c ${GSOAP_FPREFIX}Client.c ${GSOAP_FPREFIX}ServerLib.c ${GSOAP_FPREFIX}ClientLib.c: calc.h.S
- ${soapcpp} -c -p ${GSOAP_FPREFIX} ${top_srcdir2}/examples/calc.h.S
-
-wscalc_clt_ex.o: wscalc_clt_ex.c
- ${CC} -c ${CFLAGS} -o $@ $<
-
-sizeof_soap.o: sizeof_soap.c stdsoap2.h
- ${COMPILE} ${GSOAP_DEFAULT_CFLAGS} -c $< -o $@
-
-sizeof_soap: sizeof_soap.o
- ${LINK} $< -o $@
-
-glite_gscompat.h: glite_gscompat.h.in sizeof_soap
- size=${shell ./sizeof_soap}; \
- sed "s/@sizeof_struct_soap@/$$size/" ${top_srcdir2}/interface/glite_gscompat.h.in > $@
-
-pkgconfig: ${PKG_CONFIG_FILES}
-
-doc:
-
-stage:
- $(MAKE) install PREFIX=${stagedir} DOSTAGE=yes
-
-install:
- -mkdir -p ${DESTDIR}${PREFIX}${prefix}/${libdir}/pkgconfig
- -mkdir -p ${DESTDIR}${PREFIX}${prefix}/include/glite/security
- -mkdir -p ${DESTDIR}${PREFIX}${prefix}/share/doc/${package}-${version}
- -mkdir -p ${DESTDIR}${PREFIX}${prefix}/include/glite/security/
- ${INSTALL} -m 644 ${top_srcdir2}/LICENSE ${DESTDIR}${PREFIX}${prefix}/share/doc/${package}-${version}
- cd ${top_srcdir2}/interface && ${INSTALL} -m 644 ${HDRS} ${DESTDIR}${PREFIX}${prefix}/include/glite/security/
- ${INSTALL} -m 644 glite_gscompat.h ${DESTDIR}${PREFIX}${prefix}/include/glite/security/
- for v in ${gsoap_versions_noflavours}; do \
- ${MAKE} -C `echo $$v | tr -d .` -f ${top_srcdir_l2}/Makefile install-soaplib gsoap_version=$$v lang= PREFIX=${PREFIX} top_srcdir2=${top_srcdir_l2} || exit $?; \
- done
- for v in ${gsoap_versions_flavours}; do \
- ${MAKE} -C `echo $$v | tr -d .` -f ${top_srcdir_l2}/Makefile install-soaplib gsoap_version=$$v lang=c PREFIX=${PREFIX} top_srcdir2=${top_srcdir_l2} || exit $?; \
- ${MAKE} -C `echo $$v | tr -d .` -f ${top_srcdir_l2}/Makefile install-soaplib gsoap_version=$$v lang=cxx PREFIX=${PREFIX} top_srcdir2=${top_srcdir_l2} || exit $?; \
- done
- for p in gsoap-plugin.pc gsoap-plugin++.pc; do \
- ${INSTALL} -m 644 $$p ${DESTDIR}${PREFIX}${prefix}/${libdir}/pkgconfig/glite-security-$$p; \
- done
-
-install-soaplib:
- ${INSTALL} -m 755 ${lib_LTLIBRARIES_S} ${DESTDIR}${PREFIX}${prefix}/${libdir}
-
-clean:
- rm -rvf ${lib_LTLIBRARIES}
- rm -rvf ${lib_LTLIBRARIES_S}
- rm -rvf ${LTLIB_TEST_S}
- rm -rvf *.c *.h *.xml *.nsmap *.o *.lo .libs ${EXAMPLES} ${TESTS}
- rm -rvf CalcService.wsdl wscalc.xsd
- rm -rvf glite_gscompat.h sizeof_soap
- for v in ${gsoap_versions_noflavours} ${gsoap_versions_flavours}; do \
- rm -rvf `echo $$v | tr -d .`; \
- done
- rm -fv ${PKG_CONFIG_FILES}
-
-distclean:
- rm -rvf Makefile.inc *.spec debian/
-
-%.c.o: %.c
- ${COMPILE} ${GSOAP_DEFAULT_CFLAGS} -o $@ -c $<
-
-%.cxx.o: %.c
- ${COMPILEXX} ${GSOAPXX_DEFAULT_CFLAGS} -o $@ -c $<
-
-%.o: %.c
- ${COMPILE} ${GSOAP_DEFAULT_CFLAGS} -o $@ -c $<
-
-%.c.thr.o: %.c
- ${COMPILE} ${GSOAP_DEFAULT_CFLAGS} -o $@ -c $<
-
-%.cxx.thr.o: %.c
- ${COMPILEXX} ${GSOAPXX_DEFAULT_CFLAGS} -o $@ -c $<
-
-%.thr.o: %.c
- ${COMPILE} ${GSOAP_DEFAULT_CFLAGS} -o $@ -c $<
-
-%.pc: %.pc.in
- sed -e "s/@VERSION@/${version}/" -e "s/@LIBDIR@/${libdir}/" -e "s/@LIB_SUFFIX@/${dotless_ver}/" $< > $@; \
-
-test_gsplugin_cxx.o: %.o: %.cpp stdsoap2.h
- ${COMPILEXX} ${GSOAPXX_DEFAULT_CFLAGS} -c ${GLOBUS_INC} $<
-
-glite_gsplugin${langsuffix}.o glite_gsplugin${langsuffix}.thr.o: soap_version.h
-
-soap_version.h: stdsoap2.h
- head stdsoap2.h | \
- perl -ne '/^\s*stdsoap2.h\s+([0-9])\.([0-9])\.(\S+)\s.*/ && printf "#define GSOAP_VERSION %d%02d%02d\n#define GSOAP_MIN_VERSION \"$$3\"\n#ident \"soap_version.h $$1.$$2.$$3\"\n",$$1,$$2,$$3' >$@
+++ /dev/null
-#!/usr/bin/perl
-
-# WARNING: Don't edit this file unless it is the master copy in org.glite.lb
-#
-# For the purpose of standalone builds of lb/jobid/lbjp-common components
-# it is copied on tagging
-
-# $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.
-#
-
-use Getopt::Long;
-use POSIX qw(locale_h strftime);
-
-my $pwd = `pwd`; chomp $pwd;
-my $prefix = '/usr';
-my $stagedir = undef;
-my $root = $pwd.'/stage';
-my $sysroot = '';
-my $sysconfdir;
-my $localstatedir;
-my $staged;
-my $module;
-my $thrflavour = 'gcc64dbgpthr';
-my $nothrflavour = 'gcc64dbg';
-my $mode = 'build';
-my $help = 0;
-my $listmodules;
-my ($version, $force_version);
-my $branch;
-my $output;
-my $lb_tag = '';
-my $lbjp_tag = '';
-my $jp_tag = '';
-my $jobid_tag = '';
-my $libdir = getlibdir();
-my $project = 'emi';
-my $project_version;
-my (%projects, %project);
-my $debug = 0;
-my $pkg_config_env = (defined $ENV{PKG_CONFIG_PATH}) ? "$ENV{PKG_CONFIG_PATH}:" : '';
-
-my @nodes = qw/client server logger logger-msg nagios utils client-java doc ws-test db jpprimary jpindex jpclient harvester lb px proxyrenewal/;
-my @default_nodes = qw/lb px proxyrenewal nagios/;
-my %enable_nodes;
-my %disable_nodes;
-my %default_nodes; @default_nodes{@default_nodes} = (1) x ($#default_nodes + 1);
-
-my %package = (
- 'maintainer' => 'CESNET Product Teams <emi-lb@metacentrum.cz>',
- 'uploaders' => 'František Dvořák <valtri@civ.zcu.cz>',
- 'url' => 'http://glite.cern.ch',
- 'debian_vcs' => 'Vcs-Cvs: :pserver:anonymous@jra1mw.cvs.cern.ch:/cvs/jra1mw
-Vcs-Browser: http://jra1mw.cvs.cern.ch/cgi-bin/jra1mw.cgi',
-);
-
-# key: internal package name (arguments, ...)
-# 'pkg': pkg-config name
-# 'prefix': used when pkg-config fails
-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-devel' => {
- prefix=> '/opt/globus',
- pkg => 'myproxy'
- },
- 'myproxy-server' => {
- prefix=> '',
- },
- 'myproxy-admin' => {
- prefix=> '',
- },
- gsoap => {
- prefix=> '/usr',
- pkg => 'gsoap'
- },
- gsoapxx => {
- prefix=> '/usr',
- pkg => 'gsoap++'
- },
- mysql => {
- prefix=> '/usr'
- },
- 'mysql-devel' => {
- prefix=> ''
- },
- 'mysql-server' => {
- prefix => ''
- },
- voms => {
- prefix => '/opt/glite',
- pkg => 'voms-2.0'
- },
- gridsite => {
- prefix => '/opt/glite'
- },
- lcas => {
- prefix => '/opt/glite',
- pkg => 'lcas'
- },
- trustmanager => {
- prefix => '/opt/glite'
- },
- trustmanager_axis => {
- prefix => '/opt/glite'
- },
- utiljava => {
- prefix=> '/opt/glite'
- },
- ant => {
- prefix=> '/usr'
- },
- jdk => {
- prefix=> '/usr/java/latest',
- locations => [ '/usr/lib/jvm/java', '/usr/lib/jvm/default-java', '/usr/java/latest' ],
- },
- libtar => {
- prefix=> '/usr'
- },
- axis => {
- prefix=> '/usr'
- },
- log4c => {
- prefix=> '/usr'
- },
- postgresql => {
- prefix=> '/usr'
- },
- activemq => {
- prefix=>'/opt/activemq-cpp-library',
- pkg => 'activemq-cpp'
- },
-);
-
-my %jar = (
- 'jakarta-commons-codec' => '/usr/share/java/commons-codec.jar',
- 'jakarta-commons-lang' => '/usr/share/java/commons-lang.jar',
-);
-
-
-my %glite_prefix;
-my %need_externs;
-my %need_externs_type;
-my %need_jars;
-my %extrafull;
-my %extranodmod;
-my %deps;
-my %deps_type;
-my %buildroot;
-my (%etics_externs, %etics_projects);
-
-#
-# modules of the subsystems
-#
-# additional modules from $project{modules} are automatically added
-#
-my %lbmodules = (
- 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim logger-msg nagios client-devel client-progs common-devel logger-devel state-machine-devel/],
- 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin db-devel log-devel maildir-devel server-bones-devel trio-devel jp-interface-devel gss-devel gsoap-plugin-devel/],
- 'jobid' => [qw/api-c api-c-devel api-cpp api-cpp-devel api-java/],
- 'jp' => [ qw/client doc index primary server-common ws-interface/ ],
- 'gridsite' => [ qw/apache libs commands core devel slashgrid services service-clients gsexec/ ],
- 'px' => [ qw/proxyrenewal myproxy-yaim proxyrenewal-devel proxyrenewal-progs/ ],
- 'canl' => [ qw/c c-devel/ ],
- );
-
-#
-# sub-packages
-#
-# modify %lbmodules, %deps_aux, %extrafull, and %properties accodingly
-#
-my %subpackages = (
- 'jobid.api-c-devel' => 'jobid.api-c',
- 'jobid.api-cpp-devel' => 'jobid.api-cpp',
- 'lbjp-common.db-devel' => 'lbjp-common.db',
- 'lbjp-common.gsoap-plugin-devel' => 'lbjp-common.gsoap-plugin',
- 'lbjp-common.gss-devel' => 'lbjp-common.gss',
- 'lbjp-common.jp-interface-devel' => 'lbjp-common.jp-interface',
- 'lbjp-common.log-devel' => 'lbjp-common.log',
- 'lbjp-common.maildir-devel' => 'lbjp-common.maildir',
- 'lbjp-common.server-bones-devel' => 'lbjp-common.server-bones',
- 'lbjp-common.trio-devel' => 'lbjp-common.trio',
- 'lb.client-progs' => 'lb.client',
- 'lb.client-devel' => 'lb.client',
- 'lb.common-devel' => 'lb.common',
- 'lb.logger-devel' => 'lb.logger',
- 'lb.state-machine-devel' => 'lb.state-machine',
- 'px.proxyrenewal-devel' => 'px.proxyrenewal',
- 'px.proxyrenewal-progs' => 'px.proxyrenewal',
- 'canl.c-devel' => 'canl.c',
-);
-
-my @opts = (
- 'prefix:s' => \$prefix,
- 'staged=s' => \$staged,
- 'module=s' => \$module,
- 'thrflavour:s' => \$thrflavour,
- 'nothrflavour:s' => \$nothrflavour,
- 'mode=s' => \$mode,
- 'listmodules=s' => \$listmodules,
- 'version=s' => \$force_version,
- 'branch=s' => \$branch,
- 'output=s' => \$output,
- 'stage=s' => \$stagedir,
- 'root:s' => \$root,
- 'sysroot:s' => \$sysroot,
- 'sysconfdir=s' => \$sysconfdir,
- 'localstatedir=s' => \$localstatedir,
- 'lb-tag=s' => \$lb_tag,
- 'lbjp-common-tag=s' => \$lbjp_tag,
- 'jp-tag=s' => \$jp_tag,
- 'jobid-tag=s' => \$jobid_tag,
- 'canl-tag=s' => \$canl_tag,
- 'help' => \$help,
- 'libdir=s' => \$libdir,
- 'project=s' => \$project,
- 'debug' => \$debug,
-);
-
-for (@nodes) {
- $enable_nodes{$_} = 0;
- $disable_nodes{$_} = 0;
-
- push @opts,"disable-$_",\$disable_nodes{$_};
- push @opts,"enable-$_",\$enable_nodes{$_};
-}
-
-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";
-$prefix=~s/\/$//;
-$root=~s/\/$//;
-$sysroot=~s/\/$//;
-if (not $sysconfdir) { $sysconfdir = $prefix eq '/usr' ? '/etc' : "$prefix/etc"; }
-if (not $localstatedir) { $localstatedir = $prefix eq '/usr' ? '/var' : "$prefix/var"; }
-$sysconfdir=~s/\/$//;
-$localstatedir=~s/\/$//;
-
-$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq '';
-$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq '';
-$externs{'gsoapxx'}{prefix}=$externs{gsoap}{prefix} if $externs{'gsoapxx'}{prefix} eq '';
-
-$externs{'mysql-server'}{withprefix}=$externs{mysql}{withprefix} if $externs{'mysql-server'}{withprefix} eq '';
-$externs{'mysql-devel'}{wihtprefix}=$externs{mysql}{withprefix} if $externs{'mysql-devel'}{withprefix} eq '';
-$externs{'gsoapxx'}{withprefix}=$externs{gsoap}{withprefix} if $externs{'gsoapxx'}{withprefix} eq '';
-
-if ($project =~ /^([^0-9]*)(.*)$/) {
- $project = $1;
- $project_version = $2;
-}
-%project = %{$projects{$project}};
-$project_version = $project{current_version} unless $project_version;
-for my $platform (keys %{$project{etics_externs}}) {
- for $_ (keys %{$project{etics_externs}{$platform}}) {
- $etics_externs{$platform}{$_} = $project{etics_externs}{$platform}{$_};
- }
-}
-reshuffle_platforms(\%etics_externs, $project{supported_platforms});
-reshuffle_platforms(\%{$project{etics_externs_devel}}, $project{supported_platforms});
-for $_ (keys %{$project{etics_projects}}) {
- $etics_projects{$_} = $project{etics_projects}{$_};
-}
-for $_ (keys %{$project{need_externs_aux}}) {
- $need_externs_aux{$_} = $project{need_externs_aux}{$_};
-}
-for my $ext (keys %need_externs_aux) {
- for (@{$need_externs_aux{$ext}}) {
- my ($pkg, $type) =/([^:]*)(?::(.*))?/;
- $type = 'BR' unless ($type);
-
- push @{$need_externs{$ext}},$pkg;
- $need_externs_type{$ext}->{$pkg} = $type;
- }
-}
-if ($project eq 'emi') {
- $extranodmod{lb} = 'lb.emi-lb';
- $extranodmod{px} = 'px.emi-px';
-}
-for $_ (keys %{$project{modules}}) {
- push @{$lbmodules{$_}},@{$project{modules}{$_}};
-}
-
-
-if ($help) { usage(); exit 0; }
-
-if ($listmodules) {
- my $name_prefix = ($listmodules eq 'gridsite' and $project eq 'glite') ? 'org' : $project{etics_name};
- my @m;
-
- if (exists $lbmodules{$listmodules}) {
- @m = map exists $subpackages{$listmodules . '.' . $_} ? "" : "$name_prefix.$listmodules.$_",@{$lbmodules{$listmodules}};
- } else {
- if ($project eq 'emi' and $project_version == 1) {
- # no sub-packages in EMI-1
- } else {
- for my $sub (keys %subpackages) {
- push @m, $sub if ($subpackages{$sub} eq $listmodules);
- }
- }
- }
- print map $_ eq "" ? "" : "$_ ", @m;
- print "\n";
- exit 0;
-}
-
-warn "$0: --branch and --output make sense only in --mode=etics\n"
- if ($output || $branch) && $mode ne 'etics';
-
-my $en;
-for (keys %enable_nodes) { $en = 1 if $enable_nodes{$_}; }
-
-my $dis;
-for (keys %disable_nodes) { $dis = 1 if $disable_nodes{$_}; }
-
-die "--enable-* and --disable-* are mutually exclusive\n"
- if $en && $dis;
-
-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{jp}};
-
-if ($dis) {
- for (@nodes) {
- $enable_nodes{$_} = 1 unless ($disable_nodes{$_} or not $default_nodes{$_});
- }
-}
-
-if (!$en && !$dis) { for (@nodes) { $enable_nodes{$_} = 1 if ($default_nodes{$_}) } };
-
-for (keys %enable_nodes) { delete $enable_nodes{$_} unless $enable_nodes{$_}; }
-
-$stagedir = $root unless $stagedir;
-$stagedir=~s/\/$// if ($stagedir);
-
-if ($mode eq 'build') { for my $ext (keys %externs) {
- if (defined $externs{$ext} and defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; }
- elsif (defined $externs{$ext}{pkg}) {
- my ($flag, $env, $cmd, $ret);
- my $pkg = $externs{$ext}{pkg};
- my $flagname = uc $externs{$ext}{pkg};
- $flagname =~ s/-[0-9\.]*$//;
- $flagname =~ y/-\+/_X/;
-
- print "Checking $pkg ... ";
- $env = "PKG_CONFIG_PATH=$pkg_config_env$stagedir$prefix/$libdir/pkgconfig";
- $cmd = "$env pkg-config $pkg --exists >/dev/null";
- `$cmd`; $ret = $?;
- print "('$cmd' => $ret)\n" if ($debug);
- if ($ret == 0) {
- $externs{$ext}{prefix}=`$env pkg-config $pkg --variable=prefix`;
- chomp $externs{$ext}{prefix};
- print "$externs{$ext}{prefix}\n";
-
- $flag=`$env pkg-config $pkg --cflags`;
- $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag);
- $flag=`$env pkg-config $pkg --libs`;
- $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag);
- } else {
- print "(using default $externs{$ext}{prefix})\n";
- }
- print "\n" if ($debug);
- }
- elsif ($ext eq 'jdk') {
- my $jdk_prefix;
-
- print "Looking for some caffein ... ";
- if (defined $ENV{'JDK_HOME'}) {
- $jdk_prefix = $ENV{'JDK_HOME'};
- print "JDK_HOME=$jdk_prefix\n";
- } elsif (defined $ENV{'JAVA_HOME'}) {
- $jdk_prefix = $ENV{'JAVA_HOME'};
- print "JAVA_HOME=$jdk_prefix\n";
- } else {
- foreach my $i (0..$#{$externs{$ext}{locations}}) {
- if (-e $externs{$ext}{locations}[$i]) {
- $jdk_prefix=$externs{$ext}{locations}[$i];
- print "(found directory $jdk_prefix)\n";
- last;
- }
- }
- print "(using default $externs{$ext}{prefix})\n" unless ($jdk_prefix);
- }
- $externs{$ext}{prefix} = $jdk_prefix if ($jdk_prefix);
- }
-} }
-
-if ($mode eq 'build') {
- print "Writing config.status\n";
- open CONF,">config.status" or die "config.status: $!\n";
- for ('JDK_HOME', 'JAVA_HOME', 'PKG_CONFIG_PATH') {
- print CONF "$_=$ENV{$_} " if (defined $ENV{$_});
- }
- print CONF "$0 @keeparg\n";
- close CONF;
-}
-
-
-my @modules;
-my %aux;
-
-if ($module) {
-# push @modules,split(/[,.]+/,$module);
- push @modules,$module;
-}
-else {
- @modules = map(($extranodmod{$_} ? $extranodmod{$_} : 'lb.'.$_),(keys %enable_nodes));
-
- my $n;
-
- do {
- local $"="\n";
- $n = $#modules;
- push @modules,(map @{$deps{$_}},@modules);
-
- undef %aux; @aux{@modules} = (1) x ($#modules+1);
- @modules = keys %aux;
- } while ($#modules > $n);
-}
-
-@aux{@modules} = (1) x ($#modules+1);
-delete $aux{$_} for (split /,/,$staged);
-@modules = keys %aux;
-
-mode_build() if $mode eq 'build';
-mode_checkout() if $mode eq 'checkout';
-mode_etics($module) if $mode eq 'etics';
-
-sub mode_build {
- print "\nBuilding modules: @modules\n";
- print "Mode: "; print $module ? "single module" : "multiple modules"; print "\n";
-
- my @ext = map @{$need_externs{$_}},@modules;
- my @myjars = map @{$need_jars{$_}},@modules;
- undef %aux; @aux{@ext} = 1;
- @ext = keys %aux;
- undef %aux; @aux{@myjars} = (1) x ($#myjars+1);
- @myjars = keys %aux;
-
- print "\nRequired externals:\n";
- print "\t$_: ".($externs{$_}{prefix}?$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;
-
- if ($module) {
- print "Not creating summary Makefile\n" if $debug;
- } else {
- print "Creating Makefile\n";
-
- open MAK,">Makefile" or die "Makefile: $!\n";
-
- print MAK "all: @modules\n\n";
- print MAK "stage: ".(join '-stage ', @modules)."-stage\n\n";
- print MAK "clean check install:\n";
-
- for (@modules) {
- my $full = full($_);
- print MAK "\tcd $full/$buildroot{$_} && \${MAKE} \$@\n"
- }
-
- print MAK "\ndistclean:\n";
-
- for (@modules) {
- my $full = full($_);
- print MAK $buildroot{$_} eq '' ?
- "\tcd $full && \${MAKE} distclean\n" :
- "\trm -rf $full/$buildroot{$_}\n"
- }
-
- print MAK "\n";
-
- for (@modules) {
- my %ldeps; undef %ldeps;
- @ldeps{@{$deps{$_}}} = 1;
- for my $x (split /,/,$staged) { delete $ldeps{$x}; }
- my @dnames = $module ? () : keys %ldeps;
- my $snames = $#dnames == -1 ? '' : join('-stage ', @dnames).'-stage';
-
- my $full = full($_);
- my $build = $buildroot{$_};
-
- print MAK "$_: @dnames\n\tcd $full/$build && \${MAKE} && \${MAKE} install\n\n";
- print MAK "$_-stage: $snames\n\tcd $full/$build && \${MAKE} && \${MAKE} stage\n\n";
- }
-
- close MAK;
- }
-}
-
-sub mode_checkout() {
- for (@modules) {
- my $module = $_;
- my $tag = "";
- if ($lb_tag){
- for (@{$lbmodules{lb}}){
- if ("lb.".$_ eq $module){
- $tag = '-r '.$lb_tag;
- }
- }
- }
- if ($lbjp_tag) {
- for (@{$lbmodules{'lbjp-common'}}){
- if ("lbjp-common.".$_ eq $module){
- $tag = '-r '.$lbjp_tag;
- }
- }
- }
- if ($jp_tag){
- for (@{$lbmodules{'jp'}}){
- if ("jp.".$_ eq $module){
- $tag = '-r '.$jp_tag;
- }
- }
- }
- if ($jobid_tag){
- for (@{$lbmodules{jobid}}){
- if ("jobid.".$_ eq $module){
- $tag = '-r '.$jobid_tag;
- }
- }
- }
- if ($canl_tag) {
- for (@{$lbmodules{'canl'}}){
- if ("canl.".$_ eq $module){
- $tag = '-r '.$canl_tag;
- }
- }
- }
- #if (grep {"lb.".$_ eq $module} @{$lbmodules{lb}}){
- # print "found";
- #}
- $_ = full($_);
- print "\n*** Checking out $_\n";
- system("cvs checkout $tag $_") == 0 or die "cvs checkout $tag $_: $?\n";
- }
-}
-
-BEGIN{
-%etics_externs = (
- default => {
- 'myproxy-devel'=>'myproxy-devel',
- 'myproxy-server'=>'myproxy-server',
- 'myproxy-admin'=>'myproxy-admin',
- cares=>'c-ares',
- utiljava=>'org.glite.security.util-java',
- gpt=>'gpt',
- fetchcrl=>'fetch-crl',
- activemq=>'activemq-cpp-library',
- },
-);
-
-%etics_projects = (
-);
-
-%need_externs_aux = (
- 'lb.client' => [ qw/cppunit:B classads libtool:B globus:B/ ],
- 'lb.common' => [ qw/expat cares:B cppunit:B classads libtool:B globus:B/ ],
- 'lb.doc' => [ qw/tetex-latex:B/ ],
- 'lb.logger' => [ qw/cppunit:B libtool:B globus:B/ ],
- 'lb.logger-msg' => [ qw/cppunit:B activemq libtool:B globus:B/ ],
- 'lb.nagios' => [ qw/globus_proxy_utils:R/ ],
- 'lb.server' => [ qw/globus_essentials:R globus:B expat cares mysql-server:R cppunit:B gsoap:B classads voms:B lcas gridsite:B bison:B libtool:B libxml2 flex:B/ ],
- 'lb.state-machine' => [ qw/classads libtool:B libxslt:B expat:B globus:B/ ],
- 'lb.utils' => [ qw/cppunit:B libtool:B globus:B/ ],
- 'lb.ws-interface' => [ qw/libxslt:B tidy:B/ ],
- 'lb.ws-test' => [ qw/gsoap:B libtool:B globus:B/ ],
- 'lb.types' => [ qw// ],
- 'lb.harvester' => [ qw/docbook-utils:B libtool:B globus:B/ ],
- 'lbjp-common.db' => [ qw/mysql-devel:B postgresql:B cppunit:B log4c:B libtool:B/ ],
- 'lbjp-common.log' => [ qw/log4c libtool:B/ ],
- 'lbjp-common.maildir' => [ qw/libtool:B/ ],
- 'lbjp-common.server-bones' => [ qw/libtool:B/ ],
- 'lbjp-common.trio' => [ qw/cppunit:B libtool:B/ ],
- 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B libtool:B/ ],
- 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B libtool:B/ ],
- 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap gsoapxx libtool:B/ ],
- 'jobid.api-c' => [ qw/cppunit:B libtool:B openssl:B/ ],
- 'jobid.api-cpp' => [ qw/cppunit:B libtool:B/ ],
- 'jobid.api-java' => [ qw/ant:B jdk:B/ ],
- 'jp.client' => [ qw/gsoap libtar globus_essentials:R globus:B/ ],
- 'jp.doc' => [],
- 'jp.index' => [ qw/gsoap globus_essentials:R globus:B mysql-server:R/ ],
- 'jp.primary' => [ qw/classads gsoap libtar globus_essentials:R globus:B mysql-server:R/ ],
- 'jp.server-common' => [],
- 'jp.ws-interface' => [],
- 'gridsite.core' => [ qw/httpd-devel:B gsoap:B globus:B curl:B doxygen:B fuse-devel:B libxml2:B openssl:B doxygen:B/ ],
- 'gridsite.commands' => [ qw/curl:R openssl:R/ ],
- 'gridsite.apache' => [ qw/libxml2:R openssl:R curl:R/ ],
- 'gridsite.libs' => [ qw/libxml2:R openssl:R/ ],
- 'gridsite.devel' => [ qw// ],
- 'gridsite.slashgrid' => [ qw/curl:R fuse:R/],
- 'gridsite.services' => [ qw/curl:R gsoap:R/ ],
- 'gridsite.service-clients' => [ qw/curl:R gsoap:R gsoapxx:R/ ],
- 'gridsite.gsexec' => [ qw// ],
- 'gridsite.1.5-compat' => [ qw/httpd-devel:B gsoap:B globus:B curl:B doxygen:B fuse-devel:B libxml2:B openssl:B doxygen:B/ ],
- 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-devel:B voms:B libtool:B/ ],
- 'px.myproxy-config' => [ qw/myproxy-admin:R/ ], # in myproxy-config.spec
- 'canl.c' => [ qw/cares:B openssl:B libtool:B bison:B flex:B krb5-devel:B/ ],
-);
-
-%need_jars = (
- 'jobid.api-java' => [ qw/jakarta-commons-codec/ ],
- 'lb.client-java' => [ qw/jakarta-commons-lang/ ],
-);
-
-for my $jar (keys %need_jars) {
- for (@{$need_jars{$jar}}) {
- $need_externs_type{$jar}->{$_} = 'BR'; # XXX
- }
-}
-
-%deps_aux = (
- 'lb.client' => [ qw/
- lb.types:B lb.common
- lbjp-common.trio
- jobid.api-cpp:B jobid.api-c
- lbjp-common.gss
- / ],
- 'lb.client-java' => [ qw/
- lb.types:B
- lb.ws-interface:B
- jobid.api-java
- / ],
- 'lb.common' => [ qw/
- jobid.api-cpp:B jobid.api-c
- lb.types:B lbjp-common.trio lbjp-common.gss
- / ],
- 'lb.doc' => [ qw/lb.types:B/ ],
- 'lb.logger' => [ qw/
- lbjp-common.trio
- lbjp-common.log
- jobid.api-c
- lb.common
- lbjp-common.gss
- / ],
- 'lb.logger-msg' => [ qw/
- lb.logger:B
- / ],
- 'lb.nagios' => [ qw/
- lb.client:R
- lb.ws-test:R
- lb.utils:R
- / ],
- 'lb.server' => [ qw/
- lb.ws-interface lb.types:B lb.common lb.state-machine lb.utils:R
- lbjp-common.db lbjp-common.server-bones lbjp-common.trio lbjp-common.maildir lbjp-common.log
- jobid.api-c
- lbjp-common.gsoap-plugin lbjp-common.gss
- / ],
- 'lb.state-machine' => [ qw/lb.types:B lb.common lbjp-common.jp-interface lbjp-common.gss/ ],
- 'lb.utils' => [ qw/
- lbjp-common.jp-interface
- jobid.api-c
- lbjp-common.trio lbjp-common.maildir
- lb.client lb.state-machine lb.types:B
- / ],
- 'lb.ws-test' => [ qw/lbjp-common.gsoap-plugin lb.ws-interface/ ],
- 'lb.ws-interface' => [ qw/lb.types:B/ ],
- 'lb.types' => [ qw// ],
- 'lb.harvester' => [ qw/
- jobid.api-c lbjp-common.trio lbjp-common.db lb.common lb.client
- lbjp-common.gss lbjp-common.log
- / ],
- 'lb.yaim' => [ qw// ],
- 'lb.glite-LB' => [ qw/
- lb.logger:R lb.server:R lb.utils:R lb.doc:R
- lb.ws-test:R lb.harvester:R lb.yaim:R lb.client-java:R
- lb.logger-msg:R
- / ],
- 'lb.emi-lb' => [ qw/
- lb.logger:R lb.server:R lb.utils:R lb.doc:R
- lb.ws-test:R lb.harvester:R lb.yaim:R lb.client-java:R
- lb.logger-msg:R
- / ],
- 'lbjp-common.db' => [ qw/lbjp-common.trio lbjp-common.log/ ],
- 'lbjp-common.maildir' => [ qw// ],
- 'lbjp-common.log' => [ qw// ],
- 'lbjp-common.server-bones' => [ qw/lbjp-common.log/ ],
- 'lbjp-common.trio' => [ qw// ],
- 'lbjp-common.gss' => [ qw// ],
- 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ],
- 'jobid.api-c' => [ qw// ],
- 'jobid.api-cpp' => [ qw/jobid.api-c/ ],
- 'jobid.api-java' => [ qw// ],
-
- 'lbjp-common.jp-interface' => [ qw/lbjp-common.trio lbjp-common.db jobid.api-c/ ],
-
- 'jp.client' => [ qw/
- jp.ws-interface
- lbjp-common.jp-interface lbjp-common.maildir
- jobid.api-c
- lbjp-common.gsoap-plugin
- / ],
- 'jp.doc' => [ qw// ],
- 'jp.index' => [ qw/
- jp.server-common jp.ws-interface
- lbjp-common.jp-interface lbjp-common.trio lbjp-common.db lbjp-common.server-bones
- lbjp-common.gsoap-plugin
- / ],
- 'jp.primary' => [ qw/
- jobid.api-c
- jp.server-common jp.ws-interface
- lb.state-machine
- lbjp-common.jp-interface lbjp-common.trio lbjp-common.db lbjp-common.server-bones
- lbjp-common.gsoap-plugin
- / ],
- 'jp.server-common' => [ qw/
- lbjp-common.jp-interface lbjp-common.db
- / ],
- 'jp.ws-interface' => [ qw// ],
-
- 'gridsite.core' => [ qw// ],
- 'gridsite.commands' => [ qw/gridsite.core:B/ ],
- 'gridsite.apache' => [ qw/gridsite.core:B/ ],
- 'gridsite.libs' => [ qw/gridsite.core:B / ],
- 'gridsite.devel' => [ qw/gridsite.core:B/ ],
- 'gridsite.slashgrid' => [ qw/gridsite.core:B/],
- 'gridsite.services' => [ qw/gridsite.core:B/ ],
- 'gridsite.service-clients' => [ qw/gridsite.core:B/ ],
- 'gridsite.gsexec' => [ qw/gridsite.core:B/ ],
-
- 'px.proxyrenewal' => [ qw// ],
- 'px.glite-PX' => [qw/px.myproxy-yaim:R/],
- 'px.emi-px' => [qw/px.myproxy-yaim:R/],
- 'px.myproxy-yaim' => [ qw// ],
- 'px.myproxy-config' => [],
-
- 'canl.c' => [],
-
- # sub-packages (virtual ETICS components depending on the main)
- 'jobid.api-c-devel' => [ qw/jobid.api-c:B/ ],
- 'jobid.api-cpp-devel' => [ qw/jobid.api-cpp:B/ ],
- 'lbjp-common.db-devel' => [ qw/lbjp-common.db:B/ ],
- 'lbjp-common.gsoap-plugin-devel' => [ qw/lbjp-common.gsoap-plugin:B/ ],
- 'lbjp-common.gss-devel' => [ qw/lbjp-common.gss:B/ ],
- 'lbjp-common.jp-interface-devel' => [ qw/lbjp-common.jp-interface:B/ ],
- 'lbjp-common.log-devel' => [ qw/lbjp-common.log:B/ ],
- 'lbjp-common.maildir-devel' => [ qw/lbjp-common.maildir:B/ ],
- 'lbjp-common.server-bones-devel' => [ qw/lbjp-common.server-bones:B/ ],
- 'lbjp-common.trio-devel' => [ qw/lbjp-common.trio:B/ ],
- 'lb.client-progs' => [ qw/lb.client:B/ ],
- 'lb.client-devel' => [ qw/lb.client:B/ ],
- 'lb.common-devel' => [ qw/lb.common:B/ ],
- 'lb.logger-devel' => [ qw/lb.logger:B/ ],
- 'lb.state-machine-devel' => [ qw/lb.state-machine:B/ ],
- 'px.proxyrenewal-devel' => [ qw/px.proxyrenewal:B/ ],
- 'px.proxyrenewal-progs' => [ qw/px.proxyrenewal:B/ ],
- 'canl.c-devel' => [ qw/canl.c:B/ ],
-);
-
-for my $ext (keys %deps_aux) {
- for (@{$deps_aux{$ext}}) {
- /([^:]*)(?::(.*))?/;
- push @{$deps{$ext}},$1;
- my $type = $2 ? $2 : 'BR';
- $deps_type{$ext}->{$1} = $type;
- }
-}
-
-
-%extrafull = (
- gridsite=>'org.gridsite.core',
- 'canl.c' => 'emi.canl.canl-c',
- 'canl.c-devel' => 'emi.canl.canl-c',
- 'jobid.api-c-devel' => 'org.glite.jobid.api-c',
- 'jobid.api-cpp-devel' => 'org.glite.jobid.api-cpp',
- 'lbjp-common.db-devel' => 'org.glite.lbjp-common.db',
- 'lbjp-common.gsoap-plugin-devel' => 'org.glite.lbjp-common.gsoap-plugin',
- 'lbjp-common.gss-devel' => 'org.glite.lbjp-common.gss',
- 'lbjp-common.jp-interface-devel' => 'org.glite.lbjp-common.jp-interface',
- 'lbjp-common.log-devel' => 'org.glite.lbjp-common.log',
- 'lbjp-common.maildir-devel' => 'org.glite.lbjp-common.maildir',
- 'lbjp-common.server-bones-devel' => 'org.glite.lbjp-common.server-bones',
- 'lbjp-common.trio-devel' => 'org.glite.lbjp-common.trio',
- 'lb.client-devel' => 'org.glite.lb.client',
- 'lb.client-progs' => 'org.glite.lb.client',
- 'lb.common-devel' => 'org.glite.lb.common',
- 'lb.logger-devel' => 'org.glite.lb.logger',
- 'lb.state-machine-devel' => 'org.glite.lb.state-machine',
- 'px.proxyrenewal-devel' => 'org.glite.px.proxyrenewal',
- 'px.proxyrenewal-progs' => 'org.glite.px.proxyrenewal',
-);
-
-#( java => 'client-java' );
-%extranodmod = (
- db => 'lbjp-common.db',
- jpprimary => 'jp.primary',
- jpindex => 'jp.index',
- jpclient => 'jp.client',
- lb => 'lb.glite-LB',
- px => 'px.glite-PX',
- proxyrenewal => 'px.proxyrenewal',
- canl => 'canl.c',
-);
-
-%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/ ],
-);
-
-%conflicts = (
-);
-
-%provides = (
- 'lbjp-common.gss' => [ qq/glite-security-gss/ ],
- 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ],
- 'lb.nagios' => [ qq/glite-lb-nagios-plugins/ ],
-);
-
-%cvs_prefix = (
- 'lb' => 'org.glite',
- 'jp' => 'org.glite',
- 'jobid' => 'org.glite',
- 'lbjp-common' => 'org.glite',
- 'gridsite' => 'org',
- 'px' => 'org.glite',
- 'canl' => 'emi',
-);
-
-%cvs_tag_prefix = (
- 'lb' => 'glite-',
- 'jp' => 'glite-',
- 'jobid' => 'glite-',
- 'lbjp-common' => 'glite-',
- 'gridsite' => '',
- 'px' => 'glite-',
- 'canl' => 'emi-',
-);
-
-# ==== projects specification ====
-# etics_name ........... ETICS project name
-# conf_prefix .......... ETICS configurations name prefix
-# tag_prefix ........... VCS tag prefix
-# local_prefix ......... prefix (relative to stage)
-# etics_externs ........ ETICS modules names of externals
-# (${NAME.location}, ETICS conf. dependencies)
-# etics_projects ....... ETICS project names of externals
-# etics_externs_devel .. ETICS modules names of devel versions of externals
-# etics_locations ...... ETICS locations in ${NAME.location} properties
-# need_externs_aux ..... project-specific external dependencies
-# supported_platforms .. platforms supported by the project
-# modules .............. additional modules in subsystems
-%projects = (
- glite => {
- current_version => 3,
- etics_name => 'org.glite',
- conf_prefix => { %cvs_tag_prefix },
- tag_prefix => { %cvs_tag_prefix },
- flavours => '--thrflavour=${globus.thr.flavor} --nothrflavour=${globus.nothr.flavor}',
- local_prefix => '',
- etics_externs => {
- default => {
- globus_essentials=>'vdt_globus_essentials',
- globus=>'globus',
- globus_proxy_utils=>'vdt_globus_essentials',
- gridsite=>'org.gridsite.libs',
- yaim_core=>'org.glite.yaim.core',
- gip_release=>'glite-info-provider-release',
- gip_service=>'glite-info-provider-service',
- bdii=>'bdii',
- glite_version=>'glite-version',
- glite_info_templates=>'glite-info-templates',
- glue_schema=>'glue-schema',
- trustmanager=>'org.glite.security.trustmanager',
- axis=>'axis',
- lcas=>'org.glite.security.lcas',
- gsoapxx=>'-',
- jdk=>'jdk',
- voms=>'org.glite.security.voms-api-cpp',
- },
- },
- etics_externs_devel => {
- default => {
- gridsite=>'org.gridsite.devel',
- voms=>'org.glite.security.voms-api',
- },
- },
- etics_projects => {
- vdt=>[qw/globus globus_essentials globus_proxy_utils gpt/],
- 'org.glite'=>[qw/voms gridsite lcas gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/],
- },
- etics_locations => {
- '*' => '',
- },
- need_externs_aux => {
- 'lb.client-java' => [ qw/ant:B jdk:B axis:B trustmanager utiljava libtool:B/ ],
- 'lb.glite-LB' => [ qw/fetchcrl:R gpt:R gip_release:R gip_service:R bdii:R glite_version:R glite_info_templates:R glue_schema:R/ ],
- 'lb.yaim' => [ qw/yaim_core:R/ ],
- 'px.glite-PX' => [qw/myproxy-server:R myproxy-admin:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/],
- 'px.myproxy-yaim' => [ qw/yaim_core:R/ ],
- },
- supported_platforms => {
- sl5_x86_64_gcc412 => 1,
- sl5_ia32_gcc412 => 1,
- deb5_x86_64_gcc432 => 1,
- deb5_ia32_gcc432 => 1,
- slc4_x86_64_gcc346 => 1,
- slc4_ia32_gcc346 => 1,
- },
- modules => {
- 'lb' => [ qw/glite-LB/ ],
- 'px' => [ qw/glite-PX/ ],
- },
- },
-
- emi => {
- current_version => 2,
- etics_name => 'emi',
- conf_prefix => {
- 'lb' => 'emi-',
- 'jp' => 'emi-',
- 'jobid' => 'emi-',
- 'lbjp-common' => 'emi-',
- 'gridsite' => 'emi-',
- 'px' => 'emi-',
- 'canl' => 'emi-',
- },
- tag_prefix => { %cvs_tag_prefix },
- flavours => '--thrflavour= --nothrflavour=',
- local_prefix => '/usr',
- etics_externs => {
- default => {
- globus_essentials=>'globus-gssapi-gsi',
- globus=>'globus-gssapi-gsi-devel',
- globus_proxy_utils=>'globus-proxy-utils',
- gridsite=>'emi.gridsite.libs',
- yaim_core=>'emi.yaim.yaim-core',
- yaim_bdii=>'emi.bdii.yaim-bdii',
- gip_service=>'emi.bdii.glite-info-provider-service',
- bdii=>'emi.bdii.core',
- glite_version=>'emi.emi-version',
- glue_schema=>'emi.bdii.glue-schema',
- trustmanager=>'emi.java-security.trustmanager',
- trustmanager_axis=>'emi.java-security.trustmanager-axis',
- axis=>'axis1.4',
- lcas=>'emi.sac.lcas',
- gsoapxx=>'-',
- jdk=>'java',
- voms => 'emi.voms.voms-api',
- },
- sl5_x86_64_gcc412EPEL => {
- 'myproxy-devel' => 'myproxy-devel.x86_64',
- },
- sl6_x86_64_gcc446EPEL => {
- 'myproxy-devel' => 'myproxy-devel.x86_64',
- },
- deb6_x86_64_gcc445 => {
- axis => 'axis1.4',
- # mappings in ETICS project configuration
- #globus_essentials => 'libglobus-gssapi-gsi4',
- #globus => 'libglobus-gssapi-gsi-dev',
- #axis => 'libaxis-java',
- #cares => 'libc-ares2',
- #cppunit => 'libcppunit',
- #expat => 'libexpat1',
- #log4c => 'liblog4c3',
- #curl => 'libcurl3',
- #'mysql' => 'libmysqlclient16',
- #'mysql-devel' => 'libmysqlclient-dev',
- #libxslt => 'xsltproc',
- #'jakarta-commons-codec' => 'libcommons-codec-java',
- #'jakarta-commons-lang' => 'libcommons-lang-java',
- #'tetex-latex' => 'texlive-latex-extra',
- #'perl-LDAP' => 'libnet-ldap-perl',
- #'fuse-lib' => 'libfuse2',
- #'fuse' => 'fuse-utils',
- },
- },
- etics_externs_devel => {
- default => {
- cares => 'c-ares-devel',
- classads => 'classads-devel',
- cppunit => 'cppunit-devel',
- expat => 'expat-devel',
- gsoap => 'gsoap-devel',
- voms => 'emi.voms.voms-api-devel',
- libtar => 'libtar-devel',
- log4c => 'log4c-devel',
- postgresql => 'postgresql-devel',
- curl => 'curl-devel',
- libxml2 => 'libxml2-devel',
- openssl => 'openssl-devel',
- gridsite=>'emi.gridsite.devel',
- jdk=>'java-devel',
- },
- deb6_x86_64_gcc445 => {
- # mappings in ETICS project configuration
- #cares => 'libc-ares-dev',
- #cppunit => 'libcppunit-dev',
- #expat => 'libexpat1-dev',
- #libtar => 'libtar-dev',
- #log4c => 'liblog4c-dev',
- #postgresql => 'libpq-dev',
- #curl => 'libcurl4-openssl-dev',
- #libxml2 => 'libxml2-dev',
- #openssl => 'libssl-dev',
- #'tetex-latex' => 'texlive-latex-extra',
- #libxslt=>'xsltproc',
- #'httpd-devel' => 'apache2-prefork-dev',
- #'fuse-devel' => 'libfuse-dev',
- #gsoap => 'gsoap',
- #'krb5-devel' => 'libkrb5-dev',
- },
- },
- etics_projects => {
- 'emi'=>[qw/voms voms-devel gridsite lcas gip_service bdii glite_version glue_schema yaim_core yaim_bdii trustmanager trustmanager_axis/],
- },
- etics_locations => {
- axis => 'axis',
- },
- need_externs_aux => {
- 'lb.client-java' => [ qw/ant:B jdk:B axis:B trustmanager trustmanager_axis libtool:B/ ],
- 'lb.emi-lb' => [ qw/fetchcrl:R gip_service:R bdii:R glite_version:R glue_schema:R/ ],
- 'lb.yaim' => [ qw/yaim_core:R yaim_bdii:R/ ],
- 'px.emi-px' => [qw/myproxy-server:R myproxy-admin:R fetchcrl:R gip_service:R bdii:R glite_version:R glue_schema:R/],
- 'px.myproxy-yaim' => [ qw/yaim_core:R yaim_bdii:R/ ],
- },
- supported_platforms => {
- sl5_x86_64_gcc412EPEL => 1,
- sl5_ia32_gcc412EPEL => 1,
- sl6_x86_64_gcc446EPEL => 1,
- deb6_x86_64_gcc445 => 1,
- },
- modules => {
- 'lb' => [ qw/emi-lb/ ],
- 'px' => [ qw/emi-px/ ],
- },
- },
-);
-
-%platform_properties = (
- 'jobid.api-java' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.types' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.doc' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.ws-interface' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.yaim' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.nagios' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'px.yaim' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'px.myproxy-config' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'gridsite.devel' => {
- default => { 'packageName' => 'gridsite-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libgridsite-dev' },
- },
- 'canl.c-devel' => {
- default => { 'packageName' => 'canl-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libcanl-dev' },
- },
- 'jobid.api-c-devel' => {
- default => { 'packageName' => 'glite-jobid-api-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-jobid-dev' },
- },
- 'jobid.api-cpp-devel' => {
- default => { 'packageName' => 'glite-jobid-api-cpp-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-jobid-cpp-dev' },
- },
- 'lbjp-common.db-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-db-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-db-dev' },
- },
- 'lbjp-common.gsoap-plugin-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-gsoap-plugin-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-gsoap-plugin-dev' },
- },
- 'lbjp-common.gss-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-gss-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-gss-dev' },
- },
- 'lbjp-common.jp-interface-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-jp-interface-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-jp-interface-dev' },
- },
- 'lbjp-common.log-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-log-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-log-dev' },
- },
- 'lbjp-common.maildir-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-maildir-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-maildir-dev' },
- },
- 'lbjp-common.server-bones-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-server-bones-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-server-bones-dev' },
- },
- 'lbjp-common.trio-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-trio-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-trio-dev' },
- },
- 'lb.client-devel' => {
- default => { 'packageName' => 'glite-lb-client-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-client-dev' },
- },
- 'lb.common-devel' => {
- default => { 'packageName' => 'glite-lb-common-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-common-dev' },
- },
- 'lb.state-machine-devel' => {
- default => { 'packageName' => 'glite-lb-state-machine-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-state-machine-dev' },
- },
- 'lb.logger-devel' => {
- default => { 'packageName' => 'glite-lb-logger-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-logger-dev' },
- },
- 'px.proxyrenewal-devel' => {
- default => { 'packageName' => 'glite-px-proxyrenewal-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-security-proxyrenewal-dev' },
- },
- 'canl.c-devel' => {
- default => { 'packageName' => 'canl-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libcanl-c-dev' },
- },
-);
-
-my @k = keys %deps_aux;
-@buildroot{@k} = ('') x ($#k+1);
-
-$buildroot{'gridsite.core'} = 'src';
-}
-
-sub full
-{
- my ($short) = @_;
- my $subsys = $short;
- $subsys =~ s/\..*//;
-
- my $cvs_prefix = exists $cvs_prefix{$subsys} ? $cvs_prefix{$subsys} : 'org.glite';
- return $extrafull{$short} ? $extrafull{$short} : "$cvs_prefix.$short";
-}
-
-sub get_version
-{
- my ($fmod, $top_srcdir) = @_;
-
- my ($subsys,$mod) = split /\./,$fmod,2;
- my ($major,$minor,$rev,$age);
- my $old_;
-
- if ($force_version) {
- $force_version =~ /([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)-(.+)/;
- ($major,$minor,$rev,$age) = ($1,$2,$3,$4);
- }
- else {
- my $path = "$top_srcdir/project";
- if ($subsys eq 'gridsite') {
- $path = "$cvs_prefix{$subsys}.$subsys.core/project";
- }
- open V,"$path/version.properties"
- or die "$path/version.properties: $!\n";
-
- $old_ = $_;
- while (<V>) {
- chomp;
- ($major,$minor,$rev) = ($1,$2,$3) if /module\.version\s*=\s*([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/;
- $age = $1 if /module\.age\s*=\s*([[:digit:]]+)/;
- }
- close V;
- $_ = $old_;
- }
- $version = "$major.$minor.$rev-$age";
-
- return ($major, $minor, $rev, $age);
-}
-
-sub get_description
-{
- my ($top_srcdir) = @_;
-
- my $cvs_module = $top_srcdir;
- my $package_description = "";
- my $package_summary = "";
-
- if (-e "$cvs_module/project/package.description") {
- open V, "$cvs_module/project/package.description";
- $package_description = join ("", <V>);
- close V;
- chomp $package_description;
- }
- else {
- print STDERR "package.description not found for $subsys.$module!\n"; }
-
- if (-e "$cvs_module/project/package.summary") {
- open V, "$cvs_module/project/package.summary";
- $package_summary = join ("", <V>);
- close V;
- chomp $package_summary;
- $package_summary =~ s/\n/\\n/g;
- }
- else {
- print STDERR "package.summary not found for $subsys.$module!\n"; }
-
- return ($package_summary, $package_description);
-}
-
-sub mkinc
-{
- my %aux;
- undef %aux;
- my @m=qw/
-lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.nagios lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lb.emi-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
-px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config px.emi-px
-canl.c
-/;
- @aux{@m} = (1) x ($#m+1);
-
- my ($short) = @_;
- my $full = full $short;
- my ($subsys,$mod) = split /\./,$short,2;
- my $packageName = "$project{tag_prefix}{$subsys}$subsys-${mod}";
-
- unless ($aux{$short}) {
- print "Makefile.inc not needed in $full\n";
- return;
- }
-
- my $top_srcdir = '.';
- my $abs_srcdir = '';
- my $build = '';
-
- if ($module) {
- $top_srcdir = $0;
- $top_srcdir =~ s,/?[^/]*$,,;
- $abs_srcdir = $top_srcdir;
- $top_srcdir =~ s,^$,\.,;
- } else {
- $build = "$full/";
- $abs_srcdir = "$full/";
- unless ($buildroot{$_} eq '') {
- $top_srcdir = '..';
- $build .= "$buildroot{$_}/";
- unless (-d "$build") {
- mkdir "$build" or die "mkdir $build: $!\n";
- }
- }
- }
-
- my ($major, $minor, $rev, $age) = get_version $short, $abs_srcdir;
- my ($package_summary, $package_description) = get_description $abs_srcdir;
- if ($package_description) { $package_description =~ s/(.{1,78}\S|\S+)\s+/$1\n/mg; }
- my $package_description_debian = $package_description;
- $package_description_debian =~ s/^/ /mg;
-
- my ($old_locale, $specdate, $debdate);
-
- # files for ETICS always in root source directory
- mkdir $abs_srcdir."project" unless (-d $abs_srcdir."project");
- open PKGCHL,">".$abs_srcdir."project/changelog"
- or die $abs_srcdir."project/changelog: $!\n";
- $old_locale = setlocale(LC_TIME);
- setlocale(LC_TIME, "C");
- $specdate = strftime("%a %b %d %Y", gmtime());
- $debdate = strftime("%a, %d %b %Y %H:%M:%S %z", gmtime());
- setlocale(LC_TIME, $old_locale);
- print PKGCHL qq{* $specdate CESNET team <emi-lb\@metacentrum.cz>
-- automatically generated package
-};
- close PKGCHL;
-
- unless ($top_srcdir eq '.') {
- unlink $build."Makefile";
- symlink "$top_srcdir/Makefile",$build."Makefile" or die "symlink $top_srcdir/Makefile ".$build."Makefile: $!\n";
- }
-
- open MKINC,">".$build."Makefile.inc"
- or die $build."Makefile.inc: $!\n";
-
- print "Creating ".$build."Makefile.inc\n";
-
- print MKINC qq{project = $project
-PREFIX = $root
-prefix = $prefix
-stagedir = $stagedir
-sysroot = $sysroot
-sysconfdir = $sysconfdir
-localstatedir = $localstatedir
-thrflavour = $thrflavour
-nothrflavour = $nothrflavour
-libdir = $libdir
-top_srcdir = $top_srcdir
-};
-
- for (@{$need_externs{$short}}) {
- next unless defined $externs{$_} and defined $externs{$_}{prefix};
- print MKINC "${_}_prefix = $externs{$_}{prefix}\n";
- print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags};
- }
-
- for (@{$need_jars{$short}}) {
- print MKINC "${_}_jar = $jar{$_}\n"
- }
-
- my $need_gsoap = 0;
- for (@{$need_externs{$short}}) { $need_gsoap = 1 if $_ eq 'gsoap'; }
-
- print MKINC "gsoap_default_version=".gsoap_version()."\n" if $need_gsoap;
-
- close MKINC;
-
- my $dh;
- my $debian = 0;
-
- opendir $dh, "$abs_srcdir/project" || die "Can't open $abs_srcdir/project: $!";
- for my $dir (readdir $dh) {
- if ($dir=~/^(.*)\.spec$/) {
- if ($1 ne $packageName) {
- printf STDERR "Changed RPM name: $packageName --> $1\n" if ($debug);;
- $packageName=$1;
- }
- last;
- }
- }
- closedir $dh;
-
- for my $file ("$packageName.spec", "debian.rules", "debian.control", "debian.changelog", "debian.copyright") {
- if (-f "$abs_srcdir/project/$file") {
- my $old_ = $_;
- printf STDERR "Creating $build$file\n" if ($debug);;
- open DST, ">$build$file";
- open SRC, "<$abs_srcdir/project/$file";
- while (<SRC>) {
- if (/\@MODULE\@/) { s/\@MODULE\@/$full/g; }
- if (/\@URL\@/) { s/\@URL\@/$package{url}/g; }
- if (/\@SUMMARY\@/) { s/\@SUMMARY\@/$package_summary/g; }
- if (/\@DESCRIPTION\@/) { s/\@DESCRIPTION\@/$package_description/g; }
- if (/\@DEBIAN_DESCRIPTION\@/) { s/\@DEBIAN_DESCRIPTION\@/$package_description_debian/g; }
- if (/\@VERSION\@/) { s/\@VERSION\@/$version/g; }
- if (/\@MAJOR\@/) { s/\@MAJOR\@/$major/g; }
- if (/\@MINOR\@/) { s/\@MINOR\@/$minor/g; }
- if (/\@REVISION\@/) { s/\@REVISION\@/$rev/g; }
- if (/\@AGE\@/) { s/\@AGE\@/$age/g; }
- if (/\@MAINTAINER\@/) { s/\@MAINTAINER\@/$package{maintainer}/g; }
- if (/\@UPLOADERS\@/) { s/\@UPLOADERS\@/$package{uploaders}/g; }
- if (/\@DEBIAN_VCS\@/) { s/\@DEBIAN_VCS\@/$package{debian_vcs}/g; }
- if (/\@DEBIAN_DATE\@/) { s/\@DEBIAN_DATE\@/$debdate/g; }
- if (/\@SPEC_DATE\@/) { s/\@SPEC_DATE\@/$specdate/g; }
- if (/^\s*.+\/configure\s/ and $force_version) {
- print "Version forced to $version\n" if ($debug);;
- s/--version\s+\S+\s?//;
- s/$/ --version $version/;
- }
- printf DST "%s", "$_";
- }
- close SRC;
- close DST;
- $_ = $old_;
- }
- }
-
- print "Creating ${build}debian/\n" if ($debug);;
-
- `rm -rfv ${build}debian`;
- mkdir $build."debian" or die $!;
- `cp $abs_srcdir/project/debian.* ${build}debian/ 2>/dev/null`;
- `mv ${build}debian.* ${build}debian/ 2>/dev/null`;
- `rm -f ${build}debian/*.orig`;
- opendir $dh, "${build}debian" || die "Can't open ${build}debian: $!";
- for $_ (readdir $dh) {
- if (/^debian\.(.*)/) {
- `mv ${build}debian/$_ ${build}debian/$1`;
- $debian = 1;
- }
- }
- closedir $dh;
-
- if ($debian) {
- my ($dir, $file);
-
- chmod 0755, "${build}debian/rules";
- $file="${build}debian/docs"; if (not -f $file) { `touch $file`; }
- $dir="${build}debian/source"; if (not -d $dir) { mkdir $dir; }
- $file="${build}debian/source/format"; if (not -f $file) { `echo "3.0 (quilt)" > $file` }
- $file="${build}debian/compat"; if (not -f $file) { `echo "7" > $file` }
- $file="${build}debian/changelog"; if (not -f $file) {
- open FH, ">$file" or die $!;
- print FH qq{$packageName ($major.$minor.$rev-$age) unstable; urgency=low
-
- * Automatically generated package
-
- -- $package{maintainer} $debdate
-};
- close FH;
- }
-
- } else {
- `rm -rf ${build}debian`;
- }
-}
-
-BEGIN{
-};
-
-sub mode_etics_packaging {
- my ($fmod, $cmd, $rpmprepare, $debprepare) = @_;
- my ($workspaceDir, $srcPackageName, $srcAge, $topDir);
-
- # old-school packaging by ETICS for EMI-1
- if ($project eq 'emi' and $project_version == 1) { return; }
-
- if ($fmod eq 'gridsite.core') {
- $workspaceDir = '..';
- $srcPackageName = 'gridsite';
- $srcAge = '';
- $topDir = '../';
- } else {
- $workspaceDir = '${workspaceDir}';
- $srcPackageName = '${packageName}';
- $srcAge = '-${age}';
- $topDir = '';
- }
-
- $cmd->{clean} = 'make clean
- rm -rfv ${package.tgzLocation} ${package.SRPMSLocation}';
- $cmd->{default}{packaging} = $rpmprepare;
- $cmd->{default}{packaging} .= "dir=\${workspaceDir}/rpm_build_src_\$\$
- mkdir -p \${package.tgzLocation} \${package.SRPMSLocation} \$dir/{BUILD,RPMS,SOURCES,SRPMS} 2>/dev/null || true
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \${package.tgzLocation}/
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \$dir/SOURCES/
- rpmbuild -bs --nodeps --define \"_topdir \$dir\" $srcPackageName.spec
- cp -v \$dir/SRPMS/*.src.rpm \${package.SRPMSLocation}/
- rm -rf \$dir";
-
- for my $p ('deb5_x86_64_gcc432', 'deb5_ia32_gcc432', 'deb6_x86_64_gcc445', 'deb6_ia32_gcc445') {
- for my $c (keys %{$cmd->{default}}) { $cmd->{$p}{$c} = $cmd->{default}{$c}; }
- $cmd->{$p}{clean} = 'make clean
- rm -rfv ${package.tgzLocation} ${package.SDEBSLocation}';
- $cmd->{$p}{packaging} = $debprepare;
- $cmd->{$p}{packaging} .= "dir=\${workspaceDir}/dpkg_build_src_\$\$
- mkdir -p \${package.tgzLocation} \${package.SDEBSLocation} \$dir 2>/dev/null || true
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \${package.tgzLocation}/
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \$dir/${srcPackageName}_\${version}.orig.tar.gz
- tar xzf \$dir/${srcPackageName}_\${version}.orig.tar.gz -C \$dir
- cp -rf ${topDir}debian/ \$dir/$srcPackageName-\${version}/
- cd \$dir/$srcPackageName-\${version}
- dpkg-buildpackage -S -d -nc
- cd -
- cp -v \$dir/*.tar.gz \$dir/*.dsc \${package.SDEBSLocation}/
- rm -rf \$dir";
- }
-}
-
-sub mode_etics {
- $fmod = shift;
-
- die "$0: --module required with --etics\n" unless $fmod;
-
- my ($subsys,$module) = split /\./,$fmod,2;
- my $full = full "$subsys.$module";
-
- my ($major,$minor,$rev,$age) = get_version $fmod, $full;
-
- # XXX: --with ignored for platform-dependend packages
- my @copts = ();
- my %ge;
- @ge{@{$etics_projects{$project{etics_name}}}} = (1) x ($#{$etics_projects{$project{etics_name}}}+1);
-
- for (@{$need_externs{"$subsys.$module"}}) {
- if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/ and (defined $externs{$_} or defined $jar{$_})) {
- my $eext = $etics_externs{default}{$_} ? $etics_externs{default}{$_} : $_;
- next if ($eext eq '-');
- if (defined $project{etics_locations}{'*'} or defined $project{etics_locations}{$_}) {
- $eext = $project{etics_locations}{$_} if ($project{etics_locations}{$_});
- push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}";
- } else {
- if ($ge{$_} and not defined $externs{$_}{pkg}) {
- push @copts, "--with-$_=\${stageDir}";
- }
- }
- }
- }
-
- for (@{$need_jars{"$subsys.$module"}}) {
- my $eext = $etics_externs{default}{$_} ? $etics_externs{default}{$_} : $_;
-
- push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (defined $project{etics_locations}{'*'} or defined $project{etics_locations}{$_});
- }
-
- my $conf;
- my $conftag;
- my ($confprefix, $nameprefix, $packageName);
-
- $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n";
-
- $confprefix = $project{conf_prefix}{$subsys};
- $nameprefix = $confprefix;
- $nameprefix =~ s/-$//;
- $nameprefix =~ s/-/\./g;
- $packageName = "$project{tag_prefix}{$subsys}$subsys-${module}";
-
- if ($branch) {
- $conf = "$confprefix${subsys}-${module}_$branch";
- $conftag = $branch;
- # forced low age number
- $age = $branch eq 'HEAD' ? '0head' : '0dev';
- push @copts, '--version ${version}-${age}';
- }
- else {
- $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}";
-# XXX: gridsite hack
- $conftag = $subsys eq 'gridsite' ? "$project{tag_prefix}{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" :
- "$project{tag_prefix}{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}";
-
- # lowering age for older packaging
- if ($project eq 'emi' and $project_version == 1) {
- $age = $age - 1;
- }
- }
-
- # emi1 suffix for older packaging
- if ($project eq 'emi' and $project_version == 1) {
- $age = $age.$project.$project_version;
- $conf = $conf.$project.$project_version;
- }
-
- my $file = $output ? $output : "$conf.ini";
- open C,">$file" or die "$file: $!\n";
-
- my $buildroot = $buildroot{"$subsys.$module"} eq '' ? '#no build.root' : "build.root = " . $buildroot{"$subsys.$module"};
-
- my $confdir = $buildroot{"$subsys.$module"} eq '' ? '.' : '..';
-
- my $cvs_module = full "$subsys.$module";
- my ($package_summary, $package_description) = get_description $cvs_module;
- if ($package_description) {
- $package_description =~ s/\n/\\n/g;
- $package_description = "package.description = $package_description\n";
- }
- if ($package_summary) {
- $package_summary = "package.summary = $package_summary\n";
- }
-
- my %cmd;
- $cmd_vcs{checkout} = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_module 2>/dev/null";
- #$cmd_vcs{checkout} = "((test -d jra1mw/.git && (cd jra1mw; git pull)) || (git clone -q http://scientific.zcu.cz/git/jra1mw.git";
- #$cmd_vcs{checkout} .= " && (cd jra1mw; git checkout -b \${tag} --track origin/\${tag})" unless ($conftag eq /HEAD/);
- #$cmd_vcs{checkout} .= ")) && (test -d \${moduleName} || ln -s jra1mw/$cvs_module \${moduleName})";
- $cmd_vcs{checkout} .= "\n\ttest -f \${packageName}-\${version}-\${age}.src.tar.gz || (ln -s \${moduleName} \${packageName}-\${version}; tar -chf - \${packageName}-\${version} --exclude CVS --exclude .git --exclude .etics | gzip --best > \${packageName}-\${version}-\${age}.src.tar.gz; rm \${packageName}-\${version})";
- $cmd_vcs{tag} = "cvs -d \${vcsroot} tag -R \${tag} ${moduleName}";
-
- $cmd{default}{init} = 'None';
- $cmd{default}{configure} = 'None';
- $cmd{default}{compile} = 'None';
- $cmd{default}{test} = 'None';
- $cmd{default}{install} = 'None';
- $cmd{default}{packaging} = 'None';
- $cmd{default}{clean} = 'make clean';
-
- if (exists $subpackages{$fmod}) {
- $cmd{default}{clean} = 'None';
- $cmd{default}{packaging} = "echo building nothing, $subpackages{$fmod} will build this package";
- $cmd_vcs{checkout} = "mkdir -v \${moduleName} 2>/dev/null || true";
- } elsif ($subsys eq 'gridsite') {
- $cmd_vcs{tag} = 'None';
-
- if ($module eq 'core') {
- my $flags;
-
- if ($project ne 'glite') {
- # don't evaluate pkg-config calls to get them into source package
- $flags = 'RELEASE_VERSION=${age}
- GSOAPDIR=\`pkg-config gsoap --variable=prefix\`
- OPENSSL_GLOBUS_FLAGS=\`pkg-config globus-openssl --cflags\`
- OPENSSL_GLOBUS_LIBS=\`pkg-config globus-openssl --libs\`';
- } else {
- $flags = 'RELEASE_VERSION=${age}
- GSOAPDIR=${gsoap.location}
- OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor}
- OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}
- HTTPD_FLAGS=-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-1 -I${httpd-devel.location}/include/apr-1.0 -I${httpd-devel.location}/include/apr-0 -I${httpd-devel.location}/include/pcre';
- }
-
- $cmd{default}{configure} = "cat > Makefile.inc <<EOF
- project = $project
- top_srcdir = ..
- $flags
- EOF";
- $cmd{default}{compile} = "make prefix=\${prefix}$project{local_prefix} libdir=\${libdir}";
- $cmd{default}{install} = "make prefix=\${prefix}$project{local_prefix} libdir=\${libdir} install";
- mode_etics_packaging($fmod, \%cmd,
- "make prefix=\${prefix}$project{local_prefix} rpm-prepare
- cp gridsite.spec ../\n\t",
- "chmod +x \${moduleDir}/src/make-debian-files || true
- make prefix=\${prefix}$project{local_prefix} deb-prepare\n\t"
- );
- }
- elsif ($module eq '1.5-compat') {
- $cmd_vcs{checkout} = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.core 2>/dev/null";
- $cmd{default}{init} = 'echo "/sbin/ldconfig" > project/.post
- echo "/sbin/ldconfig" > project/.postun';
- $cmd{default}{configure} = "cat > src/Makefile.inc <<EOF
- project = emi
- libdir = \${libdir}
- MAJOR_VERSION=1
- MINOR_VERSION=1.5
- PATCH_VERSION=1.5.0
- VERSION=\\\$(PATCH_VERSION)
- RELEASE_VERSION=\${age}
- GSOAPDIR=\\`pkg-config gsoap --variable=prefix\\`
- OPENSSL_GLOBUS_FLAGS=\\`pkg-config globus-openssl --cflags\\`
- OPENSSL_GLOBUS_LIBS=\\`pkg-config globus-openssl --libs\\`
- EOF";
- $cmd{default}{compile} = "make -C src prefix=\${prefix}$project{local_prefix}
- rm -fv project/debian.changelog";
- $cmd{default}{install} = "make -C src prefix=\${prefix}$project{local_prefix} install-lib
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.so.1
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.so
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.a";
- $cmd{default}{packaging} = "None";
- }
- else {
- $cmd{default}{clean} = 'None';
- $cmd{default}{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this";
- $cmd_vcs{checkout} = "mkdir -v \${moduleName} 2>/dev/null || true";
- }
- }
- elsif ($subsys eq 'px' and $module eq 'myproxy-config') {
- $cmd{default}{configure} = "/usr/bin/perl $confdir/configure --root=\${prefix} --prefix= --stage=\${stageDir} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts";
- $cmd{default}{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config";
- }
- else {
- $cmd{default}{configure} = "/usr/bin/perl $confdir/configure $project{flavours} --root=\${prefix} --prefix=$project{local_prefix} --stage=\${stageDir} --sysroot=\${package.prefix} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts";
- $cmd{default}{compile} = 'make';
- $cmd{default}{test} = 'make check';
- $cmd{default}{install} = 'make install';
- if ($subsys eq 'lb' and $module eq 'client') {
- $cmd{default}{compile} = "make rpath=$project{local_prefix}/\${libdir}";
- $cmd{default}{install} = "make install post-install rpath=$project{local_prefix}/\${libdir}";
- }
- mode_etics_packaging($fmod, \%cmd);
- }
-
- 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 = $project{etics_name}.$subsys.$module
-displayName = $conf
-description = $cvs_prefix{$subsys}.$subsys.$module
-projectName = $project{etics_name}
-age = $age
-deploymentType = None
-vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite
-tag = $conftag
-version = $major.$minor.$rev
-$dwpath
-[Platform-default:VcsCommand]
-displayName = None
-description = None
-tag = $cmd_vcs{tag}
-branch = None
-commit = None
-checkout = $cmd_vcs{checkout}
-
-};
-
- for my $p (keys %cmd) {
- next if $p ne 'default' and exists $project{supported_platforms} and not exists $project{supported_platforms}{$p};
-
- print C qq{[Platform-$p:BuildCommand]
-postpublish = None
-packaging = $cmd{$p}{packaging}
-displayName = None
-description = None
-doc = None
-prepublish = None
-publish = None
-compile = $cmd{$p}{compile}
-init = $cmd{$p}{init}
-install = $cmd{$p}{install}
-clean = $cmd{$p}{clean}
-test = $cmd{$p}{test}
-configure = $cmd{$p}{configure}
-checkstyle = None
-
-};
- }
-
- print C qq{[Platform-default:Property]
-$buildroot
-package.preserve.libtool = false
-$package_description$package_summary$defprops};
-
- for (@{$obsoletes{"$subsys.$module"}}) {
- print C "package.obsoletes = $_\n";
- print C "package.replaces = $_\n";
- }
- for (@{$conflicts{"$subsys.$module"}}) {
- print C "package.conflicts = $_\n";
- }
- for (@{$provides{"$subsys.$module"}}) {
- print C "package.provides = $_\n";
- }
- print C "\n";
-
- for my $pp (keys %{$platform_properties{"$subsys.$module"}}) {
- next if $pp eq 'default';
- next if exists $project{supported_platforms} and not exists $project{supported_platforms}{$pp};
-
- print C "[Platform-$pp:Property]\n$buildroot\n";
-
- for my $p (keys %{$platform_properties{"$subsys.$module"}->{$pp}}) {
- print C $p . ' = ' . $platform_properties{"$subsys.$module"}->{$pp}->{$p} . "\n";
- }
- print C "$package_description$package_summary\n";
- }
-
- for my $platform ('default', keys %{$project{supported_platforms}}) {
- my $used = 0;
- my $output = '';
-
- for (@{$need_externs{"$subsys.$module"}},@{$need_jars{"$subsys.$module"}}) {
- my $eext = $etics_externs{$platform}{$_};
- my $edev = $project{etics_externs_devel}{$platform}{$_};
-
- # for the default platform using package of the same
- # name for runtime dependency
- if (not $eext) {
- if ($platform eq 'default') {
-#print "default runtime $_ on default\n";
- $eext = $_; }
- else {
-#print "no runtime $_ on $platform\n";
- $eext = '-'; }
- }
- if ($eext eq '-' and $edev eq '-') {
-#print "skipping $_ on $platform\n";
- next;
- }
-
- my $proj = 'externals';
- for my $p (keys %etics_projects) {
- for $m (@{$etics_projects{$p}}) {
- $proj = $p if $m eq $_;
- }
- }
-
- my $type = $need_externs_type{"$subsys.$module"}->{$_};
-
- if ($edev) {
- if ($type eq 'B') {
- # no runtime - change to devel pkg
- $eext = $edev;
- } elsif ($type eq 'BR' or $type eq 'RB') {
- # additional devel pkg
- if ($edev ne '-') { $output .= "$proj|$edev = B\n"; }
- }
- }
- if ($eext ne '-') { $output .= "$proj|$eext = $type\n"; }
- }
-
- if ($platform eq 'default') {
- for (@{$deps{"$subsys.$module"}}) {
- my $type = $deps_type{"$subsys.$module"}->{$_};
- if (not $used) {
- $used = 1;
- }
- $output .= "$project{etics_name}|$project{etics_name}.$_ = $type\n";
- }
- }
-
- if ($output) {
- print C qq{
-[Platform-$platform:DynamicDependency]
-$output};
- }
- }
-
- close C;
-
- for $file ("$cvs_module/project/debian.rules", "$cvs_module/project/$packageName.spec") {
- my $lib;
- my $main_module;
- @copts = ();
-
- if ($file =~ /debian\.rules$/) { $lib = 'lib'; }
- else { $lib = '%{_lib}'; }
-
- my $main_module = "$subsys.$module";
- if (exists $subpackages{$main_module}) { $main_module = $subpackages{$main_module}; }
-
- # locations hacks
- if ($file =~ /$packageName\.spec$/) {
- if ($fmod eq 'lb.client-java') {
- push @copts, '';
- push @copts, '--with-axis=/usr/local/axis1.4';
- }
- }
-
- if (-f $file) {
- open DST,">$file.new" or die "$file.new: $!\n";
- open SRC,"<$file" or die "$file: $!\n";
- while (<SRC>) {
- if (/^(\s*).+\/configure\s/) {
- printf DST "%s", "$1";
- printf DST "/usr/bin/perl $confdir/configure $project{flavours} --root=/ --prefix=$project{local_prefix} --libdir=$lib --project=$project --module $main_module@copts\n";
- } else {
- printf DST "%s", "$_";
- }
- }
- close SRC;
- close DST;
-
- `diff -b "$file" "$file.new"`;
- if ($? == 0) {
- print STDERR "($file not changed)\n";
- unlink "$file.new";
- } else {
- print STDERR "Writing $file\n";
- rename "$file", "$file.orig" unless -f "$file.orig";
- rename "$file.new", "$file";
- }
- }
- }
-}
-
-sub gsoap_version {
- local $_;
- my $gsoap_version;
- open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n";
-
- while ($_ = <S>) {
- 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;
-}
-
-sub getlibdir {
- if ( -e "/etc/debian_version") { # We are on Debian
- $lib64="lib";
- $lib32="lib32"; }
- else { # Another distribution
- $lib64="lib64";
- $lib32="lib"; }
- $libdir=$lib32;
-
- open INP, "uname -s | "; # Check kernel name
- $kname= <INP>;
- chomp($kname);
- close INP;
-
- if ( $kname eq "Linux") {
- $arch = ("x86_64\npowerpc\nppc64\n");
-
- open INP, "uname -p | "; # Check processor type
- $procname= <INP>;
- chomp($procname);
- close INP;
-
- if ($arch =~/^$procname\n/) {
- return ($lib64); }
-
- open INP, "uname -m | "; # Check machine hardware
- $machname= <INP>;
- chomp($machname);
- close INP;
-
- if ($arch =~/^$machname\n/) {
- return ($lib64); }
-
- # special cases (hyperlink lib64, Debian)
- if (-l "/usr/lib64") {
- $libdir=$lib32; }
-
- # if /usr/lib64 doesn't exist at all (AIX)
- unless ( -e "/usr/lib64" ) {
- $libdir=$lib32; }
- }
-
- if ( $kname eq "SunOS") {
- if (-e "/usr/lib/64") {
- $libdir="lib/64"; }
- }
-
- return $libdir;
-}
-
-sub reshuffle_platforms($$) {
- my ($data, $platforms) = @_;
- my ($platform, %blacklist, $value);
-
- return if not $platforms;
-
- for $platform (keys %$data) {
-#print "plat: $platform: $data->{$platform}\n";
- next if $platform eq 'default';
- for $_ (keys %{$data->{$platform}}) {
-#print " blacklist: $_ = $data->{$platform}{$_}\n";
- $blacklist{$_} = 1;
- }
- }
-
- for $_ (keys %blacklist) {
- $value = $data->{default}{$_} ? $data->{default}{$_} : $_;
- for $platform (keys %$platforms) {
- next if $platform eq 'default';
- if (not defined $data->{$platform}{$_}) {
- $data->{$platform}{$_} = $value;
-#print "added $value to $platform\n"
- }
- }
- $data->{default}{$_} = '-';
-#print "deleted $_ from default\n";
- }
-
- # merge dependencies across the supported platforms
- %blacklist = [];
- for $platform (keys %$platforms) {
- next if $platform eq 'default';
- for $_ (keys %{$data->{$platform}}) {
- $blacklist{$_} = 1;
- }
- }
- for $_ (keys %blacklist) {
- $value = undef;
- $same = 1;
- for $platform (keys %$platforms) {
- if (not $value) { $value = $data->{$platform}{$_}; }
- if (not $data->{$platform}{$_} or $value ne $data->{$platform}{$_}) {
- $same = 0;
- last;
- }
- }
- if ($same and $value) {
-#print "merged dependency $_\n";
- $data->{default}{$_} = $value;
- for $platform (keys %$platforms) {
- delete $data->{$platform}{$_};
- }
- }
- }
-}
-
-sub usage {
- my @ext = keys %externs;
- my @myjars = keys %jar;
-
- print STDERR qq{
-Usage: $0 options
-
-General options (defaults in []):
- --prefix=PREFIX destination directory [./stage]
- --stage=DIR staging directory [./stage]
- --root=DIR installation root (custom relocation root -> sysroot) [./stage]
- --sysroot=DIR system root (custom relocation root -> sysroot) []
- --sysconfdir=DIR system configuration directory [PREFIX/etc]
- --staged=module,module,... what is already in PREFIX (specify without org.glite.)
- --thrflavour=flavour
- --nothrflavour=flavour threaded and non-treaded flavours [gcc64dbgpthr,gcc64dbg]
- --listmodules=subsys list modules of a subsystem
- --listmodules=module list subpackages of a module
- --version=maj.min.rev-age version used instead of reading version.properties
- --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...)
- --libdir=libdir typically [lib,lib64] postfix
- --project=PROJECT build or generate etics for a project (glite/emi1/emi) [emi]
- --debug print more details
-
-Mode of operation:
- --mode=\{checkout|build|etics\} what to do [build]
-
-What to build:
- --module=module build this module only
- --enable-NODE build this "node" (set of modules) only
- --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
- --jobid-tag=tag checkout jobid modules with specific tag
- --canl-tag=tag checkout canl modules with specific tag
-
-Dependencies (summary of what will be used is always printed):
- --with-EXTERNAL=PATH where to look for an external [autodetect]
- --with-JAR=JAR where to look for jars
-
-Available nodes:
- @nodes
-
-Default nodes:
- @default_nodes
-
-Externals (not all for all modules) are:
- @ext
-
-External jars are:
- @myjars
-
-};
-
-}
+++ /dev/null
-//gsoap wscalc service name: CalcService
-//gsoap wscalc service type: Calc
-//gsoap wscalc service port: https://localhost:19999/
-//gsoap wscalc service namespace: urn:calc:wscalc
-//gsoap wscalc service documentation: Calculator service
-
-//gsoap wscalc service method-documentation: add Adds two numbers
-int wscalc__add(double a, double b, struct wscalc__addResponse {
-double result; } * );
-
-//gsoap wscalc service method-documentation: sub Subtracts two numbers
-int wscalc__sub(double a, double b, struct wscalc__subResponse {
-double result; } * );
+++ /dev/null
-/*
-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 <glite_gsplugin.h>
-
-#include "GSOAP_H.h"
-#include "CalcService.nsmap"
-
-static const char *server = "http://localhost:19999/";
-
-int
-main(int argc, char **argv)
-{
- struct soap soap;
- double a, b, result;
- int ret;
- struct wscalc__addResponse addresult;
- struct wscalc__subResponse subresult;
-
-
- if (argc < 4) {
- fprintf(stderr, "Usage: [add|sub] num num\n");
- exit(1);
- }
-
- soap_init(&soap);
- soap_set_namespaces(&soap, namespaces);
- soap_register_plugin(&soap, glite_gsplugin);
-
- a = strtod(argv[2], NULL);
- b = strtod(argv[3], NULL);
- switch ( *argv[1] ) {
- case 'a':
- ret = soap_call_wscalc__add(&soap, server, "", a, b, &addresult);
- result = addresult.result;
- break;
- case 's':
- ret = soap_call_wscalc__sub(&soap, server, "", a, b, &subresult);
- result = subresult.result;
- break;
- default:
- fprintf(stderr, "Unknown command\n");
- exit(2);
- }
-
- if ( ret ) {
- fprintf(stderr, "NECO JE V ****\n\n");
- fprintf(stderr, "plugin err: %s", glite_gsplugin_errdesc(&soap));
- soap_print_fault(&soap, stderr);
- }
- else printf("result = %g\n", result);
-
-
- return 0;
-}
+++ /dev/null
-/*
-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 <stdio.h>
-#include <getopt.h>
-#include <stdsoap2.h>
-#include <glite_gsplugin.h>
-
-#include "GSOAP_H.h"
-#include "CalcService.nsmap"
-
-
-static struct option long_options[] = {
- { "cert", required_argument, NULL, 'c' },
- { "key", required_argument, NULL, 'k' },
- { NULL, 0, NULL, 0 }
-};
-
-void
-usage(const char *me)
-{
- fprintf(stderr,
- "usage: %s [option]\n"
- "\t-c, --cred\t certificate file\n"
- "\t-k, --key\t private key file\n", me);
-}
-
-
-int
-main(int argc, char **argv)
-{
- struct soap soap;
- glite_gsplugin_Context ctx = NULL;
- char *name;
- char *cert, *key;
- int opt;
-
- cert = key = NULL;
- name = strrchr(argv[0],'/');
- if ( name ) name++; else name = argv[0];
-
- while ((opt = getopt_long(argc, argv, "c:k:", long_options, NULL)) != EOF) {
- switch (opt) {
- case 'c': cert = optarg; break;
- case 'k': key = optarg; break;
- case '?':
- default : usage(name); exit(1);
- }
- }
-
- soap_init(&soap);
- soap_set_namespaces(&soap, namespaces);
-
- if ( soap_register_plugin_arg(&soap, glite_gsplugin, NULL) ) {
- fprintf(stderr, "Can't register plugin\n");
- exit(1);
- }
-
- if ( cert || key ) {
- ctx = glite_gsplugin_get_context(&soap);
- if (ctx == NULL) {
- fprintf(stderr, "Can't get context\n");
- exit(1);
- }
-
- if (glite_gsplugin_set_credential(ctx, cert, key) != 0) {
- fprintf(stderr, "Can't set credentials: %s\n",
- glite_gsplugin_errdesc(&soap));
- exit(1);
- }
- }
-
- if ( soap_bind(&soap, NULL, 19999, 100) < 0 ) {
- soap_print_fault(&soap, stderr);
- exit(1);
- }
-
- while ( 1 ) {
- printf("accepting connection\n");
- if ( soap_accept(&soap) < 0 ) {
- fprintf(stderr, "soap_accept() failed!!!\n");
- soap_print_fault(&soap, stderr);
- fprintf(stderr, "plugin err: %s\n", glite_gsplugin_errdesc(&soap));
- continue;
- }
-
- printf("serving connection\n");
- if ( soap_serve(&soap) ) {
- soap_print_fault(&soap, stderr);
- fprintf(stderr, "plugin err: %s", glite_gsplugin_errdesc(&soap));
- }
-
- soap_destroy(&soap); /* clean up class instances */
- soap_end(&soap); /* clean up everything and close socket */
- }
- soap_done(&soap); /* close master socket */
-
- if ( ctx ) glite_gsplugin_free_context(ctx);
-
- return 0;
-}
-
-int wscalc__add(struct soap *soap, double a, double b, struct wscalc__addResponse *result)
-{
- result->result = a + b;
- return SOAP_OK;
-}
-
-int wscalc__sub(struct soap *soap, double a, double b, struct wscalc__subResponse *result)
-{
- result->result = a - b;
- return SOAP_OK;
-}
+++ /dev/null
-/*
-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 <stdio.h>
-#include <getopt.h>
-#include <stdsoap2.h>
-#include <glite_gsplugin.h>
-#include <glite_gsplugin-int.h>
-
-#include "GSOAP_H.h"
-#include "CalcService.nsmap"
-
-
-static struct option long_options[] = {
- { "cert", required_argument, NULL, 'c' },
- { "key", required_argument, NULL, 'k' },
- { "port", required_argument, NULL, 'p' },
- { NULL, 0, NULL, 0 }
-};
-
-void
-usage(const char *me)
-{
- fprintf(stderr,
- "usage: %s [option]\n"
- "\t-p, --port\t listening port\n"
- "\t-c, --cred\t certificate file\n"
- "\t-k, --key\t private key file\n", me);
-}
-
-
-int
-main(int argc, char **argv)
-{
- struct soap soap;
- edg_wll_GssStatus gss_code;
- edg_wll_GssCred cred = NULL;
- edg_wll_GssConnection connection;
- glite_gsplugin_Context ctx;
- struct sockaddr_storage a;
- socklen_t alen;
- char *name, *msg;
- int opt,
- port = 19999;
- char *cert_filename = NULL, *key_filename = NULL;
- int sock;
- struct addrinfo hints;
- struct addrinfo *res;
- char *portname;
- int error;
-
- name = strrchr(argv[0],'/');
- if ( name ) name++; else name = argv[0];
-
- if ( glite_gsplugin_init_context(&ctx) ) { perror("init context"); exit(1); }
-
- while ((opt = getopt_long(argc, argv, "c:k:p:", long_options, NULL)) != EOF) {
- switch (opt) {
- case 'p': port = atoi(optarg); break;
- case 'c': cert_filename = strdup(optarg); break;
- case 'k': key_filename = strdup(optarg); break;
- case '?':
- default : usage(name); exit(1);
- }
- }
-
- if ( edg_wll_gss_acquire_cred_gsi(cert_filename, key_filename, &cred, &gss_code) ) {
- edg_wll_gss_get_error(&gss_code, "Failed to read credential", &msg);
- fprintf(stderr, "%s\n", msg);
- free(msg);
- exit(1);
- }
- if (cred->name) {
- printf("server running with certificate: %s\n", cred->name);
- }
-
- glite_gsplugin_use_credential(ctx, cred);
-
- soap_init(&soap);
- soap_set_namespaces(&soap, namespaces);
-
- if ( soap_register_plugin_arg(&soap, glite_gsplugin, ctx) ) {
- fprintf(stderr, "Can't register plugin\n");
- exit(1);
- }
-
- asprintf(&portname, "%d", port);
- memset(&hints, 0, sizeof(hints));
- hints.ai_family = PF_UNSPEC;
- hints.ai_flags = AI_PASSIVE;
- hints.ai_socktype = SOCK_STREAM;
- error = getaddrinfo(NULL, portname , &hints, &res);
- if (error) {
- perror(gai_strerror(error));
- exit(1);
- }
- alen = res->ai_addrlen;
- if ( (sock = socket(res->ai_family, res->ai_socktype, res->ai_protocol)) < 0 )
- { perror("socket()"); exit(1); }
- if ( bind(sock, res->ai_addr, res->ai_addrlen) ) { perror("bind()"); exit(1); }
- freeaddrinfo(res);
- if ( listen(sock, 100) ) { perror("listen()"); exit(1); }
-
- bzero((char *) &a, alen);
-
- while ( 1 ) {
- int conn;
-
- printf("accepting connection\n");
- if ( (conn = accept(sock, (struct sockaddr *) &a, &alen)) < 0 ) {
- close(sock);
- perror("accept");
- exit(1);
- }
- if ( edg_wll_gss_accept(cred,conn,ctx->timeout,&connection,&gss_code) ){
- edg_wll_gss_get_error(&gss_code, "Failed to read credential", &msg);
- fprintf(stderr, "%s\n", msg);
- free(msg);
- exit(1);
- }
-
- glite_gsplugin_set_connection(ctx, &connection);
-
- printf("serving connection\n");
- if ( soap_serve(&soap) ) {
- soap_print_fault(&soap, stderr);
- fprintf(stderr, "plugin err: %s", glite_gsplugin_errdesc(&soap));
- }
-
- soap_destroy(&soap); /* clean up class instances */
- soap_end(&soap); /* clean up everything and close socket */
- edg_wll_gss_close(&connection, NULL);
- }
-
- soap_done(&soap); /* close master socket */
-
- glite_gsplugin_free_context(ctx);
- edg_wll_gss_release_cred(&cred, NULL);
-
- return 0;
-}
-
-int wscalc__add(struct soap *soap, double a, double b, struct wscalc__addResponse *result)
-{
- result->result = a + b;
- return SOAP_OK;
-}
-
-int wscalc__sub(struct soap *soap, double a, double b, struct wscalc__subResponse *result)
-{
- result->result = a - b;
- return SOAP_OK;
-}
+++ /dev/null
-/*
-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.
-*/
-
-#ifndef GLITE_SECURITY_GSCOMPAT_H
-#define GLITE_SECURITY_GSCOMPAT_H
-
-#ident "$Header: "
-
-/*
- * for basic sanity check
- *
- * size of the soap structure can differs with compilation flags
- * or with C/C++ compilers
- */
-#define GSOAP_SIZEOF_STRUCT_SOAP @sizeof_struct_soap@
-
-#ifndef GSOAP_VERSION
- #error GSOAP_VERSION required
-#endif
-
-#ifndef GSOAP_VERSION_LETTER
-#define GSOAP_VERSION_LETTER '\0'
-#endif
-
-#if GSOAP_VERSION >= 20709 || GSOAP_VERSION == 20706 && GSOAP_VERSION_LETTER >= 'd'
- #define GLITE_SECURITY_GSOAP_CHOICE_GET(CHOICE, ITEM, TYPENAME, TYPENO) ((CHOICE)->union_##TYPENAME.ITEM)
- #define GLITE_SECURITY_GSOAP_CHOICE_SETTYPE(CHOICE, ITEM, NS, TYPENAME, TYPENO) ((CHOICE)->__union_##TYPENAME) = SOAP_UNION__##NS##__union_##TYPENAME##_##ITEM
- #define GLITE_SECURITY_GSOAP_CHOICE_ISTYPE(CHOICE, ITEM, NS, TYPENAME, TYPENO) (((CHOICE)->__union_##TYPENAME) == SOAP_UNION__##NS##__union_##TYPENAME##_##ITEM)
- /** 2.7.10 requires created dummy choice with type == 0 for empty optional choice */
- #if GSOAP_VERSION >= 20710
- #define GLITE_SECURITY_GSOAP_CHOICE_SETNULL(CHOICE, TYPENAME) ((CHOICE)->__union_##TYPENAME) = 0
- #endif
-#elif GSOAP_VERSION >= 20706
- #define GLITE_SECURITY_GSOAP_CHOICE_GET(CHOICE, ITEM, TYPENAME, TYPENO) ((CHOICE)->union_##TYPENO.ITEM)
- #define GLITE_SECURITY_GSOAP_CHOICE_SETTYPE(CHOICE, ITEM, NS, TYPENAME, TYPENO) ((CHOICE)->__union_##TYPENO) = SOAP_UNION_##NS##__union_##TYPENO##_##ITEM
- #define GLITE_SECURITY_GSOAP_CHOICE_ISTYPE(CHOICE, ITEM, NS, TYPENAME, TYPENO) (((CHOICE)->__union_##TYPENO) == SOAP_UNION_##NS##__union_##TYPENO##_##ITEM)
-#else
- #define GLITE_SECURITY_GSOAP_CHOICE_GET(CHOICE, ITEM, TYPENAME, TYPENO) ((CHOICE)->ITEM)
- #define GLITE_SECURITY_GSOAP_CHOICE_SETTYPE(CHOICE, ITEM, NS, TYPENAME, TYPENO)
- #define GLITE_SECURITY_GSOAP_CHOICE_ISTYPE(CHOICE, ITEM, NS, TYPENAME, TYPENO) (((CHOICE)->ITEM) != NULL)
-#endif
-#define GLITE_SECURITY_GSOAP_CHOICE_SET(CHOICE, ITEM, NS, TYPENAME, TYPENO, VALUE) do { \
- memset((CHOICE), 0, sizeof(*(CHOICE))); \
- GLITE_SECURITY_GSOAP_CHOICE_SETTYPE(CHOICE, ITEM, NS, TYPENAME, TYPENO); \
- GLITE_SECURITY_GSOAP_CHOICE_GET(CHOICE, ITEM, TYPENAME, TYPENO) = (VALUE); \
-} while(0)
-
-#if GSOAP_VERSION >= 20706
- #define GLITE_SECURITY_GSOAP_REASON2(SOAP) ((SOAP)->fault->SOAP_ENV__Reason ? (SOAP)->fault->SOAP_ENV__Reason->SOAP_ENV__Text : "(no reason)")
- #define GLITE_SECURITY_GSOAP_TRUE xsd__boolean__true_
- #define GLITE_SECURITY_GSOAP_FALSE xsd__boolean__false_
-#else
- #define GLITE_SECURITY_GSOAP_REASON2(SOAP) ((SOAP)->fault->SOAP_ENV__Reason)
- #define GLITE_SECURITY_GSOAP_TRUE true_
- #define GLITE_SECURITY_GSOAP_FALSE false_
-#endif
-
-#define GLITE_SECURITY_GSOAP_DETAIL(SOAP) ((SOAP)->version == 2 ? (SOAP)->fault->SOAP_ENV__Detail : (SOAP)->fault->detail)
-#define GLITE_SECURITY_GSOAP_REASON(SOAP) ((SOAP)->version == 2 ? GLITE_SECURITY_GSOAP_REASON2((SOAP)) : (SOAP)->fault->faultstring)
-
-#if GSOAP_VERSION >= 20709
- #define GLITE_SECURITY_GSOAP_LIST_CREATE0(SOAP, LIST, SIZE, TYPE, N) do { \
- if ((N) != 0) (LIST) = soap_malloc((SOAP), (N) * sizeof(TYPE)); \
- else (LIST) = NULL; \
- (SIZE) = (N); \
-} while (0)
- #define GLITE_SECURITY_GSOAP_LIST_DESTROY0(SOAP, LIST, SIZE) do { \
- if ((LIST) && (SIZE) != 0) soap_dealloc((SOAP), (LIST)); \
- (LIST) = NULL; \
-} while (0)
- #define GLITE_SECURITY_GSOAP_LIST_GET(LIST, INDEX) (&(LIST)[INDEX])
- #define GLITE_SECURITY_GSOAP_LIST_TYPE(NS, LIST) struct NS##__##LIST *
-#else
- #define GLITE_SECURITY_GSOAP_LIST_CREATE0(SOAP, LIST, SIZE, TYPE, N) do { \
- int ilist; \
- \
- if ((N) != 0) (LIST) = soap_malloc((SOAP), (N) * sizeof(void *)); \
- else (LIST) = NULL; \
- (SIZE) = (N); \
- for (ilist = 0; ilist < (N); ilist++) { \
- (LIST)[ilist] = soap_malloc((SOAP), sizeof(TYPE)); \
- } \
-} while (0)
- #define GLITE_SECURITY_GSOAP_LIST_DESTROY0(SOAP, LIST, SIZE) do { \
- int ilist; \
- \
- for (ilist = 0; ilist < (SIZE); ilist++) soap_dealloc((SOAP), (LIST)[ilist]); \
- if ((LIST) && (SIZE) != 0) soap_dealloc((SOAP), (LIST)); \
- (LIST) = NULL; \
-} while (0)
- #define GLITE_SECURITY_GSOAP_LIST_GET(LIST, INDEX) ((LIST)[INDEX])
- #define GLITE_SECURITY_GSOAP_LIST_TYPE(NS, LIST) struct NS##__##LIST **
-#endif
-#define GLITE_SECURITY_GSOAP_LIST_CREATE(SOAP, CONTAINER, LIST, TYPE, N) GLITE_SECURITY_GSOAP_LIST_CREATE0(SOAP, (CONTAINER)->LIST, (CONTAINER)->__size##LIST, TYPE, N)
-#define GLITE_SECURITY_GSOAP_LIST_DESTROY(SOAP, CONTAINER, LIST) GLITE_SECURITY_GSOAP_LIST_DESTROY0(SOAP, (CONTAINER)->LIST, (CONTAINER)->__size##LIST)
-
-#if GSOAP_VERSION >= 20710
- #define GLITE_SECURITY_GSOAP_SET_FIXED(soap,attr,value) \
- (attr) = soap_strdup((soap),(value))
-#else
-/* XXX unsupported */
- #define GLITE_SECURITY_GSOAP_SET_FIXED(soap,attr,value)
-#endif
-
-#endif
+++ /dev/null
-/*
-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.
-*/
-
-#ifndef GLITE_SECURITY_GSOAP_PLUGIN_INTERNAL_H
-#define GLITE_SECURITY_GSOAP_PLUGIN_INTERNAL_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "glite/security/glite_gss.h"
-
-struct _glite_gsplugin_ctx {
- struct timeval _timeout, *timeout;
-
- char *error_msg;
-
- edg_wll_GssConnection *connection;
- edg_wll_GssCred cred;
- int internal_connection;
- int internal_credentials;
-
- void *user_data;
-};
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
+++ /dev/null
-/*
-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.
-*/
-
-#ifndef GLITE_SECURITY_GSOAP_PLUGIN_H
-#define GLITE_SECURITY_GSOAP_PLUGIN_H
-
-#include <stdsoap2.h>
-
-#include "glite/security/glite_gss.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define PLUGIN_ID "GLITE_GSOAP_PLUGIN"
-
-typedef struct _glite_gsplugin_ctx *glite_gsplugin_Context;
-
-extern int glite_gsplugin_init_context(glite_gsplugin_Context *);
-extern int glite_gsplugin_free_context(glite_gsplugin_Context);
-extern glite_gsplugin_Context glite_gsplugin_get_context(struct soap *);
-extern void *glite_gsplugin_get_udata(struct soap *);
-extern void glite_gsplugin_set_udata(struct soap *, void *);
-
-extern void glite_gsplugin_set_timeout(glite_gsplugin_Context, struct timeval const *);
-extern int glite_gsplugin_set_credential(glite_gsplugin_Context, const char *, const char *);
-extern void glite_gsplugin_use_credential(glite_gsplugin_Context, edg_wll_GssCred);
-extern int glite_gsplugin_set_connection(glite_gsplugin_Context, edg_wll_GssConnection *);
-
-extern int glite_gsplugin(struct soap *, struct soap_plugin *, void *);
-extern char *glite_gsplugin_errdesc(struct soap *);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GLITE_SECURITY_GSOAP_PLUGIN_H */
+++ /dev/null
-/sbin/ldconfig
+++ /dev/null
-/sbin/ldconfig
+++ /dev/null
-1.5.3-1
-- avoid memleak in gsoap
-- fix #32059
-- support gsoap 2.7.10
-
-1.5.4-1
-- handle client connection errors in gsoap (generate faults)
-- don't define gsoap.platformName in configuration confusingly
-
-1.5.4-2
-- disctinct c and c++ builds (concerns gsoap 2.7.10 only)
-
-2.0.0-1
-- LB 2.0 release
-
-2.0.0-2
-- configure script update (globus flavors added to configure call)
-
-2.0.1-1
-- API reverted towards backward compatibility
-
-2.0.1-2
-- Module repacked
-
-2.0.1-3
-- install libraries into $libdir
-
-2.0.2-1
-- Updated Makefile & Configure script
-
-2.1.0-1
-- IPv6 fixes
-- Fixed error reporting
-- Attempt to fix compatibility with gsoap 2.7.10
-- Improved portability
-
-2.1.1-1
-- libtool version numbering reintroduced
-
-2.1.2-1
-- Fixed target 'clean' in the Makefile to handle debian builds
-
-2.1.2-2
-- Module rebuilt
-
-2.1.3-1
-- Module renamed
-- Makefile a configuration updated to work across org.glite & EMI
-
-2.1.3-2
-- Module rebuilt
-
-2.1.4-1
-- Threaded gsoap-plugin linked with gsoap, too.
-
-3.0.0-1
-- Version numbering fixed
-
-3.0.0-2
-- Module rebuilt
-
-3.0.1-1
-- Root directory option (ETICS performs own files relocation)
-- Prefix option as prefix inside stage
-- Sysconfdir option (for /etc vs /usr)
-- DESTDIR in makefiles
-
-3.0.1-2
-- Module rebuilt
-
-3.0.2-1
-
-- Relocatable build directory.
-- Fix compiler flags mismatch for modules compiled with system gsoap library.
-- Sanity check of gsoap structure size (gsoap-plugin vs ws-test module).
-- Link C++ flavoured gsoap-plugin with -lgsoap++ (problem on 32bit platforms).
-- Runtime dependency of gsoap-plugin on system's gsoap.
-- Proper flavor of the objects for the EPEL meal (threaded globus).
-
-3.0.2-2
-- Module rebuilt
-
-3.0.2-3
-- Module rebuilt
-
-3.0.2-4
-- Module rebuilt
-
-3.0.2-5
-- Module rebuilt
-
-3.0.2-6
-- Module rebuilt
-
-3.0.2-7
-- Module rebuilt
-
-3.0.2-8
-- Module rebuilt
-
-3.1.0-1
-- Preparation for a new multiplatform release
-- Build fixes
-
-3.1.1-1
-- Code reduction -- compile only one gsoap-plugin library linked with system gsoap
-- pkg-config files added
-
-3.1.1-2
-- Module rebuilt
-
-3.1.2-1
-- Compile-time warning fixes
-
-3.1.2-2
-- Module rebuilt
-
+++ /dev/null
-Source: glite-lbjp-common-gsoap-plugin
-Priority: extra
-Maintainer: @MAINTAINER@
-Uploaders: @UPLOADERS@
-Build-Depends: debhelper (>= 7.0.50~), chrpath, libc-ares-dev, libcppunit-dev, libglite-lbjp-common-gss-dev, libglobus-gssapi-gsi-dev, gsoap, libtool
-Standards-Version: 3.9.1
-Section: libs
-Homepage: @URL@
-DM-Upload-Allowed: yes
-@DEBIAN_VCS@
-
-Package: libglite-lbjp-common-gsoap-plugin
-Section: libs
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: @SUMMARY@
-@DEBIAN_DESCRIPTION@
-
-Package: libglite-lbjp-common-gsoap-plugin-dev
-Section: libdevel
-Architecture: any
-Provides: glite-lbjp-common-gsoap-plugin, glite-security-gsoap-plugin
-Depends: libglite-lbjp-common-gsoap-plugin (= ${binary:Version}), ${misc:Depends}
-Description: Development files for gLite gsoap-plugin
- This package contains development libraries and header files for gLite
- gsoap-plugin.
-
-Package: glite-lbjp-common-gsoap-plugin-dbg
-Section: debug
-Architecture: any
-Priority: extra
-Depends: libglite-lbjp-common-gsoap-plugin (= ${binary:Version}), ${misc:Depends}
-Description: gLite gsoap-plugin library debugging symbols
- This package contains debugging symbols for gLite gsoap-plugin library.
+++ /dev/null
-This work was packaged for Debian by:
-
- @MAINTAINER@ on Thu, 08 Dec 2011 00:46:07 +0100
-
-It was downloaded from:
-
- @URL@
-
-Upstream Author(s):
-
- @MAINTAINER@
-
-Copyright:
-
- <Copyright (C) 2004-2011 Members of the EGEE Collaboration>
-
-License:
-
- 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.
-
-On Debian systems, the complete text of the Apache version 2.0 license
-can be found in "/usr/share/common-licenses/Apache-2.0".
-
-The Debian packaging is:
-
- Copyright (C) 2004-2011 Members of the EGEE Collaboration
-
-and is licensed under the Apache License, Version 2.0.
+++ /dev/null
-usr/include/glite/security
-usr/lib
-usr/lib/pkgconfig
\ No newline at end of file
+++ /dev/null
-usr/include/glite/security/*.h
-usr/lib/lib*.so
-usr/lib/pkgconfig/*.pc
+++ /dev/null
-usr/lib/lib*.so.*
+++ /dev/null
-#!/usr/bin/make -f
-# -*- makefile -*-
-
--include /usr/share/dpkg/buildflags.mk
-
-# Uncomment this to turn on verbose mode.
-export DH_VERBOSE=1
-
-configure: configure-stamp
-configure-stamp:
- dh_testdir
- /usr/bin/perl ./configure --thrflavour= --nothrflavour= --root=/ --prefix=/usr --libdir=lib --project=emi --module lbjp-common.gsoap-plugin
- touch $@
-
-build: build-arch build-indep
-
-build-arch build-indep: build-stamp
-
-build-stamp: configure-stamp
- dh_testdir
- CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE)
- CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) check
- touch $@
-
-clean: configure-stamp
- dh_testdir
- dh_testroot
- rm -f configure-stamp build-stamp
- $(MAKE) clean
- rm -f Makefile.inc config.status
- dh_clean
-
-install: build-stamp
- dh_testdir
- dh_testroot
- dh_prep
- dh_installdirs
- $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
- rm -rvf $(CURDIR)/debian/tmp/usr/share
- rm -vf $(CURDIR)/debian/tmp/usr/lib/*.la
- rm -vf $(CURDIR)/debian/tmp/usr/lib/*.a
- find $(CURDIR)/debian/tmp -name '*' -print | xargs -I {} -i bash -c "chrpath -d {} > /dev/null 2>&1" || echo 'Stripped RPATH'
-
-binary-indep:
-
-binary-arch: install
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_installexamples
- dh_installman
- dh_installlogrotate
- dh_installcron
- dh_install --fail-missing
- dh_link
- dh_strip --dbg-package=glite-lbjp-common-gsoap-plugin-dbg
- dh_compress
- dh_fixperms
- dh_makeshlibs
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-arch binary-indep
+++ /dev/null
-Summary: @SUMMARY@
-Name: glite-lbjp-common-gsoap-plugin
-Version: @MAJOR@.@MINOR@.@REVISION@
-Release: @AGE@%{?dist}
-Url: @URL@
-License: ASL 2.0
-Vendor: EMI
-Group: System Environment/Libraries
-BuildRequires: c-ares-devel
-BuildRequires: cppunit-devel
-BuildRequires: chrpath
-BuildRequires: globus-gssapi-gsi-devel
-BuildRequires: gsoap
-BuildRequires: gsoap-devel
-BuildRequires: glite-lbjp-common-gss-devel
-BuildRequires: libtool
-BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
-Obsoletes: glite-security-gsoap-plugin%{?_isa} < 2.0.1-1
-AutoReqProv: yes
-Source: http://eticssoft.web.cern.ch/eticssoft/repository/emi/emi.lbjp-common.gsoap-plugin/%{version}/src/%{name}-@VERSION@.src.tar.gz
-
-
-%description
-@DESCRIPTION@
-
-
-%package devel
-Summary: Development files for gLite gsoap-plugin
-Group: Development/Libraries
-Requires: %{name}%{?_isa} = %{version}-%{release}
-Requires: glite-lbjp-common-gss-devel
-Provides: glite-security-gsoap-plugin%{?_isa} = %{version}-%{release}
-Obsoletes: glite-security-gsoap-plugin%{?_isa} < 2.0.1-1
-
-
-%description devel
-This package contains development libraries and header files for gLite
-gsoap-plugin.
-
-
-%prep
-%setup -q
-
-
-%build
-/usr/bin/perl ./configure --thrflavour= --nothrflavour= --root=/ --prefix=/usr --libdir=%{_lib} --project=emi --module lbjp-common.gsoap-plugin
-make
-
-
-%check
-make check
-
-
-%install
-rm -rf $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
-find $RPM_BUILD_ROOT -name '*.la' -exec rm -rf {} \;
-find $RPM_BUILD_ROOT -name '*.a' -exec rm -rf {} \;
-find $RPM_BUILD_ROOT -name '*' -print | xargs -I {} -i bash -c "chrpath -d {} > /dev/null 2>&1" || echo 'Stripped RPATH'
-
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
-%post -p /sbin/ldconfig
-
-
-%postun -p /sbin/ldconfig
-
-
-%files
-%defattr(-,root,root)
-%dir /usr/share/doc/gsoap-plugin-%{version}
-%doc /usr/share/doc/gsoap-plugin-%{version}/LICENSE
-/usr/%{_lib}/libglite_security_gsoap_plugin_*.so.9.@MINOR@.@REVISION@
-/usr/%{_lib}/libglite_security_gsoap_plugin_*.so.9
-
-
-%files devel
-%defattr(-,root,root)
-%dir /usr/include/glite
-%dir /usr/include/glite/security
-/usr/include/glite/security/glite_gscompat.h
-/usr/include/glite/security/glite_gsplugin.h
-/usr/include/glite/security/glite_gsplugin-int.h
-/usr/%{_lib}/libglite_security_gsoap_plugin_*.so
-/usr/%{_lib}/pkgconfig/*.pc
-
-
-%changelog
-* @SPEC_DATE@ @MAINTAINER@ - @MAJOR@.@MINOR@.@REVISION@-@AGE@%{?dist}
-- automatically generated package
+++ /dev/null
-prefix=/usr
-exec_prefix=${prefix}
-libdir=/usr/@LIBDIR@
-includedir=${prefix}/include
-
-Name: gLite security gSoap plugin
-Description: Plugin for gSoap to use glite-security-gss as the communication layer
-Version: @VERSION@
-Requires: gsoap++
-Libs: -L${libdir} -lglite_security_gsoap_plugin_@LIB_SUFFIX@_cxx -lglite_security_gss
-Cflags: -I${includedir}
+++ /dev/null
-prefix=/usr
-exec_prefix=${prefix}
-libdir=/usr/@LIBDIR@
-includedir=${prefix}/include
-
-Name: gLite security gSoap plugin
-Description: Plugin for gSoap to use glite-security-gss as the communication layer
-Version: @VERSION@
-Requires: gsoap
-Libs: -L${libdir} -lglite_security_gsoap_plugin_@LIB_SUFFIX@_c -lglite_security_gss
-Cflags: -I${includedir}
+++ /dev/null
-glite-security-gsoap-plugin is plugin for gSoap providing secured communication via GSS, as well as strict timing control of all operations via glite-security-gss.
+++ /dev/null
-Plugin for gSoap to use glite-security-gss as the communication layer
+++ /dev/null
-# $Header$
-module.version=3.1.2
-module.age=2
+++ /dev/null
-/*
-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 <sys/select.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <stdio.h>
-#include <assert.h>
-#include <signal.h>
-#include <stdsoap2.h>
-
-#include "soap_version.h"
-#include "glite_gsplugin-int.h"
-#include "glite_gsplugin.h"
-
-#ifdef GSPLUGIN_DEBUG
-# define pdprintf(s) printf s
-#else
-# define pdprintf(s)
-#endif
-
-typedef struct _int_plugin_data_t {
- glite_gsplugin_Context ctx; /**< data used for connection etc. */
- int def; /**< is the context created by plugin? */
-} int_plugin_data_t;
-
-static const char plugin_id[] = PLUGIN_ID;
-
-static void glite_gsplugin_delete(struct soap *, struct soap_plugin *);
-static int glite_gsplugin_copy(struct soap *, struct soap_plugin *, struct soap_plugin *);
-
-static size_t glite_gsplugin_recv(struct soap *, char *, size_t);
-static int glite_gsplugin_send(struct soap *, const char *, size_t);
-static int glite_gsplugin_connect(struct soap *, const char *, const char *, int);
-static int glite_gsplugin_close(struct soap *);
-#if GSOAP_VERSION >= 20700
-static int glite_gsplugin_poll(struct soap *);
-#endif
-static int glite_gsplugin_accept(struct soap *, int, struct sockaddr *, int *);
-static int glite_gsplugin_posthdr(struct soap *soap, const char *key, const char *val);
-
-static int get_error(int err, edg_wll_GssStatus *gss_stat, const char *msg, char **desc);
-
-int
-glite_gsplugin_init_context(glite_gsplugin_Context *ctx)
-{
- glite_gsplugin_Context out = (glite_gsplugin_Context) malloc(sizeof(*out));
- if (!out) return ENOMEM;
-
- memset(out, 0, sizeof(*out));
- out->cred = NULL;
-
- /* XXX: some troubles with glite_gss and blocking calls!
- out->timeout.tv_sec = 10000;
- */
-
- out->timeout = NULL;
- *ctx = out;
-
- return 0;
-}
-
-int
-glite_gsplugin_free_context(glite_gsplugin_Context ctx)
-{
- if (ctx == NULL)
- return 0;
-
- if ( ctx->internal_credentials && ctx->cred != NULL )
- edg_wll_gss_release_cred(&ctx->cred, NULL);
- if ( ctx->internal_connection && ctx->connection ) {
- if ( ctx->connection->context != NULL )
- edg_wll_gss_close(ctx->connection, NULL);
- free(ctx->connection);
- }
- if (ctx->error_msg)
- free(ctx->error_msg);
- free(ctx);
-
- return 0;
-}
-
-glite_gsplugin_Context
-glite_gsplugin_get_context(struct soap *soap)
-{
- return ((int_plugin_data_t *)soap_lookup_plugin(soap, plugin_id))->ctx;
-}
-
-void *
-glite_gsplugin_get_udata(struct soap *soap)
-{
- int_plugin_data_t *pdata;
-
- pdata = (int_plugin_data_t *)soap_lookup_plugin(soap, plugin_id);
- assert(pdata);
- return pdata->ctx->user_data;
-}
-
-void
-glite_gsplugin_set_udata(struct soap *soap, void *d)
-{
- int_plugin_data_t *pdata;
-
- pdata = (int_plugin_data_t *)soap_lookup_plugin(soap, plugin_id);
- assert(pdata);
- pdata->ctx->user_data = d;
-}
-
-void glite_gsplugin_set_timeout(glite_gsplugin_Context ctx, struct timeval const *to)
-{
- if (to) {
- ctx->_timeout = *to;
- ctx->timeout = &ctx->_timeout;
- }
- else ctx->timeout = NULL;
-}
-
-int
-glite_gsplugin_set_credential(glite_gsplugin_Context ctx,
- const char *cert,
- const char *key)
-{
- edg_wll_GssStatus gss_code;
- edg_wll_GssCred cred = NULL;
-
- int ret;
-
- ret = edg_wll_gss_acquire_cred_gsi((char *)cert, (char *)key, &cred, &gss_code);
- if (ret)
- return get_error(ret, &gss_code, "failed to load GSI credentials", &ctx->error_msg);
-
- if (ctx->internal_credentials && ctx->cred != NULL)
- edg_wll_gss_release_cred(&ctx->cred, NULL);
-
- ctx->cred = cred;
- ctx->internal_credentials = 1;
-
- return 0;
-}
-
-void
-glite_gsplugin_use_credential(glite_gsplugin_Context ctx,
- edg_wll_GssCred cred)
-{
- ctx->cred = cred;
- ctx->internal_credentials = 0;
-}
-
-int
-glite_gsplugin_set_connection(glite_gsplugin_Context ctx, edg_wll_GssConnection *conn)
-{
- int ret = SOAP_OK;
-
- if ( ctx->connection ) {
- if ( ctx->internal_connection && ctx->connection->context != NULL) {
- pdprintf(("GSLITE_GSPLUGIN: closing gss connection\n"));
- ret = edg_wll_gss_close(ctx->connection, ctx->timeout);
- free(ctx->connection);
- }
- }
- ctx->connection = conn;
- ctx->internal_connection = 0;
-
- return ret;
-}
-
-int
-glite_gsplugin(struct soap *soap, struct soap_plugin *p, void *arg)
-{
- int_plugin_data_t *pdata = (int_plugin_data_t *)malloc(sizeof(int_plugin_data_t));
-
- pdprintf(("GSLITE_GSPLUGIN: initializing gSOAP plugin\n"));
- if ( !pdata ) return ENOMEM;
- if ( arg ) {
- pdprintf(("GSLITE_GSPLUGIN: Context is given\n"));
- pdata->ctx = (glite_gsplugin_Context)arg;
- pdata->def = 0;
- }
- else {
- edg_wll_GssStatus gss_code;
-
- pdprintf(("GSLITE_GSPLUGIN: Creating default context\n"));
- if ( glite_gsplugin_init_context((glite_gsplugin_Context*)&(pdata->ctx)) ) {
- free(pdata);
- return ENOMEM;
- }
- if ( edg_wll_gss_acquire_cred_gsi(NULL, NULL, &pdata->ctx->cred, &gss_code) ) {
- /* XXX: Let user know, that cred. load failed. Somehow...
- */
- glite_gsplugin_free_context(pdata->ctx);
- return EINVAL;
- }
- pdata->ctx->internal_credentials = 1;
- pdprintf(("GSLITE_GSPLUGIN: server running with certificate: %s\n",
- pdata->ctx->cred->name));
- pdata->def = 1;
- }
-
- p->id = plugin_id;
- p->data = pdata;
- p->fdelete = glite_gsplugin_delete;
- p->fcopy = glite_gsplugin_copy;
-
- soap->fopen = glite_gsplugin_connect;
- soap->fconnect = NULL;
- soap->fclose = glite_gsplugin_close;
-#if GSOAP_VERSION >= 20700
- soap->fpoll = glite_gsplugin_poll;
-#endif
- soap->faccept = glite_gsplugin_accept;
- soap->fsend = glite_gsplugin_send;
- soap->frecv = glite_gsplugin_recv;
- soap->fposthdr = glite_gsplugin_posthdr;
-
- return SOAP_OK;
-}
-
-
-char *glite_gsplugin_errdesc(struct soap *soap)
-{
- glite_gsplugin_Context ctx;
-
- ctx = ((int_plugin_data_t *)soap_lookup_plugin(soap, plugin_id))->ctx;
- if ( ctx ) return ctx->error_msg;
-
- return NULL;
-}
-
-
-
-static int
-glite_gsplugin_copy(struct soap *soap, struct soap_plugin *dst, struct soap_plugin *src)
-{
- pdprintf(("GSLITE_GSPLUGIN: glite_gsplugin_copy()\n"));
- /* Should be the copy code here?
- */
- return ENOSYS;
-}
-
-static void
-glite_gsplugin_delete(struct soap *soap, struct soap_plugin *p)
-{
- int_plugin_data_t *d = (int_plugin_data_t *)soap_lookup_plugin(soap, plugin_id);
-
- pdprintf(("GSLITE_GSPLUGIN: glite_gsplugin_delete()\n"));
- if ( d->def ) {
- glite_gsplugin_close(soap);
- glite_gsplugin_free_context(d->ctx);
- }
- free(d);
-}
-
-
-static int
-glite_gsplugin_connect(
- struct soap *soap,
- const char *endpoint,
- const char *host,
- int port)
-{
- glite_gsplugin_Context ctx;
- edg_wll_GssStatus gss_stat;
- int ret;
- const char *msg = NULL;
-
-
- pdprintf(("GSLITE_GSPLUGIN: glite_gsplugin_connect()\n"));
-#if defined(CHECK_GSOAP_VERSION) && GSOAP_VERSION <= 20700
- if ( GSOAP_VERSION < 20700
- || (GSOAP_VERSION == 20700
- && (strlen(GSOAP_MIN_VERSION) < 1 || GSOAP_MIN_VERSION[1] < 'e')) ) {
- fprintf(stderr, "Client connect will work only with gSOAP v2.7.0e and later");
- soap->errnum = ENOSYS;
- return ENOSYS;
- }
-#endif
-
- ctx = ((int_plugin_data_t *)soap_lookup_plugin(soap, plugin_id))->ctx;
- if (ctx->connection) {
- pdprintf(("GSLITE_GSPLUGIN: Warning: connection dropped, new to %s:%d\n", host, port));
- }
- pdprintf(("GSLITE_GSPLUGIN: connection to %s:%d will be established\n", host, port));
-
- if ( ctx->cred == NULL ) {
- pdprintf(("GSLITE_GSPLUGIN: loading default credentials\n"));
- ret = edg_wll_gss_acquire_cred_gsi(NULL, NULL,
- &ctx->cred, &gss_stat);
- if ( ret ) {
- msg = "failed to load GSI credentials";
- goto err;
- }
- ctx->internal_credentials = 1;
- }
-
- if ( !(ctx->connection = (edg_wll_GssConnection *)malloc(sizeof(*ctx->connection))) ) return errno;
- ret = edg_wll_gss_connect(ctx->cred,
- host, port,
- ctx->timeout,
- ctx->connection, &gss_stat);
- if ( ret ) {
- free(ctx->connection);
- ctx->connection = NULL;
- msg = "edg_wll_gss_connect() error";
- goto err;
- }
- ctx->internal_connection = 1;
-
- soap->errnum = 0;
- return ctx->connection->sock;
-
-err:
- pdprintf(("GSLITE_GSPLUGIN: glite_gsplugin_connect() error!\n"));
-
- soap->errnum = get_error(ret, &gss_stat, msg, &ctx->error_msg);
-
- switch ( ret ) {
- case EDG_WLL_GSS_ERROR_GSS:
- soap_set_sender_error(soap, "SSL error", "SSL authentication failed in tcp_connect(): check password, key file, and ca file.", SOAP_SSL_ERROR);
- break;
- case EDG_WLL_GSS_ERROR_HERRNO:
- soap_set_sender_error(soap, "connection error", hstrerror(soap->errnum), SOAP_CLI_FAULT);
- break;
- case EDG_WLL_GSS_ERROR_EOF:
- soap->errnum = ECONNREFUSED;
- soap_set_sender_error(soap, "connection error", strerror(soap->errnum), SOAP_CLI_FAULT);
- break;
- case EDG_WLL_GSS_ERROR_ERRNO:
- case EDG_WLL_GSS_ERROR_TIMEOUT:
- soap_set_sender_error(soap, "connection error", strerror(soap->errnum), SOAP_CLI_FAULT);
- break;
- default:
- soap_set_sender_error(soap, "unknown error", "", SOAP_CLI_FAULT);
- break;
- }
-
- return SOAP_INVALID_SOCKET;
-}
-
-/** It is called in soap_closesocket()
- *
- * return like errno value
- */
-static int
-glite_gsplugin_close(struct soap *soap)
-{
- glite_gsplugin_Context ctx;
-
- pdprintf(("GSLITE_GSPLUGIN: glite_gsplugin_close()\n"));
- ctx = ((int_plugin_data_t *)soap_lookup_plugin(soap, plugin_id))->ctx;
- return glite_gsplugin_set_connection(ctx, NULL);
-}
-
-
-static int
-glite_gsplugin_accept(struct soap *soap, int s, struct sockaddr *a, int *n)
-{
- glite_gsplugin_Context ctx;
- edg_wll_GssStatus gss_code;
- int conn;
- int ret;
-
- soap->errnum = 0;
- pdprintf(("GSLITE_GSPLUGIN: glite_gsplugin_accept()\n"));
- ctx = ((int_plugin_data_t *)soap_lookup_plugin(soap, plugin_id))->ctx;
- if ( (conn = accept(s, (struct sockaddr *)&a, (socklen_t *)n)) < 0 ) return conn;
- if ( !ctx->connection ) {
- if ( !(ctx->connection = (edg_wll_GssConnection *)malloc(sizeof(*ctx->connection))) ) {
- close(conn);
- soap_set_receiver_error(soap, "malloc error", strerror(ENOMEM), ENOMEM);
- return SOAP_INVALID_SOCKET;
- }
- ctx->internal_connection = 1;
- }
- if ( (ret = edg_wll_gss_accept(ctx->cred, conn, ctx->timeout, ctx->connection, &gss_code)) != 0) {
- pdprintf(("GSLITE_GSPLUGIN: Client authentication failed, closing.\n"));
- close(conn);
- get_error(ret, &gss_code, "Client authentication failed", &ctx->error_msg);
- soap->errnum = SOAP_SVR_FAULT;
- soap_set_receiver_error(soap, "SSL error", "SSL authentication failed in tcp_connect(): check password, key file, and ca file.", SOAP_SSL_ERROR);
- return SOAP_INVALID_SOCKET;
- }
-
- return conn;
-}
-
-static size_t
-glite_gsplugin_recv(struct soap *soap, char *buf, size_t bufsz)
-{
- glite_gsplugin_Context ctx;
- edg_wll_GssStatus gss_code;
- int len;
-
-
- ctx = ((int_plugin_data_t *)soap_lookup_plugin(soap, plugin_id))->ctx;
- if ( ctx->error_msg ) { free(ctx->error_msg); ctx->error_msg = NULL; }
-
- if ( ctx->connection->context == NULL ) {
- soap->errnum = ENOTCONN;
- /* XXX: glite_gsplugin_send() returns SOAP_EOF on errors
- */
- return 0;
- }
-
- len = edg_wll_gss_read(ctx->connection, buf, bufsz,
- ctx->timeout,
- &gss_code);
-
- switch ( len ) {
- case EDG_WLL_GSS_OK:
- break;
- case EDG_WLL_GSS_ERROR_GSS:
- case EDG_WLL_GSS_ERROR_ERRNO:
- case EDG_WLL_GSS_ERROR_TIMEOUT:
- case EDG_WLL_GSS_ERROR_EOF:
- soap->errnum = get_error(len, &gss_code, "receiving WS request", &ctx->error_msg);
- return 0;
- /* default: fallthrough */
- }
- pdprintf(("GSLITE_GSPLUGIN: glite_gsplugin_recv() = %d\n",len));
-
- return len;
-}
-
-static int
-glite_gsplugin_send(struct soap *soap, const char *buf, size_t bufsz)
-{
- glite_gsplugin_Context ctx;
- edg_wll_GssStatus gss_code;
- struct sigaction sa, osa;
- size_t total = 0;
- int ret;
-
-
- ctx = ((int_plugin_data_t *)soap_lookup_plugin(soap, plugin_id))->ctx;
- /* XXX: check whether ctx is initialized
- * i.e. ctx->connection != NULL
- */
- if ( ctx->error_msg ) { free(ctx->error_msg); ctx->error_msg = NULL; }
- if ( ctx->connection == NULL || ctx->connection->context == NULL ) {
- soap->errnum = ENOTCONN;
- return SOAP_EOF;
- }
-
- memset(&sa, 0, sizeof(sa));
- assert(sa.sa_handler == NULL);
- sa.sa_handler = SIG_IGN;
- sigaction(SIGPIPE, &sa, &osa);
-
- ret = edg_wll_gss_write_full(ctx->connection,
- (void*)buf, bufsz, ctx->timeout, &total, &gss_code);
-
- sigaction(SIGPIPE, &osa, NULL);
-
- pdprintf(("GSLITE_GSPLUGIN: glite_gsplugin_send(%d) = %d\n",bufsz,ret));
-
- soap->errnum = get_error(ret, &gss_code, "sending WS request", &ctx->error_msg);
-
- switch ( ret ) {
- case EDG_WLL_GSS_OK:
- return SOAP_OK;
-
- case EDG_WLL_GSS_ERROR_ERRNO:
- if (soap->errnum == EPIPE) soap->errnum = ENOTCONN;
- return SOAP_EOF;
-
- case EDG_WLL_GSS_ERROR_TIMEOUT:
- case EDG_WLL_GSS_ERROR_GSS:
- case EDG_WLL_GSS_ERROR_EOF:
- default:
- return SOAP_EOF;
- }
-}
-
-
-#if GSOAP_VERSION >= 20700
-static int
-glite_gsplugin_poll(struct soap *soap)
-{
- glite_gsplugin_Context ctx;
- fd_set readfds;
- struct timeval timeout = {tv_sec: 0, tv_usec: 0};
- int ret;
-
- ctx = ((int_plugin_data_t *)soap_lookup_plugin(soap, plugin_id))->ctx;
- if (!ctx->connection || !ctx->connection->context) {
- pdprintf(("GSLITE_GSPLUGIN: glite_gsplugin_poll, no connection\n"));
- return SOAP_EOF;
- }
-
- FD_ZERO(&readfds);
- FD_SET(ctx->connection->sock, &readfds);
- ret = select(ctx->connection->sock + 1, &readfds, NULL, NULL, &timeout);
- if (ret < 0) {
- pdprintf(("GSLITE_GSPLUGIN: glite_gsplugin_poll, select(%d) failed\n", ctx->connection->sock));
- return SOAP_TCP_ERROR;
- } else if (ret == 0) {
- /* has been OK but server can disconnect anytime */
- return SOAP_OK;
- } else {
- pdprintf(("GSLITE_GSPLUGIN: glite_gsplugin_poll, select(%d) = %d\n", ctx->connection->sock, ret));
- return SOAP_EOF;
- }
-}
-#endif
-
-
-static int http_send_header(struct soap *soap, const char *s) {
- const char *t;
-
- do {
- t = strchr(s, '\n'); /* disallow \n in HTTP headers */
- if (!t) t = s + strlen(s);
- if (soap_send_raw(soap, s, t - s)) return soap->error;
- s = t + 1;
- } while (*t);
-
- return SOAP_OK;
-}
-
-
-static int glite_gsplugin_posthdr(struct soap *soap, const char *key, const char *val) {
- if (key) {
- if (strcmp(key, "Status") == 0) {
- snprintf(soap->tmpbuf, sizeof(soap->tmpbuf), "HTTP/%s", soap->http_version);
- if (http_send_header(soap, soap->tmpbuf)) return soap->error;
- if (val && (soap_send_raw(soap, " ", 1) || http_send_header(soap, val)))
- return soap->error;
- } else {
- if (http_send_header(soap, key)) return soap->error;
- if (val && (soap_send_raw(soap, ": ", 2) || http_send_header(soap, val)))
- return soap->error;
- }
- }
-
- return soap_send_raw(soap, "\r\n", 2);
-}
-
-
-static int get_error(int err, edg_wll_GssStatus *gss_stat, const char *msg, char **desc) {
- int num;
- const char *s;
-
- if (desc) {
- free(*desc);
- *desc = NULL;
- }
-
- switch (err) {
- case EDG_WLL_GSS_OK:
- return 0;
- case EDG_WLL_GSS_ERROR_GSS:
- if (desc) edg_wll_gss_get_error(gss_stat, msg, desc);
- return ENOTCONN;
- case EDG_WLL_GSS_ERROR_HERRNO:
- num = h_errno;
- s = hstrerror(num);
- if (desc) {
- if (s) asprintf(desc, "%s: %s", msg, s);
- else asprintf(desc, "%s: herrno %d", msg, num);
- }
- return num;
- case EDG_WLL_GSS_ERROR_ERRNO:
- num = errno;
- break;
- case EDG_WLL_GSS_ERROR_TIMEOUT:
- num = ETIMEDOUT;
- break;
- case EDG_WLL_GSS_ERROR_EOF:
- num = ENOTCONN;
- break;
- default:
- if (desc) asprintf(desc, "%s: unknown error type %d from glite_gss", msg, err);
- return EINVAL;
- }
-
- if (desc) asprintf(desc, "%s: %s", msg, strerror(num));
- return num;
-}
+++ /dev/null
-/*
-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 <stdsoap2.h>
-
-int
-main(int argc, char **argv)
-{
- printf("%zd\n", sizeof(struct soap));
-
- return 0;
-}
+++ /dev/null
-/*
-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 <iostream>
-
-#include "stdsoap2.h"
-#include "glite_gsplugin.h"
-
-#define TEST_STR "123456789ABCDEF"
-
-int main() {
- struct soap *mydlo = NULL;
- glite_gsplugin_Context gsplugin_ctx = NULL;
- int ok1;
-
- // test 1 - stdsoap2.c compatibility
- if ((mydlo = soap_new()) == NULL) {
- std::cerr << "Couldn't create soap" << std::endl;
- return 1;
- }
- soap_set_endpoint(mydlo, TEST_STR);
- std::cout << mydlo->endpoint << std::endl;
- ok1 = strcmp(mydlo->endpoint, TEST_STR);
-
- // test 2 - glite_gsplugin.c compatibility
- //
- // not real test, just may crash in bad test case on calling
- // soap->fdelete where will be other function
- if ( glite_gsplugin_init_context(&gsplugin_ctx) ) {
- std::cerr << "Couldn't create gSOAP plugin context" << std::endl;
- goto err;
- }
- if (soap_register_plugin_arg(mydlo, glite_gsplugin, gsplugin_ctx)) {
- std::cerr << "Couldn't register gSoap plugin" << std::endl;
- goto err;
- }
-
- soap_done(mydlo);
- free(mydlo);
- glite_gsplugin_free_context(gsplugin_ctx);
- return ok1;
-
-err:
- if (gsplugin_ctx) glite_gsplugin_free_context(gsplugin_ctx);
- if (mydlo) soap_destroy(mydlo);
- return 1;
-}
-
-Namespace namespaces[] = {{NULL, NULL, NULL, NULL}};
+++ /dev/null
-LICENSE file for EGEE Middleware\r
-================================\r
-\r
-Copyright (c) 2004 on behalf of the EU EGEE Project: \r
-The European Organization for Nuclear Research (CERN), \r
-Istituto Nazionale di Fisica Nucleare (INFN), Italy\r
-Datamat Spa, Italy\r
-Centre National de la Recherche Scientifique (CNRS), France\r
-CS Systeme d'Information (CSSI), France\r
-Royal Institute of Technology, Center for Parallel Computers (KTH-PDC), Sweden\r
-Universiteit van Amsterdam (UvA), Netherlands\r
-University of Helsinki (UH.HIP), Finlan\r
-University of Bergen (UiB), Norway\r
-Council for the Central Laboratory of the Research Councils (CCLRC), United Kingdom\r
-\r
-Redistribution and use in source and binary forms, with or without\r
-modification, are permitted provided that the following conditions are\r
-met: \r
-\r
-1. Redistributions of source code must retain the above copyright\r
-notice, this list of conditions and the following disclaimer.\r
-\r
-2. Redistributions in binary form must reproduce the above copyright\r
-notice, this list of conditions and the following disclaimer in the\r
-documentation and/or other materials provided with the distribution.\r
-\r
-3. The end-user documentation included with the redistribution, if\r
-any, must include the following acknowledgment: "This product includes\r
-software developed by The EU EGEE Project (http://cern.ch/eu-egee/)."\r
-Alternatively, this acknowledgment may appear in the software itself, if\r
-and wherever such third-party acknowledgments normally appear.\r
-\r
-4. The names EGEE and the EU EGEE Project must not be\r
-used to endorse or promote products derived from this software without\r
-prior written permission. For written permission, please contact\r
-<email address>.\r
-\r
-5. You are under no obligation whatsoever to provide anyone with any\r
-bug fixes, patches, or upgrades to the features, functionality or\r
-performance of the Software ("Enhancements") that you may develop over\r
-time; however, if you choose to provide your Enhancements to The EU\r
-EGEE Project, or if you choose to otherwise publish or distribute your\r
-Enhancements, in source code form without contemporaneously requiring\r
-end users of The EU EGEE Proejct to enter into a separate written license\r
-agreement for such Enhancements, then you hereby grant The EU EGEE Project\r
-a non-exclusive, royalty-free perpetual license to install, use, copy,\r
-modify, prepare derivative works, incorporate into the EGEE Middleware\r
-or any other computer software, distribute, and sublicense your\r
-Enhancements or derivative works thereof, in binary and source code\r
-form (if any), whether developed by The EU EGEE Project or third parties.\r
-\r
-THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED\r
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r
-DISCLAIMED. IN NO EVENT SHALL PROJECT OR ITS CONTRIBUTORS BE LIABLE\r
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\r
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\r
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\r
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\r
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-\r
-This software consists of voluntary contributions made by many\r
-individuals on behalf of the EU EGEE Prject. For more information on The\r
-EU EGEE Project, please see http://cern.ch/eu-egee/. For more information on\r
-EGEE Middleware, please see http://egee-jra1.web.cern.ch/egee-jra1/\r
-\r
-\r
+++ /dev/null
-# defaults
-top_srcdir=..
-builddir=build
-top_builddir=${top_srcdir}/${builddir}
-stagedir=.
-globalprefix=glite
-package=gss
-version=1.0.0
-PREFIX=/opt/glite
-prefix=
-
-glite_location=/opt/glite
-globus_prefix=/opt/globus
-cppunit_prefix=/opt/cppunit
-
-CC=gcc
-
--include Makefile.inc
--include ${top_srcdir}/project/version.properties
-
-version=${module.version}
-
-# In order to use libtool versioning correcty, we must have:
-#
-# current = major + minor + offset
-# revision = patch
-# age = minor
-#
-# where offset is a sum of maximal released minor's of all previous major's
-#
-
-# counted minors: gsoap-plugin 1.5, gss 2.1
-offset=6
-version_info:=-version-info ${shell \
- perl -e '$$,=":"; @F=split "\\.","${version}"; print $$F[0]+$$F[1]+${offset},$$F[2],$$F[1]' }
-
-VPATH=${top_srcdir}/src:${top_srcdir}/test:${top_srcdir}/examples
-
-default: all
-
-DEBUG:=-g -O0 -W -Wall -Wno-unused-parameter
-# not for globus, gsoap: -Werror
-
-CFLAGS:= ${CFLAGS} ${DEBUG} \
- -DVERSION=\"${version}\" \
- -I. -I${top_srcdir}/interface \
- -I${stagedir}${prefix}/include \
- ${COVERAGE_FLAGS} -D_GNU_SOURCE -DDATAGRID_EXTENSION
-
-LDFLAGS:=${LDFLAGS} ${COVERAGE_FLAGS}
-
-COMPILE:=libtool --mode=compile ${CC} ${CFLAGS}
-LINK:=libtool --mode=link ${CC} -rpath ${stagedir}${prefix}/${libdir} ${LDFLAGS}
-LINKXX:=libtool --mode=link ${CXX} -rpath ${stagedir}${prefix}/${libdir} ${LDFLAGS}
-INSTALL:=libtool --mode=install install
-
-CPPUNIT_LIBS?=-L${cppunit_prefix}/${libdir} -lcppunit
-CPPUNIT_CFLAGS?=-I${cppunit_prefix}/include
-
-GLOBUS_NOTHR_INC:= -I${globus_prefix}/include/${nothrflavour}
-GLOBUS_THR_INC:= -I${globus_prefix}/include/${thrflavour}
-
-GLOBUS_NOTHR_LIBS:= -L${globus_prefix}/lib \
- -lglobus_common_${nothrflavour}
-GLOBUS_THR_LIBS:= -L${globus_prefix}/lib \
- -lglobus_common_${thrflavour}
-
-GLOBUS_GSSAPI_NOTHR_LIBS=-lglobus_gssapi_gsi_${nothrflavour}
-GLOBUS_GSSAPI_THR_LIBS=-lglobus_gssapi_gsi_${thrflavour}
-
-KERBEROS_GSSAPI_LIBS=-lgssapi_krb5
-KERBEROS_GSSAPI_CFLAGS=-DNO_GLOBUS_GSSAPI
-
-GLOBUS_GSSAPI_GSI_LIBS?=${GLOBUS_THR_LIBS} ${GLOBUS_GSSAPI_THR_LIBS}
-GLOBUS_GSSAPI_GSI_CFLAGS?=${GLOBUS_THR_INC}
-
-GLOBUS_COMMON_LIBS?=${GLOBUS_THR_LIBS}
-GLOBUS_COMMON_CFLAGS?=${GLOBUS_THR_INC}
-
-ifeq ($(gssapi_provider),kerberos)
-GSSAPI_THR_LIBS=${GLOBUS_COMMON_LIBS} ${KERBEROS_GSSAPI_LIBS} -lssl
-GSSAPI_THR_INC=${GLOBUS_COMMON_CFLAGS} ${KERBEROS_GSSAPI_CFLAGS}
-GSSAPI_NOTHR_LIBS=${GLOBUS_NOTHR_LIBS} ${KERBEROS_GSSAPI_LIBS} -lssl
-GSSAPI_NOTHR_INC=${GLOBUS_NOTHR_INC} ${KERBEROS_GSSAPI_CFLAGS}
-else
-GSSAPI_THR_LIBS=${GLOBUS_GSSAPI_GSI_LIBS}
-GSSAPI_THR_INC=${GLOBUS_GSSAPI_GSI_CFLAGS}
-GSSAPI_NOTHR_LIBS=${GLOBUS_NOTHR_LIBS} ${GLOBUS_GSSAPI_NOTHR_LIBS}
-GSSAPI_NOTHR_INC=${GLOBUS_NOTHR_INC}
-endif
-
-LIBCARES_CFLAGS?=-I${cares_prefix}/include
-LIBCARES_LIBS?=-L${cares_prefix}/${libdir} -L${cares_prefix}/lib -lcares
-
-HDRS:=glite_gss.h
-
-GSS_OBJS:=glite_gss.o
-GSS_LOBJS:=${GSS_OBJS:.o=.lo}
-GSS_THROBJS:=${GSS_OBJS:.o=.thr.o}
-GSS_THRLOBJS:=${GSS_OBJS:.o=.thr.lo}
-
-GSS_NOTHRSTATICLIB:=libglite_security_gss_${nothrflavour}.a
-GSS_THRSTATICLIB:=libglite_security_gss_${thrflavour}.a
-GSS_STATICLIB:=libglite_security_gss.a
-GSS_NOTHRLTLIB:=libglite_security_gss_${nothrflavour}.la
-GSS_THRLTLIB:=libglite_security_gss_${thrflavour}.la
-GSS_LTLIB:=libglite_security_gss.la
-
-ifeq ($(thrflavour),)
-lib_LTLIBRARIES=${GSS_LTLIB}
-lib_LIBRARIES=${GSS_STATICLIB}
-default_gss=${GSS_LTLIB}
-else
-lib_LTLIBRARIES=${GSS_NOTHRLTLIB} ${GSS_THRLTLIB}
-lib_LIBRARIES=${GSS_NOTHRSTATICLIB} ${GSS_THRSTATICLIB}
-default_gss=${GSS_NOTHRLTLIB}
-endif
-
-
-ifeq ($(thrflavour),)
-${GSS_STATICLIB}: ${GSS_THROBJS}
- ar crv $@ ${GSS_THROBJS}
- ranlib $@
-
-${GSS_LTLIB}: ${GSS_THROBJS}
- ${LINK} ${version_info} -o $@ ${GSS_THRLOBJS} ${GSSAPI_THR_LIBS} ${LIBCARES_LIBS} -lpthread
-else
-${GSS_NOTHRSTATICLIB}: ${GSS_OBJS}
- ar crv $@ ${GSS_OBJS}
- ranlib $@
-
-${GSS_THRSTATICLIB}: ${GSS_THROBJS}
- ar crv $@ ${GSS_THROBJS}
- ranlib $@
-
-${GSS_NOTHRLTLIB}: ${GSS_OBJS}
- ${LINK} ${version_info} -o $@ ${GSS_LOBJS} ${GSSAPI_NOTHR_LIBS} ${LIBCARES_LIBS}
-
-${GSS_THRLTLIB}: ${GSS_THROBJS}
- ${LINK} ${version_info} -o $@ ${GSS_THRLOBJS} ${GSSAPI_THR_LIBS} ${LIBCARES_LIBS} -lpthread
-endif
-
-
-all compile: $(lib_LTLIBRARIES) ${lib_LIBRARIES} examples
-
-check: compile check.gss
-
-check.gss: test_gss
- # ./test_gss out.xml
- echo test_gss not run automatically util we have got some credentials in X509_USER_PROXY
-
-test_gss: test_gss.o
- ${LINKXX} -o $@ test_gss.o ${default_gss} ${CPPUNIT_LIBS} ${GLOBUS_GSSAPI_GSI_LIBS} ${LIBCARES_LIBS}
-
-test_coverage:
- -mkdir coverage
- cd coverage && $(MAKE) -f ../Makefile top_srcdir=../../ COVERAGE_FLAGS="-fprofile-arcs -ftest-coverage" check
- cd coverage && for i in ${OBJS}; do gcov -o .libs/ $$i ; done
-
-gss_server: gss_server.o example_common.o
- ${LINK} -o $@ ${default_gss} $^
-
-gss_client: gss_client.o example_common.o
- ${LINK} -o $@ ${default_gss} $^
-
-examples:
-
-doc:
-
-stage:
- $(MAKE) install PREFIX=${stagedir} DOSTAGE=yes
-
-install:
- -mkdir -p ${DESTDIR}${PREFIX}${prefix}/${libdir}
- -mkdir -p ${DESTDIR}${PREFIX}${prefix}/share/doc/${package}-${version}
- -mkdir -p ${DESTDIR}${PREFIX}${prefix}/include/glite/security
- ${INSTALL} -m 755 ${lib_LTLIBRARIES} ${DESTDIR}${PREFIX}${prefix}/${libdir}
- ${INSTALL} -m 644 ${top_srcdir}/LICENSE ${DESTDIR}${PREFIX}${prefix}/share/doc/${package}-${version}
- cd ${top_srcdir}/interface && ${INSTALL} -m 644 ${HDRS} ${DESTDIR}${PREFIX}${prefix}/include/glite/security/
- if [ x${DOSTAGE} = xyes ]; then \
- install -m 644 ${lib_LIBRARIES} ${DESTDIR}${PREFIX}${prefix}/${libdir}; \
- fi
-
-clean:
- rm -rf *.o *.lo *.a *.la .libs test_gss gss_server gss_client
-
-distclean:
- rm -rvf Makefile.inc *.spec debian/
-
-%.o: %.c
- ${COMPILE} ${GSSAPI_NOTHR_INC} ${LIBCARES_CFLAGS} -o $@ -c $<
-
-%.thr.o: %.c
- ${COMPILE} -D_REENTRANT -DGLITE_LBU_THREADED ${GSSAPI_THR_INC} ${LIBCARES_CFLAGS} -o $@ -c $<
-
-test_gss.o: %.o: %.cpp
- ${CXX} -c ${CFLAGS} ${GLOBUS_GSSAPI_GSI_CFLAGS} ${CPPUNIT_CFLAGS} -Wno-error $<
+++ /dev/null
-#!/usr/bin/perl
-
-# WARNING: Don't edit this file unless it is the master copy in org.glite.lb
-#
-# For the purpose of standalone builds of lb/jobid/lbjp-common components
-# it is copied on tagging
-
-# $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.
-#
-
-use Getopt::Long;
-use POSIX qw(locale_h strftime);
-
-my $pwd = `pwd`; chomp $pwd;
-my $prefix = '/usr';
-my $stagedir = undef;
-my $root = $pwd.'/stage';
-my $sysroot = '';
-my $sysconfdir;
-my $localstatedir;
-my $staged;
-my $module;
-my $thrflavour = 'gcc64dbgpthr';
-my $nothrflavour = 'gcc64dbg';
-my $mode = 'build';
-my $help = 0;
-my $listmodules;
-my ($version, $force_version);
-my $branch;
-my $output;
-my $lb_tag = '';
-my $lbjp_tag = '';
-my $jp_tag = '';
-my $jobid_tag = '';
-my $libdir = getlibdir();
-my $project = 'emi';
-my $project_version;
-my (%projects, %project);
-my $debug = 0;
-my $pkg_config_env = (defined $ENV{PKG_CONFIG_PATH}) ? "$ENV{PKG_CONFIG_PATH}:" : '';
-
-my @nodes = qw/client server logger logger-msg nagios utils client-java doc ws-test db jpprimary jpindex jpclient harvester lb px proxyrenewal/;
-my @default_nodes = qw/lb px proxyrenewal nagios/;
-my %enable_nodes;
-my %disable_nodes;
-my %default_nodes; @default_nodes{@default_nodes} = (1) x ($#default_nodes + 1);
-
-my %package = (
- 'maintainer' => 'CESNET Product Teams <emi-lb@metacentrum.cz>',
- 'uploaders' => 'František Dvořák <valtri@civ.zcu.cz>',
- 'url' => 'http://glite.cern.ch',
- 'debian_vcs' => 'Vcs-Cvs: :pserver:anonymous@jra1mw.cvs.cern.ch:/cvs/jra1mw
-Vcs-Browser: http://jra1mw.cvs.cern.ch/cgi-bin/jra1mw.cgi',
-);
-
-# key: internal package name (arguments, ...)
-# 'pkg': pkg-config name
-# 'prefix': used when pkg-config fails
-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-devel' => {
- prefix=> '/opt/globus',
- pkg => 'myproxy'
- },
- 'myproxy-server' => {
- prefix=> '',
- },
- 'myproxy-admin' => {
- prefix=> '',
- },
- gsoap => {
- prefix=> '/usr',
- pkg => 'gsoap'
- },
- gsoapxx => {
- prefix=> '/usr',
- pkg => 'gsoap++'
- },
- mysql => {
- prefix=> '/usr'
- },
- 'mysql-devel' => {
- prefix=> ''
- },
- 'mysql-server' => {
- prefix => ''
- },
- voms => {
- prefix => '/opt/glite',
- pkg => 'voms-2.0'
- },
- gridsite => {
- prefix => '/opt/glite'
- },
- lcas => {
- prefix => '/opt/glite',
- pkg => 'lcas'
- },
- trustmanager => {
- prefix => '/opt/glite'
- },
- trustmanager_axis => {
- prefix => '/opt/glite'
- },
- utiljava => {
- prefix=> '/opt/glite'
- },
- ant => {
- prefix=> '/usr'
- },
- jdk => {
- prefix=> '/usr/java/latest',
- locations => [ '/usr/lib/jvm/java', '/usr/lib/jvm/default-java', '/usr/java/latest' ],
- },
- libtar => {
- prefix=> '/usr'
- },
- axis => {
- prefix=> '/usr'
- },
- log4c => {
- prefix=> '/usr'
- },
- postgresql => {
- prefix=> '/usr'
- },
- activemq => {
- prefix=>'/opt/activemq-cpp-library',
- pkg => 'activemq-cpp'
- },
-);
-
-my %jar = (
- 'jakarta-commons-codec' => '/usr/share/java/commons-codec.jar',
- 'jakarta-commons-lang' => '/usr/share/java/commons-lang.jar',
-);
-
-
-my %glite_prefix;
-my %need_externs;
-my %need_externs_type;
-my %need_jars;
-my %extrafull;
-my %extranodmod;
-my %deps;
-my %deps_type;
-my %buildroot;
-my (%etics_externs, %etics_projects);
-
-#
-# modules of the subsystems
-#
-# additional modules from $project{modules} are automatically added
-#
-my %lbmodules = (
- 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim logger-msg nagios client-devel client-progs common-devel logger-devel state-machine-devel/],
- 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin db-devel log-devel maildir-devel server-bones-devel trio-devel jp-interface-devel gss-devel gsoap-plugin-devel/],
- 'jobid' => [qw/api-c api-c-devel api-cpp api-cpp-devel api-java/],
- 'jp' => [ qw/client doc index primary server-common ws-interface/ ],
- 'gridsite' => [ qw/apache libs commands core devel slashgrid services service-clients gsexec/ ],
- 'px' => [ qw/proxyrenewal myproxy-yaim proxyrenewal-devel proxyrenewal-progs/ ],
- 'canl' => [ qw/c c-devel/ ],
- );
-
-#
-# sub-packages
-#
-# modify %lbmodules, %deps_aux, %extrafull, and %properties accodingly
-#
-my %subpackages = (
- 'jobid.api-c-devel' => 'jobid.api-c',
- 'jobid.api-cpp-devel' => 'jobid.api-cpp',
- 'lbjp-common.db-devel' => 'lbjp-common.db',
- 'lbjp-common.gsoap-plugin-devel' => 'lbjp-common.gsoap-plugin',
- 'lbjp-common.gss-devel' => 'lbjp-common.gss',
- 'lbjp-common.jp-interface-devel' => 'lbjp-common.jp-interface',
- 'lbjp-common.log-devel' => 'lbjp-common.log',
- 'lbjp-common.maildir-devel' => 'lbjp-common.maildir',
- 'lbjp-common.server-bones-devel' => 'lbjp-common.server-bones',
- 'lbjp-common.trio-devel' => 'lbjp-common.trio',
- 'lb.client-progs' => 'lb.client',
- 'lb.client-devel' => 'lb.client',
- 'lb.common-devel' => 'lb.common',
- 'lb.logger-devel' => 'lb.logger',
- 'lb.state-machine-devel' => 'lb.state-machine',
- 'px.proxyrenewal-devel' => 'px.proxyrenewal',
- 'px.proxyrenewal-progs' => 'px.proxyrenewal',
- 'canl.c-devel' => 'canl.c',
-);
-
-my @opts = (
- 'prefix:s' => \$prefix,
- 'staged=s' => \$staged,
- 'module=s' => \$module,
- 'thrflavour:s' => \$thrflavour,
- 'nothrflavour:s' => \$nothrflavour,
- 'mode=s' => \$mode,
- 'listmodules=s' => \$listmodules,
- 'version=s' => \$force_version,
- 'branch=s' => \$branch,
- 'output=s' => \$output,
- 'stage=s' => \$stagedir,
- 'root:s' => \$root,
- 'sysroot:s' => \$sysroot,
- 'sysconfdir=s' => \$sysconfdir,
- 'localstatedir=s' => \$localstatedir,
- 'lb-tag=s' => \$lb_tag,
- 'lbjp-common-tag=s' => \$lbjp_tag,
- 'jp-tag=s' => \$jp_tag,
- 'jobid-tag=s' => \$jobid_tag,
- 'canl-tag=s' => \$canl_tag,
- 'help' => \$help,
- 'libdir=s' => \$libdir,
- 'project=s' => \$project,
- 'debug' => \$debug,
-);
-
-for (@nodes) {
- $enable_nodes{$_} = 0;
- $disable_nodes{$_} = 0;
-
- push @opts,"disable-$_",\$disable_nodes{$_};
- push @opts,"enable-$_",\$enable_nodes{$_};
-}
-
-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";
-$prefix=~s/\/$//;
-$root=~s/\/$//;
-$sysroot=~s/\/$//;
-if (not $sysconfdir) { $sysconfdir = $prefix eq '/usr' ? '/etc' : "$prefix/etc"; }
-if (not $localstatedir) { $localstatedir = $prefix eq '/usr' ? '/var' : "$prefix/var"; }
-$sysconfdir=~s/\/$//;
-$localstatedir=~s/\/$//;
-
-$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq '';
-$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq '';
-$externs{'gsoapxx'}{prefix}=$externs{gsoap}{prefix} if $externs{'gsoapxx'}{prefix} eq '';
-
-$externs{'mysql-server'}{withprefix}=$externs{mysql}{withprefix} if $externs{'mysql-server'}{withprefix} eq '';
-$externs{'mysql-devel'}{wihtprefix}=$externs{mysql}{withprefix} if $externs{'mysql-devel'}{withprefix} eq '';
-$externs{'gsoapxx'}{withprefix}=$externs{gsoap}{withprefix} if $externs{'gsoapxx'}{withprefix} eq '';
-
-if ($project =~ /^([^0-9]*)(.*)$/) {
- $project = $1;
- $project_version = $2;
-}
-%project = %{$projects{$project}};
-$project_version = $project{current_version} unless $project_version;
-for my $platform (keys %{$project{etics_externs}}) {
- for $_ (keys %{$project{etics_externs}{$platform}}) {
- $etics_externs{$platform}{$_} = $project{etics_externs}{$platform}{$_};
- }
-}
-reshuffle_platforms(\%etics_externs, $project{supported_platforms});
-reshuffle_platforms(\%{$project{etics_externs_devel}}, $project{supported_platforms});
-for $_ (keys %{$project{etics_projects}}) {
- $etics_projects{$_} = $project{etics_projects}{$_};
-}
-for $_ (keys %{$project{need_externs_aux}}) {
- $need_externs_aux{$_} = $project{need_externs_aux}{$_};
-}
-for my $ext (keys %need_externs_aux) {
- for (@{$need_externs_aux{$ext}}) {
- my ($pkg, $type) =/([^:]*)(?::(.*))?/;
- $type = 'BR' unless ($type);
-
- push @{$need_externs{$ext}},$pkg;
- $need_externs_type{$ext}->{$pkg} = $type;
- }
-}
-if ($project eq 'emi') {
- $extranodmod{lb} = 'lb.emi-lb';
- $extranodmod{px} = 'px.emi-px';
-}
-for $_ (keys %{$project{modules}}) {
- push @{$lbmodules{$_}},@{$project{modules}{$_}};
-}
-
-
-if ($help) { usage(); exit 0; }
-
-if ($listmodules) {
- my $name_prefix = ($listmodules eq 'gridsite' and $project eq 'glite') ? 'org' : $project{etics_name};
- my @m;
-
- if (exists $lbmodules{$listmodules}) {
- @m = map exists $subpackages{$listmodules . '.' . $_} ? "" : "$name_prefix.$listmodules.$_",@{$lbmodules{$listmodules}};
- } else {
- if ($project eq 'emi' and $project_version == 1) {
- # no sub-packages in EMI-1
- } else {
- for my $sub (keys %subpackages) {
- push @m, $sub if ($subpackages{$sub} eq $listmodules);
- }
- }
- }
- print map $_ eq "" ? "" : "$_ ", @m;
- print "\n";
- exit 0;
-}
-
-warn "$0: --branch and --output make sense only in --mode=etics\n"
- if ($output || $branch) && $mode ne 'etics';
-
-my $en;
-for (keys %enable_nodes) { $en = 1 if $enable_nodes{$_}; }
-
-my $dis;
-for (keys %disable_nodes) { $dis = 1 if $disable_nodes{$_}; }
-
-die "--enable-* and --disable-* are mutually exclusive\n"
- if $en && $dis;
-
-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{jp}};
-
-if ($dis) {
- for (@nodes) {
- $enable_nodes{$_} = 1 unless ($disable_nodes{$_} or not $default_nodes{$_});
- }
-}
-
-if (!$en && !$dis) { for (@nodes) { $enable_nodes{$_} = 1 if ($default_nodes{$_}) } };
-
-for (keys %enable_nodes) { delete $enable_nodes{$_} unless $enable_nodes{$_}; }
-
-$stagedir = $root unless $stagedir;
-$stagedir=~s/\/$// if ($stagedir);
-
-if ($mode eq 'build') { for my $ext (keys %externs) {
- if (defined $externs{$ext} and defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; }
- elsif (defined $externs{$ext}{pkg}) {
- my ($flag, $env, $cmd, $ret);
- my $pkg = $externs{$ext}{pkg};
- my $flagname = uc $externs{$ext}{pkg};
- $flagname =~ s/-[0-9\.]*$//;
- $flagname =~ y/-\+/_X/;
-
- print "Checking $pkg ... ";
- $env = "PKG_CONFIG_PATH=$pkg_config_env$stagedir$prefix/$libdir/pkgconfig";
- $cmd = "$env pkg-config $pkg --exists >/dev/null";
- `$cmd`; $ret = $?;
- print "('$cmd' => $ret)\n" if ($debug);
- if ($ret == 0) {
- $externs{$ext}{prefix}=`$env pkg-config $pkg --variable=prefix`;
- chomp $externs{$ext}{prefix};
- print "$externs{$ext}{prefix}\n";
-
- $flag=`$env pkg-config $pkg --cflags`;
- $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag);
- $flag=`$env pkg-config $pkg --libs`;
- $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag);
- } else {
- print "(using default $externs{$ext}{prefix})\n";
- }
- print "\n" if ($debug);
- }
- elsif ($ext eq 'jdk') {
- my $jdk_prefix;
-
- print "Looking for some caffein ... ";
- if (defined $ENV{'JDK_HOME'}) {
- $jdk_prefix = $ENV{'JDK_HOME'};
- print "JDK_HOME=$jdk_prefix\n";
- } elsif (defined $ENV{'JAVA_HOME'}) {
- $jdk_prefix = $ENV{'JAVA_HOME'};
- print "JAVA_HOME=$jdk_prefix\n";
- } else {
- foreach my $i (0..$#{$externs{$ext}{locations}}) {
- if (-e $externs{$ext}{locations}[$i]) {
- $jdk_prefix=$externs{$ext}{locations}[$i];
- print "(found directory $jdk_prefix)\n";
- last;
- }
- }
- print "(using default $externs{$ext}{prefix})\n" unless ($jdk_prefix);
- }
- $externs{$ext}{prefix} = $jdk_prefix if ($jdk_prefix);
- }
-} }
-
-if ($mode eq 'build') {
- print "Writing config.status\n";
- open CONF,">config.status" or die "config.status: $!\n";
- for ('JDK_HOME', 'JAVA_HOME', 'PKG_CONFIG_PATH') {
- print CONF "$_=$ENV{$_} " if (defined $ENV{$_});
- }
- print CONF "$0 @keeparg\n";
- close CONF;
-}
-
-
-my @modules;
-my %aux;
-
-if ($module) {
-# push @modules,split(/[,.]+/,$module);
- push @modules,$module;
-}
-else {
- @modules = map(($extranodmod{$_} ? $extranodmod{$_} : 'lb.'.$_),(keys %enable_nodes));
-
- my $n;
-
- do {
- local $"="\n";
- $n = $#modules;
- push @modules,(map @{$deps{$_}},@modules);
-
- undef %aux; @aux{@modules} = (1) x ($#modules+1);
- @modules = keys %aux;
- } while ($#modules > $n);
-}
-
-@aux{@modules} = (1) x ($#modules+1);
-delete $aux{$_} for (split /,/,$staged);
-@modules = keys %aux;
-
-mode_build() if $mode eq 'build';
-mode_checkout() if $mode eq 'checkout';
-mode_etics($module) if $mode eq 'etics';
-
-sub mode_build {
- print "\nBuilding modules: @modules\n";
- print "Mode: "; print $module ? "single module" : "multiple modules"; print "\n";
-
- my @ext = map @{$need_externs{$_}},@modules;
- my @myjars = map @{$need_jars{$_}},@modules;
- undef %aux; @aux{@ext} = 1;
- @ext = keys %aux;
- undef %aux; @aux{@myjars} = (1) x ($#myjars+1);
- @myjars = keys %aux;
-
- print "\nRequired externals:\n";
- print "\t$_: ".($externs{$_}{prefix}?$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;
-
- if ($module) {
- print "Not creating summary Makefile\n" if $debug;
- } else {
- print "Creating Makefile\n";
-
- open MAK,">Makefile" or die "Makefile: $!\n";
-
- print MAK "all: @modules\n\n";
- print MAK "stage: ".(join '-stage ', @modules)."-stage\n\n";
- print MAK "clean check install:\n";
-
- for (@modules) {
- my $full = full($_);
- print MAK "\tcd $full/$buildroot{$_} && \${MAKE} \$@\n"
- }
-
- print MAK "\ndistclean:\n";
-
- for (@modules) {
- my $full = full($_);
- print MAK $buildroot{$_} eq '' ?
- "\tcd $full && \${MAKE} distclean\n" :
- "\trm -rf $full/$buildroot{$_}\n"
- }
-
- print MAK "\n";
-
- for (@modules) {
- my %ldeps; undef %ldeps;
- @ldeps{@{$deps{$_}}} = 1;
- for my $x (split /,/,$staged) { delete $ldeps{$x}; }
- my @dnames = $module ? () : keys %ldeps;
- my $snames = $#dnames == -1 ? '' : join('-stage ', @dnames).'-stage';
-
- my $full = full($_);
- my $build = $buildroot{$_};
-
- print MAK "$_: @dnames\n\tcd $full/$build && \${MAKE} && \${MAKE} install\n\n";
- print MAK "$_-stage: $snames\n\tcd $full/$build && \${MAKE} && \${MAKE} stage\n\n";
- }
-
- close MAK;
- }
-}
-
-sub mode_checkout() {
- for (@modules) {
- my $module = $_;
- my $tag = "";
- if ($lb_tag){
- for (@{$lbmodules{lb}}){
- if ("lb.".$_ eq $module){
- $tag = '-r '.$lb_tag;
- }
- }
- }
- if ($lbjp_tag) {
- for (@{$lbmodules{'lbjp-common'}}){
- if ("lbjp-common.".$_ eq $module){
- $tag = '-r '.$lbjp_tag;
- }
- }
- }
- if ($jp_tag){
- for (@{$lbmodules{'jp'}}){
- if ("jp.".$_ eq $module){
- $tag = '-r '.$jp_tag;
- }
- }
- }
- if ($jobid_tag){
- for (@{$lbmodules{jobid}}){
- if ("jobid.".$_ eq $module){
- $tag = '-r '.$jobid_tag;
- }
- }
- }
- if ($canl_tag) {
- for (@{$lbmodules{'canl'}}){
- if ("canl.".$_ eq $module){
- $tag = '-r '.$canl_tag;
- }
- }
- }
- #if (grep {"lb.".$_ eq $module} @{$lbmodules{lb}}){
- # print "found";
- #}
- $_ = full($_);
- print "\n*** Checking out $_\n";
- system("cvs checkout $tag $_") == 0 or die "cvs checkout $tag $_: $?\n";
- }
-}
-
-BEGIN{
-%etics_externs = (
- default => {
- 'myproxy-devel'=>'myproxy-devel',
- 'myproxy-server'=>'myproxy-server',
- 'myproxy-admin'=>'myproxy-admin',
- cares=>'c-ares',
- utiljava=>'org.glite.security.util-java',
- gpt=>'gpt',
- fetchcrl=>'fetch-crl',
- activemq=>'activemq-cpp-library',
- },
-);
-
-%etics_projects = (
-);
-
-%need_externs_aux = (
- 'lb.client' => [ qw/cppunit:B classads libtool:B globus:B/ ],
- 'lb.common' => [ qw/expat cares:B cppunit:B classads libtool:B globus:B/ ],
- 'lb.doc' => [ qw/tetex-latex:B/ ],
- 'lb.logger' => [ qw/cppunit:B libtool:B globus:B/ ],
- 'lb.logger-msg' => [ qw/cppunit:B activemq libtool:B globus:B/ ],
- 'lb.nagios' => [ qw/globus_proxy_utils:R/ ],
- 'lb.server' => [ qw/globus_essentials:R globus:B expat cares mysql-server:R cppunit:B gsoap:B classads voms:B lcas gridsite:B bison:B libtool:B libxml2 flex:B/ ],
- 'lb.state-machine' => [ qw/classads libtool:B libxslt:B expat:B globus:B/ ],
- 'lb.utils' => [ qw/cppunit:B libtool:B globus:B/ ],
- 'lb.ws-interface' => [ qw/libxslt:B tidy:B/ ],
- 'lb.ws-test' => [ qw/gsoap:B libtool:B globus:B/ ],
- 'lb.types' => [ qw// ],
- 'lb.harvester' => [ qw/docbook-utils:B libtool:B globus:B/ ],
- 'lbjp-common.db' => [ qw/mysql-devel:B postgresql:B cppunit:B log4c:B libtool:B/ ],
- 'lbjp-common.log' => [ qw/log4c libtool:B/ ],
- 'lbjp-common.maildir' => [ qw/libtool:B/ ],
- 'lbjp-common.server-bones' => [ qw/libtool:B/ ],
- 'lbjp-common.trio' => [ qw/cppunit:B libtool:B/ ],
- 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B libtool:B/ ],
- 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B libtool:B/ ],
- 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap gsoapxx libtool:B/ ],
- 'jobid.api-c' => [ qw/cppunit:B libtool:B openssl:B/ ],
- 'jobid.api-cpp' => [ qw/cppunit:B libtool:B/ ],
- 'jobid.api-java' => [ qw/ant:B jdk:B/ ],
- 'jp.client' => [ qw/gsoap libtar globus_essentials:R globus:B/ ],
- 'jp.doc' => [],
- 'jp.index' => [ qw/gsoap globus_essentials:R globus:B mysql-server:R/ ],
- 'jp.primary' => [ qw/classads gsoap libtar globus_essentials:R globus:B mysql-server:R/ ],
- 'jp.server-common' => [],
- 'jp.ws-interface' => [],
- 'gridsite.core' => [ qw/httpd-devel:B gsoap:B globus:B curl:B doxygen:B fuse-devel:B libxml2:B openssl:B doxygen:B/ ],
- 'gridsite.commands' => [ qw/curl:R openssl:R/ ],
- 'gridsite.apache' => [ qw/libxml2:R openssl:R curl:R/ ],
- 'gridsite.libs' => [ qw/libxml2:R openssl:R/ ],
- 'gridsite.devel' => [ qw// ],
- 'gridsite.slashgrid' => [ qw/curl:R fuse:R/],
- 'gridsite.services' => [ qw/curl:R gsoap:R/ ],
- 'gridsite.service-clients' => [ qw/curl:R gsoap:R gsoapxx:R/ ],
- 'gridsite.gsexec' => [ qw// ],
- 'gridsite.1.5-compat' => [ qw/httpd-devel:B gsoap:B globus:B curl:B doxygen:B fuse-devel:B libxml2:B openssl:B doxygen:B/ ],
- 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-devel:B voms:B libtool:B/ ],
- 'px.myproxy-config' => [ qw/myproxy-admin:R/ ], # in myproxy-config.spec
- 'canl.c' => [ qw/cares:B openssl:B libtool:B bison:B flex:B krb5-devel:B/ ],
-);
-
-%need_jars = (
- 'jobid.api-java' => [ qw/jakarta-commons-codec/ ],
- 'lb.client-java' => [ qw/jakarta-commons-lang/ ],
-);
-
-for my $jar (keys %need_jars) {
- for (@{$need_jars{$jar}}) {
- $need_externs_type{$jar}->{$_} = 'BR'; # XXX
- }
-}
-
-%deps_aux = (
- 'lb.client' => [ qw/
- lb.types:B lb.common
- lbjp-common.trio
- jobid.api-cpp:B jobid.api-c
- lbjp-common.gss
- / ],
- 'lb.client-java' => [ qw/
- lb.types:B
- lb.ws-interface:B
- jobid.api-java
- / ],
- 'lb.common' => [ qw/
- jobid.api-cpp:B jobid.api-c
- lb.types:B lbjp-common.trio lbjp-common.gss
- / ],
- 'lb.doc' => [ qw/lb.types:B/ ],
- 'lb.logger' => [ qw/
- lbjp-common.trio
- lbjp-common.log
- jobid.api-c
- lb.common
- lbjp-common.gss
- / ],
- 'lb.logger-msg' => [ qw/
- lb.logger:B
- / ],
- 'lb.nagios' => [ qw/
- lb.client:R
- lb.ws-test:R
- lb.utils:R
- / ],
- 'lb.server' => [ qw/
- lb.ws-interface lb.types:B lb.common lb.state-machine lb.utils:R
- lbjp-common.db lbjp-common.server-bones lbjp-common.trio lbjp-common.maildir lbjp-common.log
- jobid.api-c
- lbjp-common.gsoap-plugin lbjp-common.gss
- / ],
- 'lb.state-machine' => [ qw/lb.types:B lb.common lbjp-common.jp-interface lbjp-common.gss/ ],
- 'lb.utils' => [ qw/
- lbjp-common.jp-interface
- jobid.api-c
- lbjp-common.trio lbjp-common.maildir
- lb.client lb.state-machine lb.types:B
- / ],
- 'lb.ws-test' => [ qw/lbjp-common.gsoap-plugin lb.ws-interface/ ],
- 'lb.ws-interface' => [ qw/lb.types:B/ ],
- 'lb.types' => [ qw// ],
- 'lb.harvester' => [ qw/
- jobid.api-c lbjp-common.trio lbjp-common.db lb.common lb.client
- lbjp-common.gss lbjp-common.log
- / ],
- 'lb.yaim' => [ qw// ],
- 'lb.glite-LB' => [ qw/
- lb.logger:R lb.server:R lb.utils:R lb.doc:R
- lb.ws-test:R lb.harvester:R lb.yaim:R lb.client-java:R
- lb.logger-msg:R
- / ],
- 'lb.emi-lb' => [ qw/
- lb.logger:R lb.server:R lb.utils:R lb.doc:R
- lb.ws-test:R lb.harvester:R lb.yaim:R lb.client-java:R
- lb.logger-msg:R
- / ],
- 'lbjp-common.db' => [ qw/lbjp-common.trio lbjp-common.log/ ],
- 'lbjp-common.maildir' => [ qw// ],
- 'lbjp-common.log' => [ qw// ],
- 'lbjp-common.server-bones' => [ qw/lbjp-common.log/ ],
- 'lbjp-common.trio' => [ qw// ],
- 'lbjp-common.gss' => [ qw// ],
- 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ],
- 'jobid.api-c' => [ qw// ],
- 'jobid.api-cpp' => [ qw/jobid.api-c/ ],
- 'jobid.api-java' => [ qw// ],
-
- 'lbjp-common.jp-interface' => [ qw/lbjp-common.trio lbjp-common.db jobid.api-c/ ],
-
- 'jp.client' => [ qw/
- jp.ws-interface
- lbjp-common.jp-interface lbjp-common.maildir
- jobid.api-c
- lbjp-common.gsoap-plugin
- / ],
- 'jp.doc' => [ qw// ],
- 'jp.index' => [ qw/
- jp.server-common jp.ws-interface
- lbjp-common.jp-interface lbjp-common.trio lbjp-common.db lbjp-common.server-bones
- lbjp-common.gsoap-plugin
- / ],
- 'jp.primary' => [ qw/
- jobid.api-c
- jp.server-common jp.ws-interface
- lb.state-machine
- lbjp-common.jp-interface lbjp-common.trio lbjp-common.db lbjp-common.server-bones
- lbjp-common.gsoap-plugin
- / ],
- 'jp.server-common' => [ qw/
- lbjp-common.jp-interface lbjp-common.db
- / ],
- 'jp.ws-interface' => [ qw// ],
-
- 'gridsite.core' => [ qw// ],
- 'gridsite.commands' => [ qw/gridsite.core:B/ ],
- 'gridsite.apache' => [ qw/gridsite.core:B/ ],
- 'gridsite.libs' => [ qw/gridsite.core:B / ],
- 'gridsite.devel' => [ qw/gridsite.core:B/ ],
- 'gridsite.slashgrid' => [ qw/gridsite.core:B/],
- 'gridsite.services' => [ qw/gridsite.core:B/ ],
- 'gridsite.service-clients' => [ qw/gridsite.core:B/ ],
- 'gridsite.gsexec' => [ qw/gridsite.core:B/ ],
-
- 'px.proxyrenewal' => [ qw// ],
- 'px.glite-PX' => [qw/px.myproxy-yaim:R/],
- 'px.emi-px' => [qw/px.myproxy-yaim:R/],
- 'px.myproxy-yaim' => [ qw// ],
- 'px.myproxy-config' => [],
-
- 'canl.c' => [],
-
- # sub-packages (virtual ETICS components depending on the main)
- 'jobid.api-c-devel' => [ qw/jobid.api-c:B/ ],
- 'jobid.api-cpp-devel' => [ qw/jobid.api-cpp:B/ ],
- 'lbjp-common.db-devel' => [ qw/lbjp-common.db:B/ ],
- 'lbjp-common.gsoap-plugin-devel' => [ qw/lbjp-common.gsoap-plugin:B/ ],
- 'lbjp-common.gss-devel' => [ qw/lbjp-common.gss:B/ ],
- 'lbjp-common.jp-interface-devel' => [ qw/lbjp-common.jp-interface:B/ ],
- 'lbjp-common.log-devel' => [ qw/lbjp-common.log:B/ ],
- 'lbjp-common.maildir-devel' => [ qw/lbjp-common.maildir:B/ ],
- 'lbjp-common.server-bones-devel' => [ qw/lbjp-common.server-bones:B/ ],
- 'lbjp-common.trio-devel' => [ qw/lbjp-common.trio:B/ ],
- 'lb.client-progs' => [ qw/lb.client:B/ ],
- 'lb.client-devel' => [ qw/lb.client:B/ ],
- 'lb.common-devel' => [ qw/lb.common:B/ ],
- 'lb.logger-devel' => [ qw/lb.logger:B/ ],
- 'lb.state-machine-devel' => [ qw/lb.state-machine:B/ ],
- 'px.proxyrenewal-devel' => [ qw/px.proxyrenewal:B/ ],
- 'px.proxyrenewal-progs' => [ qw/px.proxyrenewal:B/ ],
- 'canl.c-devel' => [ qw/canl.c:B/ ],
-);
-
-for my $ext (keys %deps_aux) {
- for (@{$deps_aux{$ext}}) {
- /([^:]*)(?::(.*))?/;
- push @{$deps{$ext}},$1;
- my $type = $2 ? $2 : 'BR';
- $deps_type{$ext}->{$1} = $type;
- }
-}
-
-
-%extrafull = (
- gridsite=>'org.gridsite.core',
- 'canl.c' => 'emi.canl.canl-c',
- 'canl.c-devel' => 'emi.canl.canl-c',
- 'jobid.api-c-devel' => 'org.glite.jobid.api-c',
- 'jobid.api-cpp-devel' => 'org.glite.jobid.api-cpp',
- 'lbjp-common.db-devel' => 'org.glite.lbjp-common.db',
- 'lbjp-common.gsoap-plugin-devel' => 'org.glite.lbjp-common.gsoap-plugin',
- 'lbjp-common.gss-devel' => 'org.glite.lbjp-common.gss',
- 'lbjp-common.jp-interface-devel' => 'org.glite.lbjp-common.jp-interface',
- 'lbjp-common.log-devel' => 'org.glite.lbjp-common.log',
- 'lbjp-common.maildir-devel' => 'org.glite.lbjp-common.maildir',
- 'lbjp-common.server-bones-devel' => 'org.glite.lbjp-common.server-bones',
- 'lbjp-common.trio-devel' => 'org.glite.lbjp-common.trio',
- 'lb.client-devel' => 'org.glite.lb.client',
- 'lb.client-progs' => 'org.glite.lb.client',
- 'lb.common-devel' => 'org.glite.lb.common',
- 'lb.logger-devel' => 'org.glite.lb.logger',
- 'lb.state-machine-devel' => 'org.glite.lb.state-machine',
- 'px.proxyrenewal-devel' => 'org.glite.px.proxyrenewal',
- 'px.proxyrenewal-progs' => 'org.glite.px.proxyrenewal',
-);
-
-#( java => 'client-java' );
-%extranodmod = (
- db => 'lbjp-common.db',
- jpprimary => 'jp.primary',
- jpindex => 'jp.index',
- jpclient => 'jp.client',
- lb => 'lb.glite-LB',
- px => 'px.glite-PX',
- proxyrenewal => 'px.proxyrenewal',
- canl => 'canl.c',
-);
-
-%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/ ],
-);
-
-%conflicts = (
-);
-
-%provides = (
- 'lbjp-common.gss' => [ qq/glite-security-gss/ ],
- 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ],
- 'lb.nagios' => [ qq/glite-lb-nagios-plugins/ ],
-);
-
-%cvs_prefix = (
- 'lb' => 'org.glite',
- 'jp' => 'org.glite',
- 'jobid' => 'org.glite',
- 'lbjp-common' => 'org.glite',
- 'gridsite' => 'org',
- 'px' => 'org.glite',
- 'canl' => 'emi',
-);
-
-%cvs_tag_prefix = (
- 'lb' => 'glite-',
- 'jp' => 'glite-',
- 'jobid' => 'glite-',
- 'lbjp-common' => 'glite-',
- 'gridsite' => '',
- 'px' => 'glite-',
- 'canl' => 'emi-',
-);
-
-# ==== projects specification ====
-# etics_name ........... ETICS project name
-# conf_prefix .......... ETICS configurations name prefix
-# tag_prefix ........... VCS tag prefix
-# local_prefix ......... prefix (relative to stage)
-# etics_externs ........ ETICS modules names of externals
-# (${NAME.location}, ETICS conf. dependencies)
-# etics_projects ....... ETICS project names of externals
-# etics_externs_devel .. ETICS modules names of devel versions of externals
-# etics_locations ...... ETICS locations in ${NAME.location} properties
-# need_externs_aux ..... project-specific external dependencies
-# supported_platforms .. platforms supported by the project
-# modules .............. additional modules in subsystems
-%projects = (
- glite => {
- current_version => 3,
- etics_name => 'org.glite',
- conf_prefix => { %cvs_tag_prefix },
- tag_prefix => { %cvs_tag_prefix },
- flavours => '--thrflavour=${globus.thr.flavor} --nothrflavour=${globus.nothr.flavor}',
- local_prefix => '',
- etics_externs => {
- default => {
- globus_essentials=>'vdt_globus_essentials',
- globus=>'globus',
- globus_proxy_utils=>'vdt_globus_essentials',
- gridsite=>'org.gridsite.libs',
- yaim_core=>'org.glite.yaim.core',
- gip_release=>'glite-info-provider-release',
- gip_service=>'glite-info-provider-service',
- bdii=>'bdii',
- glite_version=>'glite-version',
- glite_info_templates=>'glite-info-templates',
- glue_schema=>'glue-schema',
- trustmanager=>'org.glite.security.trustmanager',
- axis=>'axis',
- lcas=>'org.glite.security.lcas',
- gsoapxx=>'-',
- jdk=>'jdk',
- voms=>'org.glite.security.voms-api-cpp',
- },
- },
- etics_externs_devel => {
- default => {
- gridsite=>'org.gridsite.devel',
- voms=>'org.glite.security.voms-api',
- },
- },
- etics_projects => {
- vdt=>[qw/globus globus_essentials globus_proxy_utils gpt/],
- 'org.glite'=>[qw/voms gridsite lcas gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/],
- },
- etics_locations => {
- '*' => '',
- },
- need_externs_aux => {
- 'lb.client-java' => [ qw/ant:B jdk:B axis:B trustmanager utiljava libtool:B/ ],
- 'lb.glite-LB' => [ qw/fetchcrl:R gpt:R gip_release:R gip_service:R bdii:R glite_version:R glite_info_templates:R glue_schema:R/ ],
- 'lb.yaim' => [ qw/yaim_core:R/ ],
- 'px.glite-PX' => [qw/myproxy-server:R myproxy-admin:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/],
- 'px.myproxy-yaim' => [ qw/yaim_core:R/ ],
- },
- supported_platforms => {
- sl5_x86_64_gcc412 => 1,
- sl5_ia32_gcc412 => 1,
- deb5_x86_64_gcc432 => 1,
- deb5_ia32_gcc432 => 1,
- slc4_x86_64_gcc346 => 1,
- slc4_ia32_gcc346 => 1,
- },
- modules => {
- 'lb' => [ qw/glite-LB/ ],
- 'px' => [ qw/glite-PX/ ],
- },
- },
-
- emi => {
- current_version => 2,
- etics_name => 'emi',
- conf_prefix => {
- 'lb' => 'emi-',
- 'jp' => 'emi-',
- 'jobid' => 'emi-',
- 'lbjp-common' => 'emi-',
- 'gridsite' => 'emi-',
- 'px' => 'emi-',
- 'canl' => 'emi-',
- },
- tag_prefix => { %cvs_tag_prefix },
- flavours => '--thrflavour= --nothrflavour=',
- local_prefix => '/usr',
- etics_externs => {
- default => {
- globus_essentials=>'globus-gssapi-gsi',
- globus=>'globus-gssapi-gsi-devel',
- globus_proxy_utils=>'globus-proxy-utils',
- gridsite=>'emi.gridsite.libs',
- yaim_core=>'emi.yaim.yaim-core',
- yaim_bdii=>'emi.bdii.yaim-bdii',
- gip_service=>'emi.bdii.glite-info-provider-service',
- bdii=>'emi.bdii.core',
- glite_version=>'emi.emi-version',
- glue_schema=>'emi.bdii.glue-schema',
- trustmanager=>'emi.java-security.trustmanager',
- trustmanager_axis=>'emi.java-security.trustmanager-axis',
- axis=>'axis1.4',
- lcas=>'emi.sac.lcas',
- gsoapxx=>'-',
- jdk=>'java',
- voms => 'emi.voms.voms-api',
- },
- sl5_x86_64_gcc412EPEL => {
- 'myproxy-devel' => 'myproxy-devel.x86_64',
- },
- sl6_x86_64_gcc446EPEL => {
- 'myproxy-devel' => 'myproxy-devel.x86_64',
- },
- deb6_x86_64_gcc445 => {
- axis => 'axis1.4',
- # mappings in ETICS project configuration
- #globus_essentials => 'libglobus-gssapi-gsi4',
- #globus => 'libglobus-gssapi-gsi-dev',
- #axis => 'libaxis-java',
- #cares => 'libc-ares2',
- #cppunit => 'libcppunit',
- #expat => 'libexpat1',
- #log4c => 'liblog4c3',
- #curl => 'libcurl3',
- #'mysql' => 'libmysqlclient16',
- #'mysql-devel' => 'libmysqlclient-dev',
- #libxslt => 'xsltproc',
- #'jakarta-commons-codec' => 'libcommons-codec-java',
- #'jakarta-commons-lang' => 'libcommons-lang-java',
- #'tetex-latex' => 'texlive-latex-extra',
- #'perl-LDAP' => 'libnet-ldap-perl',
- #'fuse-lib' => 'libfuse2',
- #'fuse' => 'fuse-utils',
- },
- },
- etics_externs_devel => {
- default => {
- cares => 'c-ares-devel',
- classads => 'classads-devel',
- cppunit => 'cppunit-devel',
- expat => 'expat-devel',
- gsoap => 'gsoap-devel',
- voms => 'emi.voms.voms-api-devel',
- libtar => 'libtar-devel',
- log4c => 'log4c-devel',
- postgresql => 'postgresql-devel',
- curl => 'curl-devel',
- libxml2 => 'libxml2-devel',
- openssl => 'openssl-devel',
- gridsite=>'emi.gridsite.devel',
- jdk=>'java-devel',
- },
- deb6_x86_64_gcc445 => {
- # mappings in ETICS project configuration
- #cares => 'libc-ares-dev',
- #cppunit => 'libcppunit-dev',
- #expat => 'libexpat1-dev',
- #libtar => 'libtar-dev',
- #log4c => 'liblog4c-dev',
- #postgresql => 'libpq-dev',
- #curl => 'libcurl4-openssl-dev',
- #libxml2 => 'libxml2-dev',
- #openssl => 'libssl-dev',
- #'tetex-latex' => 'texlive-latex-extra',
- #libxslt=>'xsltproc',
- #'httpd-devel' => 'apache2-prefork-dev',
- #'fuse-devel' => 'libfuse-dev',
- #gsoap => 'gsoap',
- #'krb5-devel' => 'libkrb5-dev',
- },
- },
- etics_projects => {
- 'emi'=>[qw/voms voms-devel gridsite lcas gip_service bdii glite_version glue_schema yaim_core yaim_bdii trustmanager trustmanager_axis/],
- },
- etics_locations => {
- axis => 'axis',
- },
- need_externs_aux => {
- 'lb.client-java' => [ qw/ant:B jdk:B axis:B trustmanager trustmanager_axis libtool:B/ ],
- 'lb.emi-lb' => [ qw/fetchcrl:R gip_service:R bdii:R glite_version:R glue_schema:R/ ],
- 'lb.yaim' => [ qw/yaim_core:R yaim_bdii:R/ ],
- 'px.emi-px' => [qw/myproxy-server:R myproxy-admin:R fetchcrl:R gip_service:R bdii:R glite_version:R glue_schema:R/],
- 'px.myproxy-yaim' => [ qw/yaim_core:R yaim_bdii:R/ ],
- },
- supported_platforms => {
- sl5_x86_64_gcc412EPEL => 1,
- sl5_ia32_gcc412EPEL => 1,
- sl6_x86_64_gcc446EPEL => 1,
- deb6_x86_64_gcc445 => 1,
- },
- modules => {
- 'lb' => [ qw/emi-lb/ ],
- 'px' => [ qw/emi-px/ ],
- },
- },
-);
-
-%platform_properties = (
- 'jobid.api-java' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.types' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.doc' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.ws-interface' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.yaim' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.nagios' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'px.yaim' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'px.myproxy-config' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'gridsite.devel' => {
- default => { 'packageName' => 'gridsite-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libgridsite-dev' },
- },
- 'canl.c-devel' => {
- default => { 'packageName' => 'canl-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libcanl-dev' },
- },
- 'jobid.api-c-devel' => {
- default => { 'packageName' => 'glite-jobid-api-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-jobid-dev' },
- },
- 'jobid.api-cpp-devel' => {
- default => { 'packageName' => 'glite-jobid-api-cpp-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-jobid-cpp-dev' },
- },
- 'lbjp-common.db-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-db-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-db-dev' },
- },
- 'lbjp-common.gsoap-plugin-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-gsoap-plugin-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-gsoap-plugin-dev' },
- },
- 'lbjp-common.gss-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-gss-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-gss-dev' },
- },
- 'lbjp-common.jp-interface-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-jp-interface-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-jp-interface-dev' },
- },
- 'lbjp-common.log-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-log-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-log-dev' },
- },
- 'lbjp-common.maildir-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-maildir-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-maildir-dev' },
- },
- 'lbjp-common.server-bones-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-server-bones-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-server-bones-dev' },
- },
- 'lbjp-common.trio-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-trio-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-trio-dev' },
- },
- 'lb.client-devel' => {
- default => { 'packageName' => 'glite-lb-client-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-client-dev' },
- },
- 'lb.common-devel' => {
- default => { 'packageName' => 'glite-lb-common-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-common-dev' },
- },
- 'lb.state-machine-devel' => {
- default => { 'packageName' => 'glite-lb-state-machine-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-state-machine-dev' },
- },
- 'lb.logger-devel' => {
- default => { 'packageName' => 'glite-lb-logger-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-logger-dev' },
- },
- 'px.proxyrenewal-devel' => {
- default => { 'packageName' => 'glite-px-proxyrenewal-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-security-proxyrenewal-dev' },
- },
- 'canl.c-devel' => {
- default => { 'packageName' => 'canl-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libcanl-c-dev' },
- },
-);
-
-my @k = keys %deps_aux;
-@buildroot{@k} = ('') x ($#k+1);
-
-$buildroot{'gridsite.core'} = 'src';
-}
-
-sub full
-{
- my ($short) = @_;
- my $subsys = $short;
- $subsys =~ s/\..*//;
-
- my $cvs_prefix = exists $cvs_prefix{$subsys} ? $cvs_prefix{$subsys} : 'org.glite';
- return $extrafull{$short} ? $extrafull{$short} : "$cvs_prefix.$short";
-}
-
-sub get_version
-{
- my ($fmod, $top_srcdir) = @_;
-
- my ($subsys,$mod) = split /\./,$fmod,2;
- my ($major,$minor,$rev,$age);
- my $old_;
-
- if ($force_version) {
- $force_version =~ /([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)-(.+)/;
- ($major,$minor,$rev,$age) = ($1,$2,$3,$4);
- }
- else {
- my $path = "$top_srcdir/project";
- if ($subsys eq 'gridsite') {
- $path = "$cvs_prefix{$subsys}.$subsys.core/project";
- }
- open V,"$path/version.properties"
- or die "$path/version.properties: $!\n";
-
- $old_ = $_;
- while (<V>) {
- chomp;
- ($major,$minor,$rev) = ($1,$2,$3) if /module\.version\s*=\s*([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/;
- $age = $1 if /module\.age\s*=\s*([[:digit:]]+)/;
- }
- close V;
- $_ = $old_;
- }
- $version = "$major.$minor.$rev-$age";
-
- return ($major, $minor, $rev, $age);
-}
-
-sub get_description
-{
- my ($top_srcdir) = @_;
-
- my $cvs_module = $top_srcdir;
- my $package_description = "";
- my $package_summary = "";
-
- if (-e "$cvs_module/project/package.description") {
- open V, "$cvs_module/project/package.description";
- $package_description = join ("", <V>);
- close V;
- chomp $package_description;
- }
- else {
- print STDERR "package.description not found for $subsys.$module!\n"; }
-
- if (-e "$cvs_module/project/package.summary") {
- open V, "$cvs_module/project/package.summary";
- $package_summary = join ("", <V>);
- close V;
- chomp $package_summary;
- $package_summary =~ s/\n/\\n/g;
- }
- else {
- print STDERR "package.summary not found for $subsys.$module!\n"; }
-
- return ($package_summary, $package_description);
-}
-
-sub mkinc
-{
- my %aux;
- undef %aux;
- my @m=qw/
-lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.nagios lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lb.emi-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
-px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config px.emi-px
-canl.c
-/;
- @aux{@m} = (1) x ($#m+1);
-
- my ($short) = @_;
- my $full = full $short;
- my ($subsys,$mod) = split /\./,$short,2;
- my $packageName = "$project{tag_prefix}{$subsys}$subsys-${mod}";
-
- unless ($aux{$short}) {
- print "Makefile.inc not needed in $full\n";
- return;
- }
-
- my $top_srcdir = '.';
- my $abs_srcdir = '';
- my $build = '';
-
- if ($module) {
- $top_srcdir = $0;
- $top_srcdir =~ s,/?[^/]*$,,;
- $abs_srcdir = $top_srcdir;
- $top_srcdir =~ s,^$,\.,;
- } else {
- $build = "$full/";
- $abs_srcdir = "$full/";
- unless ($buildroot{$_} eq '') {
- $top_srcdir = '..';
- $build .= "$buildroot{$_}/";
- unless (-d "$build") {
- mkdir "$build" or die "mkdir $build: $!\n";
- }
- }
- }
-
- my ($major, $minor, $rev, $age) = get_version $short, $abs_srcdir;
- my ($package_summary, $package_description) = get_description $abs_srcdir;
- if ($package_description) { $package_description =~ s/(.{1,78}\S|\S+)\s+/$1\n/mg; }
- my $package_description_debian = $package_description;
- $package_description_debian =~ s/^/ /mg;
-
- my ($old_locale, $specdate, $debdate);
-
- # files for ETICS always in root source directory
- mkdir $abs_srcdir."project" unless (-d $abs_srcdir."project");
- open PKGCHL,">".$abs_srcdir."project/changelog"
- or die $abs_srcdir."project/changelog: $!\n";
- $old_locale = setlocale(LC_TIME);
- setlocale(LC_TIME, "C");
- $specdate = strftime("%a %b %d %Y", gmtime());
- $debdate = strftime("%a, %d %b %Y %H:%M:%S %z", gmtime());
- setlocale(LC_TIME, $old_locale);
- print PKGCHL qq{* $specdate CESNET team <emi-lb\@metacentrum.cz>
-- automatically generated package
-};
- close PKGCHL;
-
- unless ($top_srcdir eq '.') {
- unlink $build."Makefile";
- symlink "$top_srcdir/Makefile",$build."Makefile" or die "symlink $top_srcdir/Makefile ".$build."Makefile: $!\n";
- }
-
- open MKINC,">".$build."Makefile.inc"
- or die $build."Makefile.inc: $!\n";
-
- print "Creating ".$build."Makefile.inc\n";
-
- print MKINC qq{project = $project
-PREFIX = $root
-prefix = $prefix
-stagedir = $stagedir
-sysroot = $sysroot
-sysconfdir = $sysconfdir
-localstatedir = $localstatedir
-thrflavour = $thrflavour
-nothrflavour = $nothrflavour
-libdir = $libdir
-top_srcdir = $top_srcdir
-};
-
- for (@{$need_externs{$short}}) {
- next unless defined $externs{$_} and defined $externs{$_}{prefix};
- print MKINC "${_}_prefix = $externs{$_}{prefix}\n";
- print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags};
- }
-
- for (@{$need_jars{$short}}) {
- print MKINC "${_}_jar = $jar{$_}\n"
- }
-
- my $need_gsoap = 0;
- for (@{$need_externs{$short}}) { $need_gsoap = 1 if $_ eq 'gsoap'; }
-
- print MKINC "gsoap_default_version=".gsoap_version()."\n" if $need_gsoap;
-
- close MKINC;
-
- my $dh;
- my $debian = 0;
-
- opendir $dh, "$abs_srcdir/project" || die "Can't open $abs_srcdir/project: $!";
- for my $dir (readdir $dh) {
- if ($dir=~/^(.*)\.spec$/) {
- if ($1 ne $packageName) {
- printf STDERR "Changed RPM name: $packageName --> $1\n" if ($debug);;
- $packageName=$1;
- }
- last;
- }
- }
- closedir $dh;
-
- for my $file ("$packageName.spec", "debian.rules", "debian.control", "debian.changelog", "debian.copyright") {
- if (-f "$abs_srcdir/project/$file") {
- my $old_ = $_;
- printf STDERR "Creating $build$file\n" if ($debug);;
- open DST, ">$build$file";
- open SRC, "<$abs_srcdir/project/$file";
- while (<SRC>) {
- if (/\@MODULE\@/) { s/\@MODULE\@/$full/g; }
- if (/\@URL\@/) { s/\@URL\@/$package{url}/g; }
- if (/\@SUMMARY\@/) { s/\@SUMMARY\@/$package_summary/g; }
- if (/\@DESCRIPTION\@/) { s/\@DESCRIPTION\@/$package_description/g; }
- if (/\@DEBIAN_DESCRIPTION\@/) { s/\@DEBIAN_DESCRIPTION\@/$package_description_debian/g; }
- if (/\@VERSION\@/) { s/\@VERSION\@/$version/g; }
- if (/\@MAJOR\@/) { s/\@MAJOR\@/$major/g; }
- if (/\@MINOR\@/) { s/\@MINOR\@/$minor/g; }
- if (/\@REVISION\@/) { s/\@REVISION\@/$rev/g; }
- if (/\@AGE\@/) { s/\@AGE\@/$age/g; }
- if (/\@MAINTAINER\@/) { s/\@MAINTAINER\@/$package{maintainer}/g; }
- if (/\@UPLOADERS\@/) { s/\@UPLOADERS\@/$package{uploaders}/g; }
- if (/\@DEBIAN_VCS\@/) { s/\@DEBIAN_VCS\@/$package{debian_vcs}/g; }
- if (/\@DEBIAN_DATE\@/) { s/\@DEBIAN_DATE\@/$debdate/g; }
- if (/\@SPEC_DATE\@/) { s/\@SPEC_DATE\@/$specdate/g; }
- if (/^\s*.+\/configure\s/ and $force_version) {
- print "Version forced to $version\n" if ($debug);;
- s/--version\s+\S+\s?//;
- s/$/ --version $version/;
- }
- printf DST "%s", "$_";
- }
- close SRC;
- close DST;
- $_ = $old_;
- }
- }
-
- print "Creating ${build}debian/\n" if ($debug);;
-
- `rm -rfv ${build}debian`;
- mkdir $build."debian" or die $!;
- `cp $abs_srcdir/project/debian.* ${build}debian/ 2>/dev/null`;
- `mv ${build}debian.* ${build}debian/ 2>/dev/null`;
- `rm -f ${build}debian/*.orig`;
- opendir $dh, "${build}debian" || die "Can't open ${build}debian: $!";
- for $_ (readdir $dh) {
- if (/^debian\.(.*)/) {
- `mv ${build}debian/$_ ${build}debian/$1`;
- $debian = 1;
- }
- }
- closedir $dh;
-
- if ($debian) {
- my ($dir, $file);
-
- chmod 0755, "${build}debian/rules";
- $file="${build}debian/docs"; if (not -f $file) { `touch $file`; }
- $dir="${build}debian/source"; if (not -d $dir) { mkdir $dir; }
- $file="${build}debian/source/format"; if (not -f $file) { `echo "3.0 (quilt)" > $file` }
- $file="${build}debian/compat"; if (not -f $file) { `echo "7" > $file` }
- $file="${build}debian/changelog"; if (not -f $file) {
- open FH, ">$file" or die $!;
- print FH qq{$packageName ($major.$minor.$rev-$age) unstable; urgency=low
-
- * Automatically generated package
-
- -- $package{maintainer} $debdate
-};
- close FH;
- }
-
- } else {
- `rm -rf ${build}debian`;
- }
-}
-
-BEGIN{
-};
-
-sub mode_etics_packaging {
- my ($fmod, $cmd, $rpmprepare, $debprepare) = @_;
- my ($workspaceDir, $srcPackageName, $srcAge, $topDir);
-
- # old-school packaging by ETICS for EMI-1
- if ($project eq 'emi' and $project_version == 1) { return; }
-
- if ($fmod eq 'gridsite.core') {
- $workspaceDir = '..';
- $srcPackageName = 'gridsite';
- $srcAge = '';
- $topDir = '../';
- } else {
- $workspaceDir = '${workspaceDir}';
- $srcPackageName = '${packageName}';
- $srcAge = '-${age}';
- $topDir = '';
- }
-
- $cmd->{clean} = 'make clean
- rm -rfv ${package.tgzLocation} ${package.SRPMSLocation}';
- $cmd->{default}{packaging} = $rpmprepare;
- $cmd->{default}{packaging} .= "dir=\${workspaceDir}/rpm_build_src_\$\$
- mkdir -p \${package.tgzLocation} \${package.SRPMSLocation} \$dir/{BUILD,RPMS,SOURCES,SRPMS} 2>/dev/null || true
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \${package.tgzLocation}/
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \$dir/SOURCES/
- rpmbuild -bs --nodeps --define \"_topdir \$dir\" $srcPackageName.spec
- cp -v \$dir/SRPMS/*.src.rpm \${package.SRPMSLocation}/
- rm -rf \$dir";
-
- for my $p ('deb5_x86_64_gcc432', 'deb5_ia32_gcc432', 'deb6_x86_64_gcc445', 'deb6_ia32_gcc445') {
- for my $c (keys %{$cmd->{default}}) { $cmd->{$p}{$c} = $cmd->{default}{$c}; }
- $cmd->{$p}{clean} = 'make clean
- rm -rfv ${package.tgzLocation} ${package.SDEBSLocation}';
- $cmd->{$p}{packaging} = $debprepare;
- $cmd->{$p}{packaging} .= "dir=\${workspaceDir}/dpkg_build_src_\$\$
- mkdir -p \${package.tgzLocation} \${package.SDEBSLocation} \$dir 2>/dev/null || true
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \${package.tgzLocation}/
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \$dir/${srcPackageName}_\${version}.orig.tar.gz
- tar xzf \$dir/${srcPackageName}_\${version}.orig.tar.gz -C \$dir
- cp -rf ${topDir}debian/ \$dir/$srcPackageName-\${version}/
- cd \$dir/$srcPackageName-\${version}
- dpkg-buildpackage -S -d -nc
- cd -
- cp -v \$dir/*.tar.gz \$dir/*.dsc \${package.SDEBSLocation}/
- rm -rf \$dir";
- }
-}
-
-sub mode_etics {
- $fmod = shift;
-
- die "$0: --module required with --etics\n" unless $fmod;
-
- my ($subsys,$module) = split /\./,$fmod,2;
- my $full = full "$subsys.$module";
-
- my ($major,$minor,$rev,$age) = get_version $fmod, $full;
-
- # XXX: --with ignored for platform-dependend packages
- my @copts = ();
- my %ge;
- @ge{@{$etics_projects{$project{etics_name}}}} = (1) x ($#{$etics_projects{$project{etics_name}}}+1);
-
- for (@{$need_externs{"$subsys.$module"}}) {
- if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/ and (defined $externs{$_} or defined $jar{$_})) {
- my $eext = $etics_externs{default}{$_} ? $etics_externs{default}{$_} : $_;
- next if ($eext eq '-');
- if (defined $project{etics_locations}{'*'} or defined $project{etics_locations}{$_}) {
- $eext = $project{etics_locations}{$_} if ($project{etics_locations}{$_});
- push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}";
- } else {
- if ($ge{$_} and not defined $externs{$_}{pkg}) {
- push @copts, "--with-$_=\${stageDir}";
- }
- }
- }
- }
-
- for (@{$need_jars{"$subsys.$module"}}) {
- my $eext = $etics_externs{default}{$_} ? $etics_externs{default}{$_} : $_;
-
- push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (defined $project{etics_locations}{'*'} or defined $project{etics_locations}{$_});
- }
-
- my $conf;
- my $conftag;
- my ($confprefix, $nameprefix, $packageName);
-
- $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n";
-
- $confprefix = $project{conf_prefix}{$subsys};
- $nameprefix = $confprefix;
- $nameprefix =~ s/-$//;
- $nameprefix =~ s/-/\./g;
- $packageName = "$project{tag_prefix}{$subsys}$subsys-${module}";
-
- if ($branch) {
- $conf = "$confprefix${subsys}-${module}_$branch";
- $conftag = $branch;
- # forced low age number
- $age = $branch eq 'HEAD' ? '0head' : '0dev';
- push @copts, '--version ${version}-${age}';
- }
- else {
- $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}";
-# XXX: gridsite hack
- $conftag = $subsys eq 'gridsite' ? "$project{tag_prefix}{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" :
- "$project{tag_prefix}{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}";
-
- # lowering age for older packaging
- if ($project eq 'emi' and $project_version == 1) {
- $age = $age - 1;
- }
- }
-
- # emi1 suffix for older packaging
- if ($project eq 'emi' and $project_version == 1) {
- $age = $age.$project.$project_version;
- $conf = $conf.$project.$project_version;
- }
-
- my $file = $output ? $output : "$conf.ini";
- open C,">$file" or die "$file: $!\n";
-
- my $buildroot = $buildroot{"$subsys.$module"} eq '' ? '#no build.root' : "build.root = " . $buildroot{"$subsys.$module"};
-
- my $confdir = $buildroot{"$subsys.$module"} eq '' ? '.' : '..';
-
- my $cvs_module = full "$subsys.$module";
- my ($package_summary, $package_description) = get_description $cvs_module;
- if ($package_description) {
- $package_description =~ s/\n/\\n/g;
- $package_description = "package.description = $package_description\n";
- }
- if ($package_summary) {
- $package_summary = "package.summary = $package_summary\n";
- }
-
- my %cmd;
- $cmd_vcs{checkout} = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_module 2>/dev/null";
- #$cmd_vcs{checkout} = "((test -d jra1mw/.git && (cd jra1mw; git pull)) || (git clone -q http://scientific.zcu.cz/git/jra1mw.git";
- #$cmd_vcs{checkout} .= " && (cd jra1mw; git checkout -b \${tag} --track origin/\${tag})" unless ($conftag eq /HEAD/);
- #$cmd_vcs{checkout} .= ")) && (test -d \${moduleName} || ln -s jra1mw/$cvs_module \${moduleName})";
- $cmd_vcs{checkout} .= "\n\ttest -f \${packageName}-\${version}-\${age}.src.tar.gz || (ln -s \${moduleName} \${packageName}-\${version}; tar -chf - \${packageName}-\${version} --exclude CVS --exclude .git --exclude .etics | gzip --best > \${packageName}-\${version}-\${age}.src.tar.gz; rm \${packageName}-\${version})";
- $cmd_vcs{tag} = "cvs -d \${vcsroot} tag -R \${tag} ${moduleName}";
-
- $cmd{default}{init} = 'None';
- $cmd{default}{configure} = 'None';
- $cmd{default}{compile} = 'None';
- $cmd{default}{test} = 'None';
- $cmd{default}{install} = 'None';
- $cmd{default}{packaging} = 'None';
- $cmd{default}{clean} = 'make clean';
-
- if (exists $subpackages{$fmod}) {
- $cmd{default}{clean} = 'None';
- $cmd{default}{packaging} = "echo building nothing, $subpackages{$fmod} will build this package";
- $cmd_vcs{checkout} = "mkdir -v \${moduleName} 2>/dev/null || true";
- } elsif ($subsys eq 'gridsite') {
- $cmd_vcs{tag} = 'None';
-
- if ($module eq 'core') {
- my $flags;
-
- if ($project ne 'glite') {
- # don't evaluate pkg-config calls to get them into source package
- $flags = 'RELEASE_VERSION=${age}
- GSOAPDIR=\`pkg-config gsoap --variable=prefix\`
- OPENSSL_GLOBUS_FLAGS=\`pkg-config globus-openssl --cflags\`
- OPENSSL_GLOBUS_LIBS=\`pkg-config globus-openssl --libs\`';
- } else {
- $flags = 'RELEASE_VERSION=${age}
- GSOAPDIR=${gsoap.location}
- OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor}
- OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}
- HTTPD_FLAGS=-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-1 -I${httpd-devel.location}/include/apr-1.0 -I${httpd-devel.location}/include/apr-0 -I${httpd-devel.location}/include/pcre';
- }
-
- $cmd{default}{configure} = "cat > Makefile.inc <<EOF
- project = $project
- top_srcdir = ..
- $flags
- EOF";
- $cmd{default}{compile} = "make prefix=\${prefix}$project{local_prefix} libdir=\${libdir}";
- $cmd{default}{install} = "make prefix=\${prefix}$project{local_prefix} libdir=\${libdir} install";
- mode_etics_packaging($fmod, \%cmd,
- "make prefix=\${prefix}$project{local_prefix} rpm-prepare
- cp gridsite.spec ../\n\t",
- "chmod +x \${moduleDir}/src/make-debian-files || true
- make prefix=\${prefix}$project{local_prefix} deb-prepare\n\t"
- );
- }
- elsif ($module eq '1.5-compat') {
- $cmd_vcs{checkout} = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.core 2>/dev/null";
- $cmd{default}{init} = 'echo "/sbin/ldconfig" > project/.post
- echo "/sbin/ldconfig" > project/.postun';
- $cmd{default}{configure} = "cat > src/Makefile.inc <<EOF
- project = emi
- libdir = \${libdir}
- MAJOR_VERSION=1
- MINOR_VERSION=1.5
- PATCH_VERSION=1.5.0
- VERSION=\\\$(PATCH_VERSION)
- RELEASE_VERSION=\${age}
- GSOAPDIR=\\`pkg-config gsoap --variable=prefix\\`
- OPENSSL_GLOBUS_FLAGS=\\`pkg-config globus-openssl --cflags\\`
- OPENSSL_GLOBUS_LIBS=\\`pkg-config globus-openssl --libs\\`
- EOF";
- $cmd{default}{compile} = "make -C src prefix=\${prefix}$project{local_prefix}
- rm -fv project/debian.changelog";
- $cmd{default}{install} = "make -C src prefix=\${prefix}$project{local_prefix} install-lib
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.so.1
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.so
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.a";
- $cmd{default}{packaging} = "None";
- }
- else {
- $cmd{default}{clean} = 'None';
- $cmd{default}{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this";
- $cmd_vcs{checkout} = "mkdir -v \${moduleName} 2>/dev/null || true";
- }
- }
- elsif ($subsys eq 'px' and $module eq 'myproxy-config') {
- $cmd{default}{configure} = "/usr/bin/perl $confdir/configure --root=\${prefix} --prefix= --stage=\${stageDir} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts";
- $cmd{default}{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config";
- }
- else {
- $cmd{default}{configure} = "/usr/bin/perl $confdir/configure $project{flavours} --root=\${prefix} --prefix=$project{local_prefix} --stage=\${stageDir} --sysroot=\${package.prefix} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts";
- $cmd{default}{compile} = 'make';
- $cmd{default}{test} = 'make check';
- $cmd{default}{install} = 'make install';
- if ($subsys eq 'lb' and $module eq 'client') {
- $cmd{default}{compile} = "make rpath=$project{local_prefix}/\${libdir}";
- $cmd{default}{install} = "make install post-install rpath=$project{local_prefix}/\${libdir}";
- }
- mode_etics_packaging($fmod, \%cmd);
- }
-
- 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 = $project{etics_name}.$subsys.$module
-displayName = $conf
-description = $cvs_prefix{$subsys}.$subsys.$module
-projectName = $project{etics_name}
-age = $age
-deploymentType = None
-vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite
-tag = $conftag
-version = $major.$minor.$rev
-$dwpath
-[Platform-default:VcsCommand]
-displayName = None
-description = None
-tag = $cmd_vcs{tag}
-branch = None
-commit = None
-checkout = $cmd_vcs{checkout}
-
-};
-
- for my $p (keys %cmd) {
- next if $p ne 'default' and exists $project{supported_platforms} and not exists $project{supported_platforms}{$p};
-
- print C qq{[Platform-$p:BuildCommand]
-postpublish = None
-packaging = $cmd{$p}{packaging}
-displayName = None
-description = None
-doc = None
-prepublish = None
-publish = None
-compile = $cmd{$p}{compile}
-init = $cmd{$p}{init}
-install = $cmd{$p}{install}
-clean = $cmd{$p}{clean}
-test = $cmd{$p}{test}
-configure = $cmd{$p}{configure}
-checkstyle = None
-
-};
- }
-
- print C qq{[Platform-default:Property]
-$buildroot
-package.preserve.libtool = false
-$package_description$package_summary$defprops};
-
- for (@{$obsoletes{"$subsys.$module"}}) {
- print C "package.obsoletes = $_\n";
- print C "package.replaces = $_\n";
- }
- for (@{$conflicts{"$subsys.$module"}}) {
- print C "package.conflicts = $_\n";
- }
- for (@{$provides{"$subsys.$module"}}) {
- print C "package.provides = $_\n";
- }
- print C "\n";
-
- for my $pp (keys %{$platform_properties{"$subsys.$module"}}) {
- next if $pp eq 'default';
- next if exists $project{supported_platforms} and not exists $project{supported_platforms}{$pp};
-
- print C "[Platform-$pp:Property]\n$buildroot\n";
-
- for my $p (keys %{$platform_properties{"$subsys.$module"}->{$pp}}) {
- print C $p . ' = ' . $platform_properties{"$subsys.$module"}->{$pp}->{$p} . "\n";
- }
- print C "$package_description$package_summary\n";
- }
-
- for my $platform ('default', keys %{$project{supported_platforms}}) {
- my $used = 0;
- my $output = '';
-
- for (@{$need_externs{"$subsys.$module"}},@{$need_jars{"$subsys.$module"}}) {
- my $eext = $etics_externs{$platform}{$_};
- my $edev = $project{etics_externs_devel}{$platform}{$_};
-
- # for the default platform using package of the same
- # name for runtime dependency
- if (not $eext) {
- if ($platform eq 'default') {
-#print "default runtime $_ on default\n";
- $eext = $_; }
- else {
-#print "no runtime $_ on $platform\n";
- $eext = '-'; }
- }
- if ($eext eq '-' and $edev eq '-') {
-#print "skipping $_ on $platform\n";
- next;
- }
-
- my $proj = 'externals';
- for my $p (keys %etics_projects) {
- for $m (@{$etics_projects{$p}}) {
- $proj = $p if $m eq $_;
- }
- }
-
- my $type = $need_externs_type{"$subsys.$module"}->{$_};
-
- if ($edev) {
- if ($type eq 'B') {
- # no runtime - change to devel pkg
- $eext = $edev;
- } elsif ($type eq 'BR' or $type eq 'RB') {
- # additional devel pkg
- if ($edev ne '-') { $output .= "$proj|$edev = B\n"; }
- }
- }
- if ($eext ne '-') { $output .= "$proj|$eext = $type\n"; }
- }
-
- if ($platform eq 'default') {
- for (@{$deps{"$subsys.$module"}}) {
- my $type = $deps_type{"$subsys.$module"}->{$_};
- if (not $used) {
- $used = 1;
- }
- $output .= "$project{etics_name}|$project{etics_name}.$_ = $type\n";
- }
- }
-
- if ($output) {
- print C qq{
-[Platform-$platform:DynamicDependency]
-$output};
- }
- }
-
- close C;
-
- for $file ("$cvs_module/project/debian.rules", "$cvs_module/project/$packageName.spec") {
- my $lib;
- my $main_module;
- @copts = ();
-
- if ($file =~ /debian\.rules$/) { $lib = 'lib'; }
- else { $lib = '%{_lib}'; }
-
- my $main_module = "$subsys.$module";
- if (exists $subpackages{$main_module}) { $main_module = $subpackages{$main_module}; }
-
- # locations hacks
- if ($file =~ /$packageName\.spec$/) {
- if ($fmod eq 'lb.client-java') {
- push @copts, '';
- push @copts, '--with-axis=/usr/local/axis1.4';
- }
- }
-
- if (-f $file) {
- open DST,">$file.new" or die "$file.new: $!\n";
- open SRC,"<$file" or die "$file: $!\n";
- while (<SRC>) {
- if (/^(\s*).+\/configure\s/) {
- printf DST "%s", "$1";
- printf DST "/usr/bin/perl $confdir/configure $project{flavours} --root=/ --prefix=$project{local_prefix} --libdir=$lib --project=$project --module $main_module@copts\n";
- } else {
- printf DST "%s", "$_";
- }
- }
- close SRC;
- close DST;
-
- `diff -b "$file" "$file.new"`;
- if ($? == 0) {
- print STDERR "($file not changed)\n";
- unlink "$file.new";
- } else {
- print STDERR "Writing $file\n";
- rename "$file", "$file.orig" unless -f "$file.orig";
- rename "$file.new", "$file";
- }
- }
- }
-}
-
-sub gsoap_version {
- local $_;
- my $gsoap_version;
- open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n";
-
- while ($_ = <S>) {
- 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;
-}
-
-sub getlibdir {
- if ( -e "/etc/debian_version") { # We are on Debian
- $lib64="lib";
- $lib32="lib32"; }
- else { # Another distribution
- $lib64="lib64";
- $lib32="lib"; }
- $libdir=$lib32;
-
- open INP, "uname -s | "; # Check kernel name
- $kname= <INP>;
- chomp($kname);
- close INP;
-
- if ( $kname eq "Linux") {
- $arch = ("x86_64\npowerpc\nppc64\n");
-
- open INP, "uname -p | "; # Check processor type
- $procname= <INP>;
- chomp($procname);
- close INP;
-
- if ($arch =~/^$procname\n/) {
- return ($lib64); }
-
- open INP, "uname -m | "; # Check machine hardware
- $machname= <INP>;
- chomp($machname);
- close INP;
-
- if ($arch =~/^$machname\n/) {
- return ($lib64); }
-
- # special cases (hyperlink lib64, Debian)
- if (-l "/usr/lib64") {
- $libdir=$lib32; }
-
- # if /usr/lib64 doesn't exist at all (AIX)
- unless ( -e "/usr/lib64" ) {
- $libdir=$lib32; }
- }
-
- if ( $kname eq "SunOS") {
- if (-e "/usr/lib/64") {
- $libdir="lib/64"; }
- }
-
- return $libdir;
-}
-
-sub reshuffle_platforms($$) {
- my ($data, $platforms) = @_;
- my ($platform, %blacklist, $value);
-
- return if not $platforms;
-
- for $platform (keys %$data) {
-#print "plat: $platform: $data->{$platform}\n";
- next if $platform eq 'default';
- for $_ (keys %{$data->{$platform}}) {
-#print " blacklist: $_ = $data->{$platform}{$_}\n";
- $blacklist{$_} = 1;
- }
- }
-
- for $_ (keys %blacklist) {
- $value = $data->{default}{$_} ? $data->{default}{$_} : $_;
- for $platform (keys %$platforms) {
- next if $platform eq 'default';
- if (not defined $data->{$platform}{$_}) {
- $data->{$platform}{$_} = $value;
-#print "added $value to $platform\n"
- }
- }
- $data->{default}{$_} = '-';
-#print "deleted $_ from default\n";
- }
-
- # merge dependencies across the supported platforms
- %blacklist = [];
- for $platform (keys %$platforms) {
- next if $platform eq 'default';
- for $_ (keys %{$data->{$platform}}) {
- $blacklist{$_} = 1;
- }
- }
- for $_ (keys %blacklist) {
- $value = undef;
- $same = 1;
- for $platform (keys %$platforms) {
- if (not $value) { $value = $data->{$platform}{$_}; }
- if (not $data->{$platform}{$_} or $value ne $data->{$platform}{$_}) {
- $same = 0;
- last;
- }
- }
- if ($same and $value) {
-#print "merged dependency $_\n";
- $data->{default}{$_} = $value;
- for $platform (keys %$platforms) {
- delete $data->{$platform}{$_};
- }
- }
- }
-}
-
-sub usage {
- my @ext = keys %externs;
- my @myjars = keys %jar;
-
- print STDERR qq{
-Usage: $0 options
-
-General options (defaults in []):
- --prefix=PREFIX destination directory [./stage]
- --stage=DIR staging directory [./stage]
- --root=DIR installation root (custom relocation root -> sysroot) [./stage]
- --sysroot=DIR system root (custom relocation root -> sysroot) []
- --sysconfdir=DIR system configuration directory [PREFIX/etc]
- --staged=module,module,... what is already in PREFIX (specify without org.glite.)
- --thrflavour=flavour
- --nothrflavour=flavour threaded and non-treaded flavours [gcc64dbgpthr,gcc64dbg]
- --listmodules=subsys list modules of a subsystem
- --listmodules=module list subpackages of a module
- --version=maj.min.rev-age version used instead of reading version.properties
- --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...)
- --libdir=libdir typically [lib,lib64] postfix
- --project=PROJECT build or generate etics for a project (glite/emi1/emi) [emi]
- --debug print more details
-
-Mode of operation:
- --mode=\{checkout|build|etics\} what to do [build]
-
-What to build:
- --module=module build this module only
- --enable-NODE build this "node" (set of modules) only
- --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
- --jobid-tag=tag checkout jobid modules with specific tag
- --canl-tag=tag checkout canl modules with specific tag
-
-Dependencies (summary of what will be used is always printed):
- --with-EXTERNAL=PATH where to look for an external [autodetect]
- --with-JAR=JAR where to look for jars
-
-Available nodes:
- @nodes
-
-Default nodes:
- @default_nodes
-
-Externals (not all for all modules) are:
- @ext
-
-External jars are:
- @myjars
-
-};
-
-}
+++ /dev/null
-#include "example_locl.h"
-
-void
-print_gss_err(int ret, edg_wll_GssStatus *gss_ret, char *msg)
-{
- const char *err;
-
- if (ret == EDG_WLL_GSS_ERROR_GSS) {
- char *gss_err;
- edg_wll_gss_get_error(gss_ret, msg, &gss_err);
- fprintf(stderr, "%s\n", gss_err);
- free(gss_err);
- return;
- }
-
- switch (ret) {
- case EDG_WLL_GSS_ERROR_ERRNO:
- err = strerror(errno);
- break;
- case EDG_WLL_GSS_ERROR_HERRNO:
- err = hstrerror(errno);
- break;
- case EDG_WLL_GSS_ERROR_EOF:
- err = "Peer has closed the connection";
- break;
- case EDG_WLL_GSS_ERROR_TIMEOUT:
- err = "Connection timed out";
- break;
- default:
- err = "Unknown error";
- break;
- }
- fprintf(stderr, "%s: %s\n", msg, err);
- return;
-}
+++ /dev/null
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-
-#include <glite_gss.h>
-
-void
-print_gss_err(int ret, edg_wll_GssStatus *gss_ret, char *msg);
+++ /dev/null
-#include "example_locl.h"
-
-int
-main(int argc, char *argv[])
-{
- edg_wll_GssCred cred = NULL;
- edg_wll_GssConnection conn;
- edg_wll_GssStatus gss_ret;
- struct timeval tv = {60, 0};
- const char *hostname;
- const char *msg = "Hello";
- int port = 1234;
- int ret;
-
- if (argc < 2) {
- fprintf(stderr, "Usage: %s <hostname>\n", argv[0]);
- return 1;
- }
-
- hostname = argv[1];
-
- ret = edg_wll_gss_initialize();
- if (ret) {
- fprintf(stderr, "Failed to initialize\n");
- return 1;
- }
-
-#if 0
- ret = edg_wll_gss_acquire_cred_gsi(NULL, NULL, &cred, &gss_ret);
- if (ret) {
- print_gss_err(ret, &gss_ret, "Failed to load credentials");
- return 1;
- }
-#endif
-
- ret = edg_wll_gss_connect(cred, hostname, port,
- // NULL, GSS_C_NO_OID_SET,
- &tv, &conn, &gss_ret);
- if (ret) {
- print_gss_err(ret, &gss_ret, "Failed to connect to server");
- return 1;
- }
-
- ret = edg_wll_gss_write(&conn, msg, strlen(msg)+1, &tv, &gss_ret);
- if (ret) {
- print_gss_err(ret, &gss_ret, "Failed to send message");
- return 1;
- }
-
- edg_wll_gss_close(&conn, &tv);
-
- return 0;
-}
+++ /dev/null
-#include "example_locl.h"
-
-int
-main(int argc, char *argv[])
-{
- edg_wll_GssCred cred = NULL;
- edg_wll_GssConnection conn;
- edg_wll_GssStatus gss_ret;
- int ret;
- char buf[1024];
- struct addrinfo hints;
- struct addrinfo *ai;
- int sock;
-
- ret = edg_wll_gss_initialize();
- if (ret) {
- fprintf(stderr, "Failed to initialize\n");
- return 1;
- }
-
- memset (&hints, 0, sizeof(hints));
- hints.ai_flags = AI_NUMERICSERV | AI_PASSIVE | AI_ADDRCONFIG;
- hints.ai_socktype = SOCK_STREAM;
-
- ret = getaddrinfo (NULL, "1234", &hints, &ai);
- if (ret) {
- fprintf(stderr, "getaddrinfo() failed: %s\n",
- gai_strerror(ret));
- return 1;
- }
-
- sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
- if (sock < 0) {
- perror("Can't create socket");
- return 1;
- }
-
- ret = bind(sock, ai->ai_addr, ai->ai_addrlen);
- if (ret) {
- perror("Can't bind socket");
- return 1;
- }
-
- ret = listen(sock, 10);
- if (ret) {
- perror("Can't bind socket");
- return 1;
- }
-
- ret = edg_wll_gss_acquire_cred_gsi(NULL, NULL, &cred, &gss_ret);
- if (ret) {
- print_gss_err(ret, &gss_ret, "Failed to load credentials");
- fprintf(stderr, "continuing with default ones ...\n");
- }
-
- while (1) {
- int client;
- struct sockaddr_storage client_addr;
- socklen_t client_addr_len;
- edg_wll_GssPrincipal princ;
-
- client_addr_len = sizeof(client_addr);
- memset(&client_addr, 0, client_addr_len);
- client = accept(sock, (struct sockaddr *) &client_addr,
- &client_addr_len);
- if (client < 0) {
- perror("Failed to accept incomming connection\n");
- continue;
- }
-
- ret = edg_wll_gss_accept(cred, client, NULL, &conn, &gss_ret);
- if (ret) {
- print_gss_err(ret, &gss_ret, "Failed to accept client");
- edg_wll_gss_close(&conn, NULL);
- continue;
- }
-
- ret = edg_wll_gss_get_client_conn(&conn, &princ, &gss_ret);
- if (ret) {
- print_gss_err(ret, &gss_ret, "Failed to get client's name");
- edg_wll_gss_close(&conn, NULL);
- continue;
- }
-
- printf("Connection from %s\n", princ->name);
-
- ret = edg_wll_gss_read(&conn, buf, sizeof(buf), NULL, &gss_ret);
- edg_wll_gss_close(&conn, NULL);
- if (ret < 0) {
- print_gss_err(ret, &gss_ret, "Failed to read message");
-
- continue;
- }
-
- printf("Client sent: %s\n", buf);
- }
-
- return 0;
-}
+++ /dev/null
-#ifndef __EDG_WORKLOAD_LOGGING_COMMON_LB_GSS_H__
-#define __EDG_WORKLOAD_LOGGING_COMMON_LB_GSS_H__
-
-#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.
-*/
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <sys/time.h>
-#include <stdlib.h>
-#include <gssapi.h>
-
-enum {
- EDG_WLL_GSS_OK = 0, /* no GSS errors */
- EDG_WLL_GSS_ERROR_GSS = -1, /* GSS specific error, call edg_wll_get_gss_error() for details */
- EDG_WLL_GSS_ERROR_TIMEOUT = -2, /* Timeout */
- EDG_WLL_GSS_ERROR_EOF = -3, /* EOF occured */
- EDG_WLL_GSS_ERROR_ERRNO = -4, /* System error. See errno */
- EDG_WLL_GSS_ERROR_HERRNO = -5 /* Resolver error. See h_errno */
-};
-
-enum {
- EDG_WLL_GSS_FLAG_DELEG = 1,
- EDG_WLL_GSS_FLAG_CONF = 16,
- EDG_WLL_GSS_FLAG_INTEG = 32,
- EDG_WLL_GSS_FLAG_ANON = 64,
-};
-
-typedef void * edg_wll_GssCtx;
-
-typedef struct _edg_wll_GssConnection {
- edg_wll_GssCtx context;
- int sock;
- char *buffer;
- size_t bufsize;
- gss_OID authn_mech;
-} edg_wll_GssConnection;
-
-typedef struct _edg_wll_GssStatus {
- unsigned int major_status;
- unsigned int minor_status;
-} edg_wll_GssStatus;
-
-typedef struct _edg_wll_GssPrincipal_data {
- char *name;
- unsigned int flags;
- char **fqans;
- gss_OID authn_mech;
-} edg_wll_GssPrincipal_data;
-typedef struct _edg_wll_GssPrincipal_data *edg_wll_GssPrincipal;
-
-typedef struct _edg_wll_GssCred_data {
- void *gss_cred;
- time_t lifetime;
- char *name;
-} _edg_wll_GssCred_data;
-typedef struct _edg_wll_GssCred_data *edg_wll_GssCred;
-
-int
-edg_wll_gss_initialize(void);
-
-void
-edg_wll_gss_finalize(void);
-
-int
-edg_wll_gss_acquire_cred_gsi(const char *cert_file,
- const char *key_file,
- edg_wll_GssCred *cred,
- edg_wll_GssStatus* gss_code);
-
-int
-edg_wll_gss_release_cred(edg_wll_GssCred *cred,
- edg_wll_GssStatus* gss_code);
-
-int
-edg_wll_gss_connect(edg_wll_GssCred cred,
- char const *hostname,
- int port,
- struct timeval *timeout,
- edg_wll_GssConnection *connection,
- edg_wll_GssStatus* gss_code);
-
-int
-edg_wll_gss_connect_ext(edg_wll_GssCred cred,
- char const *hostname,
- int port,
- const char *service,
- gss_OID_set mechs,
- struct timeval *timeout,
- edg_wll_GssConnection *connection,
- edg_wll_GssStatus* gss_code);
-
-int
-edg_wll_gss_connect_name(edg_wll_GssCred cred,
- char const *hostname,
- int port,
- const char *servername,
- gss_OID_set mechs,
- struct timeval *timeout,
- edg_wll_GssConnection *connection,
- edg_wll_GssStatus* gss_code);
-
-int
-edg_wll_gss_accept(edg_wll_GssCred cred,
- int sock,
- struct timeval *timeout,
- edg_wll_GssConnection *connection,
- edg_wll_GssStatus* gss_code);
-
-int
-edg_wll_gss_read(edg_wll_GssConnection *connection,
- void *buf,
- size_t bufsize,
- struct timeval *timeout,
- edg_wll_GssStatus* gss_code);
-
-int
-edg_wll_gss_write(edg_wll_GssConnection *connection,
- const void *buf,
- size_t bufsize,
- struct timeval *timeout,
- edg_wll_GssStatus* gss_code);
-
-int
-edg_wll_gss_read_full(edg_wll_GssConnection *connection,
- void *buf,
- size_t bufsize,
- struct timeval *timeout,
- size_t *total,
- edg_wll_GssStatus* gss_code);
-
-int
-edg_wll_gss_write_full(edg_wll_GssConnection *connection,
- const void *buf,
- size_t bufsize,
- struct timeval *timeout,
- size_t *total,
- edg_wll_GssStatus* gss_code);
-
-int
-edg_wll_gss_watch_creds_gsi(const char * proxy_file,
- time_t * proxy_mtime);
-
-int
-edg_wll_gss_watch_creds(const char * proxy_file,
- time_t * proxy_mtime);
-
-int
-edg_wll_gss_get_error(edg_wll_GssStatus* gss_code,
- const char *prefix,
- char **errmsg);
-
-int
-edg_wll_gss_close(edg_wll_GssConnection *connection,
- struct timeval *timeout);
-
-int
-edg_wll_gss_reject(int sock);
-
-int
-edg_wll_gss_get_client_conn(edg_wll_GssConnection *connection,
- edg_wll_GssPrincipal *principal,
- edg_wll_GssStatus* gss_code);
-
-int
-edg_wll_gss_get_client_pem(edg_wll_GssConnection *connection,
- const char *my_cert_file, const char *my_key_file,
- char **pem_string);
-
-void
-edg_wll_gss_free_princ(edg_wll_GssPrincipal principal);
-
-int
-edg_wll_gss_gethostname(char *name, int len);
-
-char *
-edg_wll_gss_normalize_subj(char *in,
- int replace_in);
-
-int
-edg_wll_gss_equal_subj(const char *a,
- const char *b);
-
-int
-edg_wll_gss_unread(edg_wll_GssConnection *connection,
- void *data,
- size_t len);
-
-
-int
-edg_wll_gss_set_signal_handler(int signum,
- void (*handler_func)(int));
-
-void
-edg_wll_gss_poll_signal();
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __EDG_WORKLOAD_LOGGING_COMMON_LB_GSS_H__ */
+++ /dev/null
-/sbin/ldconfig
+++ /dev/null
-/sbin/ldconfig
+++ /dev/null
-2.0.0-1
-- LB 2.0 release
-
-2.0.0-2
-- proper reference to cppunit
-
-2.0.0-3
-- globus flavors added to configure
-
-2.0.0-4
-- Module repacked.
-
-2.0.0-5
-- New age to fix an erroneous lock
-
-2.0.0-6
-- install libraries into $libdir
-
-2.0.1-1
-- Memleak fixes
-- Working with c-ares >= 1.5.0
-- Added edg_wll_gss_unread()
-- Consider arch libdir when linking c-ares
-
-2.1.0-1
-- IPv6 fixes
-
-2.1.1-1
-- Fixed making target 'check'
-
-2.1.2-1
-- Fixed target 'clean' in the Makefile to handle debian builds
-
-2.1.3-1
-- c-ares function call adjusted to new/old c-ares version
-
-2.1.4-1
-- Support IPv6 literal adresses.
-
-2.1.5-1
-- EMI build (flavor-less globus, pkg-config, ...)
-- fix using globus in thread environment
-- new finalize function
-
-2.1.5-2
-- Module rebuilt
-
-3.0.0-1
-- Version numbering fixed
-
-3.0.0-2
-- Module rebuilt
-
-3.0.1-1
-- Root directory option (ETICS performs own files relocation)
-- Prefix option as prefix inside stage
-- Sysconfdir option (for /etc vs /usr)
-- DESTDIR in makefiles
-
-3.0.2-1
-
-- Relocatable build directory.
-- Proper flavor of the objects for the EPEL meal (threaded globus).
-
-3.0.2-2
-- Module rebuilt
-
-3.0.2-3
-- Module rebuilt
-
-3.0.2-4
-- Module rebuilt
-
-3.0.2-5
-- Module rebuilt
-
-3.0.3-1
-- edg_wll_gss_set_signal_handler() added
-
-3.0.4-1
-- Next stage for globus signal handler fixes:
- - globus common module loaded only in edg_wll_initialize()
- - using globus_poll_nonblocking() before checking signals in logger,
- new function in gss (needed for non-threaded globus flavour)
- - warning fixes (type cast, 32/64 portability)
- - gss functions documented in code
-
-3.0.5-1
-- compiler warnings, cosmetic changes
-- LB/GSS rutines try connecting to alternate addresses
-- savannah bug #85224 fixed. DN matches are not case-sensitive anymore.
-
-3.1.0-1
-- Support for multiple GSSAPI mechanisms
-- added example client and server
-- Next stage for globus signal handler fixes:
- - load globus common module only in edg_wll_initialize()
- - use globus_poll_nonblocking() before checking signals in logger,
- new function in gss (needed for non-threaded globus flavour)
- - warning fixes (type cast, 32/64 portability)
- - document gss functions in code
-
-3.1.1-1
-- Update build for flavour-less globus (using GSSAPI_* variables for complete Kerberos or GSI compilation flags).
-- build and fixes for Kerberos GSSAPI support
-- stop linking against efence
-- don't fail on problems with creds
-- the _gsi call made use only GSI and return silently if there's nothing to do
-- Shorted name for the Kerberos mechanism
-- Work around the globus bug that actually makes it impossible to specify own OID to import_creds.
- See https://bugzilla.mcs.anl.gov/globus/show_bug.cgi?id=7238
-
-3.1.2-1
-- Required pkg-config for -devel package working properly.
-- License string as recognized by rpmlint and packaging guidelines.
-- Always initialize Globus in threaded mode
-- Recognize sslv2 records
-- Fix segfault when trying alternative addresses without timeout
-- Implementation for edg_wll_gss_connect_name()
- - makes connection to server with a particular DN
-
-3.1.3-1
-- Control threading model through GLOBUS_THREAD_MODEL. Honour predefined value, but set explicitly the threaded model as default.
-- Workaround occasional crash in gss_init_sec_context() when using multiple threads
-- Globus pre-initialization magic workaround for gss_init_sec_context()
-- Locking around gss_import_sec_context() and setenv() to protect environment (not real fix, setenv() shouldn't be used at all)
-
-3.1.3-2
-- Module rebuilt
-
+++ /dev/null
-Source: glite-lbjp-common-gss
-Priority: extra
-Maintainer: @MAINTAINER@
-Uploaders: @UPLOADERS@
-Build-Depends: debhelper (>= 7.0.50~), chrpath, libcppunit-dev, libc-ares2, libc-ares-dev, libglobus-gssapi-gsi-dev, libtool
-Standards-Version: 3.9.1
-Section: libs
-Homepage: @URL@
-DM-Upload-Allowed: yes
-@DEBIAN_VCS@
-
-Package: libglite-security-gss9
-Section: libs
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: @SUMMARY@
-@DEBIAN_DESCRIPTION@
-
-Package: libglite-lbjp-common-gss-dev
-Section: libdevel
-Architecture: any
-Provides: glite-lbjp-common-gss
-Depends: libglite-security-gss9 (= ${binary:Version}), ${misc:Depends}, libglobus-gssapi-gsi-dev, pkg-config
-Description: Development files for gLite L&B/JP common gss library
- This package contains development libraries and header files for gLite gss
- library.
-
-Package: glite-lbjp-common-gss-dbg
-Section: debug
-Architecture: any
-Priority: extra
-Depends: libglite-security-gss9 (= ${binary:Version}), ${misc:Depends}
-Description: gLite gss library debugging symbols
- This package contains debugging symbols for gLite gss library.
+++ /dev/null
-This work was packaged for Debian by:
-
- @MAINTAINER@ on Thu, 08 Dec 2011 00:46:07 +0100
-
-It was downloaded from:
-
- @URL@
-
-Upstream Author(s):
-
- @MAINTAINER@
-
-Copyright:
-
- <Copyright (C) 2004-2011 Members of the EGEE Collaboration>
-
-License:
-
- 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.
-
-On Debian systems, the complete text of the Apache version 2.0 license
-can be found in "/usr/share/common-licenses/Apache-2.0".
-
-The Debian packaging is:
-
- Copyright (C) 2004-2011 Members of the EGEE Collaboration
-
-and is licensed under the Apache License, Version 2.0.
+++ /dev/null
-usr/lib
-usr/include/glite/security
+++ /dev/null
-usr/include/glite/security/*.h
-usr/lib/lib*.so
+++ /dev/null
-usr/lib/lib*.so.*
+++ /dev/null
-#!/usr/bin/make -f
-# -*- makefile -*-
-
--include /usr/share/dpkg/buildflags.mk
-
-# Uncomment this to turn on verbose mode.
-export DH_VERBOSE=1
-
-configure: configure-stamp
-configure-stamp:
- dh_testdir
- /usr/bin/perl ./configure --thrflavour= --nothrflavour= --root=/ --prefix=/usr --libdir=lib --project=emi --module lbjp-common.gss
- touch $@
-
-build: build-arch build-indep
-
-build-arch build-indep: build-stamp
-
-build-stamp: configure-stamp
- dh_testdir
- CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE)
- CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) check
- touch $@
-
-clean: configure-stamp
- dh_testdir
- dh_testroot
- rm -f configure-stamp build-stamp
- $(MAKE) clean
- rm -f Makefile.inc config.status
- dh_clean
-
-install: build-stamp
- dh_testdir
- dh_testroot
- dh_prep
- dh_installdirs
- $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
- rm -rvf $(CURDIR)/debian/tmp/usr/share
- rm -vf $(CURDIR)/debian/tmp/usr/lib/*.la
- rm -vf $(CURDIR)/debian/tmp/usr/lib/*.a
- find $(CURDIR)/debian/tmp -name '*' -print | xargs -I {} -i bash -c "chrpath -d {} > /dev/null 2>&1" || echo 'Stripped RPATH'
-
-binary-indep:
-
-binary-arch: install
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_installexamples
- dh_installman
- dh_installlogrotate
- dh_installcron
- dh_install --fail-missing
- dh_link
- dh_strip --dbg-package=glite-lbjp-common-gss-dbg
- dh_compress
- dh_fixperms
- dh_makeshlibs
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-arch binary-indep
+++ /dev/null
-all:
- pdflatex lbjp-common-gss_FD.tex
-
+++ /dev/null
-% emi.cls:
-% Branched from egee.cls 1.6
-% revision 2.0 [based on word template]
-% Emidio Giorgio -- emidio.giorgio@ct.infn.it
-% March 31, 2011
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% License
-%
-% This work is licensed under Creative Commons Attribution-ShareAlike 3.0.
-% http://creativecommons.org/licenses/by/3.0/
-% You are free:
-% * to Share Ñ to copy, distribute and transmit the work
-% * to Remix Ñ to adapt the work
-%
-% Under the following conditions:
-% * Attribution. You must attribute the work in the manner specified by the author or licensor
-% (but not in any way that suggests that they endorse you or your use of the work).
-% * Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting
-% work only under the same, similar or a compatible license.
-%
-% * For any reuse or distribution, you must make clear to others the license terms of this work.
-% The best way to do this is with a link to this web page : http://creativecommons.org/licenses/by/3.0/
-% * Any of the above conditions can be waived if you get permission from the copyright holder.
-% * Nothing in this license impairs or restricts the author's moral rights.
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{emi}[2011/03/24 EMI LaTeX Class]
-\typeout{EMI LaTeX class -- 2011/03/24}
-%
-%% Interface - example of an option, should we want to use these later.
-%\newif\ifmonotitle\monotitlefalse
-
-%\DeclareOption{mono}{\monotitletrue}
-
-\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
-\ProcessOptions
-
-
-% Inherit!
-\LoadClass[11pt]{article}
-
-% Necessary packages:
-\RequirePackage{lastpage}
-\RequirePackage{tabularx}
-\RequirePackage{pslatex}
-\RequirePackage{times}
-\RequirePackage{verbatim}
-\RequirePackage{geometry}
-\RequirePackage{url}
-
-\usepackage[hang,bf,small]{caption}
-\usepackage[T1]{fontenc}
-\usepackage[scaled]{helvet}
-\renewcommand*\familydefault{\sfdefault}
-%
-% We now define a new \if command to test for PDF being enabled.
-% It is important because loading graphicx overrides the definition
-% of \pdfoutput and sets it to true even when PDF is not enabled.
-% Use \ifpdf instead of \ifx\pdfoutput\undefined hereafter.
-%
-
-\newif\ifpdf
-\ifx\pdfoutput\undefined
- \pdffalse
- % \typeout{PDF _not_ defined}
-\else
- \pdfoutput=1
- \pdftrue
- % \typeout{PDF _is_ defined}
-\fi
-
-\ifpdf
- \usepackage[pdftex,
- pdfpagemode={UseOutlines},bookmarks=true,bookmarksopen=true,
- bookmarksopenlevel=0,bookmarksnumbered=true,
- hypertexnames=false,colorlinks,linkcolor={blue},
- citecolor={blue},urlcolor={red},
- pdfstartview={FitV}]{hyperref}
-\else
- \usepackage[hypertex]{hyperref}
-\fi
-
-\ifpdf
- \usepackage[pdftex]{graphicx}
- \pdfcompresslevel 9
- \pdfadjustspacing 1
-\else
- \usepackage[dvips]{graphicx}
-\fi
-
-\usepackage{color}
-
-\def\footsize{5mm}
-
-%%
-%% PAGE GEOMETRY DEFINITIONS
-%%
-% From Template file
-\geometry{centering,includeheadfoot}
-%\geometry{a4paper,top=12.5mm,headheight=12.5mm,headsep=5mm,foot=\footsize,footskip=13.3mm,bottom=12.5mm}
-\geometry{a4paper,top=15.5mm,headheight=20mm,headsep=5mm,foot=\footsize,footskip=13.3mm,bottom=12.5mm}
-\geometry{right=25mm,left=25mm}
-
-
-
-% APM -- I don't think these are right, my impression is above is correct
-%\geometry{a4paper,margin=0.98in,headheight=0.72in}
-
-
-%%
-%% PAGE COLOUR DEFINITIONS
-%%
-
-
-
-% paulm's prefered name ...
-\def\bibname{References}
-
-\setlength{\parindent}{0pt}
-\setlength{\parskip}{1.4mm plus 0.4mm minus 0.2mm}
-
-\def\@defaultfooter{
- \def\@oddfoot{\vbox to \footsize {%
- {\color{blue}\hrule width \textwidth height 1pt depth 0pt}%
- \vfil
- %\small\hbox to \textwidth{\ISTNumber%
- \small\hbox to \textwidth{%
- %\hfil
- %\hbox{\colorbox{yellow}{\MakeUppercase{\@Dissemination}}}%
- \hfil
- \hbox{\thepage/\pageref{LastPage}}}%
- }%
- }%
-}
-
-
-\def\ps@title{%
- \@defaultfooter
- \def\@oddhead{\hbox to \textwidth{\EMILogo\hfil\LargeCESNETLogo}}
-}
-
-\def\ps@headings{%
- \@defaultfooter
- \def\@oddhead{\vbox to \headheight{%
-%\hrule width \textwidth height 1pt\relax
- \vbox to 0.75\headheight{%
- \hbox to \textwidth{%
- \hbox to 0pt{\EMILogo\hss}%
- \hfil
-
-%% \hbox to 8cm{%
-%% \vbox to 0.75\headheight{%
-%% \vfil
-%% \parbox{8cm}{%
-%% \centering\color{blue}%
-%% \textbf{\MakeUppercase{\@title}}%
-%% %\ifx\@Subtitle\@empty\else
-%% % \par\textbf{\scriptsize\@Subtitle}%
-%% %\fi
-%% }%
-%% \vfil
-%% }%
-%% \hss}%
-
- \hfil
-%\hbox to 0pt{\vrule width 1pt height 10pt depth 0pt \hss}%
-%% {\scriptsize\setlength{\parskip}{0pt}\setlength{\topsep}{0pt}%
-%% % \vbox to 0.75\headheight{%
-%% \parbox{4cm}{x%
-%% \begin{flushright}%
-%% \textit{Doc. Identifier}:\\
-%% \textbf{\@DocIdentifier}\\
-%% \vfil
-%% \textit{Date}: \textbf{\@Date}
-%% \end{flushright}%
-%% }%
-%% % }%
-%% }%
-
-\hbox to 0pt{\hss\vbox to 0.75\headheight{%\hrule
-\small
-\parfillskip0pt
-\leftskip 0pt plus 1fil
-\parskip0ex
-\textsc{Title}:
-\par
-\textbf{\@title}
-
-
-\textit{Date}: \textbf{\@Date}
-\vfil
-%\hrule
-}}%
-% \hbox to 4cm{\scriptsize
-% \vbox to 0.75\headheight{%
-% \parbox{4cm}{
-% \halign{\hfill####\cr
-% \textit{Doc. Identifier}:\cr
-% \textbf{\@DocIdentifier}\cr
-% % \noalign{\vfil}
-% \textit{Date}: \textbf{\@Date}\cr
-% }}%
-% \vfil
-% }%
-% }%
- }%
- }%
-%\hrule width \textwidth height 1pt\relax
- \vfil\vskip 2.5mm\relax
- {\color{blue}\hrule width \textwidth height 1pt depth 0pt}%
- }%
- }%
-}
-
-\pagestyle{headings}
-
-\setlength{\captionmargin}{1cm}
-
-% image file extensions respective to the output format
-\ifpdf
- \DeclareGraphicsExtensions{.jpg,.pdf,.png}
- \pdfcompresslevel=9
- \pdfinfo{ /Title (EMI) }
-\else
- \DeclareGraphicsExtensions{.eps}
-\fi
-
-\def\frontboxwidth{11cm}%
-
-\definecolor{MyTeal}{rgb}{0,0.46,0.46}
-\definecolor{blue}{rgb}{0.05,0.26,0.5}
-%\definecolor{blue}{rgb}{0.1,0.1,0.5} %% egee blue
-\definecolor{lightgrey}{gray}{0.65}
-
-%%
-%% Define our title page
-%%
-\AtBeginDocument{
-\pagestyle{title}%
-\hbox{}% Force top of page
-\vfill
-{\centering
- \fontsize{30}{50}{\textbf{\textsc{\textcolor{blue}{European Middleware Initiative}}}}\\[40mm]%
- %\Huge{\textbf{\textsc{\textcolor{blue}{European Middleware Initiative}}}}\\[20mm]%
-
- \fontsize{22}{28}{\textbf{\textsc{\@title}}}\\[2mm]%
- %\ifx\@Subtitle\@empty\else
- % \normalsize\textsf{\@Subtitle}\\[10mm]%
- %\fi
-}
-\vfill
-
-\begin{center}
-\hbox to \textwidth{
-
- \vbox{
-
- {\color{MyTeal}\hrule width \frontboxwidth height 1mm depth 0pt}
-
- \hbox to \frontboxwidth{\sf
- \begin{tabularx}{\frontboxwidth}{l>{\raggedright\arraybackslash}X}
-\\
- Document version: & \textbf{\@DocVersion}\\[3mm]
- EMI Component Version: & \textbf{\@EMICompVersion}\\[3mm]
- Date: & \textbf{\@Date}\\[3mm]
- %Document status: & \textbf{\@DocStatus}\\[3mm]
-
- \end{tabularx}
-
- }
-
- {\color{MyTeal}\hrule width \frontboxwidth height 1mm depth 0pt}
- %}%centering
- }
-
-}
-\end{center}
-
-%\vfill
-%{\sf\underline{Abstract}: \@Abstract}
-\vfill
-\newpage % end of the first page
-\pagestyle{headings}
-\setcounter{tocdepth}{3}
-} % End of AtBeginningDocument
-
-
-%
-% EMI style small-capital section titles.
-%
-% The numbering is aligned with the WinWord style,
-% although it is not common in the english typography...
-%
-\newcommand{\sectionbreak}{\newpage}
-%\renewcommand{\thesection}{\arabic{section}.}
-%\renewcommand{\thesubsection}{\thesection\arabic{subsection}.}
-%\renewcommand{\thesubsubsection}{\thesubsection\arabic{subsubsection}.}
-
-\renewcommand\section{\@startsection {section}{1}{\z@}%
- {-3.5ex \@plus -1ex \@minus -.2ex}%
- {2.3ex \@plus.2ex}%
- {\normalfont\Large\bfseries\sffamily\scshape}}
-
-\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
- {-3.25ex\@plus -1ex \@minus -.2ex}%
- {1.5ex \@plus .2ex}%
- {\normalfont\large\bfseries\sffamily\scshape}}
-\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
- {-3.25ex\@plus -1ex \@minus -.2ex}%
- {1.5ex \@plus .2ex}%
- {\normalfont\normalsize\bfseries\sffamily\scshape}}
-
-
-
-%% APM NEED TO REDEFINE section
-%\titleformat{\section}{\Large\bfseries\sffamily\scshape}{\thesection}{1em}{}
-%\titlecontents{section} [2em] {\vspace*{4pt}}
-% {\large \sc \bfseries \contentslabel{2em}}
-% {\large \sc \bfseries \hspace*{-2em}}
-% {\large \textbf{\titlerule*[1ex]{.}\contentspage}} [\vspace*{4pt}]
-
-%\titleformat{\subsection}{\large\bfseries\sffamily\scshape}{\thesubsection}{1em}{}
-%\titlecontents{subsection} [5em] {}
-% {\sc \contentslabel{3em}}
-% {\sc \hspace*{-3em}}
-% {\titlerule*[1ex]{.}\contentspage}
-
-
-%
-% common constants
-%
-%\def\ISTNumber{INFSO-RI-508833}
-\newsavebox{\@EMILogo}
-%\savebox{\@EMILogo}{\includegraphics[height=0.75\headheight]{EMI_Logo_std}}
-\savebox{\@EMILogo}{\includegraphics[height=0.95\headheight]{EMI_Logo_std}}
-\def\EMILogo{\usebox{\@EMILogo}}
-%\def\LargeEMILogo{\includegraphics[height=\headheight]{EMI_Logo_std}}
-\def\SmallEMILogo{\includegraphics[height=\headheight]{EMI_Logo_std}}
-\def\LargeCESNETLogo{\includegraphics[height=\headheight]{cesnet}}
-% DEL \def\ISTLogo{\includegraphics[height=\headheight]{isi}}
-
-%
-% parameters to be supplied by the author
-%
-% EG : subtitle seems no more needed
-%\def\Subtitle#1{\gdef\@Subtitle{#1}}
-%\gdef\@Subtitle{\@latex@warning@no@line{No \noexpand\Subtitle given}}
-
-%\def\DeliverableId#1{\gdef\@DeliverableId{#1}}
-%\gdef\@DeliverableId{\@latex@warning@no@line{No \noexpand\DeliverableId given}}
-
-
-\def\DocVersion#1{\gdef\@DocVersion{#1}}
-\gdef\@DocVersion{\@latex@warning@no@line{No \noexpand\DocVersion given %
- (e.g. 0.1.2)}}
-
-\def\EMICompVersion#1{\gdef\@EMICompVersion{#1}}
-\gdef\@EMICompVersion{\@latex@warning@no@line{No \noexpand\EMICompVersion given %
- (e.g. 1.2.3)}}
-
-\def\Date#1{\gdef\@Date{#1}}
-\gdef\@Date{\@latex@warning@no@line{No \noexpand\Date given %
- (e.g. 01/04/2010)}}
-
-%\def\Activity#1{\gdef\@Activity{#1}}
-%\gdef\@Activity{\@latex@warning@no@line{No \noexpand\Activity given %
-% (e.g. NA2 Dissemination and Outreach )}}
-
-%\def\LeadPartner#1{\gdef\@LeadPartner{#1}}
-%\gdef\@LeadPartner{\@latex@warning@no@line{No \noexpand\LeadPartner given %
-% (e.g. CERN, RAL )}}
-
-%\def\DocStatus#1{\gdef\@DocStatus{#1}}
-%\gdef\@DocStatus{\@latex@warning@no@line{No \noexpand\DocStatus given %
-% (e.g. DRAFT, WORKING, DELIVERED)}}
-
-%\def\Dissemination#1{\gdef\@Dissemination{#1}}
-%\gdef\@Dissemination{\@latex@warning@no@line{No \noexpand\Dissemination given %
-% (e.g. PUBLIC, INTERNAL, ...)}}
-
-
-\long\def\Abstract#1{\gdef\@Abstract{#1}}
-\gdef\@Abstract{\@latex@warning@no@line{No \noexpand\Abstract given}}
-
-%%
-%% Define the abstract using an environment abstract
-
-%
-% This will produce the mailto link in the PDF file
-%
-%
-% We use the URL package, which does this nicely. The old way (\HTTP) was
-% a bit buggy as it had problems with '~'s and '_'s
-%
-\urlstyle{sf}
-\ifpdf
- \newcommand{\Email}[1]{\href{mailto:#1}{<{#1}>}}
- \newcommand{\HTTP}[1]{\href{#1}{\url{#1}}}
-\else
- \newcommand{\Email}[1]{\textsf{<{#1}>}}
- \newcommand{\HTTP}[1]{\url{#1}}
-\fi
-
-
-%
-% We now redifine \part and \section so that the table of contents
-% has the sections/parts in upper case.
-%
-% Note: need to use \uppercase because \MakeUppercase is not robust
-%
-\def\@part[#1]#2{%
- \ifnum \c@secnumdepth >\m@ne
- \refstepcounter{part}%
- \addcontentsline{toc}{part}{\thepart\hspace{1em}\uppercase{#1}}%
- \else
- \addcontentsline{toc}{part}{\uppercase{#1}}%
- \fi
- {\parindent \z@ \raggedright
- \interlinepenalty \@M
- \normalfont
- \ifnum \c@secnumdepth >\m@ne
- \Large\bfseries \partname\nobreakspace\thepart
- \par\nobreak
- \fi
- \huge \bfseries #2%
- \markboth{}{}\par}%
- \nobreak
- \vskip 3ex
- \@afterheading}
-
-\def\@sect#1#2#3#4#5#6[#7]#8{%
- \ifnum #2>\c@secnumdepth
- \let\@svsec\@empty
- \else
- \refstepcounter{#1}%
- \protected@edef\@svsec{\@seccntformat{#1}\relax}%
- \fi
- \@tempskipa #5\relax
- \ifdim \@tempskipa>\z@
- \begingroup
- #6{%
- \@hangfrom{\hskip #3\relax\@svsec}%
- \interlinepenalty \@M #8\@@par}%
- \endgroup
- \csname #1mark\endcsname{\uppercase{#7}}%
- \addcontentsline{toc}{#1}{%
- \ifnum #2>\c@secnumdepth \else
- \protect\numberline{\csname the#1\endcsname}%
- \fi
- \texorpdfstring{\uppercase{#7}}{#7}}%
- \else
- \def\@svsechd{%
- #6{\hskip #3\relax
- \@svsec #8}%
- \csname #1mark\endcsname{\uppercase{#7}}%
- \addcontentsline{toc}{#1}{%
- \ifnum #2>\c@secnumdepth \else
- \protect\numberline{\csname the#1\endcsname}%
- \fi
- \texorpdfstring{\uppercase{#7}}{#7}}}%
- \fi
- \@xsect{#5}}
-
-% \addcontentsline{toc} expands to \contentsline{NAME}
-% which in turn expands to \l@NAME. So, to specify
-% the table of contents, we must define \l@chapter, \l@section,
-% \l@subsection, ... ; to specify the list of figures, we must define
-% \l@figure; and so on. Most of these can be defined with the
-% \@dottedtocline command, which produces a contents line with dots
-% between the title and the page number. It works as follows:
-%
-% \@dottedtocline{LEVEL}{INDENT}{NUMWIDTH}
-% LEVEL : An entry is produced only if LEVEL < or = value of
-% 'tocdepth' counter. Note, \chapter is level 0, \section
-% is level 1, etc.
-% INDENT : The indentation from the outer left margin of the start of
-% the contents line.
-% NUMWIDTH : The width of a box in which the section number is to go,
-% if TITLE includes a \numberline command.
-%
-
-\def\l@part{\@dottedtocline{1}{4em}{2.0em}}
-\def\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
-\def\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}}
-\def\l@paragraph{\@dottedtocline{4}{7.0em}{4.1em}}
-\def\l@subparagraph{\@dottedtocline{5}{10em}{5em}}
-
+++ /dev/null
-\documentclass[]{emi}
-\usepackage[ascii]{inputenc}
-\usepackage[pdftex]{graphicx}
-
-\title{gLite GSS \& gSOAP Plugin Libraries -- Functional Description}
-%\Subtitle{Functional Description}
-\author{CESNET}
-%\DocIdentifier{emi-lbjp-common-gss-fd-1.0.0-1}
-%\DeliverableId{}
-\Date{\today}
-%\DocStatus{FINAL}
-\DocVersion{1.0.0-1}
-%\DocumentLink{\url{http://egee.cesnet.cz/cvsweb/PR/lbjp-common-gss\_FD.pdf}}
-\Abstract{
-GSS and gSOAP Plugin are security-oriented modules used exclusively within other EMI products.}
-\EMICompVersion{All versions}
-
-\begin{document}
-
-\tableofcontents
-
-\newpage
-
-\section{Introduction}
-
-Both security-oriented modules discussed in this Functional Description are internal libraries used exclusively within other EMI products.
-
-\section{GSS}
-The GSS module (\texttt{glite-lbjp-common-gss}) provides GSS functions (GSS-API\footnote{\url{http://tools.ietf.org/html/rfc2744}} and several non-GSS Globus calls) wrapped to a secure network communication library with strict timing control (via timeout arguments) of all remote operations.
-
-\section{gSOAP Plugin}
-The GSS plugin for gSoap (\texttt{glite-lbjp-common-gsoap-plugin}) provides secured communication via GSS, as well as strict timing control of all operations through \texttt{glite-lbjp-common-gss}.
-
-\end{document}
+++ /dev/null
-Summary: @SUMMARY@
-Name: glite-lbjp-common-gss
-Version: @MAJOR@.@MINOR@.@REVISION@
-Release: @AGE@%{?dist}
-Url: @URL@
-License: ASL 2.0
-Vendor: EMI
-Group: System Environment/Libraries
-BuildRequires: c-ares-devel
-BuildRequires: c-ares
-BuildRequires: chrpath
-BuildRequires: cppunit-devel
-BuildRequires: globus-gssapi-gsi-devel
-BuildRequires: libtool
-BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
-Obsoletes: glite-security-gss%{?_isa} < 2.1.5-1
-AutoReqProv: yes
-Source: http://eticssoft.web.cern.ch/eticssoft/repository/emi/emi.lbjp-common.gss/%{version}/src/%{name}-@VERSION@.src.tar.gz
-
-
-%description
-@DESCRIPTION@
-
-
-%package devel
-Summary: Development files for gLite GSS library
-Group: Development/Libraries
-Requires: %{name}%{?_isa} = %{version}-%{release}
-Requires: globus-gssapi-gsi-devel, pkgconfig
-Provides: glite-security-gss%{?_isa} = %{version}-%{release}
-Obsoletes: glite-security-gss%{?_isa} < 2.1.5-1
-
-
-%description devel
-This package contains development libraries and header files for gLite GSS
-library.
-
-
-%prep
-%setup -q
-
-
-%build
-/usr/bin/perl ./configure --thrflavour= --nothrflavour= --root=/ --prefix=/usr --libdir=%{_lib} --project=emi --module lbjp-common.gss
-make
-
-
-%check
-make check
-
-
-%install
-rm -rf $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
-find $RPM_BUILD_ROOT -name '*.la' -exec rm -rf {} \;
-find $RPM_BUILD_ROOT -name '*.a' -exec rm -rf {} \;
-find $RPM_BUILD_ROOT -name '*' -print | xargs -I {} -i bash -c "chrpath -d {} > /dev/null 2>&1" || echo 'Stripped RPATH'
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
-%post -p /sbin/ldconfig
-
-
-%postun -p /sbin/ldconfig
-
-
-%files
-%defattr(-,root,root)
-%dir /usr/share/doc/gss-%{version}
-%doc /usr/share/doc/gss-%{version}/LICENSE
-/usr/%{_lib}/libglite_security_gss.so.9.@MINOR@.@REVISION@
-/usr/%{_lib}/libglite_security_gss.so.9
-
-
-%files devel
-%defattr(-,root,root)
-%dir /usr/include/glite
-%dir /usr/include/glite/security
-/usr/include/glite/security/glite_gss.h
-/usr/%{_lib}/libglite_security_gss.so
-
-
-%changelog
-* @SPEC_DATE@ @MAINTAINER@ - @MAJOR@.@MINOR@.@REVISION@-@AGE@%{?dist}
-- automatically generated package
+++ /dev/null
-glite-security-gss wraps GSS functions (and several non-GSS Globus calls) to a secure network communication library with strict timing control (via timeout arguments) of all remote operations.
+++ /dev/null
-Wrapper of Globus GSS/SSL implementation used by gLite LB and JP
+++ /dev/null
-# $Header$
-module.version=3.1.3
-module.age=2
+++ /dev/null
-#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 <string.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <ares.h>
-#include <ares_version.h>
-#include <errno.h>
-#ifdef GLITE_LBU_THREADED
-#include <pthread.h>
-#endif
-
-#include <globus_common.h>
-#include <globus_gsi_callback.h>
-
-#include <gssapi.h>
-#include <openssl/err.h>
-#include <openssl/ssl.h>
-#include <openssl/stack.h>
-#include <openssl/x509.h>
-#include <openssl/pem.h>
-#include <openssl/bio.h>
-
-#include "glite_gss.h"
-
-#ifndef GSS_C_GLOBUS_SSL_COMPATIBLE
-#define GSS_C_GLOBUS_SSL_COMPATIBLE 16384
-#endif
-
-#define tv_sub(a,b) {\
- (a).tv_usec -= (b).tv_usec;\
- (a).tv_sec -= (b).tv_sec;\
- if ((a).tv_usec < 0) {\
- (a).tv_sec--;\
- (a).tv_usec += 1000000;\
- }\
-}
-
-struct asyn_result {
- struct hostent *ent;
- int err;
-};
-
-static int globus_common_activated = 0;
-#ifdef GLITE_LBU_THREADED
-static pthread_mutex_t init_lock = PTHREAD_MUTEX_INITIALIZER;
-#endif
-
-typedef struct gssapi_mech {
- const char* name;
- gss_OID_desc oid;
-} gssapi_mech;
-
-static
-struct gssapi_mech gssapi_mechs[] = {
- { "krb5", {9, "\x2A\x86\x48\x86\xF7\x12\x01\x02\x02"} },
- { "GSI", {9, "\x2b\x06\x01\x04\x01\x9b\x50\x01\x01"} },
- { "EAP", {9, "\x2B\x06\x01\x04\x01\xA9\x4A\x16\x01"} },
-};
-
-static gss_OID
-get_oid(const char *mech);
-
-static void
-free_hostent(struct hostent *h);
-
-static int
-try_conn_and_auth(edg_wll_GssCred cred, gss_name_t target, gss_OID mech,
- char *addr, int addrtype, int port, struct timeval *timeout,
- edg_wll_GssConnection *connection, edg_wll_GssStatus* gss_code);
-
-static int
-edg_wll_gss_oid_equal(const gss_OID a, const gss_OID b);
-
-static int decrement_timeout(struct timeval *timeout, struct timeval before, struct timeval after)
-{
- (*timeout).tv_sec = (*timeout).tv_sec - (after.tv_sec - before.tv_sec);
- (*timeout).tv_usec = (*timeout).tv_usec - (after.tv_usec - before.tv_usec);
- while ( (*timeout).tv_usec < 0) {
- (*timeout).tv_sec--;
- (*timeout).tv_usec += 1000000;
- }
- if ( ((*timeout).tv_sec < 0) || (((*timeout).tv_sec == 0) && ((*timeout).tv_usec == 0)) ) return(1);
- else return(0);
-}
-
-/* ares callback handler for ares_gethostbyname() */
-#if ARES_VERSION >= 0x010500
-static void callback_ares_gethostbyname(void *arg, int status, int timeouts, struct hostent *h)
-#else
-static void callback_ares_gethostbyname(void *arg, int status, struct hostent *h)
-#endif
-{
- struct asyn_result *arp = (struct asyn_result *) arg;
- int n_addr = 0;
- int i = 0;
-
- switch (status) {
- case ARES_SUCCESS:
- if (h == NULL || h->h_addr_list[0] == NULL){
- arp->err = NO_DATA;
- break;
- }
- /*how many addresses are there in h->h_addr_list*/
- while (h->h_addr_list[n_addr])
- n_addr++;
-
- arp->ent->h_addr_list = (char **) calloc((n_addr+1), sizeof(char *));
- if (arp->ent->h_addr_list == NULL) {
- arp->err = NETDB_INTERNAL;
- break;
- }
- for (i = 0; i < n_addr; i++) {
- arp->ent->h_addr_list[i] = malloc(h->h_length);
- if (arp->ent->h_addr_list[i] == NULL) {
- free_hostent (arp->ent);
- arp->ent = NULL;
- arp->err = NETDB_INTERNAL;
- break;
- }
- memcpy(arp->ent->h_addr_list[i], h->h_addr_list[i],
- h->h_length);
- }
- /* rest of h members might be assigned here(name,aliases), not necessery now */
- arp->ent->h_addr_list[n_addr] = NULL;
- arp->ent->h_addrtype = h->h_addrtype;
- arp->ent->h_length = h->h_length;
- arp->err = NETDB_SUCCESS;
- break;
- case ARES_EBADNAME:
- case ARES_ENOTFOUND:
- arp->err = HOST_NOT_FOUND;
- break;
- case ARES_ENOTIMP:
- arp->err = NO_RECOVERY;
- break;
- case ARES_ENOMEM:
- case ARES_EDESTRUCTION:
- default:
- arp->err = NETDB_INTERNAL;
- break;
- }
-}
-
-static void free_hostent(struct hostent *h){
- int i;
-
- if (h) {
- if (h->h_name) free(h->h_name);
- if (h->h_aliases) {
- for (i=0; h->h_aliases[i]; i++) free(h->h_aliases[i]);
- free(h->h_aliases);
- }
- if (h->h_addr_list) {
- for (i=0; h->h_addr_list[i]; i++) free(h->h_addr_list[i]);
- free(h->h_addr_list);
- }
- free(h);
- }
-}
-
-static int asyn_getservbyname(int af, struct asyn_result *ar,char const *name, int port, struct timeval *timeout) {
- ares_channel channel;
- int nfds;
- fd_set readers, writers;
- struct timeval tv, *tvp;
- struct timeval start_time,check_time;
- int err = NETDB_INTERNAL;
- char *name2, *p;
- size_t namelen;
-
- name2 = (char *)name;
- namelen = strlen(name);
- if (name[0]=='[' && name[namelen-1]==']') {
- /* IPv6 literal, strip brackets */
- name2 = strdup(name);
- if (!name2) return NETDB_INTERNAL;
- name2[namelen-1] = '\0';
- name2++;
- /* Ignore scope identifier, not supported by c-ares */
- p = strchr(name2, '%');
- if (p) *p = '\0';
- }
-
-/* start timer */
- gettimeofday(&start_time,0);
-
-/* ares init */
- if ( ares_init(&channel) != ARES_SUCCESS ) return(NETDB_INTERNAL);
-
-/* query DNS server asynchronously */
- ares_gethostbyname(channel, name2, af, callback_ares_gethostbyname,
- (void *) ar);
-
-/* wait for result */
- while (1) {
- FD_ZERO(&readers);
- FD_ZERO(&writers);
- nfds = ares_fds(channel, &readers, &writers);
- if (nfds == 0)
- break;
-
- gettimeofday(&check_time,0);
- if (timeout && decrement_timeout(timeout, start_time, check_time)) {
- ares_destroy(channel);
- return(TRY_AGAIN);
- }
- start_time = check_time;
-
- tvp = ares_timeout(channel, timeout, &tv);
-
- switch ( select(nfds, &readers, &writers, NULL, tvp) ) {
- case -1: if (errno != EINTR) {
- ares_destroy(channel);
- return NETDB_INTERNAL;
- } else
- continue;
- case 0:
- FD_ZERO(&readers);
- FD_ZERO(&writers);
- /* fallthrough */
- default: ares_process(channel, &readers, &writers);
- }
- }
- err = ar->err;
-
- /* literal conversion should always succeed */
- if (name2 != name) free(name2-1);
-
- ares_destroy(channel);
-
- return err;
-}
-
-static int
-do_connect(int *s, char *addr, int addrtype, int port, struct timeval *timeout)
-{
- int sock;
- struct timeval before,after,to;
- struct sockaddr_storage a;
- struct sockaddr_storage *p_a=&a;
- socklen_t a_len;
- int sock_err;
- socklen_t err_len;
- int opt;
-
- struct sockaddr_in *p4 = (struct sockaddr_in *)p_a;
- struct sockaddr_in6 *p6 = (struct sockaddr_in6 *)p_a;
-
- memset(p_a, 0, sizeof *p_a);
- p_a->ss_family = addrtype;
- switch (addrtype) {
- case AF_INET:
- memcpy(&p4->sin_addr, addr, sizeof(struct in_addr));
- p4->sin_port = htons(port);
- a_len = sizeof (struct sockaddr_in);
- break;
- case AF_INET6:
- memcpy(&p6->sin6_addr, addr, sizeof(struct in6_addr));
- p6->sin6_port = htons(port);
- a_len = sizeof (struct sockaddr_in6);
- break;
- default:
- return NETDB_INTERNAL;
- break;
- }
-
- sock = socket(a.ss_family, SOCK_STREAM, 0);
- if (sock < 0) return EDG_WLL_GSS_ERROR_ERRNO;
-
- opt = 1;
- setsockopt(sock,IPPROTO_TCP,TCP_NODELAY,&opt,sizeof opt);
-
- if (timeout) {
- int flags = fcntl(sock, F_GETFL, 0);
- if (fcntl(sock, F_SETFL, flags | O_NONBLOCK) < 0)
- return EDG_WLL_GSS_ERROR_ERRNO;
- gettimeofday(&before,NULL);
- }
-
- if (connect(sock,(struct sockaddr *) &a, a_len) < 0) {
- if (timeout && errno == EINPROGRESS) {
- fd_set fds;
- FD_ZERO(&fds);
- FD_SET(sock,&fds);
- memcpy(&to,timeout,sizeof to);
- gettimeofday(&before,NULL);
- switch (select(sock+1,NULL,&fds,NULL,&to)) {
- case -1: close(sock);
- return EDG_WLL_GSS_ERROR_ERRNO;
- case 0: close(sock);
- tv_sub(*timeout, *timeout);
- return EDG_WLL_GSS_ERROR_TIMEOUT;
- }
- gettimeofday(&after,NULL);
- tv_sub(after,before);
- tv_sub(*timeout,after);
-
- err_len = sizeof sock_err;
- if (getsockopt(sock,SOL_SOCKET,SO_ERROR,&sock_err,&err_len)) {
- close(sock);
- return EDG_WLL_GSS_ERROR_ERRNO;
- }
- if (sock_err) {
- close(sock);
- errno = sock_err;
- return EDG_WLL_GSS_ERROR_ERRNO;
- }
- }
- else {
- close(sock);
- return EDG_WLL_GSS_ERROR_ERRNO;
- }
- }
-
- *s = sock;
- return 0;
-}
-
-static gss_OID
-get_oid(const char *mech)
-{
- unsigned int i;
-
- for (i = 0; i < sizeof(gssapi_mechs)/sizeof(gssapi_mechs[0]); i++)
- if (strcasecmp(mech, gssapi_mechs[i].name) == 0)
- return &gssapi_mechs[i].oid;
-
- return GSS_C_NO_OID;
-}
-
-static int
-send_token(int sock, void *token, size_t token_length, struct timeval *to)
-{
- size_t num_written = 0;
- ssize_t count;
- fd_set fds;
- struct timeval timeout,before,after;
- int ret;
-
- if (to) {
- memcpy(&timeout,to,sizeof(timeout));
- gettimeofday(&before,NULL);
- }
-
-
- ret = 0;
- while(num_written < token_length) {
- FD_ZERO(&fds);
- FD_SET(sock,&fds);
- switch (select(sock+1, NULL, &fds, NULL, to ? &timeout : NULL)) {
- case 0: ret = EDG_WLL_GSS_ERROR_TIMEOUT;
- goto end;
- break;
- case -1: ret = EDG_WLL_GSS_ERROR_ERRNO;
- goto end;
- break;
- }
-
- count = write(sock, ((char *)token) + num_written,
- token_length - num_written);
- if(count < 0) {
- if(errno == EINTR)
- continue;
- else {
- ret = EDG_WLL_GSS_ERROR_ERRNO;
- goto end;
- }
- }
- num_written += count;
- }
-
-end:
- if (to) {
- gettimeofday(&after,NULL);
- tv_sub(after,before);
- tv_sub(*to,after);
- if (to->tv_sec < 0) {
- to->tv_sec = 0;
- to->tv_usec = 0;
- }
- }
-
- return ret;
-}
-
-static int
-send_gss_token(int sock, gss_OID mech, void *token, size_t token_length, struct timeval *to)
-{
- int ret;
- uint32_t net_len = htonl(token_length);
-
- /* Don't use the usual message framing when using Globus GSI, in order to be
- compatible with SSL on the wire. */
- if (!edg_wll_gss_oid_equal(mech, get_oid("GSI"))) {
- ret = send_token(sock, &net_len, 4, to);
- if (ret)
- return ret;
- }
-
- return send_token(sock, token, token_length, to);
-}
-
-static int
-recv_token(int sock, void *token, size_t token_length, struct timeval *to)
-{
- ssize_t count;
- fd_set fds;
- struct timeval timeout,before,after;
- int ret;
-
- if (to) {
- memcpy(&timeout,to,sizeof(timeout));
- gettimeofday(&before,NULL);
- }
-
- do {
- FD_ZERO(&fds);
- FD_SET(sock,&fds);
- switch (select(sock+1, &fds, NULL, NULL, to ? &timeout : NULL)) {
- case 0:
- ret = EDG_WLL_GSS_ERROR_TIMEOUT;
- goto end;
- break;
- case -1:
- ret = EDG_WLL_GSS_ERROR_ERRNO;
- goto end;
- break;
- }
-
- count = read(sock, token, token_length);
- if (count < 0) {
- if (errno == EINTR)
- continue;
- else {
- ret = EDG_WLL_GSS_ERROR_ERRNO;
- goto end;
- }
- }
-
- if (count==0) {
- ret = EDG_WLL_GSS_ERROR_EOF;
- goto end;
- }
-
- } while (count < 0); /* restart on EINTR */
-
- ret = count;
-
-end:
- if (to) {
- gettimeofday(&after,NULL);
- tv_sub(after,before);
- tv_sub(*to,after);
- if (to->tv_sec < 0) {
- to->tv_sec = 0;
- to->tv_usec = 0;
- }
- }
-
- return ret;
-}
-
-/* similar to recv_token() but never returns partial data */
-static int
-read_token(int sock, void *token, size_t length, struct timeval *to)
-{
- size_t remain = length;
- char *buf = token;
- int count;
-
- while (remain > 0) {
- count = recv_token(sock, buf, remain, to);
- if (count < 0)
- return count;
- buf += count;
- remain -= count;
- }
-
- return length;
-}
-
-/*
- SSL/TLS framing:
- SSLv3 header:
- 1st byte: SSL Handshake Record Type (\x16)
- 2nd-3rd bytes: SSL Version 3.0 (\x03 \x00)
- TLS Version 1.0 (\x03 \x01)
- 4th-5th bytes: Length
-
- SSLv2 header:
- 1st-2nd bytes: length, 1st byte has the highest bit set to 1
- N.B. this applies to client_hello, other messages may encode
- lenght in 3 bytes
- 3rd byte: type (CLIENT_HELLO) (== 1)
- 4rd-5th bytes: SSL Version 3.0 (\x03 \x00)
- TLS Version 1.0 (\x03 \x01)
-
- see also e.g. openssl's s23_srvr.c
-*/
-#define SSLv3_HEADER "\x16\x03\x00"
-#define TLSv1_HEADER "\x16\x03\x01"
-
-#define SSL2_CLIENT_HELLO 0x01
-#define SSL3_VERSION_MAJOR 0x03
-
-static int
-is_ssl(unsigned char *header)
-{
- if (memcmp(header, SSLv3_HEADER, 3) == 0)
- return 1;
- if (memcmp(header, TLSv1_HEADER, 3) == 0)
- return 1;
- if ((header[0] & 0x80) && header[2] == SSL2_CLIENT_HELLO &&
- header[3] == SSL3_VERSION_MAJOR)
- return 1;
-
- return 0;
- /* payload len == (size_t)(header[3]) << 8) | header[4]) + 5; */
-}
-
-
-static int
-recv_gss_token(int sock, gss_OID mech, void **token, size_t *token_length, struct timeval *to)
-{
- int ret;
- uint32_t len, net_len;
- unsigned char *header;
- char buf[4096];
- char *b = NULL;
-
- if (edg_wll_gss_oid_equal(mech, get_oid("GSI"))) {
- ret = recv_token(sock, buf, sizeof(buf), to);
- if (ret < 0)
- return ret;
-
- *token = malloc(ret);
- if (*token == NULL)
- return EDG_WLL_GSS_ERROR_ERRNO;
-
- memcpy(*token, buf, ret);
- *token_length = ret;
-
- return 0;
- }
-
- ret = read_token(sock, &net_len, 4, to);
- if (ret < 0)
- return ret;
-
- header = (unsigned char *)&net_len;
- if (mech == GSS_C_NO_OID && is_ssl(header)) {
- /* SSL detected. Let's return this fragment to the caller relying on
- the Globus libs being able to cope with partial messages. */
- *token = malloc(4);
- if (*token == NULL)
- return EDG_WLL_GSS_ERROR_ERRNO;
-
- memcpy(*token, header, 4);
- *token_length = 4;
-
- return 0;
- }
-
- len = ntohl(net_len);
- b = malloc(len);
- if (b == NULL)
- return EDG_WLL_GSS_ERROR_ERRNO;
-
- ret = read_token(sock, b, len, to);
- if (ret < 0) {
- free(b);
- return ret;
- }
-
- *token = b;
- *token_length = len;
-
- return 0;
-}
-
-static int
-create_proxy(const char *cert_file, const char *key_file, char **proxy_file)
-{
- char buf[4096];
- int in, out;
- char *name = NULL;
- int ret, len;
-
- *proxy_file = NULL;
-
- asprintf(&name, "%s/%d.lb.XXXXXX", P_tmpdir, getpid());
-
- out = mkstemp(name);
- if (out < 0)
- return EDG_WLL_GSS_ERROR_ERRNO;
-
- in = open(cert_file, O_RDONLY);
- if (in < 0) {
- ret = EDG_WLL_GSS_ERROR_ERRNO;
- goto end;
- }
- while ((ret = read(in, buf, sizeof(buf))) > 0) {
- len = write(out, buf, ret);
- if (len != ret) {
- ret = -1;
- break;
- }
- }
- close(in);
- if (ret < 0) {
- ret = EDG_WLL_GSS_ERROR_ERRNO;
- goto end;
- }
-
- len = write(out, "\n", 1);
- if (len != 1) {
- ret = EDG_WLL_GSS_ERROR_ERRNO;
- goto end;
- }
-
- in = open(key_file, O_RDONLY);
- if (in < 0) {
- ret = EDG_WLL_GSS_ERROR_ERRNO;
- goto end;
- }
- while ((ret = read(in, buf, sizeof(buf))) > 0) {
- len = write(out, buf, ret);
- if (len != ret) {
- ret = -1;
- break;
- }
- }
- close(in);
- if (ret < 0) {
- ret = EDG_WLL_GSS_ERROR_ERRNO;
- goto end;
- }
-
- ret = 0;
- *proxy_file = name;
-
-end:
- close(out);
- if (ret) {
- unlink(name);
- free(name);
- }
-
- return ret;
-}
-
-static int
-destroy_proxy(char *proxy_file)
-{
- /* XXX we should erase the contents safely (i.e. overwrite with 0's) */
- unlink(proxy_file);
- return 0;
-}
-
-/** Load or reload credentials. It should be called regularly (credential files can be changed).
- This call works only for GSSAPI from Globus.
- @see edg_wll_gss_watch_creds
- */
-int
-edg_wll_gss_acquire_cred_gsi(const char *cert_file, const char *key_file, edg_wll_GssCred *cred,
- edg_wll_GssStatus* gss_code)
-{
- OM_uint32 major_status = 0, minor_status, minor_status2;
- gss_cred_id_t gss_cred = GSS_C_NO_CREDENTIAL;
- gss_buffer_desc buffer = GSS_C_EMPTY_BUFFER;
- gss_name_t gss_name = GSS_C_NO_NAME;
- gss_OID_set_desc mechs;
- gss_OID_set avail_mechs = NULL;
- OM_uint32 lifetime;
- char *proxy_file = NULL;
- char *name = NULL;
- int ret, gsi_available;
-
- *cred = NULL;
-
- major_status = gss_indicate_mechs(&minor_status, &avail_mechs);
- /* ignore error */
-
- major_status = gss_test_oid_set_member(&minor_status, get_oid("GSI"),
- avail_mechs, &gsi_available);
- if (!GSS_ERROR(major_status) && !gsi_available) {
- if (cert_file != NULL || key_file != NULL) {
- errno = EINVAL;
- ret = EDG_WLL_GSS_ERROR_ERRNO;
- goto end;
- } else {
- ret = 0;
- lifetime = 0;
- goto end1;
- }
- }
-
- if ((cert_file == NULL && key_file != NULL) ||
- (cert_file != NULL && key_file == NULL))
- return EINVAL;
-
- if (cert_file == NULL) {
- mechs.count = 1;
- mechs.elements = get_oid("GSI");
-
- major_status = gss_acquire_cred(&minor_status, GSS_C_NO_NAME, 0,
- &mechs, GSS_C_BOTH,
- &gss_cred, NULL, NULL);
- if (GSS_ERROR(major_status)) {
- ret = EDG_WLL_GSS_ERROR_GSS;
- goto end;
- }
- } else {
-#ifndef NO_GLOBUS_GSSAPI
- proxy_file = (char *)cert_file;
- if (strcmp(cert_file, key_file) != 0 &&
- (ret = create_proxy(cert_file, key_file, &proxy_file))) {
- proxy_file = NULL;
- goto end;
- }
-
- asprintf((char**)&buffer.value, "X509_USER_PROXY=%s", proxy_file);
- if (buffer.value == NULL) {
- errno = ENOMEM;
- ret = EDG_WLL_GSS_ERROR_ERRNO;
- goto end;
- }
- buffer.length = strlen(proxy_file);
-
- major_status = gss_import_cred(&minor_status, &gss_cred,
- GSS_C_NO_OID, 1,
- &buffer, 0, NULL);
- free(buffer.value);
- if (GSS_ERROR(major_status)) {
- ret = EDG_WLL_GSS_ERROR_GSS;
- goto end;
- }
-#else
- errno = EINVAL;
- ret = EDG_WLL_GSS_ERROR_ERRNO;
- goto end;
-#endif
- }
-
- /* gss_import_cred() doesn't check validity of credential loaded, so let's
- * verify it now */
- major_status = gss_inquire_cred(&minor_status, gss_cred, &gss_name,
- &lifetime, NULL, NULL);
- if (GSS_ERROR(major_status)) {
- ret = EDG_WLL_GSS_ERROR_GSS;
- goto end;
- }
-
- /* Must cast to time_t since OM_uint32 is unsinged and hence we couldn't
- * detect negative values. */
- if ((time_t) lifetime <= 0) {
- major_status = GSS_S_CREDENTIALS_EXPIRED;
- minor_status = 0; /* XXX */
- ret = EDG_WLL_GSS_ERROR_GSS;
- goto end;
- }
-
- major_status = gss_display_name(&minor_status, gss_name, &buffer, NULL);
- if (GSS_ERROR(major_status)) {
- ret = EDG_WLL_GSS_ERROR_GSS;
- goto end;
- }
- name = buffer.value;
- memset(&buffer, 0, sizeof(buffer));
-
-
-end1:
-
- *cred = calloc(1, sizeof(**cred));
- if (*cred == NULL) {
- ret = EDG_WLL_GSS_ERROR_ERRNO;
- free(name);
- goto end;
- }
-
- (*cred)->gss_cred = gss_cred;
- gss_cred = GSS_C_NO_CREDENTIAL;
- (*cred)->lifetime = lifetime;
- (*cred)->name = name;
-
- ret = 0;
-
-end:
- if (cert_file && key_file && proxy_file && strcmp(cert_file, key_file) != 0) {
- destroy_proxy(proxy_file);
- free(proxy_file);
- }
-
- if (gss_name != GSS_C_NO_NAME)
- gss_release_name(&minor_status2, &gss_name);
-
- if (gss_cred != GSS_C_NO_CREDENTIAL)
- gss_release_cred(&minor_status2, &gss_cred);
-
- if (avail_mechs)
- gss_release_oid_set(&minor_status2, &avail_mechs);
-
- if (GSS_ERROR(major_status)) {
- if (gss_code) {
- gss_code->major_status = major_status;
- gss_code->minor_status = minor_status;
- }
- ret = EDG_WLL_GSS_ERROR_GSS;
- }
-
- return ret;
-}
-/* XXX XXX This is black magic. "Sometimes" server refuses the client with SSL
- * alert "certificate expired" even if it is not true. In this case the server
- * slave terminates (which helps, usually), and we can reconnect transparently.
- */
-
-/* This string appears in the error message in this case */
-#define _EXPIRED_ALERT_MESSAGE "function SSL3_READ_BYTES: sslv3 alert certificate expired"
-#define _EXPIRED_ALERT_RETRY_COUNT 10 /* default number of slaves, hope that not all
- are in the bad state */
-#define _EXPIRED_ALERT_RETRY_DELAY 10 /* ms */
-
-/** Create a socket and initiate secured connection. */
-static int
-gss_connect(edg_wll_GssCred cred, char const *hostname, int port,
- gss_name_t target, gss_OID_set mechs,
- struct timeval *timeout, edg_wll_GssConnection *connection,
- edg_wll_GssStatus* gss_code)
-{
- int ret;
- struct asyn_result ar;
- int h_errno;
- int addr_types[] = {AF_INET6, AF_INET};
- int ipver = AF_INET6; //def value; try IPv6 first
- unsigned int j,k;
- int i;
- gss_OID mech;
- gss_OID_set_desc my_mechs = {.count = 0, .elements = GSS_C_NO_OID};
- const char *mech_name;
-
- memset(connection, 0, sizeof(*connection));
- for (j = 0; j< sizeof(addr_types)/sizeof(*addr_types); j++) {
- ipver = addr_types[j];
- ar.ent = (struct hostent *) calloc (1, sizeof(struct hostent));
- switch (h_errno = asyn_getservbyname(ipver, &ar, hostname, port, timeout)) {
- case NETDB_SUCCESS:
- break;
- case TRY_AGAIN:
- ret = EDG_WLL_GSS_ERROR_TIMEOUT;
- goto end;
- case NETDB_INTERNAL:
- errno = h_errno;
- ret = EDG_WLL_GSS_ERROR_HERRNO;
- goto end;
- default:
- /* h_errno may be thread safe with Linux pthread libs,
- * but such an assumption is not portable
- */
- errno = h_errno;
- ret = EDG_WLL_GSS_ERROR_HERRNO;
- continue;
- }
-
- if (mechs == GSS_C_NO_OID_SET) {
- mech_name = getenv("GLITE_GSS_MECH");
- if (mech_name == NULL)
- mech_name = "GSI";
-
- mech = get_oid(mech_name);
- if (mech != GSS_C_NO_OID) {
- my_mechs.elements = mech;
- my_mechs.count = 1;
- mechs = &my_mechs;
- }
- }
-
- i = 0;
- while (ar.ent->h_addr_list[i])
- {
- k = 0;
- do {
- if (mechs == GSS_C_NO_OID_SET || mechs->count == 0)
- mech = GSS_C_NO_OID;
- else
- mech = &mechs->elements[k];
-
- ret = try_conn_and_auth (cred, target, mech,
- ar.ent->h_addr_list[i],
- ar.ent->h_addrtype, port, timeout, connection, gss_code);
- if (ret == 0)
- goto end;
- if (timeout && (timeout->tv_sec < 0 ||(timeout->tv_sec == 0 && timeout->tv_usec <= 0)))
- goto end;
- k++;
- } while (mechs != GSS_C_NO_OID_SET && k < mechs->count);
- i++;
- }
- free_hostent(ar.ent);
- ar.ent = NULL;
- }
-
- end:
- if (ar.ent != NULL){
- free_hostent(ar.ent);
- ar.ent = NULL;
- }
- return ret;
-}
-
-int
-edg_wll_gss_connect_ext(edg_wll_GssCred cred, char const *hostname, int port,
- const char *service, gss_OID_set mechs,
- struct timeval *timeout, edg_wll_GssConnection *connection,
- edg_wll_GssStatus* gss_code)
-{
- char *servername = NULL;
- gss_name_t target = GSS_C_NO_NAME;
- OM_uint32 maj_stat, min_stat;
- gss_buffer_desc input_token = GSS_C_EMPTY_BUFFER;
- int ret;
-
- asprintf(&servername, "%s@%s",
- (service) ? service : "host", hostname);
- if (servername == NULL) {
- errno = ENOMEM;
- return EDG_WLL_GSS_ERROR_ERRNO;
- }
- input_token.value = servername;
- input_token.length = strlen(servername) + 1;
-
- maj_stat = gss_import_name(&min_stat, &input_token,
- GSS_C_NT_HOSTBASED_SERVICE, &target);
- if (GSS_ERROR(maj_stat)) {
- if (gss_code) {
- gss_code->major_status = maj_stat;
- gss_code->minor_status = min_stat;
- }
- ret = EDG_WLL_GSS_ERROR_GSS;
- goto end;
- }
-
- ret = gss_connect(cred, hostname, port, target, mechs,
- timeout, connection, gss_code);
-
-end:
- if (target != GSS_C_NO_NAME)
- gss_release_name(&min_stat, &target);
- free(servername);
-
- return ret;
-}
-
-int
-edg_wll_gss_connect_name(edg_wll_GssCred cred,
- char const *hostname,
- int port,
- const char *servername,
- gss_OID_set mechs,
- struct timeval *timeout,
- edg_wll_GssConnection *connection,
- edg_wll_GssStatus* gss_code)
-{
- gss_name_t target = GSS_C_NO_NAME;
- OM_uint32 maj_stat, min_stat;
- gss_buffer_desc input_token = GSS_C_EMPTY_BUFFER;
- int ret;
-
- if (servername == NULL) {
- errno = ENOSYS;
- return EDG_WLL_GSS_ERROR_ERRNO;
- }
- input_token.value = (char *) servername;
- input_token.length = strlen(servername) + 1;
-
- maj_stat = gss_import_name(&min_stat, &input_token,
- GSS_C_NT_USER_NAME, &target);
- if (GSS_ERROR(maj_stat)) {
- if (gss_code) {
- gss_code->major_status = maj_stat;
- gss_code->minor_status = min_stat;
- }
- ret = EDG_WLL_GSS_ERROR_GSS;
- goto end;
- }
-
- ret = gss_connect(cred, hostname, port, target, mechs,
- timeout, connection, gss_code);
-
-end:
- if (target != GSS_C_NO_NAME)
- gss_release_name(&min_stat, &target);
-
- return ret;
-}
-
-
-int
-edg_wll_gss_connect(edg_wll_GssCred cred, char const *hostname, int port,
- struct timeval *timeout, edg_wll_GssConnection *connection,
- edg_wll_GssStatus* gss_code)
-{
- return edg_wll_gss_connect_ext(cred, hostname, port,
- NULL, NULL,
- timeout, connection, gss_code);
-}
-
-/* try connection and authentication for the given addr*/
-static int try_conn_and_auth (edg_wll_GssCred cred, gss_name_t target, gss_OID mech,
- char *addr, int addrtype, int port,
- struct timeval *timeout, edg_wll_GssConnection *connection,
- edg_wll_GssStatus* gss_code)
-{
- int sock;
- int ret = 0;
- OM_uint32 maj_stat, min_stat, min_stat2, req_flags;
- int context_established = 0;
- gss_buffer_desc input_token = GSS_C_EMPTY_BUFFER;
- gss_buffer_desc output_token = GSS_C_EMPTY_BUFFER;
- gss_ctx_id_t context = GSS_C_NO_CONTEXT;
- gss_cred_id_t gss_cred = GSS_C_NO_CREDENTIAL;
- int retry = _EXPIRED_ALERT_RETRY_COUNT;
-
- maj_stat = min_stat = min_stat2 = req_flags = 0;
-
- if (edg_wll_gss_oid_equal(mech, get_oid("GSI"))) {
- req_flags = GSS_C_GLOBUS_SSL_COMPATIBLE;
- }
-
- ret = do_connect(&sock, addr, addrtype, port, timeout);
- if (ret)
- return ret;
-
- if (cred && cred->gss_cred)
- gss_cred = cred->gss_cred;
-
- do { /* XXX: the black magic above */
-
- while (!context_established) {
- /* XXX verify ret_flags match what was requested */
- maj_stat = gss_init_sec_context(&min_stat, gss_cred, &context,
- target, mech,
- req_flags | GSS_C_MUTUAL_FLAG | GSS_C_CONF_FLAG,
- 0, GSS_C_NO_CHANNEL_BINDINGS,
- &input_token, NULL, &output_token,
- NULL, NULL);
- if (input_token.length > 0) {
- free(input_token.value);
- input_token.length = 0;
- }
-
- if (mech == GSS_C_NO_OID) {
- gss_OID oid;
-
- maj_stat = gss_inquire_context(&min_stat, context, NULL, NULL,
- NULL, &oid, NULL, NULL, NULL);
- if (!GSS_ERROR(maj_stat))
- mech = oid;
- }
-
- if (output_token.length != 0) {
- ret = send_gss_token(sock, mech, output_token.value, output_token.length, timeout);
- gss_release_buffer(&min_stat2, &output_token);
- if (ret)
- goto end;
- }
-
- if (GSS_ERROR(maj_stat)) {
- if (context != GSS_C_NO_CONTEXT) {
- gss_delete_sec_context(&min_stat2, &context, &output_token);
- context = GSS_C_NO_CONTEXT;
- if (output_token.length) {
- send_gss_token(sock, mech, output_token.value, output_token.length, timeout);
- gss_release_buffer(&min_stat2, &output_token);
- }
- }
- ret = EDG_WLL_GSS_ERROR_GSS;
- goto end;
- }
-
- if(maj_stat & GSS_S_CONTINUE_NEEDED) {
- ret = recv_gss_token(sock, mech, &input_token.value, &input_token.length, timeout);
- if (ret)
- goto end;
- } else
- context_established = 1;
- }
-
- /* XXX check ret_flags matches to what was requested */
-
- /* retry on false "certificate expired" */
- if (ret == EDG_WLL_GSS_ERROR_GSS) {
- edg_wll_GssStatus gss_stat;
- char *msg = NULL;
-
- gss_stat.major_status = maj_stat;
- gss_stat.minor_status = min_stat;
- edg_wll_gss_get_error(&gss_stat,"",&msg);
-
- if (strstr(msg,_EXPIRED_ALERT_MESSAGE)) {
- usleep(_EXPIRED_ALERT_RETRY_DELAY);
- retry--;
- }
- else retry = 0;
-
- free(msg);
- }
- else retry = 0;
-
- } while (retry);
-
- connection->sock = sock;
- connection->context = context;
- connection->authn_mech = mech;
- ret = 0;
-
-end:
- if (ret == EDG_WLL_GSS_ERROR_GSS && gss_code) {
- gss_code->major_status = maj_stat;
- gss_code->minor_status = min_stat;
- }
- if (ret)
- close(sock);
-
- return ret;
-}
-
-/** Accept a new secured connection on the listening socket. */
-int
-edg_wll_gss_accept(edg_wll_GssCred cred, int sock, struct timeval *timeout,
- edg_wll_GssConnection *connection, edg_wll_GssStatus* gss_code)
-{
- OM_uint32 maj_stat, min_stat, min_stat2;
- OM_uint32 ret_flags = 0;
- gss_buffer_desc input_token = GSS_C_EMPTY_BUFFER;
- gss_buffer_desc output_token = GSS_C_EMPTY_BUFFER;
- gss_name_t client_name = GSS_C_NO_NAME;
- gss_ctx_id_t context = GSS_C_NO_CONTEXT;
- gss_cred_id_t gss_cred = GSS_C_NO_CREDENTIAL;
- gss_OID mech = GSS_C_NO_OID;
- int ret;
-
- maj_stat = min_stat = min_stat2 = 0;
- memset(connection, 0, sizeof(*connection));
-
- if (cred && cred->gss_cred)
- gss_cred = cred->gss_cred;
-
- ret_flags = GSS_C_GLOBUS_SSL_COMPATIBLE;
-
- do {
- ret = recv_gss_token(sock, mech, &input_token.value, &input_token.length, timeout);
- if (ret)
- goto end;
-
- if (client_name != GSS_C_NO_NAME)
- gss_release_name(&min_stat2, &client_name);
-
- maj_stat = gss_accept_sec_context(&min_stat, &context,
- gss_cred, &input_token,
- GSS_C_NO_CHANNEL_BINDINGS,
- &client_name, &mech, &output_token,
- &ret_flags, NULL, NULL);
- if (input_token.length > 0) {
- free(input_token.value);
- input_token.length = 0;
- }
-
- if (output_token.length) {
- ret = send_gss_token(sock, mech, output_token.value, output_token.length, timeout);
- gss_release_buffer(&min_stat2, &output_token);
- if (ret)
- goto end;
- }
- } while(maj_stat & GSS_S_CONTINUE_NEEDED);
-
- if (GSS_ERROR(maj_stat)) {
- if (context != GSS_C_NO_CONTEXT) {
- gss_delete_sec_context(&min_stat2, &context, &output_token);
- context = GSS_C_NO_CONTEXT;
- if (output_token.length) {
- send_gss_token(sock, mech, output_token.value, output_token.length, timeout);
- gss_release_buffer(&min_stat2, &output_token);
- }
- }
- ret = EDG_WLL_GSS_ERROR_GSS;
- goto end;
- }
-
-#if 0
- maj_stat = gss_display_name(&min_stat, client_name, &output_token, NULL);
- gss_release_buffer(&min_stat2, &output_token);
- if (GSS_ERROR(maj_stat)) {
- /* XXX close context ??? */
- ret = EDG_WLL_GSS_ERROR_GSS;
- goto end;
- }
-#endif
-
- connection->sock = sock;
- connection->context = context;
- connection->authn_mech = mech;
- ret = 0;
-
-end:
- if (ret == EDG_WLL_GSS_ERROR_GSS && gss_code) {
- gss_code->major_status = maj_stat;
- gss_code->minor_status = min_stat;
- }
- if (client_name != GSS_C_NO_NAME)
- gss_release_name(&min_stat2, &client_name);
-
- return ret;
-}
-
-/** Send data over the opened connection. */
-int
-edg_wll_gss_write(edg_wll_GssConnection *connection, const void *buf, size_t bufsize,
- struct timeval *timeout, edg_wll_GssStatus* gss_code)
-{
- OM_uint32 maj_stat, min_stat;
- gss_buffer_desc input_token;
- gss_buffer_desc output_token;
- int ret;
-
- input_token.value = (void*)buf;
- input_token.length = bufsize;
-
- maj_stat = gss_wrap (&min_stat, connection->context, 1, GSS_C_QOP_DEFAULT,
- &input_token, NULL, &output_token);
- if (GSS_ERROR(maj_stat)) {
- if (gss_code) {
- gss_code->minor_status = min_stat;
- gss_code->major_status = maj_stat;
- }
-
- return EDG_WLL_GSS_ERROR_GSS;
- }
-
- ret = send_gss_token(connection->sock, connection->authn_mech,
- output_token.value, output_token.length,
- timeout);
- gss_release_buffer(&min_stat, &output_token);
-
- return ret;
-}
-
-
-/** Read a data chunk through the opened connection. */
-int
-edg_wll_gss_read(edg_wll_GssConnection *connection, void *buf, size_t bufsize,
- struct timeval *timeout, edg_wll_GssStatus* gss_code)
-{
- OM_uint32 maj_stat, min_stat, min_stat2;
- gss_buffer_desc input_token;
- gss_buffer_desc output_token;
- size_t i, len;
- int ret;
-
- if (connection->bufsize > 0) {
- len = (connection->bufsize < bufsize) ? connection->bufsize : bufsize;
- memcpy(buf, connection->buffer, len);
- if (connection->bufsize - len == 0) {
- free(connection->buffer);
- connection->buffer = NULL;
- } else {
- for (i = 0; i < connection->bufsize - len; i++)
- connection->buffer[i] = connection->buffer[i+len];
- }
- connection->bufsize -= len;
-
- return len;
- }
-
- do {
- ret = recv_gss_token(connection->sock, connection->authn_mech,
- &input_token.value, &input_token.length,
- timeout);
- if (ret)
- return ret;
-
- /* work around a Globus bug */
- ERR_clear_error();
-
- maj_stat = gss_unwrap(&min_stat, connection->context, &input_token,
- &output_token, NULL, NULL);
- gss_release_buffer(&min_stat2, &input_token);
- if (GSS_ERROR(maj_stat)) {
- if (gss_code) {
- gss_code->minor_status = min_stat;
- gss_code->major_status = maj_stat;
- }
- return EDG_WLL_GSS_ERROR_GSS;
- }
- } while (maj_stat == 0 && output_token.length == 0 && output_token.value == NULL);
-
- if (output_token.length > bufsize) {
- connection->bufsize = output_token.length - bufsize;
- connection->buffer = malloc(connection->bufsize);
- if (connection->buffer == NULL) {
- connection->bufsize = 0;
- ret = EDG_WLL_GSS_ERROR_ERRNO;
- goto end;
- }
- memcpy(connection->buffer, output_token.value + bufsize, connection->bufsize);
- output_token.length = bufsize;
- }
-
- memcpy(buf, output_token.value, output_token.length);
- ret = output_token.length;
-
-end:
- gss_release_buffer(&min_stat, &output_token);
-
- return ret;
-}
-
-/** Read data from the opened connection, repeat reading up to 'bufsize' or end of the stream. */
-int
-edg_wll_gss_read_full(edg_wll_GssConnection *connection, void *buf,
- size_t bufsize, struct timeval *timeout, size_t *total,
- edg_wll_GssStatus* gss_code)
-{
- size_t len, i;
- *total = 0;
-
- if (connection->bufsize > 0) {
- len = (connection->bufsize < bufsize) ? connection->bufsize : bufsize;
- memcpy(buf, connection->buffer, len);
- if (connection->bufsize - len == 0) {
- free(connection->buffer);
- connection->buffer = NULL;
- } else {
- for (i = 0; i < connection->bufsize - len; i++)
- connection->buffer[i] = connection->buffer[i+len];
- }
- connection->bufsize -= len;
- *total = len;
- }
-
- while (*total < bufsize) {
- int len;
-
- len = edg_wll_gss_read(connection, buf+*total, bufsize-*total,
- timeout, gss_code);
- if (len < 0) return len;
- *total += len;
- }
-
- return 0;
-}
-
-/** Send data over the opened connection. */
-int
-edg_wll_gss_write_full(edg_wll_GssConnection *connection, const void *buf,
- size_t bufsize, struct timeval *timeout, size_t *total,
- edg_wll_GssStatus* gss_code)
-{
- return edg_wll_gss_write(connection, buf, bufsize, timeout, gss_code);
-}
-
-/** Request credential reload each 60 seconds in order to work around
- * Globus bug (not reloading expired CRLs)
- */
-#define GSS_CRED_WATCH_LIMIT 60
-int
-edg_wll_gss_watch_creds(const char *proxy_file, time_t *last_time)
-{
- struct stat pstat;
- time_t now;
-
- now = time(NULL);
-
- /* to work around a globus bug we enforce reloading credentials
- quite often */
- if ( now >= (*last_time+GSS_CRED_WATCH_LIMIT) ) {
- *last_time = now;
- return 1;
- }
-
- if (!proxy_file) return 0;
- if (stat(proxy_file,&pstat)) return -1;
-
- if ( pstat.st_mtime >= *last_time ) {
- *last_time = now + 1;
- return 1;
- }
-
- return 0;
-}
-
-/** Close the connection. */
-int
-edg_wll_gss_watch_creds_gsi(const char *proxy_file, time_t *last_time)
-{
- return edg_wll_gss_watch_creds(proxy_file, last_time);
-}
-
-/** Close the connection. */
-int
-edg_wll_gss_close(edg_wll_GssConnection *con, struct timeval *timeout)
-{
- OM_uint32 min_stat;
- gss_buffer_desc output_token = GSS_C_EMPTY_BUFFER;
- /*struct timeval def_timeout = { 0, 100000};*/
-
- if (con->context != GSS_C_NO_CONTEXT) {
- gss_delete_sec_context(&min_stat, (gss_ctx_id_t *)&con->context, &output_token);
-
-#if 0
- /* XXX: commented out till timeout handling in caller is fixed */
-
- /* send the buffer (if any) to the peer. GSSAPI specs doesn't
- * recommend sending it, but we want SSL compatibility */
- if (output_token.length && con->sock>=0) {
- send_token(con->sock, output_token.value, output_token.length,
- timeout ? timeout : &def_timeout);
- }
-#endif
- gss_release_buffer(&min_stat, &output_token);
-
- /* XXX can socket be open even if context == GSS_C_NO_CONTEXT) ? */
- /* XXX ensure that edg_wll_GssConnection is created with sock set to -1 */
- if (con->sock >= 0)
- close(con->sock);
- }
- if (con->buffer)
- free(con->buffer);
- memset(con, 0, sizeof(*con));
- con->context = GSS_C_NO_CONTEXT;
- con->sock = -1;
- con->authn_mech = NULL;
- return 0;
-}
-
-/** Get error details. */
-int
-edg_wll_gss_get_error(edg_wll_GssStatus *gss_err, const char *prefix, char **msg)
-{
- OM_uint32 maj_stat, min_stat;
- OM_uint32 msg_ctx = 0;
- gss_buffer_desc maj_status_string = GSS_C_EMPTY_BUFFER;
- gss_buffer_desc min_status_string = GSS_C_EMPTY_BUFFER;
- char *str = NULL;
- char *line, *tmp;
-
- str = strdup(prefix);
- do {
- maj_stat = gss_display_status(&min_stat, gss_err->major_status,
- GSS_C_GSS_CODE, GSS_C_NO_OID,
- &msg_ctx, &maj_status_string);
- if (GSS_ERROR(maj_stat))
- break;
- maj_stat = gss_display_status(&min_stat, gss_err->minor_status,
- GSS_C_MECH_CODE, GSS_C_NULL_OID,
- &msg_ctx, &min_status_string);
- if (GSS_ERROR(maj_stat)) {
- gss_release_buffer(&min_stat, &maj_status_string);
- break;
- }
-
- asprintf(&line, ": %s (%s)", (char *)maj_status_string.value,
- (char *)min_status_string.value);
- gss_release_buffer(&min_stat, &maj_status_string);
- gss_release_buffer(&min_stat, &min_status_string);
-
- tmp = realloc(str, strlen(str) + strlen(line) + 1);
- if (tmp == NULL) {
- /* abort() ? */
- free(line);
- free(str);
- str = "WARNING: Not enough memory to produce error message";
- break;
- }
- str = tmp;
- strcat(str, line);
- free(line);
- } while (!GSS_ERROR(maj_stat) && msg_ctx != 0);
-
- *msg = str;
- return 0;
-}
-
-int
-edg_wll_gss_oid_equal(const gss_OID a, const gss_OID b)
-{
- if (a == b)
- return 1;
- else {
- if (a == GSS_C_NO_OID || b == GSS_C_NO_OID || a->length != b->length)
- return 0;
- else
- return (memcmp(a->elements, b->elements, a->length) == 0);
- }
-}
-
-int
-edg_wll_gss_reject(int sock)
-{
- /* XXX is it possible to cut & paste edg_wll_ssl_reject() ? */
- return 0;
-}
-
-
-/**
- * Initialize routine of glite gss module.
- * It activates globus modules, and it should be called before using other gss routines.
- */
-int
-edg_wll_gss_initialize(void)
-{
- int ret = 0;
- int index;
-
-#ifdef GLITE_LBU_THREADED
- pthread_mutex_lock(&init_lock);
-#endif
- setenv("GLOBUS_THREAD_MODEL", "pthread", 0);
- setenv("GLOBUS_GSSAPI_NAME_COMPATIBILITY", "STRICT_RFC2818", 0);
-
-#ifndef NO_GLOBUS_GSSAPI
- if (globus_module_activate(GLOBUS_GSI_GSSAPI_MODULE) != GLOBUS_SUCCESS) {
- errno = EINVAL;
- ret = EDG_WLL_GSS_ERROR_ERRNO;
- }
-#endif
-
- if (globus_module_activate(GLOBUS_COMMON_MODULE) == GLOBUS_SUCCESS)
- globus_common_activated = 1;
-
- // some pre-initializations (workarounds thread-safe problem
- // in gss_init_sec_context)
- globus_gsi_callback_get_SSL_callback_data_index(&index);
-#ifdef GLITE_LBU_THREADED
- pthread_mutex_unlock(&init_lock);
-#endif
-
- return ret;
-}
-
-
-/**
- * Clean up routine of gss module.
- * It can be called after using gss routines to free initializeted resources.
- */
-void
-edg_wll_gss_finalize(void)
-{
-#ifdef GLITE_LBU_THREADED
- pthread_mutex_lock(&init_lock);
-#endif
-#ifndef NO_GLOBUS_GSSAPI
- globus_module_deactivate(GLOBUS_GSI_GSSAPI_MODULE);
-#endif
- if (globus_common_activated) {
- globus_module_deactivate(GLOBUS_COMMON_MODULE);
- globus_common_activated = 0;
- }
-#ifdef GLITE_LBU_THREADED
- pthread_mutex_unlock(&init_lock);
-#endif
-}
-
-
-/**
- * Release the acquired credentials.
- */
-int
-edg_wll_gss_release_cred(edg_wll_GssCred *cred, edg_wll_GssStatus* gss_code)
-{
- OM_uint32 maj_stat, min_stat;
- int ret = 0;
-
- if (gss_code)
- gss_code->major_status = gss_code->minor_status = 0;
-
- if (cred == NULL || *cred == NULL)
- return ret;
-
- if ((*cred)->gss_cred) {
- maj_stat = gss_release_cred(&min_stat, (gss_cred_id_t*)&(*cred)->gss_cred);
- if (GSS_ERROR(maj_stat)) {
- ret = EDG_WLL_GSS_ERROR_GSS;
- if (gss_code) {
- gss_code->major_status = maj_stat;
- gss_code->minor_status = min_stat;
- }
- }
- }
-
- if ((*cred)->name)
- free((*cred)->name);
-
- free(*cred);
- *cred = NULL;
-
- return ret;
-}
-
-/**
- * Get information about the the connection - principal (display name).
- */
-int
-edg_wll_gss_get_client_conn(edg_wll_GssConnection *connection,
- edg_wll_GssPrincipal *principal,
- edg_wll_GssStatus* gss_code)
-{
- gss_buffer_desc token = GSS_C_EMPTY_BUFFER;
- OM_uint32 maj_stat, min_stat, ctx_flags;
- gss_name_t client_name = GSS_C_NO_NAME;
- edg_wll_GssPrincipal p;
- int ret;
-
- maj_stat = gss_inquire_context(&min_stat, connection->context, &client_name,
- NULL, NULL, NULL, &ctx_flags, NULL, NULL);
- if (GSS_ERROR(maj_stat))
- goto end;
-
- maj_stat = gss_display_name(&min_stat, client_name, &token, NULL);
- if (GSS_ERROR(maj_stat))
- goto end;
-
- p = calloc(1, sizeof(*p));
- if (p == NULL) {
- errno = ENOMEM;
- ret = EDG_WLL_GSS_ERROR_ERRNO;
- goto end;
- }
-
- p->name = strdup(token.value);
- p->flags = ctx_flags;
-
- *principal = p;
- ret = 0;
-
-end:
- if (GSS_ERROR(maj_stat)) {
- ret = EDG_WLL_GSS_ERROR_GSS;
- if (gss_code) {
- gss_code->major_status = maj_stat;
- gss_code->minor_status = min_stat;
- }
- }
-
- if (token.length)
- gss_release_buffer(&min_stat, &token);
- if (client_name != GSS_C_NO_NAME)
- gss_release_name(&min_stat, &client_name);
-
- return ret;
-}
-
-/* Beware, this call manipulates with environment variables and is not
- thread-safe */
-static int
-get_peer_cred(edg_wll_GssConnection *gss, const char *my_cert_file,
- const char *my_key_file, STACK_OF(X509) **chain,
- edg_wll_GssStatus* gss_code)
-{
- OM_uint32 maj_stat, min_stat;
- gss_buffer_desc buffer = GSS_C_EMPTY_BUFFER;
- BIO *bio = NULL;
- SSL_SESSION *session = NULL;
- unsigned char int_buffer[4];
- long length;
- int ret, index;
- STACK_OF(X509) *cert_chain = NULL;
- X509 *p_cert;
- char *orig_cert = NULL, *orig_key = NULL;
-
- if (!edg_wll_gss_oid_equal(gss->authn_mech, get_oid("GSI")))
- return EINVAL;
-
- maj_stat = gss_export_sec_context(&min_stat, (gss_ctx_id_t *) &gss->context,
- &buffer);
- if (GSS_ERROR(maj_stat)) {
- if (gss_code) {
- gss_code->major_status = maj_stat;
- gss_code->minor_status = min_stat;
- }
- return EDG_WLL_GSS_ERROR_GSS;
- }
-
- /* The GSSAPI specs requires gss_export_sec_context() to destroy the
- * context after exporting. So we have to resurrect the context here by
- * importing from just generated buffer. gss_import_sec_context() must be
- * able to read valid credential before it loads the exported context
- * so we set the environment temporarily to point to the ones used by
- * the server.
- * */
-
-#ifdef GLITE_LBU_THREADED
- // to protect the environment
- // XXX: only partial fix, every getenv() can still cause race-condition
- pthread_mutex_lock(&init_lock);
-#endif
- orig_cert = getenv("X509_USER_CERT");
- orig_key = getenv("X509_USER_KEY");
-
- if (my_cert_file)
- setenv("X509_USER_CERT", my_cert_file, 1);
- if (my_key_file)
- setenv("X509_USER_KEY", my_key_file, 1);
-
- maj_stat = gss_import_sec_context(&min_stat, &buffer,
- (gss_ctx_id_t *)&gss->context);
-
- if (orig_cert)
- setenv("X509_USER_CERT", orig_cert, 1);
- else
- unsetenv("X509_USER_CERT");
-
- if (orig_key)
- setenv("X509_USER_KEY", orig_key, 1);
- else
- unsetenv("X509_USER_KEY");
-#ifdef GLITE_LBU_THREADED
- pthread_mutex_unlock(&init_lock);
-#endif
-
- if (GSS_ERROR(maj_stat)) {
- if (gss_code) {
- gss_code->major_status = maj_stat;
- gss_code->minor_status = min_stat;
- }
- ret = EDG_WLL_GSS_ERROR_GSS;
- goto end;
- }
-
- bio = BIO_new(BIO_s_mem());
- if (bio == NULL) {
- ret = ENOMEM;
- goto end;
- }
-
- /* Store exported context to memory, skipping the version number and and cred_usage fields */
- BIO_write(bio, buffer.value + 8 , buffer.length - 8);
-
- /* decode the session data in order to skip at the start of the cert chain */
- session = d2i_SSL_SESSION_bio(bio, NULL);
- if (session == NULL) {
- ret = EINVAL;
- goto end;
- }
- SSL_SESSION_free(session);
-
- cert_chain = sk_X509_new_null();
-
- BIO_read(bio, (char *) int_buffer, 4);
- length = (((size_t) int_buffer[0]) << 24) & 0xffff;
- length |= (((size_t) int_buffer[1]) << 16) & 0xffff;
- length |= (((size_t) int_buffer[2]) << 8) & 0xffff;
- length |= (((size_t) int_buffer[3]) ) & 0xffff;
-
- if (length == 0) {
- ret = EINVAL;
- goto end;
- }
-
- for(index = 0; index < length; index++) {
- p_cert = d2i_X509_bio(bio, NULL);
- if (p_cert == NULL) {
- ret = EINVAL;
- sk_X509_pop_free(cert_chain, X509_free);
- goto end;
- }
-
- sk_X509_push(cert_chain, p_cert);
- }
-
- *chain = cert_chain;
- ret = 0;
-
-end:
- gss_release_buffer(&min_stat, &buffer);
-
- return ret;
-}
-
-/**
- * Get information about the the connection - pem string.
- */
-int
-edg_wll_gss_get_client_pem(edg_wll_GssConnection *connection,
- const char *my_cert_file, const char *my_key_file,
- char **pem_string)
-{
- char *tmp = NULL;
- STACK_OF(X509) *chain = NULL;
- BIO *bio = NULL;
- int ret, i;
- size_t total_len, l;
-
- ret = get_peer_cred(connection, my_cert_file, my_key_file, &chain, NULL);
- if (ret)
- return ret;
-
- bio = BIO_new(BIO_s_mem());
- if (bio == NULL) {
- ret = ENOMEM;
- goto end;
- }
-
- for (i = 0; i < sk_X509_num(chain); i++) {
- ret = PEM_write_bio_X509(bio, sk_X509_value(chain, i));
- if (ret <= 0) {
- ret = EINVAL;
- goto end;
- }
- }
-
- total_len = BIO_pending(bio);
- if (total_len <= 0) {
- ret = EINVAL;
- goto end;
- }
-
- tmp = malloc(total_len + 1);
- if (tmp == NULL) {
- ret = ENOMEM;
- goto end;
- }
-
- l = 0;
- while (l < total_len) {
- ret = BIO_read(bio, tmp+l, total_len-l);
- if (ret <= 0) {
- ret = EINVAL;
- goto end;
- }
- l += ret;
- }
-
- tmp[total_len] = '\0';
- *pem_string = tmp;
- tmp = NULL;
-
- ret = 0;
-
-end:
- sk_X509_pop_free(chain, X509_free);
- if (bio)
- BIO_free(bio);
- if (tmp)
- free(tmp);
-
- return ret;
-}
-
-/**
- * Free the principal.
- */
-void
-edg_wll_gss_free_princ(edg_wll_GssPrincipal principal)
-{
- if (principal == NULL)
- return;
-
- if (principal->name)
- free(principal->name);
-
- free(principal);
-}
-
-/**
- * Get the hostname (using globus call if possible, or system's gethostbyname() if globus is not initialized).
- */
-int
-edg_wll_gss_gethostname(char *name, int len)
-{
- int ret;
-
-#ifdef GLITE_LBU_THREADED
- pthread_mutex_lock(&init_lock);
-#endif
- if (globus_common_activated)
- ret = globus_libc_gethostname(name, len);
- else
- ret = gethostname(name, len);
-#ifdef GLITE_LBU_THREADED
- pthread_mutex_unlock(&init_lock);
-#endif
-
- return ret;
-}
-
-/**
- * Normalize subject name (stripping email address, /CN=proxy, ...).
- */
-char *
-edg_wll_gss_normalize_subj(char *in, int replace_in)
-{
- char *new, *ptr;
- size_t len;
-
- if (in == NULL) return NULL;
- if (replace_in)
- new = in;
- else
- new = strdup(in);
-
- while ((ptr = strstr(new, "/emailAddress="))) {
- memcpy(ptr, "/Email=",7);
- memmove(ptr+7, ptr+14, strlen(ptr+14)+1);
- }
-
- len = strlen(new);
- while (len > 9 && !strcmp(new+len-9, "/CN=proxy")) {
- *(new+len-9) = '\0';
- len -= 9;
- }
-
- return new;
-}
-
-/**
- * Compare subject names.
- */
-int
-edg_wll_gss_equal_subj(const char *a, const char *b)
-{
- char *an,*bn;
- int res;
-
- an = edg_wll_gss_normalize_subj((char*)a, 0);
- bn = edg_wll_gss_normalize_subj((char*)b, 0);
-
- if (!an || !bn)
- res = 0;
- else
- res = !strcasecmp(an,bn);
-
- free(an); free(bn);
- return res;
-}
-
-/**
- * Return data to the reading buffer.
- */
-int
-edg_wll_gss_unread(edg_wll_GssConnection *con, void *data, size_t len)
-{
- char *tmp;
-
- if (len == 0)
- return 0;
-
- tmp = malloc(len + con->bufsize);
- if (tmp == NULL)
- return ENOMEM;
-
- memcpy(tmp, data, len);
- if (con->bufsize > 0)
- memcpy(tmp + len, con->buffer, con->bufsize);
-
- free(con->buffer);
- con->buffer = tmp;
- con->bufsize += len;
-
- return 0;
-}
-
-
-/**
- * Signal handler compatible with globus.
- * It is required to use this function instead of sigaction(), when using threaded globus flavour.
- *
- * As for many other gss routenes, edg_wll_initialize() must be called before using this routine.
- * edg_wll_gss_set_signal_handler() will falback to sigaction() if gss is not initialized.
- *
- * @see edg_wll_initialize
- */
-int
-edg_wll_gss_set_signal_handler(int signum,
- void (*handler_func)(int))
-{
- int ret;
- intptr_t signum2;
-
-#ifdef GLITE_LBU_THREADED
- pthread_mutex_lock(&init_lock);
-#endif
- if (!globus_common_activated) {
- struct sigaction sa,osa;
-
- memset(&sa, 0, sizeof(sa));
- sigemptyset(&sa.sa_mask);
- sa.sa_handler = handler_func;
- ret = sigaction(signum, &sa, &osa);
- } else {
- signum2 = signum;
- ret = globus_callback_space_register_signal_handler(signum,
- GLOBUS_TRUE,
- (globus_callback_func_t)handler_func,
- (void *)signum2,
- GLOBUS_CALLBACK_GLOBAL_SPACE);
- }
-#ifdef GLITE_LBU_THREADED
- pthread_mutex_unlock(&init_lock);
-#endif
-
- return ret;
-}
-
-
-/**
- * Check posix signals and performs signal handlers eventually.
- * Required when using non-threaded globus flavour.
- */
-void
-edg_wll_gss_poll_signal() {
- globus_poll_nonblocking();
-}
+++ /dev/null
-/*
-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 <cstring>
-#include <iostream>
-#include <fstream>
-#include <sys/types.h>
-#include <unistd.h>
-#include <assert.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/XmlOutputter.h>
-#include <cppunit/TestRunner.h>
-#include <cppunit/TestResult.h>
-#include <cppunit/TestResultCollector.h>
-
-#include "glite_gss.h"
-
-class GSSTest: public CppUnit::TestFixture
-{
- CPPUNIT_TEST_SUITE(GSSTest);
- CPPUNIT_TEST(echo);
- CPPUNIT_TEST(echo);
- CPPUNIT_TEST(bigecho);
- CPPUNIT_TEST(errorTest);
- CPPUNIT_TEST_SUITE_END();
-
-public:
- void echo();
- void bigecho();
- void errorTest();
-
- void setUp();
- void tearDown();
-
-private:
- edg_wll_GssCred my_cred;
- int sock, port;
- struct timeval timeout;
-
- void replier();
-};
-
-
-void GSSTest::replier() {
- edg_wll_GssConnection conn;
- edg_wll_GssStatus stat;
- struct sockaddr_storage a;
- socklen_t alen = sizeof(a);
- int s, len;
- char buf[8*BUFSIZ];
-
- std::cerr << "replier " << getpid() << std::endl;
-
- if ( (s = accept(sock, (struct sockaddr *) &a, &alen)) < 0 ) exit(1);
-
- if ( edg_wll_gss_accept(my_cred, s, &timeout, &conn, &stat) ) exit(1);
-
- while ( (len = edg_wll_gss_read(&conn, buf, sizeof(buf), &timeout, &stat)) >= 0 ) {
- if ( edg_wll_gss_write(&conn, buf, len, &timeout, &stat) ) exit(1);
- }
-
- edg_wll_gss_close(&conn, &timeout);
-
- exit(0);
-}
-
-
-void GSSTest::setUp(void) {
- pid_t pid;
- edg_wll_GssStatus stat;
- struct sockaddr_storage a;
- socklen_t alen = sizeof(a);
- char * cred_file = NULL;
- char * key_file = NULL;
- char * to = getenv("GSS_TEST_TIMEOUT");
- struct addrinfo *ai;
- struct addrinfo hints;
- char servname[16];
- int ret;
-
-
- timeout.tv_sec = to ? atoi(to) : 10 ;
- timeout.tv_usec = 0;
- my_cred = NULL;
-
- key_file = cred_file = getenv("X509_USER_PROXY");
- CPPUNIT_ASSERT_MESSAGE("credential file", cred_file);
-
- if (edg_wll_gss_acquire_cred_gsi(cred_file, key_file, &my_cred, &stat))
- CPPUNIT_ASSERT_MESSAGE("gss_acquire_cred", 0);
-
- memset (&hints, '\0', sizeof (hints));
- hints.ai_flags = AI_NUMERICSERV | AI_PASSIVE | AI_ADDRCONFIG;
- hints.ai_socktype = SOCK_STREAM;
-
- snprintf(servname, sizeof servname, "%d", port);
- ret = getaddrinfo (NULL, servname, &hints, &ai);
- CPPUNIT_ASSERT_MESSAGE("getaddrinfo()", ret == 0 && ai != NULL);
-
- sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
- CPPUNIT_ASSERT_MESSAGE("socket()", sock >= 0);
-
- ret = bind(sock, ai->ai_addr, ai->ai_addrlen);
- CPPUNIT_ASSERT_MESSAGE("bind()", ret == 0);
-
- ret = listen(sock, 1);
- CPPUNIT_ASSERT_MESSAGE("listen()", ret == 0);
-
- getsockname(sock,(struct sockaddr *) &a,&alen);
- ret = getnameinfo ((struct sockaddr *) &a, alen,
- NULL, 0, servname, sizeof(servname), NI_NUMERICSERV);
- CPPUNIT_ASSERT_MESSAGE("getnameinfo()", ret == 0);
-
- port = atoi(servname);
-
- if ( !(pid = fork()) ) replier();
- else close(sock);
-}
-
-
-void GSSTest::tearDown(void) {
- edg_wll_gss_release_cred(&my_cred, NULL);
-}
-
-
-void GSSTest::echo()
-{
- edg_wll_GssConnection conn;
- edg_wll_GssStatus stat;
- size_t total;
- int err;
- char buf[] = "f843fejwfanczn nc4*&686%$$&^(*)*#$@WSH";
- char buf2[100];
-
- std::cerr << "echo " << getpid() << std::endl;
-
- err = edg_wll_gss_connect(my_cred, "localhost", port, &timeout, &conn, &stat);
- CPPUNIT_ASSERT_MESSAGE("edg_wll_gss_connect()", !err);
-
- err = edg_wll_gss_write(&conn, buf, strlen(buf)+1, &timeout, &stat);
- CPPUNIT_ASSERT_MESSAGE("edg_wll_gss_write()", !err);
-
- err = edg_wll_gss_read_full(&conn, buf2, strlen(buf)+1, &timeout, &total, &stat);
- CPPUNIT_ASSERT_MESSAGE("edg_wll_gss_read_full()", !err);
-
- CPPUNIT_ASSERT(strlen(buf)+1 == total && !strcmp(buf,buf2) );
-
- edg_wll_gss_close(&conn, &timeout);
-
-}
-
-void GSSTest::bigecho()
-{
- edg_wll_GssConnection conn;
- edg_wll_GssStatus stat;
- size_t total;
- int err;
- char buf[7*BUFSIZ];
- char buf2[7*BUFSIZ];
-
- std::cerr << "bigecho " << getpid() << std::endl;
-
- err = edg_wll_gss_connect(my_cred, "localhost", port, &timeout, &conn, &stat);
- CPPUNIT_ASSERT_MESSAGE("edg_wll_gss_connect()", !err);
-
- err = edg_wll_gss_write(&conn, buf, sizeof buf, &timeout, &stat);
- CPPUNIT_ASSERT_MESSAGE("edg_wll_gss_write()", !err);
-
- err = edg_wll_gss_read_full(&conn, buf2, sizeof buf2, &timeout, &total, &stat);
- CPPUNIT_ASSERT_MESSAGE("edg_wll_gss_read_full()", !err);
-
- CPPUNIT_ASSERT(sizeof buf == total && !memcmp(buf,buf2,sizeof buf) );
-
- edg_wll_gss_close(&conn, &timeout);
-
-}
-
-
-void GSSTest::errorTest()
-{
- edg_wll_GssConnection conn;
- edg_wll_GssStatus stat;
- int err;
- char * msg = NULL;
-
-
- err = edg_wll_gss_connect(my_cred, "xxx.example.net", port, &timeout, &conn, &stat);
- if (err) edg_wll_gss_get_error(&stat, "gss_connect()", &msg);
- CPPUNIT_ASSERT_MESSAGE("edg_wll_gss_get_error()", msg);
-}
-
-
-CPPUNIT_TEST_SUITE_REGISTRATION( GSSTest );
-
-int main (int ac,const char *av[])
-{
- assert(ac == 2);
- std::ofstream xml(av[1]);
-
- CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
- CppUnit::TestRunner runner;
-
- CppUnit::TestResult controller;
- CppUnit::TestResultCollector result;
- controller.addListener( &result );
-
- runner.addTest(suite);
- runner.run(controller);
-
-
- CppUnit::XmlOutputter xout( &result, xml );
- CppUnit::CompilerOutputter tout( &result, std::cout);
- xout.write();
- tout.write();
-
- return result.wasSuccessful() ? 0 : 1 ;
-}
+++ /dev/null
-# defaults
-top_srcdir=..
-builddir=build
-top_builddir=${top_srcdir}/${builddir}
-stagedir=.
-globalprefix=glite
-jpprefix=jp
-package=glite-lbjp-common-jp-interface
-version=0.0.0
-PREFIX=/opt/glite
-prefix=
-
-globus_prefix=/opt/globus
-expat_prefix=/opt/expat
-gsoap_prefix=/software/gsoap-2.6
-
-CC=gcc
-
--include Makefile.inc
--include ${top_srcdir}/project/version.properties
-
-version=${module.version}
-
-VPATH=${top_srcdir}/src:${top_srcdir}/test:${top_srcdir}/project:${jpproject}
-
-DEBUG:=-g -O0 -W -Wno-sign-compare
-CFLAGS:=${CFLAGS} ${DEBUG} -D_GNU_SOURCE -I. -I${top_srcdir}/interface -I${stagedir}${prefix}/include
-
-# In order to use libtool versioning correcty, we must have:
-#
-# current = major + minor + offset
-# revision = patch
-# age = minor
-#
-# where offset is a sum of maximal released minor's of all previous major's
-#
-
-# counted minors: n/a
-offset=0
-
-version_info:=-version-info ${shell \
- perl -e '$$,=":"; @F=split "\\.","${version}"; print $$F[0]+$$F[1]+${offset},$$F[2],$$F[1]' }
-
-
-LINK:=libtool --mode=link ${CC} ${LDFLAGS} -rpath ${stagedir}${prefix}/${libdir} ${version_info}
-LINKXX:=libtool --mode=link ${CXX} ${LDFLAGS}
-INSTALL:=libtool --mode=install install
-COMPILE:=libtool --mode=compile ${CC} ${CFLAGS}
-
-HDRS:=types.h context.h attr.h known_attr.h backend.h builtin_plugins.h file_plugin.h indexdb.h type_plugin.h
-
-SRCS:=context.c attr.c utils.c indexdb.c
-OBJS:=${SRCS:.c=.lo}
-THROBJS:=${OBJS:.o=.thr.lo}
-LIBS:=-L${stagedir}${prefix}/${libdir} -lglite_jobid -lglite_lbu_db
-THRLIBS:=${LIBS}
-
-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: ${lib_LTLIBRARIES}
-
-${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} ${CPPUNIT_CFLAGS} $<
- ${LINKXX} -o $@ $@.o ${default_commonlib} ${CPPUNIT_LIBS}
-
-doc:
-
-stage: compile
- $(MAKE) install PREFIX=${stagedir}
-
-install:
- -mkdir -p ${DESTDIR}${PREFIX}${prefix}/include/${globalprefix}/${jpprefix}
- cd ${top_srcdir}/interface && install -m 644 ${HDRS} ${DESTDIR}${PREFIX}${prefix}/include/${globalprefix}/${jpprefix}
- -mkdir -p ${DESTDIR}${PREFIX}${prefix}/${libdir}
- ${INSTALL} -m 755 ${lib_LTLIBRARIES} ${DESTDIR}${PREFIX}${prefix}/${libdir}
-
-clean:
- rm -rvf *.o *.lo .libs lib*
- rm -vf type_test type_test.xml
- rm -f glite jp
-
-distclean:
- rm -rvf Makefile.inc *.spec debian/
-
-%.thr.lo: %.c
- ${COMPILE} -o $@ -c $<
-
-%.lo: %.c
- ${COMPILE} -o $@ -c $<
+++ /dev/null
-#!/usr/bin/perl
-
-# WARNING: Don't edit this file unless it is the master copy in org.glite.lb
-#
-# For the purpose of standalone builds of lb/jobid/lbjp-common components
-# it is copied on tagging
-
-# $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.
-#
-
-use Getopt::Long;
-use POSIX qw(locale_h strftime);
-
-my $pwd = `pwd`; chomp $pwd;
-my $prefix = '/usr';
-my $stagedir = undef;
-my $root = $pwd.'/stage';
-my $sysroot = '';
-my $sysconfdir;
-my $localstatedir;
-my $staged;
-my $module;
-my $thrflavour = 'gcc64dbgpthr';
-my $nothrflavour = 'gcc64dbg';
-my $mode = 'build';
-my $help = 0;
-my $listmodules;
-my ($version, $force_version);
-my $branch;
-my $output;
-my $lb_tag = '';
-my $lbjp_tag = '';
-my $jp_tag = '';
-my $jobid_tag = '';
-my $libdir = getlibdir();
-my $project = 'emi';
-my $project_version;
-my (%projects, %project);
-my $debug = 0;
-my $pkg_config_env = (defined $ENV{PKG_CONFIG_PATH}) ? "$ENV{PKG_CONFIG_PATH}:" : '';
-
-my @nodes = qw/client server logger logger-msg nagios utils client-java doc ws-test db jpprimary jpindex jpclient harvester lb px proxyrenewal/;
-my @default_nodes = qw/lb px proxyrenewal nagios/;
-my %enable_nodes;
-my %disable_nodes;
-my %default_nodes; @default_nodes{@default_nodes} = (1) x ($#default_nodes + 1);
-
-my %package = (
- 'maintainer' => 'CESNET Product Teams <emi-lb@metacentrum.cz>',
- 'uploaders' => 'František Dvořák <valtri@civ.zcu.cz>',
- 'url' => 'http://glite.cern.ch',
- 'debian_vcs' => 'Vcs-Cvs: :pserver:anonymous@jra1mw.cvs.cern.ch:/cvs/jra1mw
-Vcs-Browser: http://jra1mw.cvs.cern.ch/cgi-bin/jra1mw.cgi',
-);
-
-# key: internal package name (arguments, ...)
-# 'pkg': pkg-config name
-# 'prefix': used when pkg-config fails
-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-devel' => {
- prefix=> '/opt/globus',
- pkg => 'myproxy'
- },
- 'myproxy-server' => {
- prefix=> '',
- },
- 'myproxy-admin' => {
- prefix=> '',
- },
- gsoap => {
- prefix=> '/usr',
- pkg => 'gsoap'
- },
- gsoapxx => {
- prefix=> '/usr',
- pkg => 'gsoap++'
- },
- mysql => {
- prefix=> '/usr'
- },
- 'mysql-devel' => {
- prefix=> ''
- },
- 'mysql-server' => {
- prefix => ''
- },
- voms => {
- prefix => '/opt/glite',
- pkg => 'voms-2.0'
- },
- gridsite => {
- prefix => '/opt/glite'
- },
- lcas => {
- prefix => '/opt/glite',
- pkg => 'lcas'
- },
- trustmanager => {
- prefix => '/opt/glite'
- },
- trustmanager_axis => {
- prefix => '/opt/glite'
- },
- utiljava => {
- prefix=> '/opt/glite'
- },
- ant => {
- prefix=> '/usr'
- },
- jdk => {
- prefix=> '/usr/java/latest',
- locations => [ '/usr/lib/jvm/java', '/usr/lib/jvm/default-java', '/usr/java/latest' ],
- },
- libtar => {
- prefix=> '/usr'
- },
- axis => {
- prefix=> '/usr'
- },
- log4c => {
- prefix=> '/usr'
- },
- postgresql => {
- prefix=> '/usr'
- },
- activemq => {
- prefix=>'/opt/activemq-cpp-library',
- pkg => 'activemq-cpp'
- },
-);
-
-my %jar = (
- 'jakarta-commons-codec' => '/usr/share/java/commons-codec.jar',
- 'jakarta-commons-lang' => '/usr/share/java/commons-lang.jar',
-);
-
-
-my %glite_prefix;
-my %need_externs;
-my %need_externs_type;
-my %need_jars;
-my %extrafull;
-my %extranodmod;
-my %deps;
-my %deps_type;
-my %buildroot;
-my (%etics_externs, %etics_projects);
-
-#
-# modules of the subsystems
-#
-# additional modules from $project{modules} are automatically added
-#
-my %lbmodules = (
- 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim logger-msg nagios client-devel client-progs common-devel logger-devel state-machine-devel/],
- 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin db-devel log-devel maildir-devel server-bones-devel trio-devel jp-interface-devel gss-devel gsoap-plugin-devel/],
- 'jobid' => [qw/api-c api-c-devel api-cpp api-cpp-devel api-java/],
- 'jp' => [ qw/client doc index primary server-common ws-interface/ ],
- 'gridsite' => [ qw/apache libs commands core devel slashgrid services service-clients gsexec/ ],
- 'px' => [ qw/proxyrenewal myproxy-yaim proxyrenewal-devel proxyrenewal-progs/ ],
- 'canl' => [ qw/c c-devel/ ],
- );
-
-#
-# sub-packages
-#
-# modify %lbmodules, %deps_aux, %extrafull, and %properties accodingly
-#
-my %subpackages = (
- 'jobid.api-c-devel' => 'jobid.api-c',
- 'jobid.api-cpp-devel' => 'jobid.api-cpp',
- 'lbjp-common.db-devel' => 'lbjp-common.db',
- 'lbjp-common.gsoap-plugin-devel' => 'lbjp-common.gsoap-plugin',
- 'lbjp-common.gss-devel' => 'lbjp-common.gss',
- 'lbjp-common.jp-interface-devel' => 'lbjp-common.jp-interface',
- 'lbjp-common.log-devel' => 'lbjp-common.log',
- 'lbjp-common.maildir-devel' => 'lbjp-common.maildir',
- 'lbjp-common.server-bones-devel' => 'lbjp-common.server-bones',
- 'lbjp-common.trio-devel' => 'lbjp-common.trio',
- 'lb.client-progs' => 'lb.client',
- 'lb.client-devel' => 'lb.client',
- 'lb.common-devel' => 'lb.common',
- 'lb.logger-devel' => 'lb.logger',
- 'lb.state-machine-devel' => 'lb.state-machine',
- 'px.proxyrenewal-devel' => 'px.proxyrenewal',
- 'px.proxyrenewal-progs' => 'px.proxyrenewal',
- 'canl.c-devel' => 'canl.c',
-);
-
-my @opts = (
- 'prefix:s' => \$prefix,
- 'staged=s' => \$staged,
- 'module=s' => \$module,
- 'thrflavour:s' => \$thrflavour,
- 'nothrflavour:s' => \$nothrflavour,
- 'mode=s' => \$mode,
- 'listmodules=s' => \$listmodules,
- 'version=s' => \$force_version,
- 'branch=s' => \$branch,
- 'output=s' => \$output,
- 'stage=s' => \$stagedir,
- 'root:s' => \$root,
- 'sysroot:s' => \$sysroot,
- 'sysconfdir=s' => \$sysconfdir,
- 'localstatedir=s' => \$localstatedir,
- 'lb-tag=s' => \$lb_tag,
- 'lbjp-common-tag=s' => \$lbjp_tag,
- 'jp-tag=s' => \$jp_tag,
- 'jobid-tag=s' => \$jobid_tag,
- 'canl-tag=s' => \$canl_tag,
- 'help' => \$help,
- 'libdir=s' => \$libdir,
- 'project=s' => \$project,
- 'debug' => \$debug,
-);
-
-for (@nodes) {
- $enable_nodes{$_} = 0;
- $disable_nodes{$_} = 0;
-
- push @opts,"disable-$_",\$disable_nodes{$_};
- push @opts,"enable-$_",\$enable_nodes{$_};
-}
-
-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";
-$prefix=~s/\/$//;
-$root=~s/\/$//;
-$sysroot=~s/\/$//;
-if (not $sysconfdir) { $sysconfdir = $prefix eq '/usr' ? '/etc' : "$prefix/etc"; }
-if (not $localstatedir) { $localstatedir = $prefix eq '/usr' ? '/var' : "$prefix/var"; }
-$sysconfdir=~s/\/$//;
-$localstatedir=~s/\/$//;
-
-$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq '';
-$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq '';
-$externs{'gsoapxx'}{prefix}=$externs{gsoap}{prefix} if $externs{'gsoapxx'}{prefix} eq '';
-
-$externs{'mysql-server'}{withprefix}=$externs{mysql}{withprefix} if $externs{'mysql-server'}{withprefix} eq '';
-$externs{'mysql-devel'}{wihtprefix}=$externs{mysql}{withprefix} if $externs{'mysql-devel'}{withprefix} eq '';
-$externs{'gsoapxx'}{withprefix}=$externs{gsoap}{withprefix} if $externs{'gsoapxx'}{withprefix} eq '';
-
-if ($project =~ /^([^0-9]*)(.*)$/) {
- $project = $1;
- $project_version = $2;
-}
-%project = %{$projects{$project}};
-$project_version = $project{current_version} unless $project_version;
-for my $platform (keys %{$project{etics_externs}}) {
- for $_ (keys %{$project{etics_externs}{$platform}}) {
- $etics_externs{$platform}{$_} = $project{etics_externs}{$platform}{$_};
- }
-}
-reshuffle_platforms(\%etics_externs, $project{supported_platforms});
-reshuffle_platforms(\%{$project{etics_externs_devel}}, $project{supported_platforms});
-for $_ (keys %{$project{etics_projects}}) {
- $etics_projects{$_} = $project{etics_projects}{$_};
-}
-for $_ (keys %{$project{need_externs_aux}}) {
- $need_externs_aux{$_} = $project{need_externs_aux}{$_};
-}
-for my $ext (keys %need_externs_aux) {
- for (@{$need_externs_aux{$ext}}) {
- my ($pkg, $type) =/([^:]*)(?::(.*))?/;
- $type = 'BR' unless ($type);
-
- push @{$need_externs{$ext}},$pkg;
- $need_externs_type{$ext}->{$pkg} = $type;
- }
-}
-if ($project eq 'emi') {
- $extranodmod{lb} = 'lb.emi-lb';
- $extranodmod{px} = 'px.emi-px';
-}
-for $_ (keys %{$project{modules}}) {
- push @{$lbmodules{$_}},@{$project{modules}{$_}};
-}
-
-
-if ($help) { usage(); exit 0; }
-
-if ($listmodules) {
- my $name_prefix = ($listmodules eq 'gridsite' and $project eq 'glite') ? 'org' : $project{etics_name};
- my @m;
-
- if (exists $lbmodules{$listmodules}) {
- @m = map exists $subpackages{$listmodules . '.' . $_} ? "" : "$name_prefix.$listmodules.$_",@{$lbmodules{$listmodules}};
- } else {
- if ($project eq 'emi' and $project_version == 1) {
- # no sub-packages in EMI-1
- } else {
- for my $sub (keys %subpackages) {
- push @m, $sub if ($subpackages{$sub} eq $listmodules);
- }
- }
- }
- print map $_ eq "" ? "" : "$_ ", @m;
- print "\n";
- exit 0;
-}
-
-warn "$0: --branch and --output make sense only in --mode=etics\n"
- if ($output || $branch) && $mode ne 'etics';
-
-my $en;
-for (keys %enable_nodes) { $en = 1 if $enable_nodes{$_}; }
-
-my $dis;
-for (keys %disable_nodes) { $dis = 1 if $disable_nodes{$_}; }
-
-die "--enable-* and --disable-* are mutually exclusive\n"
- if $en && $dis;
-
-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{jp}};
-
-if ($dis) {
- for (@nodes) {
- $enable_nodes{$_} = 1 unless ($disable_nodes{$_} or not $default_nodes{$_});
- }
-}
-
-if (!$en && !$dis) { for (@nodes) { $enable_nodes{$_} = 1 if ($default_nodes{$_}) } };
-
-for (keys %enable_nodes) { delete $enable_nodes{$_} unless $enable_nodes{$_}; }
-
-$stagedir = $root unless $stagedir;
-$stagedir=~s/\/$// if ($stagedir);
-
-if ($mode eq 'build') { for my $ext (keys %externs) {
- if (defined $externs{$ext} and defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; }
- elsif (defined $externs{$ext}{pkg}) {
- my ($flag, $env, $cmd, $ret);
- my $pkg = $externs{$ext}{pkg};
- my $flagname = uc $externs{$ext}{pkg};
- $flagname =~ s/-[0-9\.]*$//;
- $flagname =~ y/-\+/_X/;
-
- print "Checking $pkg ... ";
- $env = "PKG_CONFIG_PATH=$pkg_config_env$stagedir$prefix/$libdir/pkgconfig";
- $cmd = "$env pkg-config $pkg --exists >/dev/null";
- `$cmd`; $ret = $?;
- print "('$cmd' => $ret)\n" if ($debug);
- if ($ret == 0) {
- $externs{$ext}{prefix}=`$env pkg-config $pkg --variable=prefix`;
- chomp $externs{$ext}{prefix};
- print "$externs{$ext}{prefix}\n";
-
- $flag=`$env pkg-config $pkg --cflags`;
- $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag);
- $flag=`$env pkg-config $pkg --libs`;
- $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag);
- } else {
- print "(using default $externs{$ext}{prefix})\n";
- }
- print "\n" if ($debug);
- }
- elsif ($ext eq 'jdk') {
- my $jdk_prefix;
-
- print "Looking for some caffein ... ";
- if (defined $ENV{'JDK_HOME'}) {
- $jdk_prefix = $ENV{'JDK_HOME'};
- print "JDK_HOME=$jdk_prefix\n";
- } elsif (defined $ENV{'JAVA_HOME'}) {
- $jdk_prefix = $ENV{'JAVA_HOME'};
- print "JAVA_HOME=$jdk_prefix\n";
- } else {
- foreach my $i (0..$#{$externs{$ext}{locations}}) {
- if (-e $externs{$ext}{locations}[$i]) {
- $jdk_prefix=$externs{$ext}{locations}[$i];
- print "(found directory $jdk_prefix)\n";
- last;
- }
- }
- print "(using default $externs{$ext}{prefix})\n" unless ($jdk_prefix);
- }
- $externs{$ext}{prefix} = $jdk_prefix if ($jdk_prefix);
- }
-} }
-
-if ($mode eq 'build') {
- print "Writing config.status\n";
- open CONF,">config.status" or die "config.status: $!\n";
- for ('JDK_HOME', 'JAVA_HOME', 'PKG_CONFIG_PATH') {
- print CONF "$_=$ENV{$_} " if (defined $ENV{$_});
- }
- print CONF "$0 @keeparg\n";
- close CONF;
-}
-
-
-my @modules;
-my %aux;
-
-if ($module) {
-# push @modules,split(/[,.]+/,$module);
- push @modules,$module;
-}
-else {
- @modules = map(($extranodmod{$_} ? $extranodmod{$_} : 'lb.'.$_),(keys %enable_nodes));
-
- my $n;
-
- do {
- local $"="\n";
- $n = $#modules;
- push @modules,(map @{$deps{$_}},@modules);
-
- undef %aux; @aux{@modules} = (1) x ($#modules+1);
- @modules = keys %aux;
- } while ($#modules > $n);
-}
-
-@aux{@modules} = (1) x ($#modules+1);
-delete $aux{$_} for (split /,/,$staged);
-@modules = keys %aux;
-
-mode_build() if $mode eq 'build';
-mode_checkout() if $mode eq 'checkout';
-mode_etics($module) if $mode eq 'etics';
-
-sub mode_build {
- print "\nBuilding modules: @modules\n";
- print "Mode: "; print $module ? "single module" : "multiple modules"; print "\n";
-
- my @ext = map @{$need_externs{$_}},@modules;
- my @myjars = map @{$need_jars{$_}},@modules;
- undef %aux; @aux{@ext} = 1;
- @ext = keys %aux;
- undef %aux; @aux{@myjars} = (1) x ($#myjars+1);
- @myjars = keys %aux;
-
- print "\nRequired externals:\n";
- print "\t$_: ".($externs{$_}{prefix}?$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;
-
- if ($module) {
- print "Not creating summary Makefile\n" if $debug;
- } else {
- print "Creating Makefile\n";
-
- open MAK,">Makefile" or die "Makefile: $!\n";
-
- print MAK "all: @modules\n\n";
- print MAK "stage: ".(join '-stage ', @modules)."-stage\n\n";
- print MAK "clean check install:\n";
-
- for (@modules) {
- my $full = full($_);
- print MAK "\tcd $full/$buildroot{$_} && \${MAKE} \$@\n"
- }
-
- print MAK "\ndistclean:\n";
-
- for (@modules) {
- my $full = full($_);
- print MAK $buildroot{$_} eq '' ?
- "\tcd $full && \${MAKE} distclean\n" :
- "\trm -rf $full/$buildroot{$_}\n"
- }
-
- print MAK "\n";
-
- for (@modules) {
- my %ldeps; undef %ldeps;
- @ldeps{@{$deps{$_}}} = 1;
- for my $x (split /,/,$staged) { delete $ldeps{$x}; }
- my @dnames = $module ? () : keys %ldeps;
- my $snames = $#dnames == -1 ? '' : join('-stage ', @dnames).'-stage';
-
- my $full = full($_);
- my $build = $buildroot{$_};
-
- print MAK "$_: @dnames\n\tcd $full/$build && \${MAKE} && \${MAKE} install\n\n";
- print MAK "$_-stage: $snames\n\tcd $full/$build && \${MAKE} && \${MAKE} stage\n\n";
- }
-
- close MAK;
- }
-}
-
-sub mode_checkout() {
- for (@modules) {
- my $module = $_;
- my $tag = "";
- if ($lb_tag){
- for (@{$lbmodules{lb}}){
- if ("lb.".$_ eq $module){
- $tag = '-r '.$lb_tag;
- }
- }
- }
- if ($lbjp_tag) {
- for (@{$lbmodules{'lbjp-common'}}){
- if ("lbjp-common.".$_ eq $module){
- $tag = '-r '.$lbjp_tag;
- }
- }
- }
- if ($jp_tag){
- for (@{$lbmodules{'jp'}}){
- if ("jp.".$_ eq $module){
- $tag = '-r '.$jp_tag;
- }
- }
- }
- if ($jobid_tag){
- for (@{$lbmodules{jobid}}){
- if ("jobid.".$_ eq $module){
- $tag = '-r '.$jobid_tag;
- }
- }
- }
- if ($canl_tag) {
- for (@{$lbmodules{'canl'}}){
- if ("canl.".$_ eq $module){
- $tag = '-r '.$canl_tag;
- }
- }
- }
- #if (grep {"lb.".$_ eq $module} @{$lbmodules{lb}}){
- # print "found";
- #}
- $_ = full($_);
- print "\n*** Checking out $_\n";
- system("cvs checkout $tag $_") == 0 or die "cvs checkout $tag $_: $?\n";
- }
-}
-
-BEGIN{
-%etics_externs = (
- default => {
- 'myproxy-devel'=>'myproxy-devel',
- 'myproxy-server'=>'myproxy-server',
- 'myproxy-admin'=>'myproxy-admin',
- cares=>'c-ares',
- utiljava=>'org.glite.security.util-java',
- gpt=>'gpt',
- fetchcrl=>'fetch-crl',
- activemq=>'activemq-cpp-library',
- },
-);
-
-%etics_projects = (
-);
-
-%need_externs_aux = (
- 'lb.client' => [ qw/cppunit:B classads libtool:B globus:B/ ],
- 'lb.common' => [ qw/expat cares:B cppunit:B classads libtool:B globus:B/ ],
- 'lb.doc' => [ qw/tetex-latex:B/ ],
- 'lb.logger' => [ qw/cppunit:B libtool:B globus:B/ ],
- 'lb.logger-msg' => [ qw/cppunit:B activemq libtool:B globus:B/ ],
- 'lb.nagios' => [ qw/globus_proxy_utils:R/ ],
- 'lb.server' => [ qw/globus_essentials:R globus:B expat cares mysql-server:R cppunit:B gsoap:B classads voms:B lcas gridsite:B bison:B libtool:B libxml2 flex:B/ ],
- 'lb.state-machine' => [ qw/classads libtool:B libxslt:B expat:B globus:B/ ],
- 'lb.utils' => [ qw/cppunit:B libtool:B globus:B/ ],
- 'lb.ws-interface' => [ qw/libxslt:B tidy:B/ ],
- 'lb.ws-test' => [ qw/gsoap:B libtool:B globus:B/ ],
- 'lb.types' => [ qw// ],
- 'lb.harvester' => [ qw/docbook-utils:B libtool:B globus:B/ ],
- 'lbjp-common.db' => [ qw/mysql-devel:B postgresql:B cppunit:B log4c:B libtool:B/ ],
- 'lbjp-common.log' => [ qw/log4c libtool:B/ ],
- 'lbjp-common.maildir' => [ qw/libtool:B/ ],
- 'lbjp-common.server-bones' => [ qw/libtool:B/ ],
- 'lbjp-common.trio' => [ qw/cppunit:B libtool:B/ ],
- 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B libtool:B/ ],
- 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B libtool:B/ ],
- 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap gsoapxx libtool:B/ ],
- 'jobid.api-c' => [ qw/cppunit:B libtool:B openssl:B/ ],
- 'jobid.api-cpp' => [ qw/cppunit:B libtool:B/ ],
- 'jobid.api-java' => [ qw/ant:B jdk:B/ ],
- 'jp.client' => [ qw/gsoap libtar globus_essentials:R globus:B/ ],
- 'jp.doc' => [],
- 'jp.index' => [ qw/gsoap globus_essentials:R globus:B mysql-server:R/ ],
- 'jp.primary' => [ qw/classads gsoap libtar globus_essentials:R globus:B mysql-server:R/ ],
- 'jp.server-common' => [],
- 'jp.ws-interface' => [],
- 'gridsite.core' => [ qw/httpd-devel:B gsoap:B globus:B curl:B doxygen:B fuse-devel:B libxml2:B openssl:B doxygen:B/ ],
- 'gridsite.commands' => [ qw/curl:R openssl:R/ ],
- 'gridsite.apache' => [ qw/libxml2:R openssl:R curl:R/ ],
- 'gridsite.libs' => [ qw/libxml2:R openssl:R/ ],
- 'gridsite.devel' => [ qw// ],
- 'gridsite.slashgrid' => [ qw/curl:R fuse:R/],
- 'gridsite.services' => [ qw/curl:R gsoap:R/ ],
- 'gridsite.service-clients' => [ qw/curl:R gsoap:R gsoapxx:R/ ],
- 'gridsite.gsexec' => [ qw// ],
- 'gridsite.1.5-compat' => [ qw/httpd-devel:B gsoap:B globus:B curl:B doxygen:B fuse-devel:B libxml2:B openssl:B doxygen:B/ ],
- 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-devel:B voms:B libtool:B/ ],
- 'px.myproxy-config' => [ qw/myproxy-admin:R/ ], # in myproxy-config.spec
- 'canl.c' => [ qw/cares:B openssl:B libtool:B bison:B flex:B krb5-devel:B/ ],
-);
-
-%need_jars = (
- 'jobid.api-java' => [ qw/jakarta-commons-codec/ ],
- 'lb.client-java' => [ qw/jakarta-commons-lang/ ],
-);
-
-for my $jar (keys %need_jars) {
- for (@{$need_jars{$jar}}) {
- $need_externs_type{$jar}->{$_} = 'BR'; # XXX
- }
-}
-
-%deps_aux = (
- 'lb.client' => [ qw/
- lb.types:B lb.common
- lbjp-common.trio
- jobid.api-cpp:B jobid.api-c
- lbjp-common.gss
- / ],
- 'lb.client-java' => [ qw/
- lb.types:B
- lb.ws-interface:B
- jobid.api-java
- / ],
- 'lb.common' => [ qw/
- jobid.api-cpp:B jobid.api-c
- lb.types:B lbjp-common.trio lbjp-common.gss
- / ],
- 'lb.doc' => [ qw/lb.types:B/ ],
- 'lb.logger' => [ qw/
- lbjp-common.trio
- lbjp-common.log
- jobid.api-c
- lb.common
- lbjp-common.gss
- / ],
- 'lb.logger-msg' => [ qw/
- lb.logger:B
- / ],
- 'lb.nagios' => [ qw/
- lb.client:R
- lb.ws-test:R
- lb.utils:R
- / ],
- 'lb.server' => [ qw/
- lb.ws-interface lb.types:B lb.common lb.state-machine lb.utils:R
- lbjp-common.db lbjp-common.server-bones lbjp-common.trio lbjp-common.maildir lbjp-common.log
- jobid.api-c
- lbjp-common.gsoap-plugin lbjp-common.gss
- / ],
- 'lb.state-machine' => [ qw/lb.types:B lb.common lbjp-common.jp-interface lbjp-common.gss/ ],
- 'lb.utils' => [ qw/
- lbjp-common.jp-interface
- jobid.api-c
- lbjp-common.trio lbjp-common.maildir
- lb.client lb.state-machine lb.types:B
- / ],
- 'lb.ws-test' => [ qw/lbjp-common.gsoap-plugin lb.ws-interface/ ],
- 'lb.ws-interface' => [ qw/lb.types:B/ ],
- 'lb.types' => [ qw// ],
- 'lb.harvester' => [ qw/
- jobid.api-c lbjp-common.trio lbjp-common.db lb.common lb.client
- lbjp-common.gss lbjp-common.log
- / ],
- 'lb.yaim' => [ qw// ],
- 'lb.glite-LB' => [ qw/
- lb.logger:R lb.server:R lb.utils:R lb.doc:R
- lb.ws-test:R lb.harvester:R lb.yaim:R lb.client-java:R
- lb.logger-msg:R
- / ],
- 'lb.emi-lb' => [ qw/
- lb.logger:R lb.server:R lb.utils:R lb.doc:R
- lb.ws-test:R lb.harvester:R lb.yaim:R lb.client-java:R
- lb.logger-msg:R
- / ],
- 'lbjp-common.db' => [ qw/lbjp-common.trio lbjp-common.log/ ],
- 'lbjp-common.maildir' => [ qw// ],
- 'lbjp-common.log' => [ qw// ],
- 'lbjp-common.server-bones' => [ qw/lbjp-common.log/ ],
- 'lbjp-common.trio' => [ qw// ],
- 'lbjp-common.gss' => [ qw// ],
- 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ],
- 'jobid.api-c' => [ qw// ],
- 'jobid.api-cpp' => [ qw/jobid.api-c/ ],
- 'jobid.api-java' => [ qw// ],
-
- 'lbjp-common.jp-interface' => [ qw/lbjp-common.trio lbjp-common.db jobid.api-c/ ],
-
- 'jp.client' => [ qw/
- jp.ws-interface
- lbjp-common.jp-interface lbjp-common.maildir
- jobid.api-c
- lbjp-common.gsoap-plugin
- / ],
- 'jp.doc' => [ qw// ],
- 'jp.index' => [ qw/
- jp.server-common jp.ws-interface
- lbjp-common.jp-interface lbjp-common.trio lbjp-common.db lbjp-common.server-bones
- lbjp-common.gsoap-plugin
- / ],
- 'jp.primary' => [ qw/
- jobid.api-c
- jp.server-common jp.ws-interface
- lb.state-machine
- lbjp-common.jp-interface lbjp-common.trio lbjp-common.db lbjp-common.server-bones
- lbjp-common.gsoap-plugin
- / ],
- 'jp.server-common' => [ qw/
- lbjp-common.jp-interface lbjp-common.db
- / ],
- 'jp.ws-interface' => [ qw// ],
-
- 'gridsite.core' => [ qw// ],
- 'gridsite.commands' => [ qw/gridsite.core:B/ ],
- 'gridsite.apache' => [ qw/gridsite.core:B/ ],
- 'gridsite.libs' => [ qw/gridsite.core:B / ],
- 'gridsite.devel' => [ qw/gridsite.core:B/ ],
- 'gridsite.slashgrid' => [ qw/gridsite.core:B/],
- 'gridsite.services' => [ qw/gridsite.core:B/ ],
- 'gridsite.service-clients' => [ qw/gridsite.core:B/ ],
- 'gridsite.gsexec' => [ qw/gridsite.core:B/ ],
-
- 'px.proxyrenewal' => [ qw// ],
- 'px.glite-PX' => [qw/px.myproxy-yaim:R/],
- 'px.emi-px' => [qw/px.myproxy-yaim:R/],
- 'px.myproxy-yaim' => [ qw// ],
- 'px.myproxy-config' => [],
-
- 'canl.c' => [],
-
- # sub-packages (virtual ETICS components depending on the main)
- 'jobid.api-c-devel' => [ qw/jobid.api-c:B/ ],
- 'jobid.api-cpp-devel' => [ qw/jobid.api-cpp:B/ ],
- 'lbjp-common.db-devel' => [ qw/lbjp-common.db:B/ ],
- 'lbjp-common.gsoap-plugin-devel' => [ qw/lbjp-common.gsoap-plugin:B/ ],
- 'lbjp-common.gss-devel' => [ qw/lbjp-common.gss:B/ ],
- 'lbjp-common.jp-interface-devel' => [ qw/lbjp-common.jp-interface:B/ ],
- 'lbjp-common.log-devel' => [ qw/lbjp-common.log:B/ ],
- 'lbjp-common.maildir-devel' => [ qw/lbjp-common.maildir:B/ ],
- 'lbjp-common.server-bones-devel' => [ qw/lbjp-common.server-bones:B/ ],
- 'lbjp-common.trio-devel' => [ qw/lbjp-common.trio:B/ ],
- 'lb.client-progs' => [ qw/lb.client:B/ ],
- 'lb.client-devel' => [ qw/lb.client:B/ ],
- 'lb.common-devel' => [ qw/lb.common:B/ ],
- 'lb.logger-devel' => [ qw/lb.logger:B/ ],
- 'lb.state-machine-devel' => [ qw/lb.state-machine:B/ ],
- 'px.proxyrenewal-devel' => [ qw/px.proxyrenewal:B/ ],
- 'px.proxyrenewal-progs' => [ qw/px.proxyrenewal:B/ ],
- 'canl.c-devel' => [ qw/canl.c:B/ ],
-);
-
-for my $ext (keys %deps_aux) {
- for (@{$deps_aux{$ext}}) {
- /([^:]*)(?::(.*))?/;
- push @{$deps{$ext}},$1;
- my $type = $2 ? $2 : 'BR';
- $deps_type{$ext}->{$1} = $type;
- }
-}
-
-
-%extrafull = (
- gridsite=>'org.gridsite.core',
- 'canl.c' => 'emi.canl.canl-c',
- 'canl.c-devel' => 'emi.canl.canl-c',
- 'jobid.api-c-devel' => 'org.glite.jobid.api-c',
- 'jobid.api-cpp-devel' => 'org.glite.jobid.api-cpp',
- 'lbjp-common.db-devel' => 'org.glite.lbjp-common.db',
- 'lbjp-common.gsoap-plugin-devel' => 'org.glite.lbjp-common.gsoap-plugin',
- 'lbjp-common.gss-devel' => 'org.glite.lbjp-common.gss',
- 'lbjp-common.jp-interface-devel' => 'org.glite.lbjp-common.jp-interface',
- 'lbjp-common.log-devel' => 'org.glite.lbjp-common.log',
- 'lbjp-common.maildir-devel' => 'org.glite.lbjp-common.maildir',
- 'lbjp-common.server-bones-devel' => 'org.glite.lbjp-common.server-bones',
- 'lbjp-common.trio-devel' => 'org.glite.lbjp-common.trio',
- 'lb.client-devel' => 'org.glite.lb.client',
- 'lb.client-progs' => 'org.glite.lb.client',
- 'lb.common-devel' => 'org.glite.lb.common',
- 'lb.logger-devel' => 'org.glite.lb.logger',
- 'lb.state-machine-devel' => 'org.glite.lb.state-machine',
- 'px.proxyrenewal-devel' => 'org.glite.px.proxyrenewal',
- 'px.proxyrenewal-progs' => 'org.glite.px.proxyrenewal',
-);
-
-#( java => 'client-java' );
-%extranodmod = (
- db => 'lbjp-common.db',
- jpprimary => 'jp.primary',
- jpindex => 'jp.index',
- jpclient => 'jp.client',
- lb => 'lb.glite-LB',
- px => 'px.glite-PX',
- proxyrenewal => 'px.proxyrenewal',
- canl => 'canl.c',
-);
-
-%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/ ],
-);
-
-%conflicts = (
-);
-
-%provides = (
- 'lbjp-common.gss' => [ qq/glite-security-gss/ ],
- 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ],
- 'lb.nagios' => [ qq/glite-lb-nagios-plugins/ ],
-);
-
-%cvs_prefix = (
- 'lb' => 'org.glite',
- 'jp' => 'org.glite',
- 'jobid' => 'org.glite',
- 'lbjp-common' => 'org.glite',
- 'gridsite' => 'org',
- 'px' => 'org.glite',
- 'canl' => 'emi',
-);
-
-%cvs_tag_prefix = (
- 'lb' => 'glite-',
- 'jp' => 'glite-',
- 'jobid' => 'glite-',
- 'lbjp-common' => 'glite-',
- 'gridsite' => '',
- 'px' => 'glite-',
- 'canl' => 'emi-',
-);
-
-# ==== projects specification ====
-# etics_name ........... ETICS project name
-# conf_prefix .......... ETICS configurations name prefix
-# tag_prefix ........... VCS tag prefix
-# local_prefix ......... prefix (relative to stage)
-# etics_externs ........ ETICS modules names of externals
-# (${NAME.location}, ETICS conf. dependencies)
-# etics_projects ....... ETICS project names of externals
-# etics_externs_devel .. ETICS modules names of devel versions of externals
-# etics_locations ...... ETICS locations in ${NAME.location} properties
-# need_externs_aux ..... project-specific external dependencies
-# supported_platforms .. platforms supported by the project
-# modules .............. additional modules in subsystems
-%projects = (
- glite => {
- current_version => 3,
- etics_name => 'org.glite',
- conf_prefix => { %cvs_tag_prefix },
- tag_prefix => { %cvs_tag_prefix },
- flavours => '--thrflavour=${globus.thr.flavor} --nothrflavour=${globus.nothr.flavor}',
- local_prefix => '',
- etics_externs => {
- default => {
- globus_essentials=>'vdt_globus_essentials',
- globus=>'globus',
- globus_proxy_utils=>'vdt_globus_essentials',
- gridsite=>'org.gridsite.libs',
- yaim_core=>'org.glite.yaim.core',
- gip_release=>'glite-info-provider-release',
- gip_service=>'glite-info-provider-service',
- bdii=>'bdii',
- glite_version=>'glite-version',
- glite_info_templates=>'glite-info-templates',
- glue_schema=>'glue-schema',
- trustmanager=>'org.glite.security.trustmanager',
- axis=>'axis',
- lcas=>'org.glite.security.lcas',
- gsoapxx=>'-',
- jdk=>'jdk',
- voms=>'org.glite.security.voms-api-cpp',
- },
- },
- etics_externs_devel => {
- default => {
- gridsite=>'org.gridsite.devel',
- voms=>'org.glite.security.voms-api',
- },
- },
- etics_projects => {
- vdt=>[qw/globus globus_essentials globus_proxy_utils gpt/],
- 'org.glite'=>[qw/voms gridsite lcas gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/],
- },
- etics_locations => {
- '*' => '',
- },
- need_externs_aux => {
- 'lb.client-java' => [ qw/ant:B jdk:B axis:B trustmanager utiljava libtool:B/ ],
- 'lb.glite-LB' => [ qw/fetchcrl:R gpt:R gip_release:R gip_service:R bdii:R glite_version:R glite_info_templates:R glue_schema:R/ ],
- 'lb.yaim' => [ qw/yaim_core:R/ ],
- 'px.glite-PX' => [qw/myproxy-server:R myproxy-admin:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/],
- 'px.myproxy-yaim' => [ qw/yaim_core:R/ ],
- },
- supported_platforms => {
- sl5_x86_64_gcc412 => 1,
- sl5_ia32_gcc412 => 1,
- deb5_x86_64_gcc432 => 1,
- deb5_ia32_gcc432 => 1,
- slc4_x86_64_gcc346 => 1,
- slc4_ia32_gcc346 => 1,
- },
- modules => {
- 'lb' => [ qw/glite-LB/ ],
- 'px' => [ qw/glite-PX/ ],
- },
- },
-
- emi => {
- current_version => 2,
- etics_name => 'emi',
- conf_prefix => {
- 'lb' => 'emi-',
- 'jp' => 'emi-',
- 'jobid' => 'emi-',
- 'lbjp-common' => 'emi-',
- 'gridsite' => 'emi-',
- 'px' => 'emi-',
- 'canl' => 'emi-',
- },
- tag_prefix => { %cvs_tag_prefix },
- flavours => '--thrflavour= --nothrflavour=',
- local_prefix => '/usr',
- etics_externs => {
- default => {
- globus_essentials=>'globus-gssapi-gsi',
- globus=>'globus-gssapi-gsi-devel',
- globus_proxy_utils=>'globus-proxy-utils',
- gridsite=>'emi.gridsite.libs',
- yaim_core=>'emi.yaim.yaim-core',
- yaim_bdii=>'emi.bdii.yaim-bdii',
- gip_service=>'emi.bdii.glite-info-provider-service',
- bdii=>'emi.bdii.core',
- glite_version=>'emi.emi-version',
- glue_schema=>'emi.bdii.glue-schema',
- trustmanager=>'emi.java-security.trustmanager',
- trustmanager_axis=>'emi.java-security.trustmanager-axis',
- axis=>'axis1.4',
- lcas=>'emi.sac.lcas',
- gsoapxx=>'-',
- jdk=>'java',
- voms => 'emi.voms.voms-api',
- },
- sl5_x86_64_gcc412EPEL => {
- 'myproxy-devel' => 'myproxy-devel.x86_64',
- },
- sl6_x86_64_gcc446EPEL => {
- 'myproxy-devel' => 'myproxy-devel.x86_64',
- },
- deb6_x86_64_gcc445 => {
- axis => 'axis1.4',
- # mappings in ETICS project configuration
- #globus_essentials => 'libglobus-gssapi-gsi4',
- #globus => 'libglobus-gssapi-gsi-dev',
- #axis => 'libaxis-java',
- #cares => 'libc-ares2',
- #cppunit => 'libcppunit',
- #expat => 'libexpat1',
- #log4c => 'liblog4c3',
- #curl => 'libcurl3',
- #'mysql' => 'libmysqlclient16',
- #'mysql-devel' => 'libmysqlclient-dev',
- #libxslt => 'xsltproc',
- #'jakarta-commons-codec' => 'libcommons-codec-java',
- #'jakarta-commons-lang' => 'libcommons-lang-java',
- #'tetex-latex' => 'texlive-latex-extra',
- #'perl-LDAP' => 'libnet-ldap-perl',
- #'fuse-lib' => 'libfuse2',
- #'fuse' => 'fuse-utils',
- },
- },
- etics_externs_devel => {
- default => {
- cares => 'c-ares-devel',
- classads => 'classads-devel',
- cppunit => 'cppunit-devel',
- expat => 'expat-devel',
- gsoap => 'gsoap-devel',
- voms => 'emi.voms.voms-api-devel',
- libtar => 'libtar-devel',
- log4c => 'log4c-devel',
- postgresql => 'postgresql-devel',
- curl => 'curl-devel',
- libxml2 => 'libxml2-devel',
- openssl => 'openssl-devel',
- gridsite=>'emi.gridsite.devel',
- jdk=>'java-devel',
- },
- deb6_x86_64_gcc445 => {
- # mappings in ETICS project configuration
- #cares => 'libc-ares-dev',
- #cppunit => 'libcppunit-dev',
- #expat => 'libexpat1-dev',
- #libtar => 'libtar-dev',
- #log4c => 'liblog4c-dev',
- #postgresql => 'libpq-dev',
- #curl => 'libcurl4-openssl-dev',
- #libxml2 => 'libxml2-dev',
- #openssl => 'libssl-dev',
- #'tetex-latex' => 'texlive-latex-extra',
- #libxslt=>'xsltproc',
- #'httpd-devel' => 'apache2-prefork-dev',
- #'fuse-devel' => 'libfuse-dev',
- #gsoap => 'gsoap',
- #'krb5-devel' => 'libkrb5-dev',
- },
- },
- etics_projects => {
- 'emi'=>[qw/voms voms-devel gridsite lcas gip_service bdii glite_version glue_schema yaim_core yaim_bdii trustmanager trustmanager_axis/],
- },
- etics_locations => {
- axis => 'axis',
- },
- need_externs_aux => {
- 'lb.client-java' => [ qw/ant:B jdk:B axis:B trustmanager trustmanager_axis libtool:B/ ],
- 'lb.emi-lb' => [ qw/fetchcrl:R gip_service:R bdii:R glite_version:R glue_schema:R/ ],
- 'lb.yaim' => [ qw/yaim_core:R yaim_bdii:R/ ],
- 'px.emi-px' => [qw/myproxy-server:R myproxy-admin:R fetchcrl:R gip_service:R bdii:R glite_version:R glue_schema:R/],
- 'px.myproxy-yaim' => [ qw/yaim_core:R yaim_bdii:R/ ],
- },
- supported_platforms => {
- sl5_x86_64_gcc412EPEL => 1,
- sl5_ia32_gcc412EPEL => 1,
- sl6_x86_64_gcc446EPEL => 1,
- deb6_x86_64_gcc445 => 1,
- },
- modules => {
- 'lb' => [ qw/emi-lb/ ],
- 'px' => [ qw/emi-px/ ],
- },
- },
-);
-
-%platform_properties = (
- 'jobid.api-java' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.types' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.doc' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.ws-interface' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.yaim' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.nagios' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'px.yaim' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'px.myproxy-config' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'gridsite.devel' => {
- default => { 'packageName' => 'gridsite-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libgridsite-dev' },
- },
- 'canl.c-devel' => {
- default => { 'packageName' => 'canl-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libcanl-dev' },
- },
- 'jobid.api-c-devel' => {
- default => { 'packageName' => 'glite-jobid-api-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-jobid-dev' },
- },
- 'jobid.api-cpp-devel' => {
- default => { 'packageName' => 'glite-jobid-api-cpp-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-jobid-cpp-dev' },
- },
- 'lbjp-common.db-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-db-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-db-dev' },
- },
- 'lbjp-common.gsoap-plugin-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-gsoap-plugin-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-gsoap-plugin-dev' },
- },
- 'lbjp-common.gss-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-gss-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-gss-dev' },
- },
- 'lbjp-common.jp-interface-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-jp-interface-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-jp-interface-dev' },
- },
- 'lbjp-common.log-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-log-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-log-dev' },
- },
- 'lbjp-common.maildir-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-maildir-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-maildir-dev' },
- },
- 'lbjp-common.server-bones-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-server-bones-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-server-bones-dev' },
- },
- 'lbjp-common.trio-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-trio-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-trio-dev' },
- },
- 'lb.client-devel' => {
- default => { 'packageName' => 'glite-lb-client-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-client-dev' },
- },
- 'lb.common-devel' => {
- default => { 'packageName' => 'glite-lb-common-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-common-dev' },
- },
- 'lb.state-machine-devel' => {
- default => { 'packageName' => 'glite-lb-state-machine-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-state-machine-dev' },
- },
- 'lb.logger-devel' => {
- default => { 'packageName' => 'glite-lb-logger-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-logger-dev' },
- },
- 'px.proxyrenewal-devel' => {
- default => { 'packageName' => 'glite-px-proxyrenewal-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-security-proxyrenewal-dev' },
- },
- 'canl.c-devel' => {
- default => { 'packageName' => 'canl-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libcanl-c-dev' },
- },
-);
-
-my @k = keys %deps_aux;
-@buildroot{@k} = ('') x ($#k+1);
-
-$buildroot{'gridsite.core'} = 'src';
-}
-
-sub full
-{
- my ($short) = @_;
- my $subsys = $short;
- $subsys =~ s/\..*//;
-
- my $cvs_prefix = exists $cvs_prefix{$subsys} ? $cvs_prefix{$subsys} : 'org.glite';
- return $extrafull{$short} ? $extrafull{$short} : "$cvs_prefix.$short";
-}
-
-sub get_version
-{
- my ($fmod, $top_srcdir) = @_;
-
- my ($subsys,$mod) = split /\./,$fmod,2;
- my ($major,$minor,$rev,$age);
- my $old_;
-
- if ($force_version) {
- $force_version =~ /([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)-(.+)/;
- ($major,$minor,$rev,$age) = ($1,$2,$3,$4);
- }
- else {
- my $path = "$top_srcdir/project";
- if ($subsys eq 'gridsite') {
- $path = "$cvs_prefix{$subsys}.$subsys.core/project";
- }
- open V,"$path/version.properties"
- or die "$path/version.properties: $!\n";
-
- $old_ = $_;
- while (<V>) {
- chomp;
- ($major,$minor,$rev) = ($1,$2,$3) if /module\.version\s*=\s*([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/;
- $age = $1 if /module\.age\s*=\s*([[:digit:]]+)/;
- }
- close V;
- $_ = $old_;
- }
- $version = "$major.$minor.$rev-$age";
-
- return ($major, $minor, $rev, $age);
-}
-
-sub get_description
-{
- my ($top_srcdir) = @_;
-
- my $cvs_module = $top_srcdir;
- my $package_description = "";
- my $package_summary = "";
-
- if (-e "$cvs_module/project/package.description") {
- open V, "$cvs_module/project/package.description";
- $package_description = join ("", <V>);
- close V;
- chomp $package_description;
- }
- else {
- print STDERR "package.description not found for $subsys.$module!\n"; }
-
- if (-e "$cvs_module/project/package.summary") {
- open V, "$cvs_module/project/package.summary";
- $package_summary = join ("", <V>);
- close V;
- chomp $package_summary;
- $package_summary =~ s/\n/\\n/g;
- }
- else {
- print STDERR "package.summary not found for $subsys.$module!\n"; }
-
- return ($package_summary, $package_description);
-}
-
-sub mkinc
-{
- my %aux;
- undef %aux;
- my @m=qw/
-lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.nagios lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lb.emi-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
-px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config px.emi-px
-canl.c
-/;
- @aux{@m} = (1) x ($#m+1);
-
- my ($short) = @_;
- my $full = full $short;
- my ($subsys,$mod) = split /\./,$short,2;
- my $packageName = "$project{tag_prefix}{$subsys}$subsys-${mod}";
-
- unless ($aux{$short}) {
- print "Makefile.inc not needed in $full\n";
- return;
- }
-
- my $top_srcdir = '.';
- my $abs_srcdir = '';
- my $build = '';
-
- if ($module) {
- $top_srcdir = $0;
- $top_srcdir =~ s,/?[^/]*$,,;
- $abs_srcdir = $top_srcdir;
- $top_srcdir =~ s,^$,\.,;
- } else {
- $build = "$full/";
- $abs_srcdir = "$full/";
- unless ($buildroot{$_} eq '') {
- $top_srcdir = '..';
- $build .= "$buildroot{$_}/";
- unless (-d "$build") {
- mkdir "$build" or die "mkdir $build: $!\n";
- }
- }
- }
-
- my ($major, $minor, $rev, $age) = get_version $short, $abs_srcdir;
- my ($package_summary, $package_description) = get_description $abs_srcdir;
- if ($package_description) { $package_description =~ s/(.{1,78}\S|\S+)\s+/$1\n/mg; }
- my $package_description_debian = $package_description;
- $package_description_debian =~ s/^/ /mg;
-
- my ($old_locale, $specdate, $debdate);
-
- # files for ETICS always in root source directory
- mkdir $abs_srcdir."project" unless (-d $abs_srcdir."project");
- open PKGCHL,">".$abs_srcdir."project/changelog"
- or die $abs_srcdir."project/changelog: $!\n";
- $old_locale = setlocale(LC_TIME);
- setlocale(LC_TIME, "C");
- $specdate = strftime("%a %b %d %Y", gmtime());
- $debdate = strftime("%a, %d %b %Y %H:%M:%S %z", gmtime());
- setlocale(LC_TIME, $old_locale);
- print PKGCHL qq{* $specdate CESNET team <emi-lb\@metacentrum.cz>
-- automatically generated package
-};
- close PKGCHL;
-
- unless ($top_srcdir eq '.') {
- unlink $build."Makefile";
- symlink "$top_srcdir/Makefile",$build."Makefile" or die "symlink $top_srcdir/Makefile ".$build."Makefile: $!\n";
- }
-
- open MKINC,">".$build."Makefile.inc"
- or die $build."Makefile.inc: $!\n";
-
- print "Creating ".$build."Makefile.inc\n";
-
- print MKINC qq{project = $project
-PREFIX = $root
-prefix = $prefix
-stagedir = $stagedir
-sysroot = $sysroot
-sysconfdir = $sysconfdir
-localstatedir = $localstatedir
-thrflavour = $thrflavour
-nothrflavour = $nothrflavour
-libdir = $libdir
-top_srcdir = $top_srcdir
-};
-
- for (@{$need_externs{$short}}) {
- next unless defined $externs{$_} and defined $externs{$_}{prefix};
- print MKINC "${_}_prefix = $externs{$_}{prefix}\n";
- print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags};
- }
-
- for (@{$need_jars{$short}}) {
- print MKINC "${_}_jar = $jar{$_}\n"
- }
-
- my $need_gsoap = 0;
- for (@{$need_externs{$short}}) { $need_gsoap = 1 if $_ eq 'gsoap'; }
-
- print MKINC "gsoap_default_version=".gsoap_version()."\n" if $need_gsoap;
-
- close MKINC;
-
- my $dh;
- my $debian = 0;
-
- opendir $dh, "$abs_srcdir/project" || die "Can't open $abs_srcdir/project: $!";
- for my $dir (readdir $dh) {
- if ($dir=~/^(.*)\.spec$/) {
- if ($1 ne $packageName) {
- printf STDERR "Changed RPM name: $packageName --> $1\n" if ($debug);;
- $packageName=$1;
- }
- last;
- }
- }
- closedir $dh;
-
- for my $file ("$packageName.spec", "debian.rules", "debian.control", "debian.changelog", "debian.copyright") {
- if (-f "$abs_srcdir/project/$file") {
- my $old_ = $_;
- printf STDERR "Creating $build$file\n" if ($debug);;
- open DST, ">$build$file";
- open SRC, "<$abs_srcdir/project/$file";
- while (<SRC>) {
- if (/\@MODULE\@/) { s/\@MODULE\@/$full/g; }
- if (/\@URL\@/) { s/\@URL\@/$package{url}/g; }
- if (/\@SUMMARY\@/) { s/\@SUMMARY\@/$package_summary/g; }
- if (/\@DESCRIPTION\@/) { s/\@DESCRIPTION\@/$package_description/g; }
- if (/\@DEBIAN_DESCRIPTION\@/) { s/\@DEBIAN_DESCRIPTION\@/$package_description_debian/g; }
- if (/\@VERSION\@/) { s/\@VERSION\@/$version/g; }
- if (/\@MAJOR\@/) { s/\@MAJOR\@/$major/g; }
- if (/\@MINOR\@/) { s/\@MINOR\@/$minor/g; }
- if (/\@REVISION\@/) { s/\@REVISION\@/$rev/g; }
- if (/\@AGE\@/) { s/\@AGE\@/$age/g; }
- if (/\@MAINTAINER\@/) { s/\@MAINTAINER\@/$package{maintainer}/g; }
- if (/\@UPLOADERS\@/) { s/\@UPLOADERS\@/$package{uploaders}/g; }
- if (/\@DEBIAN_VCS\@/) { s/\@DEBIAN_VCS\@/$package{debian_vcs}/g; }
- if (/\@DEBIAN_DATE\@/) { s/\@DEBIAN_DATE\@/$debdate/g; }
- if (/\@SPEC_DATE\@/) { s/\@SPEC_DATE\@/$specdate/g; }
- if (/^\s*.+\/configure\s/ and $force_version) {
- print "Version forced to $version\n" if ($debug);;
- s/--version\s+\S+\s?//;
- s/$/ --version $version/;
- }
- printf DST "%s", "$_";
- }
- close SRC;
- close DST;
- $_ = $old_;
- }
- }
-
- print "Creating ${build}debian/\n" if ($debug);;
-
- `rm -rfv ${build}debian`;
- mkdir $build."debian" or die $!;
- `cp $abs_srcdir/project/debian.* ${build}debian/ 2>/dev/null`;
- `mv ${build}debian.* ${build}debian/ 2>/dev/null`;
- `rm -f ${build}debian/*.orig`;
- opendir $dh, "${build}debian" || die "Can't open ${build}debian: $!";
- for $_ (readdir $dh) {
- if (/^debian\.(.*)/) {
- `mv ${build}debian/$_ ${build}debian/$1`;
- $debian = 1;
- }
- }
- closedir $dh;
-
- if ($debian) {
- my ($dir, $file);
-
- chmod 0755, "${build}debian/rules";
- $file="${build}debian/docs"; if (not -f $file) { `touch $file`; }
- $dir="${build}debian/source"; if (not -d $dir) { mkdir $dir; }
- $file="${build}debian/source/format"; if (not -f $file) { `echo "3.0 (quilt)" > $file` }
- $file="${build}debian/compat"; if (not -f $file) { `echo "7" > $file` }
- $file="${build}debian/changelog"; if (not -f $file) {
- open FH, ">$file" or die $!;
- print FH qq{$packageName ($major.$minor.$rev-$age) unstable; urgency=low
-
- * Automatically generated package
-
- -- $package{maintainer} $debdate
-};
- close FH;
- }
-
- } else {
- `rm -rf ${build}debian`;
- }
-}
-
-BEGIN{
-};
-
-sub mode_etics_packaging {
- my ($fmod, $cmd, $rpmprepare, $debprepare) = @_;
- my ($workspaceDir, $srcPackageName, $srcAge, $topDir);
-
- # old-school packaging by ETICS for EMI-1
- if ($project eq 'emi' and $project_version == 1) { return; }
-
- if ($fmod eq 'gridsite.core') {
- $workspaceDir = '..';
- $srcPackageName = 'gridsite';
- $srcAge = '';
- $topDir = '../';
- } else {
- $workspaceDir = '${workspaceDir}';
- $srcPackageName = '${packageName}';
- $srcAge = '-${age}';
- $topDir = '';
- }
-
- $cmd->{clean} = 'make clean
- rm -rfv ${package.tgzLocation} ${package.SRPMSLocation}';
- $cmd->{default}{packaging} = $rpmprepare;
- $cmd->{default}{packaging} .= "dir=\${workspaceDir}/rpm_build_src_\$\$
- mkdir -p \${package.tgzLocation} \${package.SRPMSLocation} \$dir/{BUILD,RPMS,SOURCES,SRPMS} 2>/dev/null || true
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \${package.tgzLocation}/
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \$dir/SOURCES/
- rpmbuild -bs --nodeps --define \"_topdir \$dir\" $srcPackageName.spec
- cp -v \$dir/SRPMS/*.src.rpm \${package.SRPMSLocation}/
- rm -rf \$dir";
-
- for my $p ('deb5_x86_64_gcc432', 'deb5_ia32_gcc432', 'deb6_x86_64_gcc445', 'deb6_ia32_gcc445') {
- for my $c (keys %{$cmd->{default}}) { $cmd->{$p}{$c} = $cmd->{default}{$c}; }
- $cmd->{$p}{clean} = 'make clean
- rm -rfv ${package.tgzLocation} ${package.SDEBSLocation}';
- $cmd->{$p}{packaging} = $debprepare;
- $cmd->{$p}{packaging} .= "dir=\${workspaceDir}/dpkg_build_src_\$\$
- mkdir -p \${package.tgzLocation} \${package.SDEBSLocation} \$dir 2>/dev/null || true
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \${package.tgzLocation}/
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \$dir/${srcPackageName}_\${version}.orig.tar.gz
- tar xzf \$dir/${srcPackageName}_\${version}.orig.tar.gz -C \$dir
- cp -rf ${topDir}debian/ \$dir/$srcPackageName-\${version}/
- cd \$dir/$srcPackageName-\${version}
- dpkg-buildpackage -S -d -nc
- cd -
- cp -v \$dir/*.tar.gz \$dir/*.dsc \${package.SDEBSLocation}/
- rm -rf \$dir";
- }
-}
-
-sub mode_etics {
- $fmod = shift;
-
- die "$0: --module required with --etics\n" unless $fmod;
-
- my ($subsys,$module) = split /\./,$fmod,2;
- my $full = full "$subsys.$module";
-
- my ($major,$minor,$rev,$age) = get_version $fmod, $full;
-
- # XXX: --with ignored for platform-dependend packages
- my @copts = ();
- my %ge;
- @ge{@{$etics_projects{$project{etics_name}}}} = (1) x ($#{$etics_projects{$project{etics_name}}}+1);
-
- for (@{$need_externs{"$subsys.$module"}}) {
- if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/ and (defined $externs{$_} or defined $jar{$_})) {
- my $eext = $etics_externs{default}{$_} ? $etics_externs{default}{$_} : $_;
- next if ($eext eq '-');
- if (defined $project{etics_locations}{'*'} or defined $project{etics_locations}{$_}) {
- $eext = $project{etics_locations}{$_} if ($project{etics_locations}{$_});
- push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}";
- } else {
- if ($ge{$_} and not defined $externs{$_}{pkg}) {
- push @copts, "--with-$_=\${stageDir}";
- }
- }
- }
- }
-
- for (@{$need_jars{"$subsys.$module"}}) {
- my $eext = $etics_externs{default}{$_} ? $etics_externs{default}{$_} : $_;
-
- push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (defined $project{etics_locations}{'*'} or defined $project{etics_locations}{$_});
- }
-
- my $conf;
- my $conftag;
- my ($confprefix, $nameprefix, $packageName);
-
- $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n";
-
- $confprefix = $project{conf_prefix}{$subsys};
- $nameprefix = $confprefix;
- $nameprefix =~ s/-$//;
- $nameprefix =~ s/-/\./g;
- $packageName = "$project{tag_prefix}{$subsys}$subsys-${module}";
-
- if ($branch) {
- $conf = "$confprefix${subsys}-${module}_$branch";
- $conftag = $branch;
- # forced low age number
- $age = $branch eq 'HEAD' ? '0head' : '0dev';
- push @copts, '--version ${version}-${age}';
- }
- else {
- $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}";
-# XXX: gridsite hack
- $conftag = $subsys eq 'gridsite' ? "$project{tag_prefix}{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" :
- "$project{tag_prefix}{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}";
-
- # lowering age for older packaging
- if ($project eq 'emi' and $project_version == 1) {
- $age = $age - 1;
- }
- }
-
- # emi1 suffix for older packaging
- if ($project eq 'emi' and $project_version == 1) {
- $age = $age.$project.$project_version;
- $conf = $conf.$project.$project_version;
- }
-
- my $file = $output ? $output : "$conf.ini";
- open C,">$file" or die "$file: $!\n";
-
- my $buildroot = $buildroot{"$subsys.$module"} eq '' ? '#no build.root' : "build.root = " . $buildroot{"$subsys.$module"};
-
- my $confdir = $buildroot{"$subsys.$module"} eq '' ? '.' : '..';
-
- my $cvs_module = full "$subsys.$module";
- my ($package_summary, $package_description) = get_description $cvs_module;
- if ($package_description) {
- $package_description =~ s/\n/\\n/g;
- $package_description = "package.description = $package_description\n";
- }
- if ($package_summary) {
- $package_summary = "package.summary = $package_summary\n";
- }
-
- my %cmd;
- $cmd_vcs{checkout} = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_module 2>/dev/null";
- #$cmd_vcs{checkout} = "((test -d jra1mw/.git && (cd jra1mw; git pull)) || (git clone -q http://scientific.zcu.cz/git/jra1mw.git";
- #$cmd_vcs{checkout} .= " && (cd jra1mw; git checkout -b \${tag} --track origin/\${tag})" unless ($conftag eq /HEAD/);
- #$cmd_vcs{checkout} .= ")) && (test -d \${moduleName} || ln -s jra1mw/$cvs_module \${moduleName})";
- $cmd_vcs{checkout} .= "\n\ttest -f \${packageName}-\${version}-\${age}.src.tar.gz || (ln -s \${moduleName} \${packageName}-\${version}; tar -chf - \${packageName}-\${version} --exclude CVS --exclude .git --exclude .etics | gzip --best > \${packageName}-\${version}-\${age}.src.tar.gz; rm \${packageName}-\${version})";
- $cmd_vcs{tag} = "cvs -d \${vcsroot} tag -R \${tag} ${moduleName}";
-
- $cmd{default}{init} = 'None';
- $cmd{default}{configure} = 'None';
- $cmd{default}{compile} = 'None';
- $cmd{default}{test} = 'None';
- $cmd{default}{install} = 'None';
- $cmd{default}{packaging} = 'None';
- $cmd{default}{clean} = 'make clean';
-
- if (exists $subpackages{$fmod}) {
- $cmd{default}{clean} = 'None';
- $cmd{default}{packaging} = "echo building nothing, $subpackages{$fmod} will build this package";
- $cmd_vcs{checkout} = "mkdir -v \${moduleName} 2>/dev/null || true";
- } elsif ($subsys eq 'gridsite') {
- $cmd_vcs{tag} = 'None';
-
- if ($module eq 'core') {
- my $flags;
-
- if ($project ne 'glite') {
- # don't evaluate pkg-config calls to get them into source package
- $flags = 'RELEASE_VERSION=${age}
- GSOAPDIR=\`pkg-config gsoap --variable=prefix\`
- OPENSSL_GLOBUS_FLAGS=\`pkg-config globus-openssl --cflags\`
- OPENSSL_GLOBUS_LIBS=\`pkg-config globus-openssl --libs\`';
- } else {
- $flags = 'RELEASE_VERSION=${age}
- GSOAPDIR=${gsoap.location}
- OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor}
- OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}
- HTTPD_FLAGS=-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-1 -I${httpd-devel.location}/include/apr-1.0 -I${httpd-devel.location}/include/apr-0 -I${httpd-devel.location}/include/pcre';
- }
-
- $cmd{default}{configure} = "cat > Makefile.inc <<EOF
- project = $project
- top_srcdir = ..
- $flags
- EOF";
- $cmd{default}{compile} = "make prefix=\${prefix}$project{local_prefix} libdir=\${libdir}";
- $cmd{default}{install} = "make prefix=\${prefix}$project{local_prefix} libdir=\${libdir} install";
- mode_etics_packaging($fmod, \%cmd,
- "make prefix=\${prefix}$project{local_prefix} rpm-prepare
- cp gridsite.spec ../\n\t",
- "chmod +x \${moduleDir}/src/make-debian-files || true
- make prefix=\${prefix}$project{local_prefix} deb-prepare\n\t"
- );
- }
- elsif ($module eq '1.5-compat') {
- $cmd_vcs{checkout} = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.core 2>/dev/null";
- $cmd{default}{init} = 'echo "/sbin/ldconfig" > project/.post
- echo "/sbin/ldconfig" > project/.postun';
- $cmd{default}{configure} = "cat > src/Makefile.inc <<EOF
- project = emi
- libdir = \${libdir}
- MAJOR_VERSION=1
- MINOR_VERSION=1.5
- PATCH_VERSION=1.5.0
- VERSION=\\\$(PATCH_VERSION)
- RELEASE_VERSION=\${age}
- GSOAPDIR=\\`pkg-config gsoap --variable=prefix\\`
- OPENSSL_GLOBUS_FLAGS=\\`pkg-config globus-openssl --cflags\\`
- OPENSSL_GLOBUS_LIBS=\\`pkg-config globus-openssl --libs\\`
- EOF";
- $cmd{default}{compile} = "make -C src prefix=\${prefix}$project{local_prefix}
- rm -fv project/debian.changelog";
- $cmd{default}{install} = "make -C src prefix=\${prefix}$project{local_prefix} install-lib
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.so.1
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.so
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.a";
- $cmd{default}{packaging} = "None";
- }
- else {
- $cmd{default}{clean} = 'None';
- $cmd{default}{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this";
- $cmd_vcs{checkout} = "mkdir -v \${moduleName} 2>/dev/null || true";
- }
- }
- elsif ($subsys eq 'px' and $module eq 'myproxy-config') {
- $cmd{default}{configure} = "/usr/bin/perl $confdir/configure --root=\${prefix} --prefix= --stage=\${stageDir} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts";
- $cmd{default}{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config";
- }
- else {
- $cmd{default}{configure} = "/usr/bin/perl $confdir/configure $project{flavours} --root=\${prefix} --prefix=$project{local_prefix} --stage=\${stageDir} --sysroot=\${package.prefix} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts";
- $cmd{default}{compile} = 'make';
- $cmd{default}{test} = 'make check';
- $cmd{default}{install} = 'make install';
- if ($subsys eq 'lb' and $module eq 'client') {
- $cmd{default}{compile} = "make rpath=$project{local_prefix}/\${libdir}";
- $cmd{default}{install} = "make install post-install rpath=$project{local_prefix}/\${libdir}";
- }
- mode_etics_packaging($fmod, \%cmd);
- }
-
- 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 = $project{etics_name}.$subsys.$module
-displayName = $conf
-description = $cvs_prefix{$subsys}.$subsys.$module
-projectName = $project{etics_name}
-age = $age
-deploymentType = None
-vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite
-tag = $conftag
-version = $major.$minor.$rev
-$dwpath
-[Platform-default:VcsCommand]
-displayName = None
-description = None
-tag = $cmd_vcs{tag}
-branch = None
-commit = None
-checkout = $cmd_vcs{checkout}
-
-};
-
- for my $p (keys %cmd) {
- next if $p ne 'default' and exists $project{supported_platforms} and not exists $project{supported_platforms}{$p};
-
- print C qq{[Platform-$p:BuildCommand]
-postpublish = None
-packaging = $cmd{$p}{packaging}
-displayName = None
-description = None
-doc = None
-prepublish = None
-publish = None
-compile = $cmd{$p}{compile}
-init = $cmd{$p}{init}
-install = $cmd{$p}{install}
-clean = $cmd{$p}{clean}
-test = $cmd{$p}{test}
-configure = $cmd{$p}{configure}
-checkstyle = None
-
-};
- }
-
- print C qq{[Platform-default:Property]
-$buildroot
-package.preserve.libtool = false
-$package_description$package_summary$defprops};
-
- for (@{$obsoletes{"$subsys.$module"}}) {
- print C "package.obsoletes = $_\n";
- print C "package.replaces = $_\n";
- }
- for (@{$conflicts{"$subsys.$module"}}) {
- print C "package.conflicts = $_\n";
- }
- for (@{$provides{"$subsys.$module"}}) {
- print C "package.provides = $_\n";
- }
- print C "\n";
-
- for my $pp (keys %{$platform_properties{"$subsys.$module"}}) {
- next if $pp eq 'default';
- next if exists $project{supported_platforms} and not exists $project{supported_platforms}{$pp};
-
- print C "[Platform-$pp:Property]\n$buildroot\n";
-
- for my $p (keys %{$platform_properties{"$subsys.$module"}->{$pp}}) {
- print C $p . ' = ' . $platform_properties{"$subsys.$module"}->{$pp}->{$p} . "\n";
- }
- print C "$package_description$package_summary\n";
- }
-
- for my $platform ('default', keys %{$project{supported_platforms}}) {
- my $used = 0;
- my $output = '';
-
- for (@{$need_externs{"$subsys.$module"}},@{$need_jars{"$subsys.$module"}}) {
- my $eext = $etics_externs{$platform}{$_};
- my $edev = $project{etics_externs_devel}{$platform}{$_};
-
- # for the default platform using package of the same
- # name for runtime dependency
- if (not $eext) {
- if ($platform eq 'default') {
-#print "default runtime $_ on default\n";
- $eext = $_; }
- else {
-#print "no runtime $_ on $platform\n";
- $eext = '-'; }
- }
- if ($eext eq '-' and $edev eq '-') {
-#print "skipping $_ on $platform\n";
- next;
- }
-
- my $proj = 'externals';
- for my $p (keys %etics_projects) {
- for $m (@{$etics_projects{$p}}) {
- $proj = $p if $m eq $_;
- }
- }
-
- my $type = $need_externs_type{"$subsys.$module"}->{$_};
-
- if ($edev) {
- if ($type eq 'B') {
- # no runtime - change to devel pkg
- $eext = $edev;
- } elsif ($type eq 'BR' or $type eq 'RB') {
- # additional devel pkg
- if ($edev ne '-') { $output .= "$proj|$edev = B\n"; }
- }
- }
- if ($eext ne '-') { $output .= "$proj|$eext = $type\n"; }
- }
-
- if ($platform eq 'default') {
- for (@{$deps{"$subsys.$module"}}) {
- my $type = $deps_type{"$subsys.$module"}->{$_};
- if (not $used) {
- $used = 1;
- }
- $output .= "$project{etics_name}|$project{etics_name}.$_ = $type\n";
- }
- }
-
- if ($output) {
- print C qq{
-[Platform-$platform:DynamicDependency]
-$output};
- }
- }
-
- close C;
-
- for $file ("$cvs_module/project/debian.rules", "$cvs_module/project/$packageName.spec") {
- my $lib;
- my $main_module;
- @copts = ();
-
- if ($file =~ /debian\.rules$/) { $lib = 'lib'; }
- else { $lib = '%{_lib}'; }
-
- my $main_module = "$subsys.$module";
- if (exists $subpackages{$main_module}) { $main_module = $subpackages{$main_module}; }
-
- # locations hacks
- if ($file =~ /$packageName\.spec$/) {
- if ($fmod eq 'lb.client-java') {
- push @copts, '';
- push @copts, '--with-axis=/usr/local/axis1.4';
- }
- }
-
- if (-f $file) {
- open DST,">$file.new" or die "$file.new: $!\n";
- open SRC,"<$file" or die "$file: $!\n";
- while (<SRC>) {
- if (/^(\s*).+\/configure\s/) {
- printf DST "%s", "$1";
- printf DST "/usr/bin/perl $confdir/configure $project{flavours} --root=/ --prefix=$project{local_prefix} --libdir=$lib --project=$project --module $main_module@copts\n";
- } else {
- printf DST "%s", "$_";
- }
- }
- close SRC;
- close DST;
-
- `diff -b "$file" "$file.new"`;
- if ($? == 0) {
- print STDERR "($file not changed)\n";
- unlink "$file.new";
- } else {
- print STDERR "Writing $file\n";
- rename "$file", "$file.orig" unless -f "$file.orig";
- rename "$file.new", "$file";
- }
- }
- }
-}
-
-sub gsoap_version {
- local $_;
- my $gsoap_version;
- open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n";
-
- while ($_ = <S>) {
- 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;
-}
-
-sub getlibdir {
- if ( -e "/etc/debian_version") { # We are on Debian
- $lib64="lib";
- $lib32="lib32"; }
- else { # Another distribution
- $lib64="lib64";
- $lib32="lib"; }
- $libdir=$lib32;
-
- open INP, "uname -s | "; # Check kernel name
- $kname= <INP>;
- chomp($kname);
- close INP;
-
- if ( $kname eq "Linux") {
- $arch = ("x86_64\npowerpc\nppc64\n");
-
- open INP, "uname -p | "; # Check processor type
- $procname= <INP>;
- chomp($procname);
- close INP;
-
- if ($arch =~/^$procname\n/) {
- return ($lib64); }
-
- open INP, "uname -m | "; # Check machine hardware
- $machname= <INP>;
- chomp($machname);
- close INP;
-
- if ($arch =~/^$machname\n/) {
- return ($lib64); }
-
- # special cases (hyperlink lib64, Debian)
- if (-l "/usr/lib64") {
- $libdir=$lib32; }
-
- # if /usr/lib64 doesn't exist at all (AIX)
- unless ( -e "/usr/lib64" ) {
- $libdir=$lib32; }
- }
-
- if ( $kname eq "SunOS") {
- if (-e "/usr/lib/64") {
- $libdir="lib/64"; }
- }
-
- return $libdir;
-}
-
-sub reshuffle_platforms($$) {
- my ($data, $platforms) = @_;
- my ($platform, %blacklist, $value);
-
- return if not $platforms;
-
- for $platform (keys %$data) {
-#print "plat: $platform: $data->{$platform}\n";
- next if $platform eq 'default';
- for $_ (keys %{$data->{$platform}}) {
-#print " blacklist: $_ = $data->{$platform}{$_}\n";
- $blacklist{$_} = 1;
- }
- }
-
- for $_ (keys %blacklist) {
- $value = $data->{default}{$_} ? $data->{default}{$_} : $_;
- for $platform (keys %$platforms) {
- next if $platform eq 'default';
- if (not defined $data->{$platform}{$_}) {
- $data->{$platform}{$_} = $value;
-#print "added $value to $platform\n"
- }
- }
- $data->{default}{$_} = '-';
-#print "deleted $_ from default\n";
- }
-
- # merge dependencies across the supported platforms
- %blacklist = [];
- for $platform (keys %$platforms) {
- next if $platform eq 'default';
- for $_ (keys %{$data->{$platform}}) {
- $blacklist{$_} = 1;
- }
- }
- for $_ (keys %blacklist) {
- $value = undef;
- $same = 1;
- for $platform (keys %$platforms) {
- if (not $value) { $value = $data->{$platform}{$_}; }
- if (not $data->{$platform}{$_} or $value ne $data->{$platform}{$_}) {
- $same = 0;
- last;
- }
- }
- if ($same and $value) {
-#print "merged dependency $_\n";
- $data->{default}{$_} = $value;
- for $platform (keys %$platforms) {
- delete $data->{$platform}{$_};
- }
- }
- }
-}
-
-sub usage {
- my @ext = keys %externs;
- my @myjars = keys %jar;
-
- print STDERR qq{
-Usage: $0 options
-
-General options (defaults in []):
- --prefix=PREFIX destination directory [./stage]
- --stage=DIR staging directory [./stage]
- --root=DIR installation root (custom relocation root -> sysroot) [./stage]
- --sysroot=DIR system root (custom relocation root -> sysroot) []
- --sysconfdir=DIR system configuration directory [PREFIX/etc]
- --staged=module,module,... what is already in PREFIX (specify without org.glite.)
- --thrflavour=flavour
- --nothrflavour=flavour threaded and non-treaded flavours [gcc64dbgpthr,gcc64dbg]
- --listmodules=subsys list modules of a subsystem
- --listmodules=module list subpackages of a module
- --version=maj.min.rev-age version used instead of reading version.properties
- --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...)
- --libdir=libdir typically [lib,lib64] postfix
- --project=PROJECT build or generate etics for a project (glite/emi1/emi) [emi]
- --debug print more details
-
-Mode of operation:
- --mode=\{checkout|build|etics\} what to do [build]
-
-What to build:
- --module=module build this module only
- --enable-NODE build this "node" (set of modules) only
- --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
- --jobid-tag=tag checkout jobid modules with specific tag
- --canl-tag=tag checkout canl modules with specific tag
-
-Dependencies (summary of what will be used is always printed):
- --with-EXTERNAL=PATH where to look for an external [autodetect]
- --with-JAR=JAR where to look for jars
-
-Available nodes:
- @nodes
-
-Default nodes:
- @default_nodes
-
-Externals (not all for all modules) are:
- @ext
-
-External jars are:
- @myjars
-
-};
-
-}
+++ /dev/null
-/*
-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.
-*/
-
-#ifndef GLITE_JP_ATTR_H
-#define GLITE_JP_ATTR_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void glite_jp_attrval_free(glite_jp_attrval_t *,int);
-void glite_jp_attrval_copy(glite_jp_attrval_t *,const glite_jp_attrval_t *);
-
-/* Search through registered type plugins and call appropriate plugin method.
- * See type_plugin.h for detailed description.
- */
-
-int glite_jp_attrval_cmp(glite_jp_context_t ctx,const glite_jp_attrval_t *a,const glite_jp_attrval_t *b,int *result);
-
-char *glite_jp_attrval_to_db_full(glite_jp_context_t ctx,const glite_jp_attrval_t *attr);
-char *glite_jp_attrval_to_db_index(glite_jp_context_t ctx,const glite_jp_attrval_t *attr,int len);
-
-int glite_jp_attrval_from_db(glite_jp_context_t ctx,const char *str,glite_jp_attrval_t *attr);
-const char *glite_jp_attrval_db_type_full(glite_jp_context_t ctx,const char *attr);
-const char *glite_jp_attrval_db_type_index(glite_jp_context_t ctx,const char *attr,int len);
-
-time_t glite_jp_attr2time(const char *);
-char * glite_jp_time2attr(time_t);
-
-#ifdef __cplusplus
-};
-#endif
-
-
-#endif /* GLITE_JP_ATTR_H */
+++ /dev/null
-/*
-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.
-*/
-
-#ifndef GLITE_JP_BACKEND_H
-#define GLITE_JP_BACKEND_H
-
-/* do we need it?
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-*/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int glite_jppsbe_get_names(
- glite_jp_context_t ctx,
- const char *job,
- const char * /* class */,
- char ***names_out
-);
-
-int glite_jppsbe_destination_info(
- glite_jp_context_t ctx,
- const char *destination,
- char **job_out,
- char **class_out,
- char **name_out
-);
-
-int glite_jppsbe_get_job_url(
- glite_jp_context_t ctx,
- const char *job,
- const char * /* class */,
- const char *name, /* optional within class */
- char **url_out
-);
-
-int glite_jppsbe_open_file(
- glite_jp_context_t ctx,
- const char *job,
- const char * /* class */,
- const char *name, /* optional within class */
- int mode,
- void **handle_out
-);
-
-int glite_jppsbe_close_file(
- glite_jp_context_t ctx,
- void *handle
-);
-
-int glite_jppsbe_file_attrs(
- glite_jp_context_t ctx,
- void *handle,
- struct stat *buf
-);
-
-int glite_jppsbe_pread(
- glite_jp_context_t ctx,
- void *handle,
- void *buf,
- size_t nbytes,
- off_t offset,
- ssize_t *nbytes_ret
-);
-
-int glite_jppsbe_pwrite(
- glite_jp_context_t ctx,
- void *handle,
- void *buf,
- size_t nbytes,
- off_t offset
-);
-
-int glite_jppsbe_append(
- glite_jp_context_t ctx,
- void *handle,
- void *buf,
- size_t nbytes
-);
-
-int glite_jppsbe_is_metadata(
- glite_jp_context_t ctx,
- const char *attr
-);
-
-int glite_jppsbe_get_job_metadata(
- glite_jp_context_t ctx,
- const char *job,
- glite_jp_attrval_t attrs_inout[]
-);
-
-int glite_jppsbe_query(
- glite_jp_context_t ctx,
- const glite_jp_query_rec_t query[],
- char *attrs[],
- void *arg,
- int (*callback)(
- glite_jp_context_t ctx,
- const char *job,
- const glite_jp_attrval_t metadata[],
- void *arg
- )
-);
-
-char* glite_jpps_get_namespace(
- const char* attr
-);
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif /* GLITE_JP_BACKEND_H */
-
+++ /dev/null
-/*
-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.
-*/
-
-
-#define GLITE_JP_FILETYPE_TAGS "urn:org.glite.jp.primary:tags"
-#define GLITE_JP_FILETYPE_LB "urn:org.glite.jp.primary:lb"
-#define GLITE_JP_FILETYPE_CLASSAD "urn:org.glite.jp.primary:classad"
-#define GLITE_JP_FILETYPE_ISB "urn:org.glite.jp.primary:isb"
-#define GLITE_JP_FILETYPE_OSB "urn:org.glite.jp.primary:osb"
-
-#define GLITE_JP_FPLUG_TAGS_APPEND 0
+++ /dev/null
-/*
-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.
-*/
-
-#ifndef GLITE_JP_CONTEXT_H
-#define GLITE_JP_CONTEXT_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int glite_jp_init_context(glite_jp_context_t *);
-void glite_jp_free_context(glite_jp_context_t);
-void glite_jp_free_query_rec(glite_jp_query_rec_t *);
-
-char *glite_jp_peer_name(glite_jp_context_t);
-char *glite_jp_error_chain(glite_jp_context_t);
-
-int glite_jp_stack_error(glite_jp_context_t, const glite_jp_error_t *);
-int glite_jp_clear_error(glite_jp_context_t);
-
-int glite_jp_add_deferred(glite_jp_context_t,int (*)(glite_jp_context_t,void *),void *);
-int glite_jp_run_deferred(glite_jp_context_t);
-
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif /* GLITE_JP_CONTEXT_H */
+++ /dev/null
-/*
-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.
-*/
-
-#ifndef GLITE_JP_FILEPLUGIN_H
-#define GLITE_JP_FILEPLUGIN_H
-
-/** Methods of the file plugin. */
-
-typedef struct _glite_jpps_fplug_op_t {
-
-/** Open a file.
-\param[in] fpctx Context of the plugin, returned by its init.
-\param[in] bhandle Handle of the file via JPPS backend.
-\param[in] uri URI (type) of the opened file.
-\param[out] handle Handle to the opened file structure, to be passed to other plugin functions.
-*/
- int (*open)(void *fpctx,void *bhandle,const char *uri,void **handle);
-/** Open from a string.
-\param[in] fpctx Context of the plugin, returned by its init.
-\param[in] str The string to use.
-\param[in] uri URI (type) of the string
-\param[in] ns namespace to handle
-\param[out] handle Handle to the opened file structure, to be passed to other plugin functions.
-*/
-
- int (*open_str)(void *fpctx,const char *str,const char *uri,const char *ns,void **handle);
-
-/** Close the file. Free data associated to a handle */
- int (*close)(void *fpctx,void *handle);
-
-/** "Preprocess" the file -- this function is called once after the file is commited */
- int (*filecom)(void *fpctx,void *handle);
-
-/** Retrieve value(s) of an attribute.
-\param[in] fpctx Plugin context.
-\param[in] handle Handle of the opened file.
-\param[in] ns Namespace of queried attribute.
-\param[in] attr Queried attribute.
-\param[out] attrval GLITE_JP_ATTR_UNDEF-terminated list of value(s) of the attribute.
- If there are more and there is an interpretation of their order
- they must be sorted, eg. current value of tag is the last one.
-\retval 0 success
-\retval ENOSYS this attribute is not defined by this type of file
-\retval ENOENT no value is present
-*/
- int (*attr)(void *fpctx,void *handle, const char *attr,glite_jp_attrval_t **attrval);
-
-/** File type specific operation.
-\param[in] fpctx Plugin context.
-\param[in] handle Handle of the opened file.
-\param[in] oper Code of the operation, specific for a concrete plugin.
-*/
- int (*generic)(void *fpctx,void *handle,int oper,...);
-
-} glite_jpps_fplug_op_t;
-
-/** Data describing a plugin. */
-typedef struct _glite_jpps_fplug_data_t {
- void *fpctx; /**< Context passed to plugin operations. */
- char **uris; /**< NULL-terminated list of file types (URIs)
- handled by the plugin. */
- char **classes; /**< The same as uris but filesystem-friendly
- (can be used to construct file names).*/
- char **namespaces; /**< Which attribute namespaces this plugin handles. */
-
- glite_jpps_fplug_op_t ops; /**< Plugin operations. */
-} glite_jpps_fplug_data_t;
-
-/** Initialisation function of the plugin.
- Called after dlopen(), must be named "init".
-\param[in] ctx JPPS context
-\param[out] data filled-in plugin data
-*/
-
-typedef int (*glite_jpps_fplug_init_t)(
- glite_jp_context_t ctx,
- glite_jpps_fplug_data_t *plugin_data
-);
-
-
-
-
-/* XXX: not really public interface follows */
-
-int glite_jpps_fplug_load(glite_jp_context_t ctx,int argc,char **argv);
-int glite_jpps_fplug_lookup(glite_jp_context_t ctx,const char *uri, glite_jpps_fplug_data_t ***plugin_data);
-int glite_jpps_fplug_lookup_byclass(glite_jp_context_t, const char *class,glite_jpps_fplug_data_t ***plugin_data);
-
-#endif /* GLITE_JP_FILEPLUGIN_H */
+++ /dev/null
-/*
-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.
-*/
-
-#ifndef GLITE_JP_INDEXDB_H
-#define GLITE_JP_INDEXDB_H
-
-/**
- * \file indexdb.h
- * \brief Helper functions for accessing Job Provenance Index Server database.
- */
-
-#include "glite/lbu/db.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#ifdef GLITE_JP_INDEX_COMPILE
-
-/**
- * For generating table names.
- */
-#define GLITE_JP_INDEXDB_TABLE_ATTR_PREFIX "attr_"
-
-#endif
-
-
-/**
- * Returns internal id from attribute name.
- *
- * The attribute id is used in some places in the database schema. Because of the future possible changes in the schema, you should rather use other functions to get SQL commands (table names and where conditions).
- *
- * \param[in] name attribute name
- * \return attribute id string
- */
-char *glite_jp_indexdb_attr2id(const char *name);
-
-/**
- * Get parts of the SQL SELECT command to the given attribute:
- *
- * SELECT column, full_value_column FROM table WHERE where;
- *
- * This is quick version requiring additional information about indexing of the attribute.
- */
-int glite_jp_indexdb_attr2select_from_index(const char *name, int indexed, char **column, char **full_value_column, char **table, char **where);
-
-/**
- * Get parts of the SQL SELECT command to the given attribute:
- *
- * SELECT column, full_value_column FROM table WHERE where;
- *
- * This is the most portable way - it will peep to the DB for information about indexing.
- */
-int glite_jp_indexdb_attr2select_from_db(const char *name, glite_lbu_DBContext dbctx, char **column, char **full_value_column, char **table, char **where);
-
-#ifdef __cplusplus
-};
-#endif
-
-
-#endif /* GLITE_JP_INDEXDB_H */
+++ /dev/null
-/*
-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.
-*/
-
-#ifndef GLITE_JP_KNOWN_ATTR_H
-#define GLITE_JP_KNOWN_ATTR_H
-
-/** Namespace of JP system attributes */
-#define GLITE_JP_SYSTEM_NS "http://egee.cesnet.cz/en/Schema/JP/System"
-#define GLITE_JP_WORKFLOW_NS "http://egee.cesnet.cz/en/Schema/JP/Workflow"
-
-/** Job owner, as specified with RegisterJob JPPS operation */
-#define GLITE_JP_ATTR_OWNER GLITE_JP_SYSTEM_NS ":owner"
-
-/** JobId */
-#define GLITE_JP_ATTR_JOBID GLITE_JP_SYSTEM_NS ":jobId"
-
-/** Timestamp of job registration in JP.
- * Should be almost the same time as registration with LB. */
-#define GLITE_JP_ATTR_REGTIME GLITE_JP_SYSTEM_NS ":regtime"
-
-/** Workflow node relationships. */
-#define GLITE_JP_ATTR_WF_ANCESTOR GLITE_JP_WORKFLOW_NS ":ancestor"
-#define GLITE_JP_ATTR_WF_SUCCESSOR GLITE_JP_WORKFLOW_NS ":successor"
-
-/** Attributes derived from LB system data
- * \see jp_job_attrs.h */
-
-/** Namespace for LB user tags, schemaless, all values are strings */
-#define GLITE_JP_LBTAG_NS "http://egee.cesnet.cz/en/WSDL/jp-lbtag"
-#define GLITE_JP_JDL_NS "http://jdl"
-
-/** Namespace for Sandboxes */
-#define GLITE_JP_ISB_NS "http://egee.cesnet.cz/en/Schema/JP/ISB"
-#define GLITE_JP_OSB_NS "http://egee.cesnet.cz/en/Schema/JP/OSB"
-
-/** Namespace for file names listed from tar */
-#define GLITE_JP_ATTR_ISB_FILENAME GLITE_JP_ISB_NS ":filename"
-#define GLITE_JP_ATTR_OSB_FILENAME GLITE_JP_OSB_NS ":filename"
-
-/** Namespace for filenames to be unpacked from sanbox tar */
-#define GLITE_JP_ISB_CONTENT_NS GLITE_JP_ISB_NS ":content"
-#define GLITE_JP_OSB_CONTENT_NS GLITE_JP_OSB_NS ":content"
-
-#endif /* GLITE_JP_KNOWN_ATTR_H */
+++ /dev/null
-/*
-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.
-*/
-
-#ifndef GLITE_JP_TYPEPLUGIN_H
-#define GLITE_JP_TYPEPLUGIN_H
-
-typedef struct _glite_jp_tplug_data_t {
-
- char *namespace;
- void *pctx;
-
-/** Compare attribute values.
- * \param[in] a value to compare
- * \param[in] b value to compare
- * \param[out] result like strcmp()
- * \param[out] err set if the values cannot be compared
- * \retval 0 OK
- * \retval other error
- */
- int (*cmp)(
- void *ctx,
- const glite_jp_attrval_t *a,
- const glite_jp_attrval_t *b,
- int *result);
-
-/** Convert to database string representation.
- * It is guaranteed the returned value can be converted back with
- * from_db().
- * The resulting value may not be suitable for indexing with db engine.
- *
- * \param[in] attr the attribute value to convert
- * \retval NULL can't be converted
- * \retval other the string representation.
- * */
- char * (*to_db_full)(void *ctx,const glite_jp_attrval_t *attr);
-
-/** Convert to a database string representation suitable for indexing.
- * The function is non-decreasing (wrt. cmp() above and strcmp()), however it
- * is not guaranteed to be one-to-one.
- *
- * \param[in] attr the value to convert
- * \param[in] len maximum length of the converted value.
- * \retval NULL can't be converted
- * \retval other the string representation
- */
- char * (*to_db_index)(void *ctx,const glite_jp_attrval_t *attr,int len);
-
-/** Convert from the database format.
- * \param[in] str the string value
- * \param[inout] attr name contains the name of the attribute to be converted
- * the rest of attr is filled in.
- */
- int (*from_db)(void *ctx,const char *str,glite_jp_attrval_t *attr);
-
-/** Query for database types suitable to store values returned by
- * to_db_full() and to_db_index().
- * Useful for db column dynamic creation etc.
- * Return pointer to internal static data, non-reentrant.
- */
- const char * (*db_type_full)(void *ctx,const char *attr);
- const char * (*db_type_index)(void *ctx,const char *attr,int len);
-
-} glite_jp_tplug_data_t;
-
-/** Plugin init function.
- Must be called init, supposed to be called as many times as required
- for different param's (e.g. xsd files).
- Registers the plugin in ctx.
- */
-
-typedef int (*glite_jp_tplug_init_t)(
- glite_jp_context_t ctx,
- const char *param,
- glite_jp_tplug_data_t *plugin_data
-);
-
-#endif /* GLITE_JP_TYPEPLUGIN_H */
+++ /dev/null
-/*
-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.
-*/
-
-#ifndef GLITE_JP_TYPES_H
-#define GLITE_JP_TYPES_H
-
-#include <sys/time.h>
-
-typedef struct _glite_jp_error_t {
- int code;
- const char *desc;
- const char *source;
- struct _glite_jp_error_t *reason;
-} glite_jp_error_t;
-
-typedef struct _glite_jp_context {
- glite_jp_error_t *error;
- int (**deferred_func)(struct _glite_jp_context *,void *);
- void **deferred_arg;
- void *feeds;
- struct soap *other_soap;
- char *peer;
- void **plugins;
- void **type_plugins;
- void *dbhandle;
- char **trusted_peers;
- char *myURL;
- int noauth;
-} *glite_jp_context_t;
-
-typedef enum {
- GLITE_JP_ATTR_ORIG_ANY, /**< for queries: don't care about origin */
- GLITE_JP_ATTR_ORIG_SYSTEM, /**< JP internal, e.g. job owner */
- GLITE_JP_ATTR_ORIG_USER, /**< inserted by user explicitely */
- GLITE_JP_ATTR_ORIG_FILE /**< coming from uploaded file */
-} glite_jp_attr_orig_t;
-
-typedef struct {
- char *name; /**< including namespace */
- char *value;
- int binary; /**< value is binary */
- size_t size; /**< in case of binary value */
- glite_jp_attr_orig_t origin;
- char *origin_detail; /**< where it came from, i.e. file URI:name */
- time_t timestamp;
-} glite_jp_attrval_t;
-
-
-typedef enum {
- GLITE_JP_QUERYOP_UNDEF,
- GLITE_JP_QUERYOP_EQUAL,
- GLITE_JP_QUERYOP_UNEQUAL,
- GLITE_JP_QUERYOP_LESS,
- GLITE_JP_QUERYOP_GREATER,
- GLITE_JP_QUERYOP_WITHIN,
- GLITE_JP_QUERYOP_EXISTS,
- GLITE_JP_QUERYOP__LAST,
-} glite_jp_queryop_t;
-
-typedef struct {
- char *attr;
- glite_jp_queryop_t op;
- char *value, *value2;
- int binary;
- size_t size,size2;
- glite_jp_attr_orig_t origin;
-} glite_jp_query_rec_t;
-
-#endif /* GLITE_JP_TYPES_H */
+++ /dev/null
-/sbin/ldconfig
+++ /dev/null
-/sbin/ldconfig
+++ /dev/null
-1.0.0-1
-- initial release (copy of original jp.common)
-
-1.0.0-2
-- added required dependence on jobid.api-c
-
-1.0.0-3
-- fixed reference to cppunit
-
-1.0.0-4
-- configure script update (globus flavors added to configure call)
-
-1.0.0-5
-- configure script update
-
-1.0.0-6
-- Module repacked.
-
-1.0.0-7
-- install libraries into $libdir
-
-2.0.0-1
-- Fixed library version numbering
-
-2.0.1-1
-- Fixed target 'clean' in the Makefile
-
-2.0.2-1
-- Fixed target 'clean' in the Makefile
-- Fixed format of the package description file
-
-2.0.2-2
-- Module rebuilt
-
-2.0.3-1
-- Makefile a configuration updated to work across org.glite & EMI
-
-2.0.3-2
-- Module rebuilt
-
-2.0.3-3
-- Module rebuilt
-
-2.0.3-4
-- Module rebuilt
-
-2.1.0-1
-- Fixes for parallel release in EMI & gLite
-
-2.1.0-2
-- Module rebuilt
-
-2.1.1-1
-- Root directory option (ETICS performs own files relocation)
-- Prefix option as prefix inside stage
-- Sysconfdir option (for /etc vs /usr)
-- DESTDIR in makefiles
-
-2.1.2-1
-- Relocatable build directory.
-
-2.1.2-2
-- Module rebuilt
-
-2.1.2-3
-- Module rebuilt
-
-2.1.2-4
-- Module rebuilt
-
-2.1.2-5
-- Module rebuilt
-
-2.1.2-6
-- Module rebuilt
-
-2.1.2-7
-- Module rebuilt
-
-2.1.2-8
-- Module rebuilt
-
-2.2.0-1
-- Preparation for a new multiplatform release
-
-2.2.0-2
-- Module rebuilt
-
-2.2.0-3
-- Module rebuilt
-
-2.2.1-1
-- Compile-time warning fixes
-
-2.2.1-2
-- Module rebuilt
-
+++ /dev/null
-Source: glite-lbjp-common-jp-interface
-Priority: extra
-Maintainer: @MAINTAINER@
-Uploaders: @UPLOADERS@
-Build-Depends: debhelper (>= 7.0.50~), chrpath, libcppunit-dev, libglite-jobid-api-c-dev, libglite-lbjp-common-db-dev, libglite-lbjp-common-trio-dev, libtool
-Standards-Version: 3.9.1
-Section: libs
-Homepage: @URL@
-DM-Upload-Allowed: yes
-@DEBIAN_VCS@
-
-Package: libglite-jp-common2
-Section: libs
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: @SUMMARY@
-@DEBIAN_DESCRIPTION@
-
-Package: libglite-lbjp-common-jp-interface-dev
-Section: libdevel
-Architecture: any
-Provides: glite-lbjp-common-jp-interface
-Depends: libglite-jp-common2 (= ${binary:Version}), ${misc:Depends}
-Description: Development files for gLite L&B/JP interface library
- This package contains development libraries and header files for gLite L&B/JP
- interface library.
-
-Package: glite-lbjp-common-jp-interface-dbg
-Section: debug
-Architecture: any
-Priority: extra
-Depends: libglite-jp-common2 (= ${binary:Version}), ${misc:Depends}
-Description: gLite L&B/JP interface library debugging symbols
- This package contains debugging symbols for gLite L&B/JP interface library.
+++ /dev/null
-This work was packaged for Debian by:
-
- @MAINTAINER@ on Thu, 08 Dec 2011 00:46:07 +0100
-
-It was downloaded from:
-
- @URL@
-
-Upstream Author(s):
-
- @MAINTAINER@
-
-Copyright:
-
- <Copyright (C) 2004-2011 Members of the EGEE Collaboration>
-
-License:
-
- 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.
-
-On Debian systems, the complete text of the Apache version 2.0 license
-can be found in "/usr/share/common-licenses/Apache-2.0".
-
-The Debian packaging is:
-
- Copyright (C) 2004-2011 Members of the EGEE Collaboration
-
-and is licensed under the Apache License, Version 2.0.
+++ /dev/null
-usr/lib/lib*.so.*
+++ /dev/null
-usr/include/glite/jp
-usr/lib
+++ /dev/null
-usr/include/glite/jp/*.h
-usr/lib/lib*.so
+++ /dev/null
-#!/usr/bin/make -f
-# -*- makefile -*-
-
--include /usr/share/dpkg/buildflags.mk
-
-# Uncomment this to turn on verbose mode.
-export DH_VERBOSE=1
-
-configure: configure-stamp
-configure-stamp:
- dh_testdir
- /usr/bin/perl ./configure --thrflavour= --nothrflavour= --root=/ --prefix=/usr --libdir=lib --project=emi --module lbjp-common.jp-interface
- touch $@
-
-build: build-arch build-indep
-
-build-arch build-indep: build-stamp
-
-build-stamp: configure-stamp
- dh_testdir
- CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE)
- CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) check
- touch $@
-
-clean: configure-stamp
- dh_testdir
- dh_testroot
- rm -f configure-stamp build-stamp
- $(MAKE) clean
- rm -f Makefile.inc config.status
- dh_clean
-
-install: build-stamp
- dh_testdir
- dh_testroot
- dh_prep
- dh_installdirs
- $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
- rm -vf $(CURDIR)/debian/tmp/usr/lib/*.la
- rm -vf $(CURDIR)/debian/tmp/usr/lib/*.a
- find $(CURDIR)/debian/tmp -name '*' -print | xargs -I {} -i bash -c "chrpath -d {} > /dev/null 2>&1" || echo 'Stripped RPATH'
-
-binary-indep:
-
-binary-arch: install
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_installexamples
- dh_installman
- dh_installlogrotate
- dh_installcron
- dh_install --fail-missing
- dh_link
- dh_strip --dbg-package=glite-lbjp-common-jp-interface-dbg
- dh_compress
- dh_fixperms
- dh_makeshlibs
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-arch binary-indep
+++ /dev/null
-Summary: @SUMMARY@
-Name: glite-lbjp-common-jp-interface
-Version: @MAJOR@.@MINOR@.@REVISION@
-Release: @AGE@%{?dist}
-Url: @URL@
-License: ASL 2.0
-Vendor: EMI
-Group: System Environment/Libraries
-BuildRequires: chrpath
-BuildRequires: cppunit-devel
-BuildRequires: glite-jobid-api-c-devel
-BuildRequires: glite-lbjp-common-db-devel
-BuildRequires: glite-lbjp-common-trio-devel
-BuildRequires: libtool
-BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
-AutoReqProv: yes
-Source: http://eticssoft.web.cern.ch/eticssoft/repository/emi/emi.lbjp-common.jp-interface/%{version}/src/%{name}-@VERSION@.src.tar.gz
-
-
-%description
-@DESCRIPTION@
-
-
-%package devel
-Summary: Development files for gLite L&B/JP interface library
-Group: Development/Libraries
-Requires: %{name}%{?_isa} = %{version}-%{release}
-
-
-%description devel
-This package contains development libraries and header files for gLite L&B/JP
-interface library.
-
-
-%prep
-%setup -q
-
-
-%build
-/usr/bin/perl ./configure --thrflavour= --nothrflavour= --root=/ --prefix=/usr --libdir=%{_lib} --project=emi --module lbjp-common.jp-interface
-make
-
-
-%check
-make check
-
-
-%install
-rm -rf $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
-find $RPM_BUILD_ROOT -name '*.la' -exec rm -rf {} \;
-find $RPM_BUILD_ROOT -name '*.a' -exec rm -rf {} \;
-find $RPM_BUILD_ROOT -name '*' -print | xargs -I {} -i bash -c "chrpath -d {} > /dev/null 2>&1" || echo 'Stripped RPATH'
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
-%post -p /sbin/ldconfig
-
-
-%postun -p /sbin/ldconfig
-
-
-%files
-%defattr(-,root,root)
-/usr/%{_lib}/libglite_jp_common.so.@MAJOR@.@MINOR@.@REVISION@
-/usr/%{_lib}/libglite_jp_common.so.@MAJOR@
-
-
-%files devel
-%defattr(-,root,root)
-%dir /usr/include/glite
-%dir /usr/include/glite/jp
-/usr/include/glite/jp/types.h
-/usr/include/glite/jp/indexdb.h
-/usr/include/glite/jp/attr.h
-/usr/include/glite/jp/file_plugin.h
-/usr/include/glite/jp/context.h
-/usr/include/glite/jp/type_plugin.h
-/usr/include/glite/jp/backend.h
-/usr/include/glite/jp/known_attr.h
-/usr/include/glite/jp/builtin_plugins.h
-/usr/%{_lib}/libglite_jp_common.so
-
-
-%changelog
-* @SPEC_DATE@ @MAINTAINER@ - @MAJOR@.@MINOR@.@REVISION@-@AGE@%{?dist}
-- automatically generated package
+++ /dev/null
-Definiton of interfaces required to build plugins for JP services and implementation of minimal library of support functions.
+++ /dev/null
-Public API to JP service internal interface
+++ /dev/null
-#: /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.2.1
-module.age=2
+++ /dev/null
-/*
-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 <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-
-#include "glite/jobid/strmd5.h"
-#include "types.h"
-#include "attr.h"
-#include "type_plugin.h"
-#include "context.h"
-
-void glite_jp_attrval_free(glite_jp_attrval_t *a,int f)
-{
- free(a->name);
- free(a->value);
- free(a->origin_detail);
- memset(a,0,sizeof *a);
- if (f) free(a);
-}
-
-void glite_jp_attrval_copy(glite_jp_attrval_t *dst,const glite_jp_attrval_t *src)
-{
- dst->name = strdup(src->name);
- dst->origin = src->origin;
- dst->size = src->size;
- dst->timestamp = src->timestamp;
- dst->origin_detail = src->origin_detail ?
- strdup(src->origin_detail) : NULL;
- if ((dst->binary = src->binary)) {
- dst->value = malloc(src->size);
- memcpy(dst->value,src->value,src->size);
- }
- else dst->value = strdup(src->value);
-}
-
-
-#define min(x,y) ((x) > (y) ? (y) : (x))
-
-static int fb_cmp(void *ctx,const glite_jp_attrval_t *a,const glite_jp_attrval_t *b,int *result)
-{
- if (a->binary != b->binary) return EINVAL;
- if (a->binary) {
- *result = memcmp(a->value,b->value,min(a->size,b->size));
- if (!*result && a->size != b->size)
- *result = a->size > b->size ? 1 : -1;
- }
- else *result = strcmp(a->value,b->value);
- return 0;
-}
-
-/* XXX: depends on specific definition of glite_jp_attr_orig_t */
-static char orig_char[] = "ASUF";
-
-/* XXX: don't allocate memory, don't grow more than twice */
-static int escape_colon(const char *in, char *out)
-{
- int i,o;
-
- for (i=o=0; in[i]; i++) switch (in[i]) {
- case ':': out[o++] = '\\'; out[o++] = ':'; break;
- case '\\': out[o++] = '\\'; out[o++] = '\\'; break;
- default: out[o++] = in[i]; break;
- }
- out[o] = 0;
- return o;
-}
-
-/* XXX: read until unescaped colon is found
- * allocates output */
-static char * unescape_colon(const char *in,int *rd)
-{
- int i,o;
- char *out;
-
- for (i=o=0; in[i] && in[i] != ':'; i++,o++)
- if (in[i] == '\\') i++;
-
- out = malloc(o+1);
-
- for (i=o=0; in[i] && in[i] != ':'; i++)
- if (in[i] == '\\') out[o++] = in[++i];
- else out[o++] = in[i];
-
- out[o] = 0;
- *rd = i;
- return out;
-}
-
-static char * fb_to_db_full(void *ctx,const glite_jp_attrval_t *attr)
-{
-
- int vsize = attr->binary ? attr->size * 4/3 + 6 : strlen(attr->value)+1,
- len;
-
- /* 4x: + \0 + ASUF + BS + %12d */
- char *db = malloc(19 + (attr->origin_detail ? 2*strlen(attr->origin_detail) : 0) + vsize);
-
- if (attr->origin < 0 || attr->origin > GLITE_JP_ATTR_ORIG_FILE) {
- free(db); return NULL;
- }
- len = sprintf(db,"%c:%ld:%c:",attr->binary ? 'B' : 'S',
- attr->timestamp,orig_char[attr->origin]);
-
- if (attr->origin_detail) len += escape_colon(attr->origin_detail,db+len);
- db[len++] = ':';
-
- if (attr->binary) {
- vsize = base64_encode(attr->value,attr->size,db+len,vsize-1);
- if (vsize < 0) { free(db); return NULL; }
- db[len+vsize] = 0;
- }
- else strcpy(db+len,attr->value);
-
- return db;
-}
-
-static char * fb_to_db_index(void *ctx,const glite_jp_attrval_t *attr,int len)
-{
- char *s;
-
-/* XXX: binary values not really handled. Though the formal semantics is not broken */
- if (attr->binary) return strdup("XXX");
-
- s = strdup(attr->value);
- if (len < strlen(s)) s[len] = 0;
- return s;
-}
-
-static int fb_from_db(void *ctx,const char *str,glite_jp_attrval_t *attr)
-{
- int p = 2;
- char *colon,*cp;
-
- if (str[0] != 'B' && str[0] != 'S') return EINVAL;
- attr->binary = str[0] == 'B';
- cp = attr->value = strdup(str);
-
- colon = strchr(cp+p,':');
- if (!colon) return EINVAL;
-
- *colon++ = 0;
- attr->timestamp = (time_t) atol(cp+p);
- p = colon-cp;
-
- for (attr->origin = GLITE_JP_ATTR_ORIG_ANY; orig_char[attr->origin] && orig_char[attr->origin] != cp[p]; attr->origin++);
- if (!orig_char[attr->origin]) return EINVAL;
-
- p += 2;
- if (cp[p] == ':') attr->origin_detail = NULL;
- else {
- int r;
- attr->origin_detail = unescape_colon(cp+p,&r);
- p += r;
- }
- if (cp[p++] != ':') return EINVAL;
-
- if (attr->binary) {
- attr->size = base64_decode(str+p,attr->value,strlen(str));
- if (attr->size < 0) return EINVAL;
- }
- else strcpy(attr->value,str+p);
-
- return 0;
-}
-
-static const char * fb_type_full(void *ctx,const char *attr)
-{
- return "mediumblob";
-}
-
-static const char * fb_type_index(void *ctx,const char *attr,int len)
-{
- static char tbuf[100];
- sprintf(tbuf,"varchar(%d)",len);
- return tbuf;
-}
-
-
-
-static glite_jp_tplug_data_t fallback_plugin = {
- "",
- NULL,
- fb_cmp,
- fb_to_db_full,
- fb_to_db_index,
- fb_from_db,
- fb_type_full,
- fb_type_index,
-};
-
-static glite_jp_tplug_data_t *get_plugin(glite_jp_context_t ctx,const char *aname)
-{
- void **cp = ctx->type_plugins;
- char *colon,*ns;
-
- if (!cp) return &fallback_plugin;
- glite_jp_clear_error(ctx);
- ns = strdup(aname);
- colon = strrchr(ns,':');
- if (colon) *colon = 0; else *ns = 0;
-
- while (*cp) {
- glite_jp_tplug_data_t *p = *cp;
- if (!strcmp(ns,p->namespace)) {
- free(ns);
- return p;
- }
- cp++;
- }
- free(ns);
- return &fallback_plugin; /* XXX: is it always desirable? */
-}
-
-int glite_jp_attrval_cmp(glite_jp_context_t ctx,const glite_jp_attrval_t *a,const glite_jp_attrval_t *b,int *result)
-{
- glite_jp_tplug_data_t *ap = get_plugin(ctx,a->name);
- glite_jp_error_t err;
-
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
- glite_jp_clear_error(ctx);
-
- if (strcmp(a->name,b->name)) {
- err.code = EINVAL;
- err.desc = "Can't compare different attributes";
- return glite_jp_stack_error(ctx,&err);
- }
-
- return ap->cmp ? ap->cmp(ap->pctx,a,b,result) : fb_cmp(ap->pctx,a,b,result);
-}
-
-char *glite_jp_attrval_to_db_full(glite_jp_context_t ctx,const glite_jp_attrval_t *attr)
-{
- glite_jp_tplug_data_t *ap = get_plugin(ctx,attr->name);
-
- glite_jp_clear_error(ctx);
- return ap->to_db_full ? ap->to_db_full(ap->pctx,attr) : fb_to_db_full(ap->pctx,attr);
-}
-
-char *glite_jp_attrval_to_db_index(glite_jp_context_t ctx,const glite_jp_attrval_t *attr,int len)
-{
- glite_jp_tplug_data_t *ap = get_plugin(ctx,attr->name);
-
- glite_jp_clear_error(ctx);
- return ap->to_db_index ? ap->to_db_index(ap->pctx,attr,len) : fb_to_db_index(ap->pctx,attr,len);
-}
-
-
-int glite_jp_attrval_from_db(glite_jp_context_t ctx,const char *str,glite_jp_attrval_t *attr)
-{
- glite_jp_tplug_data_t *ap = get_plugin(ctx,attr->name);
-
- glite_jp_clear_error(ctx);
- return ap->from_db ? ap->from_db(ap->pctx,str,attr) : fb_from_db(ap->pctx,str,attr);
-}
-
-const char *glite_jp_attrval_db_type_full(glite_jp_context_t ctx,const char *attr)
-{
- glite_jp_tplug_data_t *ap = get_plugin(ctx,attr);
-
- glite_jp_clear_error(ctx);
- return ap->db_type_full ? ap->db_type_full(ap->pctx,attr) : fb_type_full(ap->pctx,attr);
-}
-
-const char *glite_jp_attrval_db_type_index(glite_jp_context_t ctx,const char *attr,int len)
-{
- glite_jp_tplug_data_t *ap = get_plugin(ctx,attr);
-
- glite_jp_clear_error(ctx);
- return ap->db_type_index ? ap->db_type_index(ap->pctx,attr,len) : fb_type_index(ap->pctx,attr,len);
-}
-
-/* XXX: UNIX time, should be ISO blahblah */
-time_t glite_jp_attr2time(const char *a)
-{
- long t;
-
- sscanf(a,"%ld",&t);
- return t;
-}
-
-/* XXX: UNIX time, should be ISO blahblah */
-char * glite_jp_time2attr(time_t t)
-{
- char *r;
-
- asprintf(&r,"%ld",(long) t);
- return r;
-}
-
+++ /dev/null
-/*
-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 <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "types.h"
-#include "context.h"
-
-int glite_jp_init_context(glite_jp_context_t *ctx)
-{
- return (*ctx = calloc(1,sizeof **ctx)) != NULL;
-}
-
-void glite_jp_free_context(glite_jp_context_t ctx)
-{
- glite_jp_clear_error(ctx);
- free(ctx);
-}
-
-char *glite_jp_peer_name(glite_jp_context_t ctx)
-{
- return strdup(ctx->peer ? ctx->peer : "unknown");
-}
-
-char *glite_jp_error_chain(glite_jp_context_t ctx)
-{
- char *ret = NULL,indent[300] = "";
- int len = 0,add;
- char buf[2000];
-
- glite_jp_error_t *ep = ctx->error;
-
- do {
- add = snprintf(buf,sizeof buf,"%s%s: %s (%s)\n",
- indent,
- ep->source,
- strerror(ep->code),
- ep->desc ? ep->desc : "");
- ret = realloc(ret,len + add + 1);
- strncpy(ret + len,buf,add); ret[len += add] = 0;
- strcat(indent," ");
- } while ((ep = ep->reason));
-
- return ret;
-}
-
-int glite_jp_stack_error(glite_jp_context_t ctx, const glite_jp_error_t *err)
-{
- glite_jp_error_t *reason = ctx->error;
-
- ctx->error = calloc(1,sizeof *ctx->error);
- ctx->error->code = err->code;
- ctx->error->desc = err->desc ? strdup(err->desc) : NULL;
- ctx->error->source = err->source ? strdup(err->source) : NULL;
- ctx->error->reason = reason;
-
- return err->code;
-}
-
-int glite_jp_clear_error(glite_jp_context_t ctx)
-{
- glite_jp_error_t *e = ctx->error, *r;
-
- while (e) {
- r = e->reason;
- free((char *) e->source);
- free((char *) e->desc);
- free(e);
- e = r;
- }
- ctx->error = NULL;
- return 0;
-}
-
-
-void glite_jp_free_query_rec(glite_jp_query_rec_t *q)
-{
- free(q->attr);
- free(q->value);
- free(q->value2);
- memset(q,0,sizeof *q);
-}
-
-int glite_jp_queryrec_copy(glite_jp_query_rec_t *dst, const glite_jp_query_rec_t *src)
-{
- memcpy(dst,src,sizeof *src);
- if (src->attr) dst->attr = strdup(src->attr);
- if (src->value) dst->value = strdup(src->value);
- if (src->value2) dst->value2 = strdup(src->value2);
- return 0;
-}
-
-int glite_jp_run_deferred(glite_jp_context_t ctx)
-{
- int i,cnt,ret;
-
- if (!ctx->deferred_func) return 0;
-
- glite_jp_clear_error(ctx);
- for (cnt=0;ctx->deferred_func[cnt];cnt++);
- for (i=0; i<cnt; i++) {
- if ((ret = (*ctx->deferred_func)(ctx,*ctx->deferred_arg))) {
- glite_jp_error_t err;
- char desc[100];
-
- sprintf(desc,"calling func #%d, %p",i,*ctx->deferred_func);
- err.code = ret;
- err.desc = desc;
- err.source = "glite_jp_run_deferred()";
-
- glite_jp_stack_error(ctx,&err);
- return ret;
- }
- else {
- memmove(ctx->deferred_func,ctx->deferred_func+1,
- (cnt-i) * sizeof *ctx->deferred_func);
- memmove(ctx->deferred_arg,ctx->deferred_arg+1,
- (cnt-i) * sizeof *ctx->deferred_arg);
- }
- }
- free(ctx->deferred_func); ctx->deferred_func = NULL;
- free(ctx->deferred_arg); ctx->deferred_arg = NULL;
- return 0;
-}
-
-int glite_jp_add_deferred(
- glite_jp_context_t ctx,
- int (*func)(glite_jp_context_t, void *),
- void *arg
-)
-{
- int (**v)(glite_jp_context_t, void *) = ctx->deferred_func;
- int i;
-
- for (i=0; v && v[i]; i++);
-
- ctx->deferred_func = realloc(ctx->deferred_func, (i+2) * sizeof *ctx->deferred_func);
- ctx->deferred_func[i] = func;
- ctx->deferred_func[i+1] = NULL;
-
- ctx->deferred_arg = realloc(ctx->deferred_arg,(i+2) * sizeof *ctx->deferred_arg);
- ctx->deferred_arg[i] = arg;
- ctx->deferred_arg[i+1] = NULL;
-
- return 0;
-}
+++ /dev/null
-/*
-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.
-*/
-
-#ident "$Header:"
-
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <stdio.h>
-#include <ctype.h>
-
-#include <glite/jobid/strmd5.h>
-#include <glite/lbu/db.h>
-#include <glite/lbu/trio.h>
-
-#define GLITE_JP_INDEX_COMPILE 1
-
-#include "indexdb.h"
-
-char *glite_jp_indexdb_attr2id(const char *name) {
- size_t i, len;
- char *lname, *id;
-
- len = strlen(name);
- lname = malloc(len + 1);
- for (i = 0; i < len + 1; i++) lname[i] = tolower(name[i]);
- id = str2md5(lname);
- free(lname);
-
- return id;
-}
-
-
-int glite_jp_indexdb_attr2select_from_index(const char *name, int indexed __attribute__((unused)), char **column, char **full_value_column, char **table, char **where) {
- char *id;
-
- if (column) *column = strdup("value");
- if (full_value_column) *full_value_column = strdup("full_value");
- if (table) {
- id = glite_jp_indexdb_attr2id(name);
- asprintf(table, GLITE_JP_INDEXDB_TABLE_ATTR_PREFIX "%s", id);
- free(id);
- }
- if (where) *where = strdup("");
-
- return 0;
-}
-
-
-int glite_jp_indexdb_attr2select_from_db(const char *name, glite_lbu_DBContext dbctx, char **column, char **full_value_column, char **table, char **where) {
- char *sql, *id;
- glite_lbu_Statement stmt;
- int ret;
-
- if (table) {
- trio_asprintf(&sql, "SELECT attrid FROM attrs WHERE name='%|Ss'", name);
- ret = glite_lbu_ExecSQL(dbctx, sql, &stmt);
- free(sql);
- switch (ret) {
- case -1: return glite_lbu_DBError(dbctx, NULL, NULL);
- case 1: break;
- default: return EINVAL;
- }
- if (glite_lbu_FetchRow(stmt, 1, NULL, &id) < 0) return glite_lbu_DBError(dbctx, NULL, NULL);
- asprintf(table, GLITE_JP_INDEXDB_TABLE_ATTR_PREFIX "%s", id);
- free(id);
- glite_lbu_FreeStmt(&stmt);
- }
- if (column) *column = strdup("value");
- if (full_value_column) *full_value_column = strdup("full_value");
- if (where) *where = strdup("");
-
- return 0;
-}
+++ /dev/null
-/*
-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 <getopt.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <assert.h>
-#include <limits.h>
-#include <dirent.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include "glite/jobid/strmd5.h"
-#include "types.h"
-#include "context.h"
-#include "known_attr.h"
-#include "attr.h"
-
-/*
-#include "feed.h"
-#include "tags.h"
-*/
-
-#include "backend.h"
-
-
-typedef struct _rl_buffer_t {
- char *buf;
- size_t pos, size;
- off_t offset;
-} rl_buffer_t;
-
-/*
- * realloc the line to double size if needed
- *
- * \return 0 if failed, did nothing
- * \return 1 if success
- */
-int check_realloc_line(char **line, size_t *maxlen, size_t len) {
- void *tmp;
-
- if (len > *maxlen) {
- *maxlen <<= 1;
- tmp = realloc(*line, *maxlen);
- if (!tmp) return 0;
- *line = tmp;
- }
-
- return 1;
-}
-
-
-char* glite_jpps_get_namespace(const char* attr){
- char* namespace = strdup(attr);
- char* colon = strrchr(namespace, ':');
- if (colon)
- namespace[strrchr(namespace, ':') - namespace] = 0;
- else
- namespace[0] = 0;
- return namespace;
-}
-
+++ /dev/null
-/*
-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 <assert.h>
-#include <fstream>
-#include <cstdlib>
-#include <cstring>
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/XmlOutputter.h>
-#include <cppunit/TestRunner.h>
-#include <cppunit/TestResult.h>
-#include <cppunit/TestResultCollector.h>
-
-#include "types.h"
-#include "attr.h"
-#include "context.h"
-#include "backend.h"
-
-
-class TypePluginTest: public CppUnit::TestFixture
-{
- CPPUNIT_TEST_SUITE(TypePluginTest);
- CPPUNIT_TEST(simple);
- CPPUNIT_TEST(binary);
- CPPUNIT_TEST(origin);
- CPPUNIT_TEST(origin2);
- CPPUNIT_TEST(index);
- CPPUNIT_TEST_SUITE_END();
-public:
- void simple();
- void binary();
- void origin();
- void origin2();
- void index();
-};
-
-void TypePluginTest::simple()
-{
- glite_jp_context_t ctx;
-
- glite_jp_attrval_t attr = {
- "myattr",
- "short string",
- 0,0,
- GLITE_JP_ATTR_ORIG_USER,
- NULL,
- 0
- },attr2;
-
- char *db;
-
- glite_jp_init_context(&ctx);
- attr.timestamp = time(NULL);
-
- db = glite_jp_attrval_to_db_full(ctx,&attr);
-
- CPPUNIT_ASSERT_MESSAGE(std::string("glite_jp_attrval_to_db_full()"),db);
- std::cerr << db << std::endl;
-
- glite_jp_attrval_from_db(ctx,db,&attr2);
- CPPUNIT_ASSERT_MESSAGE(std::string("value"),!strcmp(attr.value,attr2.value));
- CPPUNIT_ASSERT_MESSAGE(std::string("origin"),attr.origin == attr2.origin);
- CPPUNIT_ASSERT_MESSAGE(std::string("timestamp"),attr.timestamp == attr2.timestamp);
-}
-
-void TypePluginTest::binary()
-{
- glite_jp_context_t ctx;
-
- glite_jp_attrval_t attr = {
- "myattr",
- NULL,
- 1,1000,
- GLITE_JP_ATTR_ORIG_USER,
- NULL,
- 0
- },attr2;
-
- char *db;
-
- glite_jp_init_context(&ctx);
- attr.timestamp = time(NULL);
- attr.value = (char *) malloc(attr.size);
-
- db = glite_jp_attrval_to_db_full(ctx,&attr);
-
- CPPUNIT_ASSERT_MESSAGE(std::string("glite_jp_attrval_to_db_full()"),db);
- std::cerr << db << std::endl;
-
- glite_jp_attrval_from_db(ctx,db,&attr2);
- CPPUNIT_ASSERT_MESSAGE(std::string("size"),attr.size == attr2.size);
- CPPUNIT_ASSERT_MESSAGE(std::string("value"),!memcmp(attr.value,attr2.value,attr.size));
-}
-
-void TypePluginTest::origin()
-{
- glite_jp_context_t ctx;
-
- glite_jp_attrval_t attr = {
- "myattr",
- NULL,
- 0,0,
- GLITE_JP_ATTR_ORIG_USER,
- NULL,
- 0
- },attr2;
-
- char *db;
-
- glite_jp_init_context(&ctx);
- attr.timestamp = time(NULL);
- attr.value = "origin test";
- attr.origin_detail = "simple origin";
-
- db = glite_jp_attrval_to_db_full(ctx,&attr);
-
- CPPUNIT_ASSERT_MESSAGE(std::string("glite_jp_attrval_to_db_full()"),db);
- std::cerr << db << std::endl;
-
- glite_jp_attrval_from_db(ctx,db,&attr2);
- CPPUNIT_ASSERT_MESSAGE(std::string("origin detail"),!strcmp(attr.origin_detail,attr2.origin_detail));
-}
-
-void TypePluginTest::origin2()
-{
- glite_jp_context_t ctx;
-
- glite_jp_attrval_t attr = {
- "myattr",
- NULL,
- 0,0,
- GLITE_JP_ATTR_ORIG_USER,
- NULL,
- 0
- },attr2;
-
- char *db;
-
- glite_jp_init_context(&ctx);
- attr.timestamp = time(NULL);
- attr.value = "origin:test";
- attr.origin_detail = "ftp://some.server:1234/ugly \\file";
-
- db = glite_jp_attrval_to_db_full(ctx,&attr);
-
- CPPUNIT_ASSERT_MESSAGE(std::string("glite_jp_attrval_to_db_full()"),db);
- std::cerr << db << std::endl;
-
- glite_jp_attrval_from_db(ctx,db,&attr2);
- CPPUNIT_ASSERT_MESSAGE(std::string("origin detail"),!strcmp(attr.origin_detail,attr2.origin_detail));
- CPPUNIT_ASSERT_MESSAGE(std::string("value"),!strcmp(attr.value,attr2.value));
-}
-
-void TypePluginTest::index()
-{
- /* TODO: check monotonity */
-}
-
-CPPUNIT_TEST_SUITE_REGISTRATION(TypePluginTest);
-
-
-int main (int argc,const char *argv[])
-{
- CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
-
- assert(argc == 2);
- std::ofstream xml(argv[1]);
-
- CppUnit::TestResult controller;
- CppUnit::TestResultCollector result;
- controller.addListener( &result );
-
- CppUnit::TestRunner runner;
- runner.addTest(suite);
- runner.run(controller);
-
- CppUnit::XmlOutputter xout( &result, xml );
- CppUnit::CompilerOutputter tout( &result, std::cout);
- xout.write();
- tout.write();
-
- return result.wasSuccessful() ? 0 : 1 ;
-}
-
-
-
-
-/* fake to link */
-int glite_jppsbe_pread(
- glite_jp_context_t ctx,
- void *handle,
- void *buf,
- size_t nbytes,
- off_t offset,
- ssize_t *nbytes_ret
-)
-{
- abort();
-}
-
-
+++ /dev/null
-LICENSE file for EGEE Middleware
-================================
-
-Copyright (c) 2004 on behalf of the EU EGEE Project:
-The European Organization for Nuclear Research (CERN),
-Istituto Nazionale di Fisica Nucleare (INFN), Italy
-Datamat Spa, Italy
-Centre National de la Recherche Scientifique (CNRS), France
-CS Systeme d'Information (CSSI), France
-Royal Institute of Technology, Center for Parallel Computers (KTH-PDC), Sweden
-Universiteit van Amsterdam (UvA), Netherlands
-University of Helsinki (UH.HIP), Finlan
-University of Bergen (UiB), Norway
-Council for the Central Laboratory of the Research Councils (CCLRC), United Kingdom
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-1. Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-
-3. The end-user documentation included with the redistribution, if
-any, must include the following acknowledgment: "This product includes
-software developed by The EU EGEE Project (http://cern.ch/eu-egee/)."
-Alternatively, this acknowledgment may appear in the software itself, if
-and wherever such third-party acknowledgments normally appear.
-
-4. The names EGEE and the EU EGEE Project must not be
-used to endorse or promote products derived from this software without
-prior written permission. For written permission, please contact
-<email address>.
-
-5. You are under no obligation whatsoever to provide anyone with any
-bug fixes, patches, or upgrades to the features, functionality or
-performance of the Software ("Enhancements") that you may develop over
-time; however, if you choose to provide your Enhancements to The EU
-EGEE Project, or if you choose to otherwise publish or distribute your
-Enhancements, in source code form without contemporaneously requiring
-end users of The EU EGEE Proejct to enter into a separate written license
-agreement for such Enhancements, then you hereby grant The EU EGEE Project
-a non-exclusive, royalty-free perpetual license to install, use, copy,
-modify, prepare derivative works, incorporate into the EGEE Middleware
-or any other computer software, distribute, and sublicense your
-Enhancements or derivative works thereof, in binary and source code
-form (if any), whether developed by The EU EGEE Project or third parties.
-
-THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL PROJECT OR ITS CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-This software consists of voluntary contributions made by many
-individuals on behalf of the EU EGEE Prject. For more information on The
-EU EGEE Project, please see http://cern.ch/eu-egee/. For more information on
-EGEE Middleware, please see http://egee-jra1.web.cern.ch/egee-jra1/
-
-
+++ /dev/null
-top_srcdir=..
-builddir=build
-top_builddir=${top_srcdir}/${builddir}
-stagedir=.
-distdir=.
-globalprefix=glite
-lbutilsprefix=lbu
-package=glite-lbjp-common-log
-version=0.0.0
-PREFIX=/opt/glite
-prefix=
-sysconfdir=/etc
-log4c_prefix=/usr
-
--include Makefile.inc
--include ${top_srcdir}/project/version.properties
-
-version=${module.version}
-
-CC=gcc
-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
-
-DEBUG:=-g -O0 -W -Wall
-
-CFLAGS:= ${CFLAGS} \
- ${DEBUG} \
- -I${stagedir}${prefix}/include -I${top_srcdir}/src \
- -I${top_srcdir}/interface \
- ${LOG4C_CFLAGS}
-
-LDFLAGS:=${LDFLAGS} -L${stagedir}${prefix}/${libdir}
-
-COMPILE:=libtool --mode=compile ${CC} ${CFLAGS}
-LINK:=libtool --mode=link ${CC} -rpath ${stagedir}${prefix}/${libdir} ${LDFLAGS}
-INSTALL:=libtool --mode=install install
-
-OBJS:=log.o
-LOBJS:=${OBJS:.o=.lo}
-LTLIB:=libglite_lbu_log.la
-
-# In order to use libtool versioning correcty, we must have:
-#
-# current = major + minor + offset
-# revision = patch
-# age = minor
-#
-# where offset is a sum of maximal released minor's of all previous major's
-#
-
-# counted minors: n/a
-offset=0
-
-version_info:=-version-info ${shell \
- perl -e '$$,=":"; @F=split "\\.","${version}"; print $$F[0]+$$F[1]+${offset},$$F[2],$$F[1]' }
-
-default all: compile
-
-compile: ${LTLIB}
-
-stage: compile
- $(MAKE) install PREFIX=${stagedir}
-
-install: compile
- mkdir -p ${DESTDIR}${PREFIX}${prefix}/include/${globalprefix}/${lbutilsprefix}
- ${INSTALL} -m 644 ${top_srcdir}/src/log.h ${DESTDIR}${PREFIX}${prefix}/include/${globalprefix}/${lbutilsprefix}
- mkdir -p ${DESTDIR}${PREFIX}${prefix}/share/doc/${package}-${version}
- ${INSTALL} -m 644 ${top_srcdir}/LICENSE ${DESTDIR}${PREFIX}${prefix}/share/doc/${package}-${version}
- ${INSTALL} -m 644 ${top_srcdir}/README ${DESTDIR}${PREFIX}${prefix}/share/doc/${package}-${version}
- mkdir -p ${DESTDIR}${PREFIX}${sysconfdir}/glite-lb
- ${INSTALL} -m 644 ${top_srcdir}/config/log4crc ${DESTDIR}${PREFIX}${sysconfdir}/glite-lb/log4crc
- ${INSTALL} -m 644 ${top_srcdir}/config/log4crc ${DESTDIR}${PREFIX}${prefix}/share/doc/${package}-${version}/log4crc.example-production
- ${INSTALL} -m 644 ${top_srcdir}/config/log4crc.debugging ${DESTDIR}${PREFIX}${prefix}/share/doc/${package}-${version}/log4crc.example-debugging
- mkdir -p ${DESTDIR}${PREFIX}${prefix}/${libdir}
- ${INSTALL} -m 755 ${LTLIB} ${DESTDIR}${PREFIX}${prefix}/${libdir}/${LTLIB}
-
-clean:
- rm -rvf *.o *.lo .libs lib*
- rm -rvf test
-
-distclean:
- rm -rvf Makefile.inc *.spec debian/
-
-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 $<
+++ /dev/null
-This package implements the glite common logging formats
-with respect to the gLite common logging recommendations v1.1:
-
-https://twiki.cern.ch/twiki/pub/EGEE/EGEEgLite/logging.html
-
-The implementation uses log4c (http://log4c.sourceforge.net)
-and its configuration file log4crc.
-
-There is one configuration file $GLITE_LOCATION/etc/glite-lb-log4crc
-that startup scripts use by setting the LOG4C_RCPATH environment variable.
-
-A file log4crc.example-debugging may be useful to copy to $HOME/.log4crc
-(or by setting the LOG4C_RCPATH environment variable to this file)
-to obtain detailed debugging output. One can debug only specific parts
-of the LB system, for example by uncommenting LB.SERVER.DB cathegory
-in the log4crc file, one gets only the debugging info related to the
-underlying database subsystem calls.
-
+++ /dev/null
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE log4c SYSTEM "">
-
-<log4c version="1.2.1">
-
- <config>
- <bufsize>1024</bufsize>
- <debug level="0"/>
- <nocleanup>0</nocleanup>
- </config>
-
- <!-- default categories ==================================== -->
- <category name="root" priority="notice"/>
-
- <category name="SECURITY" priority="error" appender="syslog"/>
- <category name="SECURITY" priority="fatal" appender="stderr"/>
- <category name="ACCESS" priority="error" appender="syslog"/>
- <category name="ACCESS" priority="fatal" appender="stderr"/>
- <category name="CONTROL" priority="error" appender="syslog"/>
- <category name="CONTROL" priority="fatal" appender="stderr"/>
-
- <category name="LB" priority="error" appender="syslog"/>
- <category name="LB.SERVER.DB" priority="fatal" appender="syslog"/>
- <category name="LB.HARVESTER.DB" priority="fatal" appender="syslog"/>
- <!-- category name="LB.LOGD" priority="debug" appender="stderr"/-->
- <!-- category name="LB.INTERLOGD" priority="debug" appender="stderr"/-->
- <!-- category name="LB.NOTIFINTERLOGD" priority="debug" appender="stderr"/-->
- <!-- category name="LB.SERVER" priority="debug" appender="stderr"/-->
- <!-- category name="LB.AUTHZ" priority="debug" appender="syslog"/-->
- <!-- category name="LB.HARVESTER" priority="debug" appender="syslog"/-->
-
- <!-- default appenders ===================================== -->
- <appender name="stdout" type="stream" layout="dated"/>
- <appender name="stderr" type="stream" layout="dated"/>
- <appender name="syslog" type="syslog" layout="basic"/>
-
- <!-- default layouts ======================================= -->
- <layout name="basic" type="basic"/>
- <layout name="dated" type="dated"/>
-</log4c>
-
+++ /dev/null
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE log4c SYSTEM "">
-
-<log4c version="1.2.1">
-
- <config>
- <bufsize>1024</bufsize>
- <debug level="0"/>
- <nocleanup>0</nocleanup>
- </config>
-
- <!-- default categories ==================================== -->
- <category name="root" priority="notice"/>
-
- <category name="SECURITY" priority="debug" appender="stderr"/>
- <category name="ACCESS" priority="debug" appender="stderr"/>
- <category name="CONTROL" priority="debug" appender="stderr"/>
- <category name="LB" priority="debug" appender="stderr"/>
-
- <!-- to debug only a particular LB component, or to change priority, use: -->
- <!-- category name="LB.LOGD" priority="debug" appender="stderr"/-->
- <!-- category name="LB.INTERLOGD" priority="debug" appender="stderr"/-->
- <!-- category name="LB.NOTIFINTERLOGD" priority="debug" appender="stderr"/-->
- <!-- category name="LB.SERVER" priority="debug" appender="stderr"/-->
- <!-- category name="LB.SERVER.DB" priority="debug" appender="stderr"/-->
- <!-- category name="LB.SERVER.REQUEST" priority="debug" appender="stderr"/-->
- <!-- category name="LB.HARVESTER.DB" priority="debug" appender="stderr"/-->
-
- <!-- default appenders ===================================== -->
- <appender name="stdout" type="stream" layout="dated"/>
- <appender name="stderr" type="stream" layout="dated"/>
- <appender name="syslog" type="syslog" layout="basic"/>
-
- <!-- default layouts ======================================= -->
- <layout name="basic" type="basic"/>
- <layout name="dated" type="dated"/>
-</log4c>
-
+++ /dev/null
-#!/usr/bin/perl
-
-# WARNING: Don't edit this file unless it is the master copy in org.glite.lb
-#
-# For the purpose of standalone builds of lb/jobid/lbjp-common components
-# it is copied on tagging
-
-# $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.
-#
-
-use Getopt::Long;
-use POSIX qw(locale_h strftime);
-
-my $pwd = `pwd`; chomp $pwd;
-my $prefix = '/usr';
-my $stagedir = undef;
-my $root = $pwd.'/stage';
-my $sysroot = '';
-my $sysconfdir;
-my $localstatedir;
-my $staged;
-my $module;
-my $thrflavour = 'gcc64dbgpthr';
-my $nothrflavour = 'gcc64dbg';
-my $mode = 'build';
-my $help = 0;
-my $listmodules;
-my ($version, $force_version);
-my $branch;
-my $output;
-my $lb_tag = '';
-my $lbjp_tag = '';
-my $jp_tag = '';
-my $jobid_tag = '';
-my $libdir = getlibdir();
-my $project = 'emi';
-my $project_version;
-my (%projects, %project);
-my $debug = 0;
-my $pkg_config_env = (defined $ENV{PKG_CONFIG_PATH}) ? "$ENV{PKG_CONFIG_PATH}:" : '';
-
-my @nodes = qw/client server logger logger-msg nagios utils client-java doc ws-test db jpprimary jpindex jpclient harvester lb px proxyrenewal/;
-my @default_nodes = qw/lb px proxyrenewal nagios/;
-my %enable_nodes;
-my %disable_nodes;
-my %default_nodes; @default_nodes{@default_nodes} = (1) x ($#default_nodes + 1);
-
-my %package = (
- 'maintainer' => 'CESNET Product Teams <emi-lb@metacentrum.cz>',
- 'uploaders' => 'František Dvořák <valtri@civ.zcu.cz>',
- 'url' => 'http://glite.cern.ch',
- 'debian_vcs' => 'Vcs-Cvs: :pserver:anonymous@jra1mw.cvs.cern.ch:/cvs/jra1mw
-Vcs-Browser: http://jra1mw.cvs.cern.ch/cgi-bin/jra1mw.cgi',
-);
-
-# key: internal package name (arguments, ...)
-# 'pkg': pkg-config name
-# 'prefix': used when pkg-config fails
-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-devel' => {
- prefix=> '/opt/globus',
- pkg => 'myproxy'
- },
- 'myproxy-server' => {
- prefix=> '',
- },
- 'myproxy-admin' => {
- prefix=> '',
- },
- gsoap => {
- prefix=> '/usr',
- pkg => 'gsoap'
- },
- gsoapxx => {
- prefix=> '/usr',
- pkg => 'gsoap++'
- },
- mysql => {
- prefix=> '/usr'
- },
- 'mysql-devel' => {
- prefix=> ''
- },
- 'mysql-server' => {
- prefix => ''
- },
- voms => {
- prefix => '/opt/glite',
- pkg => 'voms-2.0'
- },
- gridsite => {
- prefix => '/opt/glite'
- },
- lcas => {
- prefix => '/opt/glite',
- pkg => 'lcas'
- },
- trustmanager => {
- prefix => '/opt/glite'
- },
- trustmanager_axis => {
- prefix => '/opt/glite'
- },
- utiljava => {
- prefix=> '/opt/glite'
- },
- ant => {
- prefix=> '/usr'
- },
- jdk => {
- prefix=> '/usr/java/latest',
- locations => [ '/usr/lib/jvm/java', '/usr/lib/jvm/default-java', '/usr/java/latest' ],
- },
- libtar => {
- prefix=> '/usr'
- },
- axis => {
- prefix=> '/usr'
- },
- log4c => {
- prefix=> '/usr'
- },
- postgresql => {
- prefix=> '/usr'
- },
- activemq => {
- prefix=>'/opt/activemq-cpp-library',
- pkg => 'activemq-cpp'
- },
-);
-
-my %jar = (
- 'jakarta-commons-codec' => '/usr/share/java/commons-codec.jar',
- 'jakarta-commons-lang' => '/usr/share/java/commons-lang.jar',
-);
-
-
-my %glite_prefix;
-my %need_externs;
-my %need_externs_type;
-my %need_jars;
-my %extrafull;
-my %extranodmod;
-my %deps;
-my %deps_type;
-my %buildroot;
-my (%etics_externs, %etics_projects);
-
-#
-# modules of the subsystems
-#
-# additional modules from $project{modules} are automatically added
-#
-my %lbmodules = (
- 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim logger-msg nagios client-devel client-progs common-devel logger-devel state-machine-devel/],
- 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin db-devel log-devel maildir-devel server-bones-devel trio-devel jp-interface-devel gss-devel gsoap-plugin-devel/],
- 'jobid' => [qw/api-c api-c-devel api-cpp api-cpp-devel api-java/],
- 'jp' => [ qw/client doc index primary server-common ws-interface/ ],
- 'gridsite' => [ qw/apache libs commands core devel slashgrid services service-clients gsexec/ ],
- 'px' => [ qw/proxyrenewal myproxy-yaim proxyrenewal-devel proxyrenewal-progs/ ],
- 'canl' => [ qw/c c-devel/ ],
- );
-
-#
-# sub-packages
-#
-# modify %lbmodules, %deps_aux, %extrafull, and %properties accodingly
-#
-my %subpackages = (
- 'jobid.api-c-devel' => 'jobid.api-c',
- 'jobid.api-cpp-devel' => 'jobid.api-cpp',
- 'lbjp-common.db-devel' => 'lbjp-common.db',
- 'lbjp-common.gsoap-plugin-devel' => 'lbjp-common.gsoap-plugin',
- 'lbjp-common.gss-devel' => 'lbjp-common.gss',
- 'lbjp-common.jp-interface-devel' => 'lbjp-common.jp-interface',
- 'lbjp-common.log-devel' => 'lbjp-common.log',
- 'lbjp-common.maildir-devel' => 'lbjp-common.maildir',
- 'lbjp-common.server-bones-devel' => 'lbjp-common.server-bones',
- 'lbjp-common.trio-devel' => 'lbjp-common.trio',
- 'lb.client-progs' => 'lb.client',
- 'lb.client-devel' => 'lb.client',
- 'lb.common-devel' => 'lb.common',
- 'lb.logger-devel' => 'lb.logger',
- 'lb.state-machine-devel' => 'lb.state-machine',
- 'px.proxyrenewal-devel' => 'px.proxyrenewal',
- 'px.proxyrenewal-progs' => 'px.proxyrenewal',
- 'canl.c-devel' => 'canl.c',
-);
-
-my @opts = (
- 'prefix:s' => \$prefix,
- 'staged=s' => \$staged,
- 'module=s' => \$module,
- 'thrflavour:s' => \$thrflavour,
- 'nothrflavour:s' => \$nothrflavour,
- 'mode=s' => \$mode,
- 'listmodules=s' => \$listmodules,
- 'version=s' => \$force_version,
- 'branch=s' => \$branch,
- 'output=s' => \$output,
- 'stage=s' => \$stagedir,
- 'root:s' => \$root,
- 'sysroot:s' => \$sysroot,
- 'sysconfdir=s' => \$sysconfdir,
- 'localstatedir=s' => \$localstatedir,
- 'lb-tag=s' => \$lb_tag,
- 'lbjp-common-tag=s' => \$lbjp_tag,
- 'jp-tag=s' => \$jp_tag,
- 'jobid-tag=s' => \$jobid_tag,
- 'canl-tag=s' => \$canl_tag,
- 'help' => \$help,
- 'libdir=s' => \$libdir,
- 'project=s' => \$project,
- 'debug' => \$debug,
-);
-
-for (@nodes) {
- $enable_nodes{$_} = 0;
- $disable_nodes{$_} = 0;
-
- push @opts,"disable-$_",\$disable_nodes{$_};
- push @opts,"enable-$_",\$enable_nodes{$_};
-}
-
-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";
-$prefix=~s/\/$//;
-$root=~s/\/$//;
-$sysroot=~s/\/$//;
-if (not $sysconfdir) { $sysconfdir = $prefix eq '/usr' ? '/etc' : "$prefix/etc"; }
-if (not $localstatedir) { $localstatedir = $prefix eq '/usr' ? '/var' : "$prefix/var"; }
-$sysconfdir=~s/\/$//;
-$localstatedir=~s/\/$//;
-
-$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq '';
-$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq '';
-$externs{'gsoapxx'}{prefix}=$externs{gsoap}{prefix} if $externs{'gsoapxx'}{prefix} eq '';
-
-$externs{'mysql-server'}{withprefix}=$externs{mysql}{withprefix} if $externs{'mysql-server'}{withprefix} eq '';
-$externs{'mysql-devel'}{wihtprefix}=$externs{mysql}{withprefix} if $externs{'mysql-devel'}{withprefix} eq '';
-$externs{'gsoapxx'}{withprefix}=$externs{gsoap}{withprefix} if $externs{'gsoapxx'}{withprefix} eq '';
-
-if ($project =~ /^([^0-9]*)(.*)$/) {
- $project = $1;
- $project_version = $2;
-}
-%project = %{$projects{$project}};
-$project_version = $project{current_version} unless $project_version;
-for my $platform (keys %{$project{etics_externs}}) {
- for $_ (keys %{$project{etics_externs}{$platform}}) {
- $etics_externs{$platform}{$_} = $project{etics_externs}{$platform}{$_};
- }
-}
-reshuffle_platforms(\%etics_externs, $project{supported_platforms});
-reshuffle_platforms(\%{$project{etics_externs_devel}}, $project{supported_platforms});
-for $_ (keys %{$project{etics_projects}}) {
- $etics_projects{$_} = $project{etics_projects}{$_};
-}
-for $_ (keys %{$project{need_externs_aux}}) {
- $need_externs_aux{$_} = $project{need_externs_aux}{$_};
-}
-for my $ext (keys %need_externs_aux) {
- for (@{$need_externs_aux{$ext}}) {
- my ($pkg, $type) =/([^:]*)(?::(.*))?/;
- $type = 'BR' unless ($type);
-
- push @{$need_externs{$ext}},$pkg;
- $need_externs_type{$ext}->{$pkg} = $type;
- }
-}
-if ($project eq 'emi') {
- $extranodmod{lb} = 'lb.emi-lb';
- $extranodmod{px} = 'px.emi-px';
-}
-for $_ (keys %{$project{modules}}) {
- push @{$lbmodules{$_}},@{$project{modules}{$_}};
-}
-
-
-if ($help) { usage(); exit 0; }
-
-if ($listmodules) {
- my $name_prefix = ($listmodules eq 'gridsite' and $project eq 'glite') ? 'org' : $project{etics_name};
- my @m;
-
- if (exists $lbmodules{$listmodules}) {
- @m = map exists $subpackages{$listmodules . '.' . $_} ? "" : "$name_prefix.$listmodules.$_",@{$lbmodules{$listmodules}};
- } else {
- if ($project eq 'emi' and $project_version == 1) {
- # no sub-packages in EMI-1
- } else {
- for my $sub (keys %subpackages) {
- push @m, $sub if ($subpackages{$sub} eq $listmodules);
- }
- }
- }
- print map $_ eq "" ? "" : "$_ ", @m;
- print "\n";
- exit 0;
-}
-
-warn "$0: --branch and --output make sense only in --mode=etics\n"
- if ($output || $branch) && $mode ne 'etics';
-
-my $en;
-for (keys %enable_nodes) { $en = 1 if $enable_nodes{$_}; }
-
-my $dis;
-for (keys %disable_nodes) { $dis = 1 if $disable_nodes{$_}; }
-
-die "--enable-* and --disable-* are mutually exclusive\n"
- if $en && $dis;
-
-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{jp}};
-
-if ($dis) {
- for (@nodes) {
- $enable_nodes{$_} = 1 unless ($disable_nodes{$_} or not $default_nodes{$_});
- }
-}
-
-if (!$en && !$dis) { for (@nodes) { $enable_nodes{$_} = 1 if ($default_nodes{$_}) } };
-
-for (keys %enable_nodes) { delete $enable_nodes{$_} unless $enable_nodes{$_}; }
-
-$stagedir = $root unless $stagedir;
-$stagedir=~s/\/$// if ($stagedir);
-
-if ($mode eq 'build') { for my $ext (keys %externs) {
- if (defined $externs{$ext} and defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; }
- elsif (defined $externs{$ext}{pkg}) {
- my ($flag, $env, $cmd, $ret);
- my $pkg = $externs{$ext}{pkg};
- my $flagname = uc $externs{$ext}{pkg};
- $flagname =~ s/-[0-9\.]*$//;
- $flagname =~ y/-\+/_X/;
-
- print "Checking $pkg ... ";
- $env = "PKG_CONFIG_PATH=$pkg_config_env$stagedir$prefix/$libdir/pkgconfig";
- $cmd = "$env pkg-config $pkg --exists >/dev/null";
- `$cmd`; $ret = $?;
- print "('$cmd' => $ret)\n" if ($debug);
- if ($ret == 0) {
- $externs{$ext}{prefix}=`$env pkg-config $pkg --variable=prefix`;
- chomp $externs{$ext}{prefix};
- print "$externs{$ext}{prefix}\n";
-
- $flag=`$env pkg-config $pkg --cflags`;
- $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag);
- $flag=`$env pkg-config $pkg --libs`;
- $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag);
- } else {
- print "(using default $externs{$ext}{prefix})\n";
- }
- print "\n" if ($debug);
- }
- elsif ($ext eq 'jdk') {
- my $jdk_prefix;
-
- print "Looking for some caffein ... ";
- if (defined $ENV{'JDK_HOME'}) {
- $jdk_prefix = $ENV{'JDK_HOME'};
- print "JDK_HOME=$jdk_prefix\n";
- } elsif (defined $ENV{'JAVA_HOME'}) {
- $jdk_prefix = $ENV{'JAVA_HOME'};
- print "JAVA_HOME=$jdk_prefix\n";
- } else {
- foreach my $i (0..$#{$externs{$ext}{locations}}) {
- if (-e $externs{$ext}{locations}[$i]) {
- $jdk_prefix=$externs{$ext}{locations}[$i];
- print "(found directory $jdk_prefix)\n";
- last;
- }
- }
- print "(using default $externs{$ext}{prefix})\n" unless ($jdk_prefix);
- }
- $externs{$ext}{prefix} = $jdk_prefix if ($jdk_prefix);
- }
-} }
-
-if ($mode eq 'build') {
- print "Writing config.status\n";
- open CONF,">config.status" or die "config.status: $!\n";
- for ('JDK_HOME', 'JAVA_HOME', 'PKG_CONFIG_PATH') {
- print CONF "$_=$ENV{$_} " if (defined $ENV{$_});
- }
- print CONF "$0 @keeparg\n";
- close CONF;
-}
-
-
-my @modules;
-my %aux;
-
-if ($module) {
-# push @modules,split(/[,.]+/,$module);
- push @modules,$module;
-}
-else {
- @modules = map(($extranodmod{$_} ? $extranodmod{$_} : 'lb.'.$_),(keys %enable_nodes));
-
- my $n;
-
- do {
- local $"="\n";
- $n = $#modules;
- push @modules,(map @{$deps{$_}},@modules);
-
- undef %aux; @aux{@modules} = (1) x ($#modules+1);
- @modules = keys %aux;
- } while ($#modules > $n);
-}
-
-@aux{@modules} = (1) x ($#modules+1);
-delete $aux{$_} for (split /,/,$staged);
-@modules = keys %aux;
-
-mode_build() if $mode eq 'build';
-mode_checkout() if $mode eq 'checkout';
-mode_etics($module) if $mode eq 'etics';
-
-sub mode_build {
- print "\nBuilding modules: @modules\n";
- print "Mode: "; print $module ? "single module" : "multiple modules"; print "\n";
-
- my @ext = map @{$need_externs{$_}},@modules;
- my @myjars = map @{$need_jars{$_}},@modules;
- undef %aux; @aux{@ext} = 1;
- @ext = keys %aux;
- undef %aux; @aux{@myjars} = (1) x ($#myjars+1);
- @myjars = keys %aux;
-
- print "\nRequired externals:\n";
- print "\t$_: ".($externs{$_}{prefix}?$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;
-
- if ($module) {
- print "Not creating summary Makefile\n" if $debug;
- } else {
- print "Creating Makefile\n";
-
- open MAK,">Makefile" or die "Makefile: $!\n";
-
- print MAK "all: @modules\n\n";
- print MAK "stage: ".(join '-stage ', @modules)."-stage\n\n";
- print MAK "clean check install:\n";
-
- for (@modules) {
- my $full = full($_);
- print MAK "\tcd $full/$buildroot{$_} && \${MAKE} \$@\n"
- }
-
- print MAK "\ndistclean:\n";
-
- for (@modules) {
- my $full = full($_);
- print MAK $buildroot{$_} eq '' ?
- "\tcd $full && \${MAKE} distclean\n" :
- "\trm -rf $full/$buildroot{$_}\n"
- }
-
- print MAK "\n";
-
- for (@modules) {
- my %ldeps; undef %ldeps;
- @ldeps{@{$deps{$_}}} = 1;
- for my $x (split /,/,$staged) { delete $ldeps{$x}; }
- my @dnames = $module ? () : keys %ldeps;
- my $snames = $#dnames == -1 ? '' : join('-stage ', @dnames).'-stage';
-
- my $full = full($_);
- my $build = $buildroot{$_};
-
- print MAK "$_: @dnames\n\tcd $full/$build && \${MAKE} && \${MAKE} install\n\n";
- print MAK "$_-stage: $snames\n\tcd $full/$build && \${MAKE} && \${MAKE} stage\n\n";
- }
-
- close MAK;
- }
-}
-
-sub mode_checkout() {
- for (@modules) {
- my $module = $_;
- my $tag = "";
- if ($lb_tag){
- for (@{$lbmodules{lb}}){
- if ("lb.".$_ eq $module){
- $tag = '-r '.$lb_tag;
- }
- }
- }
- if ($lbjp_tag) {
- for (@{$lbmodules{'lbjp-common'}}){
- if ("lbjp-common.".$_ eq $module){
- $tag = '-r '.$lbjp_tag;
- }
- }
- }
- if ($jp_tag){
- for (@{$lbmodules{'jp'}}){
- if ("jp.".$_ eq $module){
- $tag = '-r '.$jp_tag;
- }
- }
- }
- if ($jobid_tag){
- for (@{$lbmodules{jobid}}){
- if ("jobid.".$_ eq $module){
- $tag = '-r '.$jobid_tag;
- }
- }
- }
- if ($canl_tag) {
- for (@{$lbmodules{'canl'}}){
- if ("canl.".$_ eq $module){
- $tag = '-r '.$canl_tag;
- }
- }
- }
- #if (grep {"lb.".$_ eq $module} @{$lbmodules{lb}}){
- # print "found";
- #}
- $_ = full($_);
- print "\n*** Checking out $_\n";
- system("cvs checkout $tag $_") == 0 or die "cvs checkout $tag $_: $?\n";
- }
-}
-
-BEGIN{
-%etics_externs = (
- default => {
- 'myproxy-devel'=>'myproxy-devel',
- 'myproxy-server'=>'myproxy-server',
- 'myproxy-admin'=>'myproxy-admin',
- cares=>'c-ares',
- utiljava=>'org.glite.security.util-java',
- gpt=>'gpt',
- fetchcrl=>'fetch-crl',
- activemq=>'activemq-cpp-library',
- },
-);
-
-%etics_projects = (
-);
-
-%need_externs_aux = (
- 'lb.client' => [ qw/cppunit:B classads libtool:B globus:B/ ],
- 'lb.common' => [ qw/expat cares:B cppunit:B classads libtool:B globus:B/ ],
- 'lb.doc' => [ qw/tetex-latex:B/ ],
- 'lb.logger' => [ qw/cppunit:B libtool:B globus:B/ ],
- 'lb.logger-msg' => [ qw/cppunit:B activemq libtool:B globus:B/ ],
- 'lb.nagios' => [ qw/globus_proxy_utils:R/ ],
- 'lb.server' => [ qw/globus_essentials:R globus:B expat cares mysql-server:R cppunit:B gsoap:B classads voms:B lcas gridsite:B bison:B libtool:B libxml2 flex:B/ ],
- 'lb.state-machine' => [ qw/classads libtool:B libxslt:B expat:B globus:B/ ],
- 'lb.utils' => [ qw/cppunit:B libtool:B globus:B/ ],
- 'lb.ws-interface' => [ qw/libxslt:B tidy:B/ ],
- 'lb.ws-test' => [ qw/gsoap:B libtool:B globus:B/ ],
- 'lb.types' => [ qw// ],
- 'lb.harvester' => [ qw/docbook-utils:B libtool:B globus:B/ ],
- 'lbjp-common.db' => [ qw/mysql-devel:B postgresql:B cppunit:B log4c:B libtool:B/ ],
- 'lbjp-common.log' => [ qw/log4c libtool:B/ ],
- 'lbjp-common.maildir' => [ qw/libtool:B/ ],
- 'lbjp-common.server-bones' => [ qw/libtool:B/ ],
- 'lbjp-common.trio' => [ qw/cppunit:B libtool:B/ ],
- 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B libtool:B/ ],
- 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B libtool:B/ ],
- 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap gsoapxx libtool:B/ ],
- 'jobid.api-c' => [ qw/cppunit:B libtool:B openssl:B/ ],
- 'jobid.api-cpp' => [ qw/cppunit:B libtool:B/ ],
- 'jobid.api-java' => [ qw/ant:B jdk:B/ ],
- 'jp.client' => [ qw/gsoap libtar globus_essentials:R globus:B/ ],
- 'jp.doc' => [],
- 'jp.index' => [ qw/gsoap globus_essentials:R globus:B mysql-server:R/ ],
- 'jp.primary' => [ qw/classads gsoap libtar globus_essentials:R globus:B mysql-server:R/ ],
- 'jp.server-common' => [],
- 'jp.ws-interface' => [],
- 'gridsite.core' => [ qw/httpd-devel:B gsoap:B globus:B curl:B doxygen:B fuse-devel:B libxml2:B openssl:B doxygen:B/ ],
- 'gridsite.commands' => [ qw/curl:R openssl:R/ ],
- 'gridsite.apache' => [ qw/libxml2:R openssl:R curl:R/ ],
- 'gridsite.libs' => [ qw/libxml2:R openssl:R/ ],
- 'gridsite.devel' => [ qw// ],
- 'gridsite.slashgrid' => [ qw/curl:R fuse:R/],
- 'gridsite.services' => [ qw/curl:R gsoap:R/ ],
- 'gridsite.service-clients' => [ qw/curl:R gsoap:R gsoapxx:R/ ],
- 'gridsite.gsexec' => [ qw// ],
- 'gridsite.1.5-compat' => [ qw/httpd-devel:B gsoap:B globus:B curl:B doxygen:B fuse-devel:B libxml2:B openssl:B doxygen:B/ ],
- 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-devel:B voms:B libtool:B/ ],
- 'px.myproxy-config' => [ qw/myproxy-admin:R/ ], # in myproxy-config.spec
- 'canl.c' => [ qw/cares:B openssl:B libtool:B bison:B flex:B krb5-devel:B/ ],
-);
-
-%need_jars = (
- 'jobid.api-java' => [ qw/jakarta-commons-codec/ ],
- 'lb.client-java' => [ qw/jakarta-commons-lang/ ],
-);
-
-for my $jar (keys %need_jars) {
- for (@{$need_jars{$jar}}) {
- $need_externs_type{$jar}->{$_} = 'BR'; # XXX
- }
-}
-
-%deps_aux = (
- 'lb.client' => [ qw/
- lb.types:B lb.common
- lbjp-common.trio
- jobid.api-cpp:B jobid.api-c
- lbjp-common.gss
- / ],
- 'lb.client-java' => [ qw/
- lb.types:B
- lb.ws-interface:B
- jobid.api-java
- / ],
- 'lb.common' => [ qw/
- jobid.api-cpp:B jobid.api-c
- lb.types:B lbjp-common.trio lbjp-common.gss
- / ],
- 'lb.doc' => [ qw/lb.types:B/ ],
- 'lb.logger' => [ qw/
- lbjp-common.trio
- lbjp-common.log
- jobid.api-c
- lb.common
- lbjp-common.gss
- / ],
- 'lb.logger-msg' => [ qw/
- lb.logger:B
- / ],
- 'lb.nagios' => [ qw/
- lb.client:R
- lb.ws-test:R
- lb.utils:R
- / ],
- 'lb.server' => [ qw/
- lb.ws-interface lb.types:B lb.common lb.state-machine lb.utils:R
- lbjp-common.db lbjp-common.server-bones lbjp-common.trio lbjp-common.maildir lbjp-common.log
- jobid.api-c
- lbjp-common.gsoap-plugin lbjp-common.gss
- / ],
- 'lb.state-machine' => [ qw/lb.types:B lb.common lbjp-common.jp-interface lbjp-common.gss/ ],
- 'lb.utils' => [ qw/
- lbjp-common.jp-interface
- jobid.api-c
- lbjp-common.trio lbjp-common.maildir
- lb.client lb.state-machine lb.types:B
- / ],
- 'lb.ws-test' => [ qw/lbjp-common.gsoap-plugin lb.ws-interface/ ],
- 'lb.ws-interface' => [ qw/lb.types:B/ ],
- 'lb.types' => [ qw// ],
- 'lb.harvester' => [ qw/
- jobid.api-c lbjp-common.trio lbjp-common.db lb.common lb.client
- lbjp-common.gss lbjp-common.log
- / ],
- 'lb.yaim' => [ qw// ],
- 'lb.glite-LB' => [ qw/
- lb.logger:R lb.server:R lb.utils:R lb.doc:R
- lb.ws-test:R lb.harvester:R lb.yaim:R lb.client-java:R
- lb.logger-msg:R
- / ],
- 'lb.emi-lb' => [ qw/
- lb.logger:R lb.server:R lb.utils:R lb.doc:R
- lb.ws-test:R lb.harvester:R lb.yaim:R lb.client-java:R
- lb.logger-msg:R
- / ],
- 'lbjp-common.db' => [ qw/lbjp-common.trio lbjp-common.log/ ],
- 'lbjp-common.maildir' => [ qw// ],
- 'lbjp-common.log' => [ qw// ],
- 'lbjp-common.server-bones' => [ qw/lbjp-common.log/ ],
- 'lbjp-common.trio' => [ qw// ],
- 'lbjp-common.gss' => [ qw// ],
- 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ],
- 'jobid.api-c' => [ qw// ],
- 'jobid.api-cpp' => [ qw/jobid.api-c/ ],
- 'jobid.api-java' => [ qw// ],
-
- 'lbjp-common.jp-interface' => [ qw/lbjp-common.trio lbjp-common.db jobid.api-c/ ],
-
- 'jp.client' => [ qw/
- jp.ws-interface
- lbjp-common.jp-interface lbjp-common.maildir
- jobid.api-c
- lbjp-common.gsoap-plugin
- / ],
- 'jp.doc' => [ qw// ],
- 'jp.index' => [ qw/
- jp.server-common jp.ws-interface
- lbjp-common.jp-interface lbjp-common.trio lbjp-common.db lbjp-common.server-bones
- lbjp-common.gsoap-plugin
- / ],
- 'jp.primary' => [ qw/
- jobid.api-c
- jp.server-common jp.ws-interface
- lb.state-machine
- lbjp-common.jp-interface lbjp-common.trio lbjp-common.db lbjp-common.server-bones
- lbjp-common.gsoap-plugin
- / ],
- 'jp.server-common' => [ qw/
- lbjp-common.jp-interface lbjp-common.db
- / ],
- 'jp.ws-interface' => [ qw// ],
-
- 'gridsite.core' => [ qw// ],
- 'gridsite.commands' => [ qw/gridsite.core:B/ ],
- 'gridsite.apache' => [ qw/gridsite.core:B/ ],
- 'gridsite.libs' => [ qw/gridsite.core:B / ],
- 'gridsite.devel' => [ qw/gridsite.core:B/ ],
- 'gridsite.slashgrid' => [ qw/gridsite.core:B/],
- 'gridsite.services' => [ qw/gridsite.core:B/ ],
- 'gridsite.service-clients' => [ qw/gridsite.core:B/ ],
- 'gridsite.gsexec' => [ qw/gridsite.core:B/ ],
-
- 'px.proxyrenewal' => [ qw// ],
- 'px.glite-PX' => [qw/px.myproxy-yaim:R/],
- 'px.emi-px' => [qw/px.myproxy-yaim:R/],
- 'px.myproxy-yaim' => [ qw// ],
- 'px.myproxy-config' => [],
-
- 'canl.c' => [],
-
- # sub-packages (virtual ETICS components depending on the main)
- 'jobid.api-c-devel' => [ qw/jobid.api-c:B/ ],
- 'jobid.api-cpp-devel' => [ qw/jobid.api-cpp:B/ ],
- 'lbjp-common.db-devel' => [ qw/lbjp-common.db:B/ ],
- 'lbjp-common.gsoap-plugin-devel' => [ qw/lbjp-common.gsoap-plugin:B/ ],
- 'lbjp-common.gss-devel' => [ qw/lbjp-common.gss:B/ ],
- 'lbjp-common.jp-interface-devel' => [ qw/lbjp-common.jp-interface:B/ ],
- 'lbjp-common.log-devel' => [ qw/lbjp-common.log:B/ ],
- 'lbjp-common.maildir-devel' => [ qw/lbjp-common.maildir:B/ ],
- 'lbjp-common.server-bones-devel' => [ qw/lbjp-common.server-bones:B/ ],
- 'lbjp-common.trio-devel' => [ qw/lbjp-common.trio:B/ ],
- 'lb.client-progs' => [ qw/lb.client:B/ ],
- 'lb.client-devel' => [ qw/lb.client:B/ ],
- 'lb.common-devel' => [ qw/lb.common:B/ ],
- 'lb.logger-devel' => [ qw/lb.logger:B/ ],
- 'lb.state-machine-devel' => [ qw/lb.state-machine:B/ ],
- 'px.proxyrenewal-devel' => [ qw/px.proxyrenewal:B/ ],
- 'px.proxyrenewal-progs' => [ qw/px.proxyrenewal:B/ ],
- 'canl.c-devel' => [ qw/canl.c:B/ ],
-);
-
-for my $ext (keys %deps_aux) {
- for (@{$deps_aux{$ext}}) {
- /([^:]*)(?::(.*))?/;
- push @{$deps{$ext}},$1;
- my $type = $2 ? $2 : 'BR';
- $deps_type{$ext}->{$1} = $type;
- }
-}
-
-
-%extrafull = (
- gridsite=>'org.gridsite.core',
- 'canl.c' => 'emi.canl.canl-c',
- 'canl.c-devel' => 'emi.canl.canl-c',
- 'jobid.api-c-devel' => 'org.glite.jobid.api-c',
- 'jobid.api-cpp-devel' => 'org.glite.jobid.api-cpp',
- 'lbjp-common.db-devel' => 'org.glite.lbjp-common.db',
- 'lbjp-common.gsoap-plugin-devel' => 'org.glite.lbjp-common.gsoap-plugin',
- 'lbjp-common.gss-devel' => 'org.glite.lbjp-common.gss',
- 'lbjp-common.jp-interface-devel' => 'org.glite.lbjp-common.jp-interface',
- 'lbjp-common.log-devel' => 'org.glite.lbjp-common.log',
- 'lbjp-common.maildir-devel' => 'org.glite.lbjp-common.maildir',
- 'lbjp-common.server-bones-devel' => 'org.glite.lbjp-common.server-bones',
- 'lbjp-common.trio-devel' => 'org.glite.lbjp-common.trio',
- 'lb.client-devel' => 'org.glite.lb.client',
- 'lb.client-progs' => 'org.glite.lb.client',
- 'lb.common-devel' => 'org.glite.lb.common',
- 'lb.logger-devel' => 'org.glite.lb.logger',
- 'lb.state-machine-devel' => 'org.glite.lb.state-machine',
- 'px.proxyrenewal-devel' => 'org.glite.px.proxyrenewal',
- 'px.proxyrenewal-progs' => 'org.glite.px.proxyrenewal',
-);
-
-#( java => 'client-java' );
-%extranodmod = (
- db => 'lbjp-common.db',
- jpprimary => 'jp.primary',
- jpindex => 'jp.index',
- jpclient => 'jp.client',
- lb => 'lb.glite-LB',
- px => 'px.glite-PX',
- proxyrenewal => 'px.proxyrenewal',
- canl => 'canl.c',
-);
-
-%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/ ],
-);
-
-%conflicts = (
-);
-
-%provides = (
- 'lbjp-common.gss' => [ qq/glite-security-gss/ ],
- 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ],
- 'lb.nagios' => [ qq/glite-lb-nagios-plugins/ ],
-);
-
-%cvs_prefix = (
- 'lb' => 'org.glite',
- 'jp' => 'org.glite',
- 'jobid' => 'org.glite',
- 'lbjp-common' => 'org.glite',
- 'gridsite' => 'org',
- 'px' => 'org.glite',
- 'canl' => 'emi',
-);
-
-%cvs_tag_prefix = (
- 'lb' => 'glite-',
- 'jp' => 'glite-',
- 'jobid' => 'glite-',
- 'lbjp-common' => 'glite-',
- 'gridsite' => '',
- 'px' => 'glite-',
- 'canl' => 'emi-',
-);
-
-# ==== projects specification ====
-# etics_name ........... ETICS project name
-# conf_prefix .......... ETICS configurations name prefix
-# tag_prefix ........... VCS tag prefix
-# local_prefix ......... prefix (relative to stage)
-# etics_externs ........ ETICS modules names of externals
-# (${NAME.location}, ETICS conf. dependencies)
-# etics_projects ....... ETICS project names of externals
-# etics_externs_devel .. ETICS modules names of devel versions of externals
-# etics_locations ...... ETICS locations in ${NAME.location} properties
-# need_externs_aux ..... project-specific external dependencies
-# supported_platforms .. platforms supported by the project
-# modules .............. additional modules in subsystems
-%projects = (
- glite => {
- current_version => 3,
- etics_name => 'org.glite',
- conf_prefix => { %cvs_tag_prefix },
- tag_prefix => { %cvs_tag_prefix },
- flavours => '--thrflavour=${globus.thr.flavor} --nothrflavour=${globus.nothr.flavor}',
- local_prefix => '',
- etics_externs => {
- default => {
- globus_essentials=>'vdt_globus_essentials',
- globus=>'globus',
- globus_proxy_utils=>'vdt_globus_essentials',
- gridsite=>'org.gridsite.libs',
- yaim_core=>'org.glite.yaim.core',
- gip_release=>'glite-info-provider-release',
- gip_service=>'glite-info-provider-service',
- bdii=>'bdii',
- glite_version=>'glite-version',
- glite_info_templates=>'glite-info-templates',
- glue_schema=>'glue-schema',
- trustmanager=>'org.glite.security.trustmanager',
- axis=>'axis',
- lcas=>'org.glite.security.lcas',
- gsoapxx=>'-',
- jdk=>'jdk',
- voms=>'org.glite.security.voms-api-cpp',
- },
- },
- etics_externs_devel => {
- default => {
- gridsite=>'org.gridsite.devel',
- voms=>'org.glite.security.voms-api',
- },
- },
- etics_projects => {
- vdt=>[qw/globus globus_essentials globus_proxy_utils gpt/],
- 'org.glite'=>[qw/voms gridsite lcas gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/],
- },
- etics_locations => {
- '*' => '',
- },
- need_externs_aux => {
- 'lb.client-java' => [ qw/ant:B jdk:B axis:B trustmanager utiljava libtool:B/ ],
- 'lb.glite-LB' => [ qw/fetchcrl:R gpt:R gip_release:R gip_service:R bdii:R glite_version:R glite_info_templates:R glue_schema:R/ ],
- 'lb.yaim' => [ qw/yaim_core:R/ ],
- 'px.glite-PX' => [qw/myproxy-server:R myproxy-admin:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/],
- 'px.myproxy-yaim' => [ qw/yaim_core:R/ ],
- },
- supported_platforms => {
- sl5_x86_64_gcc412 => 1,
- sl5_ia32_gcc412 => 1,
- deb5_x86_64_gcc432 => 1,
- deb5_ia32_gcc432 => 1,
- slc4_x86_64_gcc346 => 1,
- slc4_ia32_gcc346 => 1,
- },
- modules => {
- 'lb' => [ qw/glite-LB/ ],
- 'px' => [ qw/glite-PX/ ],
- },
- },
-
- emi => {
- current_version => 2,
- etics_name => 'emi',
- conf_prefix => {
- 'lb' => 'emi-',
- 'jp' => 'emi-',
- 'jobid' => 'emi-',
- 'lbjp-common' => 'emi-',
- 'gridsite' => 'emi-',
- 'px' => 'emi-',
- 'canl' => 'emi-',
- },
- tag_prefix => { %cvs_tag_prefix },
- flavours => '--thrflavour= --nothrflavour=',
- local_prefix => '/usr',
- etics_externs => {
- default => {
- globus_essentials=>'globus-gssapi-gsi',
- globus=>'globus-gssapi-gsi-devel',
- globus_proxy_utils=>'globus-proxy-utils',
- gridsite=>'emi.gridsite.libs',
- yaim_core=>'emi.yaim.yaim-core',
- yaim_bdii=>'emi.bdii.yaim-bdii',
- gip_service=>'emi.bdii.glite-info-provider-service',
- bdii=>'emi.bdii.core',
- glite_version=>'emi.emi-version',
- glue_schema=>'emi.bdii.glue-schema',
- trustmanager=>'emi.java-security.trustmanager',
- trustmanager_axis=>'emi.java-security.trustmanager-axis',
- axis=>'axis1.4',
- lcas=>'emi.sac.lcas',
- gsoapxx=>'-',
- jdk=>'java',
- voms => 'emi.voms.voms-api',
- },
- sl5_x86_64_gcc412EPEL => {
- 'myproxy-devel' => 'myproxy-devel.x86_64',
- },
- sl6_x86_64_gcc446EPEL => {
- 'myproxy-devel' => 'myproxy-devel.x86_64',
- },
- deb6_x86_64_gcc445 => {
- axis => 'axis1.4',
- # mappings in ETICS project configuration
- #globus_essentials => 'libglobus-gssapi-gsi4',
- #globus => 'libglobus-gssapi-gsi-dev',
- #axis => 'libaxis-java',
- #cares => 'libc-ares2',
- #cppunit => 'libcppunit',
- #expat => 'libexpat1',
- #log4c => 'liblog4c3',
- #curl => 'libcurl3',
- #'mysql' => 'libmysqlclient16',
- #'mysql-devel' => 'libmysqlclient-dev',
- #libxslt => 'xsltproc',
- #'jakarta-commons-codec' => 'libcommons-codec-java',
- #'jakarta-commons-lang' => 'libcommons-lang-java',
- #'tetex-latex' => 'texlive-latex-extra',
- #'perl-LDAP' => 'libnet-ldap-perl',
- #'fuse-lib' => 'libfuse2',
- #'fuse' => 'fuse-utils',
- },
- },
- etics_externs_devel => {
- default => {
- cares => 'c-ares-devel',
- classads => 'classads-devel',
- cppunit => 'cppunit-devel',
- expat => 'expat-devel',
- gsoap => 'gsoap-devel',
- voms => 'emi.voms.voms-api-devel',
- libtar => 'libtar-devel',
- log4c => 'log4c-devel',
- postgresql => 'postgresql-devel',
- curl => 'curl-devel',
- libxml2 => 'libxml2-devel',
- openssl => 'openssl-devel',
- gridsite=>'emi.gridsite.devel',
- jdk=>'java-devel',
- },
- deb6_x86_64_gcc445 => {
- # mappings in ETICS project configuration
- #cares => 'libc-ares-dev',
- #cppunit => 'libcppunit-dev',
- #expat => 'libexpat1-dev',
- #libtar => 'libtar-dev',
- #log4c => 'liblog4c-dev',
- #postgresql => 'libpq-dev',
- #curl => 'libcurl4-openssl-dev',
- #libxml2 => 'libxml2-dev',
- #openssl => 'libssl-dev',
- #'tetex-latex' => 'texlive-latex-extra',
- #libxslt=>'xsltproc',
- #'httpd-devel' => 'apache2-prefork-dev',
- #'fuse-devel' => 'libfuse-dev',
- #gsoap => 'gsoap',
- #'krb5-devel' => 'libkrb5-dev',
- },
- },
- etics_projects => {
- 'emi'=>[qw/voms voms-devel gridsite lcas gip_service bdii glite_version glue_schema yaim_core yaim_bdii trustmanager trustmanager_axis/],
- },
- etics_locations => {
- axis => 'axis',
- },
- need_externs_aux => {
- 'lb.client-java' => [ qw/ant:B jdk:B axis:B trustmanager trustmanager_axis libtool:B/ ],
- 'lb.emi-lb' => [ qw/fetchcrl:R gip_service:R bdii:R glite_version:R glue_schema:R/ ],
- 'lb.yaim' => [ qw/yaim_core:R yaim_bdii:R/ ],
- 'px.emi-px' => [qw/myproxy-server:R myproxy-admin:R fetchcrl:R gip_service:R bdii:R glite_version:R glue_schema:R/],
- 'px.myproxy-yaim' => [ qw/yaim_core:R yaim_bdii:R/ ],
- },
- supported_platforms => {
- sl5_x86_64_gcc412EPEL => 1,
- sl5_ia32_gcc412EPEL => 1,
- sl6_x86_64_gcc446EPEL => 1,
- deb6_x86_64_gcc445 => 1,
- },
- modules => {
- 'lb' => [ qw/emi-lb/ ],
- 'px' => [ qw/emi-px/ ],
- },
- },
-);
-
-%platform_properties = (
- 'jobid.api-java' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.types' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.doc' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.ws-interface' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.yaim' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.nagios' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'px.yaim' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'px.myproxy-config' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'gridsite.devel' => {
- default => { 'packageName' => 'gridsite-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libgridsite-dev' },
- },
- 'canl.c-devel' => {
- default => { 'packageName' => 'canl-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libcanl-dev' },
- },
- 'jobid.api-c-devel' => {
- default => { 'packageName' => 'glite-jobid-api-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-jobid-dev' },
- },
- 'jobid.api-cpp-devel' => {
- default => { 'packageName' => 'glite-jobid-api-cpp-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-jobid-cpp-dev' },
- },
- 'lbjp-common.db-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-db-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-db-dev' },
- },
- 'lbjp-common.gsoap-plugin-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-gsoap-plugin-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-gsoap-plugin-dev' },
- },
- 'lbjp-common.gss-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-gss-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-gss-dev' },
- },
- 'lbjp-common.jp-interface-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-jp-interface-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-jp-interface-dev' },
- },
- 'lbjp-common.log-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-log-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-log-dev' },
- },
- 'lbjp-common.maildir-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-maildir-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-maildir-dev' },
- },
- 'lbjp-common.server-bones-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-server-bones-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-server-bones-dev' },
- },
- 'lbjp-common.trio-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-trio-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-trio-dev' },
- },
- 'lb.client-devel' => {
- default => { 'packageName' => 'glite-lb-client-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-client-dev' },
- },
- 'lb.common-devel' => {
- default => { 'packageName' => 'glite-lb-common-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-common-dev' },
- },
- 'lb.state-machine-devel' => {
- default => { 'packageName' => 'glite-lb-state-machine-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-state-machine-dev' },
- },
- 'lb.logger-devel' => {
- default => { 'packageName' => 'glite-lb-logger-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-logger-dev' },
- },
- 'px.proxyrenewal-devel' => {
- default => { 'packageName' => 'glite-px-proxyrenewal-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-security-proxyrenewal-dev' },
- },
- 'canl.c-devel' => {
- default => { 'packageName' => 'canl-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libcanl-c-dev' },
- },
-);
-
-my @k = keys %deps_aux;
-@buildroot{@k} = ('') x ($#k+1);
-
-$buildroot{'gridsite.core'} = 'src';
-}
-
-sub full
-{
- my ($short) = @_;
- my $subsys = $short;
- $subsys =~ s/\..*//;
-
- my $cvs_prefix = exists $cvs_prefix{$subsys} ? $cvs_prefix{$subsys} : 'org.glite';
- return $extrafull{$short} ? $extrafull{$short} : "$cvs_prefix.$short";
-}
-
-sub get_version
-{
- my ($fmod, $top_srcdir) = @_;
-
- my ($subsys,$mod) = split /\./,$fmod,2;
- my ($major,$minor,$rev,$age);
- my $old_;
-
- if ($force_version) {
- $force_version =~ /([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)-(.+)/;
- ($major,$minor,$rev,$age) = ($1,$2,$3,$4);
- }
- else {
- my $path = "$top_srcdir/project";
- if ($subsys eq 'gridsite') {
- $path = "$cvs_prefix{$subsys}.$subsys.core/project";
- }
- open V,"$path/version.properties"
- or die "$path/version.properties: $!\n";
-
- $old_ = $_;
- while (<V>) {
- chomp;
- ($major,$minor,$rev) = ($1,$2,$3) if /module\.version\s*=\s*([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/;
- $age = $1 if /module\.age\s*=\s*([[:digit:]]+)/;
- }
- close V;
- $_ = $old_;
- }
- $version = "$major.$minor.$rev-$age";
-
- return ($major, $minor, $rev, $age);
-}
-
-sub get_description
-{
- my ($top_srcdir) = @_;
-
- my $cvs_module = $top_srcdir;
- my $package_description = "";
- my $package_summary = "";
-
- if (-e "$cvs_module/project/package.description") {
- open V, "$cvs_module/project/package.description";
- $package_description = join ("", <V>);
- close V;
- chomp $package_description;
- }
- else {
- print STDERR "package.description not found for $subsys.$module!\n"; }
-
- if (-e "$cvs_module/project/package.summary") {
- open V, "$cvs_module/project/package.summary";
- $package_summary = join ("", <V>);
- close V;
- chomp $package_summary;
- $package_summary =~ s/\n/\\n/g;
- }
- else {
- print STDERR "package.summary not found for $subsys.$module!\n"; }
-
- return ($package_summary, $package_description);
-}
-
-sub mkinc
-{
- my %aux;
- undef %aux;
- my @m=qw/
-lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.nagios lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lb.emi-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
-px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config px.emi-px
-canl.c
-/;
- @aux{@m} = (1) x ($#m+1);
-
- my ($short) = @_;
- my $full = full $short;
- my ($subsys,$mod) = split /\./,$short,2;
- my $packageName = "$project{tag_prefix}{$subsys}$subsys-${mod}";
-
- unless ($aux{$short}) {
- print "Makefile.inc not needed in $full\n";
- return;
- }
-
- my $top_srcdir = '.';
- my $abs_srcdir = '';
- my $build = '';
-
- if ($module) {
- $top_srcdir = $0;
- $top_srcdir =~ s,/?[^/]*$,,;
- $abs_srcdir = $top_srcdir;
- $top_srcdir =~ s,^$,\.,;
- } else {
- $build = "$full/";
- $abs_srcdir = "$full/";
- unless ($buildroot{$_} eq '') {
- $top_srcdir = '..';
- $build .= "$buildroot{$_}/";
- unless (-d "$build") {
- mkdir "$build" or die "mkdir $build: $!\n";
- }
- }
- }
-
- my ($major, $minor, $rev, $age) = get_version $short, $abs_srcdir;
- my ($package_summary, $package_description) = get_description $abs_srcdir;
- if ($package_description) { $package_description =~ s/(.{1,78}\S|\S+)\s+/$1\n/mg; }
- my $package_description_debian = $package_description;
- $package_description_debian =~ s/^/ /mg;
-
- my ($old_locale, $specdate, $debdate);
-
- # files for ETICS always in root source directory
- mkdir $abs_srcdir."project" unless (-d $abs_srcdir."project");
- open PKGCHL,">".$abs_srcdir."project/changelog"
- or die $abs_srcdir."project/changelog: $!\n";
- $old_locale = setlocale(LC_TIME);
- setlocale(LC_TIME, "C");
- $specdate = strftime("%a %b %d %Y", gmtime());
- $debdate = strftime("%a, %d %b %Y %H:%M:%S %z", gmtime());
- setlocale(LC_TIME, $old_locale);
- print PKGCHL qq{* $specdate CESNET team <emi-lb\@metacentrum.cz>
-- automatically generated package
-};
- close PKGCHL;
-
- unless ($top_srcdir eq '.') {
- unlink $build."Makefile";
- symlink "$top_srcdir/Makefile",$build."Makefile" or die "symlink $top_srcdir/Makefile ".$build."Makefile: $!\n";
- }
-
- open MKINC,">".$build."Makefile.inc"
- or die $build."Makefile.inc: $!\n";
-
- print "Creating ".$build."Makefile.inc\n";
-
- print MKINC qq{project = $project
-PREFIX = $root
-prefix = $prefix
-stagedir = $stagedir
-sysroot = $sysroot
-sysconfdir = $sysconfdir
-localstatedir = $localstatedir
-thrflavour = $thrflavour
-nothrflavour = $nothrflavour
-libdir = $libdir
-top_srcdir = $top_srcdir
-};
-
- for (@{$need_externs{$short}}) {
- next unless defined $externs{$_} and defined $externs{$_}{prefix};
- print MKINC "${_}_prefix = $externs{$_}{prefix}\n";
- print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags};
- }
-
- for (@{$need_jars{$short}}) {
- print MKINC "${_}_jar = $jar{$_}\n"
- }
-
- my $need_gsoap = 0;
- for (@{$need_externs{$short}}) { $need_gsoap = 1 if $_ eq 'gsoap'; }
-
- print MKINC "gsoap_default_version=".gsoap_version()."\n" if $need_gsoap;
-
- close MKINC;
-
- my $dh;
- my $debian = 0;
-
- opendir $dh, "$abs_srcdir/project" || die "Can't open $abs_srcdir/project: $!";
- for my $dir (readdir $dh) {
- if ($dir=~/^(.*)\.spec$/) {
- if ($1 ne $packageName) {
- printf STDERR "Changed RPM name: $packageName --> $1\n" if ($debug);;
- $packageName=$1;
- }
- last;
- }
- }
- closedir $dh;
-
- for my $file ("$packageName.spec", "debian.rules", "debian.control", "debian.changelog", "debian.copyright") {
- if (-f "$abs_srcdir/project/$file") {
- my $old_ = $_;
- printf STDERR "Creating $build$file\n" if ($debug);;
- open DST, ">$build$file";
- open SRC, "<$abs_srcdir/project/$file";
- while (<SRC>) {
- if (/\@MODULE\@/) { s/\@MODULE\@/$full/g; }
- if (/\@URL\@/) { s/\@URL\@/$package{url}/g; }
- if (/\@SUMMARY\@/) { s/\@SUMMARY\@/$package_summary/g; }
- if (/\@DESCRIPTION\@/) { s/\@DESCRIPTION\@/$package_description/g; }
- if (/\@DEBIAN_DESCRIPTION\@/) { s/\@DEBIAN_DESCRIPTION\@/$package_description_debian/g; }
- if (/\@VERSION\@/) { s/\@VERSION\@/$version/g; }
- if (/\@MAJOR\@/) { s/\@MAJOR\@/$major/g; }
- if (/\@MINOR\@/) { s/\@MINOR\@/$minor/g; }
- if (/\@REVISION\@/) { s/\@REVISION\@/$rev/g; }
- if (/\@AGE\@/) { s/\@AGE\@/$age/g; }
- if (/\@MAINTAINER\@/) { s/\@MAINTAINER\@/$package{maintainer}/g; }
- if (/\@UPLOADERS\@/) { s/\@UPLOADERS\@/$package{uploaders}/g; }
- if (/\@DEBIAN_VCS\@/) { s/\@DEBIAN_VCS\@/$package{debian_vcs}/g; }
- if (/\@DEBIAN_DATE\@/) { s/\@DEBIAN_DATE\@/$debdate/g; }
- if (/\@SPEC_DATE\@/) { s/\@SPEC_DATE\@/$specdate/g; }
- if (/^\s*.+\/configure\s/ and $force_version) {
- print "Version forced to $version\n" if ($debug);;
- s/--version\s+\S+\s?//;
- s/$/ --version $version/;
- }
- printf DST "%s", "$_";
- }
- close SRC;
- close DST;
- $_ = $old_;
- }
- }
-
- print "Creating ${build}debian/\n" if ($debug);;
-
- `rm -rfv ${build}debian`;
- mkdir $build."debian" or die $!;
- `cp $abs_srcdir/project/debian.* ${build}debian/ 2>/dev/null`;
- `mv ${build}debian.* ${build}debian/ 2>/dev/null`;
- `rm -f ${build}debian/*.orig`;
- opendir $dh, "${build}debian" || die "Can't open ${build}debian: $!";
- for $_ (readdir $dh) {
- if (/^debian\.(.*)/) {
- `mv ${build}debian/$_ ${build}debian/$1`;
- $debian = 1;
- }
- }
- closedir $dh;
-
- if ($debian) {
- my ($dir, $file);
-
- chmod 0755, "${build}debian/rules";
- $file="${build}debian/docs"; if (not -f $file) { `touch $file`; }
- $dir="${build}debian/source"; if (not -d $dir) { mkdir $dir; }
- $file="${build}debian/source/format"; if (not -f $file) { `echo "3.0 (quilt)" > $file` }
- $file="${build}debian/compat"; if (not -f $file) { `echo "7" > $file` }
- $file="${build}debian/changelog"; if (not -f $file) {
- open FH, ">$file" or die $!;
- print FH qq{$packageName ($major.$minor.$rev-$age) unstable; urgency=low
-
- * Automatically generated package
-
- -- $package{maintainer} $debdate
-};
- close FH;
- }
-
- } else {
- `rm -rf ${build}debian`;
- }
-}
-
-BEGIN{
-};
-
-sub mode_etics_packaging {
- my ($fmod, $cmd, $rpmprepare, $debprepare) = @_;
- my ($workspaceDir, $srcPackageName, $srcAge, $topDir);
-
- # old-school packaging by ETICS for EMI-1
- if ($project eq 'emi' and $project_version == 1) { return; }
-
- if ($fmod eq 'gridsite.core') {
- $workspaceDir = '..';
- $srcPackageName = 'gridsite';
- $srcAge = '';
- $topDir = '../';
- } else {
- $workspaceDir = '${workspaceDir}';
- $srcPackageName = '${packageName}';
- $srcAge = '-${age}';
- $topDir = '';
- }
-
- $cmd->{clean} = 'make clean
- rm -rfv ${package.tgzLocation} ${package.SRPMSLocation}';
- $cmd->{default}{packaging} = $rpmprepare;
- $cmd->{default}{packaging} .= "dir=\${workspaceDir}/rpm_build_src_\$\$
- mkdir -p \${package.tgzLocation} \${package.SRPMSLocation} \$dir/{BUILD,RPMS,SOURCES,SRPMS} 2>/dev/null || true
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \${package.tgzLocation}/
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \$dir/SOURCES/
- rpmbuild -bs --nodeps --define \"_topdir \$dir\" $srcPackageName.spec
- cp -v \$dir/SRPMS/*.src.rpm \${package.SRPMSLocation}/
- rm -rf \$dir";
-
- for my $p ('deb5_x86_64_gcc432', 'deb5_ia32_gcc432', 'deb6_x86_64_gcc445', 'deb6_ia32_gcc445') {
- for my $c (keys %{$cmd->{default}}) { $cmd->{$p}{$c} = $cmd->{default}{$c}; }
- $cmd->{$p}{clean} = 'make clean
- rm -rfv ${package.tgzLocation} ${package.SDEBSLocation}';
- $cmd->{$p}{packaging} = $debprepare;
- $cmd->{$p}{packaging} .= "dir=\${workspaceDir}/dpkg_build_src_\$\$
- mkdir -p \${package.tgzLocation} \${package.SDEBSLocation} \$dir 2>/dev/null || true
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \${package.tgzLocation}/
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \$dir/${srcPackageName}_\${version}.orig.tar.gz
- tar xzf \$dir/${srcPackageName}_\${version}.orig.tar.gz -C \$dir
- cp -rf ${topDir}debian/ \$dir/$srcPackageName-\${version}/
- cd \$dir/$srcPackageName-\${version}
- dpkg-buildpackage -S -d -nc
- cd -
- cp -v \$dir/*.tar.gz \$dir/*.dsc \${package.SDEBSLocation}/
- rm -rf \$dir";
- }
-}
-
-sub mode_etics {
- $fmod = shift;
-
- die "$0: --module required with --etics\n" unless $fmod;
-
- my ($subsys,$module) = split /\./,$fmod,2;
- my $full = full "$subsys.$module";
-
- my ($major,$minor,$rev,$age) = get_version $fmod, $full;
-
- # XXX: --with ignored for platform-dependend packages
- my @copts = ();
- my %ge;
- @ge{@{$etics_projects{$project{etics_name}}}} = (1) x ($#{$etics_projects{$project{etics_name}}}+1);
-
- for (@{$need_externs{"$subsys.$module"}}) {
- if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/ and (defined $externs{$_} or defined $jar{$_})) {
- my $eext = $etics_externs{default}{$_} ? $etics_externs{default}{$_} : $_;
- next if ($eext eq '-');
- if (defined $project{etics_locations}{'*'} or defined $project{etics_locations}{$_}) {
- $eext = $project{etics_locations}{$_} if ($project{etics_locations}{$_});
- push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}";
- } else {
- if ($ge{$_} and not defined $externs{$_}{pkg}) {
- push @copts, "--with-$_=\${stageDir}";
- }
- }
- }
- }
-
- for (@{$need_jars{"$subsys.$module"}}) {
- my $eext = $etics_externs{default}{$_} ? $etics_externs{default}{$_} : $_;
-
- push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (defined $project{etics_locations}{'*'} or defined $project{etics_locations}{$_});
- }
-
- my $conf;
- my $conftag;
- my ($confprefix, $nameprefix, $packageName);
-
- $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n";
-
- $confprefix = $project{conf_prefix}{$subsys};
- $nameprefix = $confprefix;
- $nameprefix =~ s/-$//;
- $nameprefix =~ s/-/\./g;
- $packageName = "$project{tag_prefix}{$subsys}$subsys-${module}";
-
- if ($branch) {
- $conf = "$confprefix${subsys}-${module}_$branch";
- $conftag = $branch;
- # forced low age number
- $age = $branch eq 'HEAD' ? '0head' : '0dev';
- push @copts, '--version ${version}-${age}';
- }
- else {
- $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}";
-# XXX: gridsite hack
- $conftag = $subsys eq 'gridsite' ? "$project{tag_prefix}{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" :
- "$project{tag_prefix}{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}";
-
- # lowering age for older packaging
- if ($project eq 'emi' and $project_version == 1) {
- $age = $age - 1;
- }
- }
-
- # emi1 suffix for older packaging
- if ($project eq 'emi' and $project_version == 1) {
- $age = $age.$project.$project_version;
- $conf = $conf.$project.$project_version;
- }
-
- my $file = $output ? $output : "$conf.ini";
- open C,">$file" or die "$file: $!\n";
-
- my $buildroot = $buildroot{"$subsys.$module"} eq '' ? '#no build.root' : "build.root = " . $buildroot{"$subsys.$module"};
-
- my $confdir = $buildroot{"$subsys.$module"} eq '' ? '.' : '..';
-
- my $cvs_module = full "$subsys.$module";
- my ($package_summary, $package_description) = get_description $cvs_module;
- if ($package_description) {
- $package_description =~ s/\n/\\n/g;
- $package_description = "package.description = $package_description\n";
- }
- if ($package_summary) {
- $package_summary = "package.summary = $package_summary\n";
- }
-
- my %cmd;
- $cmd_vcs{checkout} = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_module 2>/dev/null";
- #$cmd_vcs{checkout} = "((test -d jra1mw/.git && (cd jra1mw; git pull)) || (git clone -q http://scientific.zcu.cz/git/jra1mw.git";
- #$cmd_vcs{checkout} .= " && (cd jra1mw; git checkout -b \${tag} --track origin/\${tag})" unless ($conftag eq /HEAD/);
- #$cmd_vcs{checkout} .= ")) && (test -d \${moduleName} || ln -s jra1mw/$cvs_module \${moduleName})";
- $cmd_vcs{checkout} .= "\n\ttest -f \${packageName}-\${version}-\${age}.src.tar.gz || (ln -s \${moduleName} \${packageName}-\${version}; tar -chf - \${packageName}-\${version} --exclude CVS --exclude .git --exclude .etics | gzip --best > \${packageName}-\${version}-\${age}.src.tar.gz; rm \${packageName}-\${version})";
- $cmd_vcs{tag} = "cvs -d \${vcsroot} tag -R \${tag} ${moduleName}";
-
- $cmd{default}{init} = 'None';
- $cmd{default}{configure} = 'None';
- $cmd{default}{compile} = 'None';
- $cmd{default}{test} = 'None';
- $cmd{default}{install} = 'None';
- $cmd{default}{packaging} = 'None';
- $cmd{default}{clean} = 'make clean';
-
- if (exists $subpackages{$fmod}) {
- $cmd{default}{clean} = 'None';
- $cmd{default}{packaging} = "echo building nothing, $subpackages{$fmod} will build this package";
- $cmd_vcs{checkout} = "mkdir -v \${moduleName} 2>/dev/null || true";
- } elsif ($subsys eq 'gridsite') {
- $cmd_vcs{tag} = 'None';
-
- if ($module eq 'core') {
- my $flags;
-
- if ($project ne 'glite') {
- # don't evaluate pkg-config calls to get them into source package
- $flags = 'RELEASE_VERSION=${age}
- GSOAPDIR=\`pkg-config gsoap --variable=prefix\`
- OPENSSL_GLOBUS_FLAGS=\`pkg-config globus-openssl --cflags\`
- OPENSSL_GLOBUS_LIBS=\`pkg-config globus-openssl --libs\`';
- } else {
- $flags = 'RELEASE_VERSION=${age}
- GSOAPDIR=${gsoap.location}
- OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor}
- OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}
- HTTPD_FLAGS=-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-1 -I${httpd-devel.location}/include/apr-1.0 -I${httpd-devel.location}/include/apr-0 -I${httpd-devel.location}/include/pcre';
- }
-
- $cmd{default}{configure} = "cat > Makefile.inc <<EOF
- project = $project
- top_srcdir = ..
- $flags
- EOF";
- $cmd{default}{compile} = "make prefix=\${prefix}$project{local_prefix} libdir=\${libdir}";
- $cmd{default}{install} = "make prefix=\${prefix}$project{local_prefix} libdir=\${libdir} install";
- mode_etics_packaging($fmod, \%cmd,
- "make prefix=\${prefix}$project{local_prefix} rpm-prepare
- cp gridsite.spec ../\n\t",
- "chmod +x \${moduleDir}/src/make-debian-files || true
- make prefix=\${prefix}$project{local_prefix} deb-prepare\n\t"
- );
- }
- elsif ($module eq '1.5-compat') {
- $cmd_vcs{checkout} = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.core 2>/dev/null";
- $cmd{default}{init} = 'echo "/sbin/ldconfig" > project/.post
- echo "/sbin/ldconfig" > project/.postun';
- $cmd{default}{configure} = "cat > src/Makefile.inc <<EOF
- project = emi
- libdir = \${libdir}
- MAJOR_VERSION=1
- MINOR_VERSION=1.5
- PATCH_VERSION=1.5.0
- VERSION=\\\$(PATCH_VERSION)
- RELEASE_VERSION=\${age}
- GSOAPDIR=\\`pkg-config gsoap --variable=prefix\\`
- OPENSSL_GLOBUS_FLAGS=\\`pkg-config globus-openssl --cflags\\`
- OPENSSL_GLOBUS_LIBS=\\`pkg-config globus-openssl --libs\\`
- EOF";
- $cmd{default}{compile} = "make -C src prefix=\${prefix}$project{local_prefix}
- rm -fv project/debian.changelog";
- $cmd{default}{install} = "make -C src prefix=\${prefix}$project{local_prefix} install-lib
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.so.1
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.so
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.a";
- $cmd{default}{packaging} = "None";
- }
- else {
- $cmd{default}{clean} = 'None';
- $cmd{default}{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this";
- $cmd_vcs{checkout} = "mkdir -v \${moduleName} 2>/dev/null || true";
- }
- }
- elsif ($subsys eq 'px' and $module eq 'myproxy-config') {
- $cmd{default}{configure} = "/usr/bin/perl $confdir/configure --root=\${prefix} --prefix= --stage=\${stageDir} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts";
- $cmd{default}{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config";
- }
- else {
- $cmd{default}{configure} = "/usr/bin/perl $confdir/configure $project{flavours} --root=\${prefix} --prefix=$project{local_prefix} --stage=\${stageDir} --sysroot=\${package.prefix} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts";
- $cmd{default}{compile} = 'make';
- $cmd{default}{test} = 'make check';
- $cmd{default}{install} = 'make install';
- if ($subsys eq 'lb' and $module eq 'client') {
- $cmd{default}{compile} = "make rpath=$project{local_prefix}/\${libdir}";
- $cmd{default}{install} = "make install post-install rpath=$project{local_prefix}/\${libdir}";
- }
- mode_etics_packaging($fmod, \%cmd);
- }
-
- 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 = $project{etics_name}.$subsys.$module
-displayName = $conf
-description = $cvs_prefix{$subsys}.$subsys.$module
-projectName = $project{etics_name}
-age = $age
-deploymentType = None
-vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite
-tag = $conftag
-version = $major.$minor.$rev
-$dwpath
-[Platform-default:VcsCommand]
-displayName = None
-description = None
-tag = $cmd_vcs{tag}
-branch = None
-commit = None
-checkout = $cmd_vcs{checkout}
-
-};
-
- for my $p (keys %cmd) {
- next if $p ne 'default' and exists $project{supported_platforms} and not exists $project{supported_platforms}{$p};
-
- print C qq{[Platform-$p:BuildCommand]
-postpublish = None
-packaging = $cmd{$p}{packaging}
-displayName = None
-description = None
-doc = None
-prepublish = None
-publish = None
-compile = $cmd{$p}{compile}
-init = $cmd{$p}{init}
-install = $cmd{$p}{install}
-clean = $cmd{$p}{clean}
-test = $cmd{$p}{test}
-configure = $cmd{$p}{configure}
-checkstyle = None
-
-};
- }
-
- print C qq{[Platform-default:Property]
-$buildroot
-package.preserve.libtool = false
-$package_description$package_summary$defprops};
-
- for (@{$obsoletes{"$subsys.$module"}}) {
- print C "package.obsoletes = $_\n";
- print C "package.replaces = $_\n";
- }
- for (@{$conflicts{"$subsys.$module"}}) {
- print C "package.conflicts = $_\n";
- }
- for (@{$provides{"$subsys.$module"}}) {
- print C "package.provides = $_\n";
- }
- print C "\n";
-
- for my $pp (keys %{$platform_properties{"$subsys.$module"}}) {
- next if $pp eq 'default';
- next if exists $project{supported_platforms} and not exists $project{supported_platforms}{$pp};
-
- print C "[Platform-$pp:Property]\n$buildroot\n";
-
- for my $p (keys %{$platform_properties{"$subsys.$module"}->{$pp}}) {
- print C $p . ' = ' . $platform_properties{"$subsys.$module"}->{$pp}->{$p} . "\n";
- }
- print C "$package_description$package_summary\n";
- }
-
- for my $platform ('default', keys %{$project{supported_platforms}}) {
- my $used = 0;
- my $output = '';
-
- for (@{$need_externs{"$subsys.$module"}},@{$need_jars{"$subsys.$module"}}) {
- my $eext = $etics_externs{$platform}{$_};
- my $edev = $project{etics_externs_devel}{$platform}{$_};
-
- # for the default platform using package of the same
- # name for runtime dependency
- if (not $eext) {
- if ($platform eq 'default') {
-#print "default runtime $_ on default\n";
- $eext = $_; }
- else {
-#print "no runtime $_ on $platform\n";
- $eext = '-'; }
- }
- if ($eext eq '-' and $edev eq '-') {
-#print "skipping $_ on $platform\n";
- next;
- }
-
- my $proj = 'externals';
- for my $p (keys %etics_projects) {
- for $m (@{$etics_projects{$p}}) {
- $proj = $p if $m eq $_;
- }
- }
-
- my $type = $need_externs_type{"$subsys.$module"}->{$_};
-
- if ($edev) {
- if ($type eq 'B') {
- # no runtime - change to devel pkg
- $eext = $edev;
- } elsif ($type eq 'BR' or $type eq 'RB') {
- # additional devel pkg
- if ($edev ne '-') { $output .= "$proj|$edev = B\n"; }
- }
- }
- if ($eext ne '-') { $output .= "$proj|$eext = $type\n"; }
- }
-
- if ($platform eq 'default') {
- for (@{$deps{"$subsys.$module"}}) {
- my $type = $deps_type{"$subsys.$module"}->{$_};
- if (not $used) {
- $used = 1;
- }
- $output .= "$project{etics_name}|$project{etics_name}.$_ = $type\n";
- }
- }
-
- if ($output) {
- print C qq{
-[Platform-$platform:DynamicDependency]
-$output};
- }
- }
-
- close C;
-
- for $file ("$cvs_module/project/debian.rules", "$cvs_module/project/$packageName.spec") {
- my $lib;
- my $main_module;
- @copts = ();
-
- if ($file =~ /debian\.rules$/) { $lib = 'lib'; }
- else { $lib = '%{_lib}'; }
-
- my $main_module = "$subsys.$module";
- if (exists $subpackages{$main_module}) { $main_module = $subpackages{$main_module}; }
-
- # locations hacks
- if ($file =~ /$packageName\.spec$/) {
- if ($fmod eq 'lb.client-java') {
- push @copts, '';
- push @copts, '--with-axis=/usr/local/axis1.4';
- }
- }
-
- if (-f $file) {
- open DST,">$file.new" or die "$file.new: $!\n";
- open SRC,"<$file" or die "$file: $!\n";
- while (<SRC>) {
- if (/^(\s*).+\/configure\s/) {
- printf DST "%s", "$1";
- printf DST "/usr/bin/perl $confdir/configure $project{flavours} --root=/ --prefix=$project{local_prefix} --libdir=$lib --project=$project --module $main_module@copts\n";
- } else {
- printf DST "%s", "$_";
- }
- }
- close SRC;
- close DST;
-
- `diff -b "$file" "$file.new"`;
- if ($? == 0) {
- print STDERR "($file not changed)\n";
- unlink "$file.new";
- } else {
- print STDERR "Writing $file\n";
- rename "$file", "$file.orig" unless -f "$file.orig";
- rename "$file.new", "$file";
- }
- }
- }
-}
-
-sub gsoap_version {
- local $_;
- my $gsoap_version;
- open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n";
-
- while ($_ = <S>) {
- 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;
-}
-
-sub getlibdir {
- if ( -e "/etc/debian_version") { # We are on Debian
- $lib64="lib";
- $lib32="lib32"; }
- else { # Another distribution
- $lib64="lib64";
- $lib32="lib"; }
- $libdir=$lib32;
-
- open INP, "uname -s | "; # Check kernel name
- $kname= <INP>;
- chomp($kname);
- close INP;
-
- if ( $kname eq "Linux") {
- $arch = ("x86_64\npowerpc\nppc64\n");
-
- open INP, "uname -p | "; # Check processor type
- $procname= <INP>;
- chomp($procname);
- close INP;
-
- if ($arch =~/^$procname\n/) {
- return ($lib64); }
-
- open INP, "uname -m | "; # Check machine hardware
- $machname= <INP>;
- chomp($machname);
- close INP;
-
- if ($arch =~/^$machname\n/) {
- return ($lib64); }
-
- # special cases (hyperlink lib64, Debian)
- if (-l "/usr/lib64") {
- $libdir=$lib32; }
-
- # if /usr/lib64 doesn't exist at all (AIX)
- unless ( -e "/usr/lib64" ) {
- $libdir=$lib32; }
- }
-
- if ( $kname eq "SunOS") {
- if (-e "/usr/lib/64") {
- $libdir="lib/64"; }
- }
-
- return $libdir;
-}
-
-sub reshuffle_platforms($$) {
- my ($data, $platforms) = @_;
- my ($platform, %blacklist, $value);
-
- return if not $platforms;
-
- for $platform (keys %$data) {
-#print "plat: $platform: $data->{$platform}\n";
- next if $platform eq 'default';
- for $_ (keys %{$data->{$platform}}) {
-#print " blacklist: $_ = $data->{$platform}{$_}\n";
- $blacklist{$_} = 1;
- }
- }
-
- for $_ (keys %blacklist) {
- $value = $data->{default}{$_} ? $data->{default}{$_} : $_;
- for $platform (keys %$platforms) {
- next if $platform eq 'default';
- if (not defined $data->{$platform}{$_}) {
- $data->{$platform}{$_} = $value;
-#print "added $value to $platform\n"
- }
- }
- $data->{default}{$_} = '-';
-#print "deleted $_ from default\n";
- }
-
- # merge dependencies across the supported platforms
- %blacklist = [];
- for $platform (keys %$platforms) {
- next if $platform eq 'default';
- for $_ (keys %{$data->{$platform}}) {
- $blacklist{$_} = 1;
- }
- }
- for $_ (keys %blacklist) {
- $value = undef;
- $same = 1;
- for $platform (keys %$platforms) {
- if (not $value) { $value = $data->{$platform}{$_}; }
- if (not $data->{$platform}{$_} or $value ne $data->{$platform}{$_}) {
- $same = 0;
- last;
- }
- }
- if ($same and $value) {
-#print "merged dependency $_\n";
- $data->{default}{$_} = $value;
- for $platform (keys %$platforms) {
- delete $data->{$platform}{$_};
- }
- }
- }
-}
-
-sub usage {
- my @ext = keys %externs;
- my @myjars = keys %jar;
-
- print STDERR qq{
-Usage: $0 options
-
-General options (defaults in []):
- --prefix=PREFIX destination directory [./stage]
- --stage=DIR staging directory [./stage]
- --root=DIR installation root (custom relocation root -> sysroot) [./stage]
- --sysroot=DIR system root (custom relocation root -> sysroot) []
- --sysconfdir=DIR system configuration directory [PREFIX/etc]
- --staged=module,module,... what is already in PREFIX (specify without org.glite.)
- --thrflavour=flavour
- --nothrflavour=flavour threaded and non-treaded flavours [gcc64dbgpthr,gcc64dbg]
- --listmodules=subsys list modules of a subsystem
- --listmodules=module list subpackages of a module
- --version=maj.min.rev-age version used instead of reading version.properties
- --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...)
- --libdir=libdir typically [lib,lib64] postfix
- --project=PROJECT build or generate etics for a project (glite/emi1/emi) [emi]
- --debug print more details
-
-Mode of operation:
- --mode=\{checkout|build|etics\} what to do [build]
-
-What to build:
- --module=module build this module only
- --enable-NODE build this "node" (set of modules) only
- --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
- --jobid-tag=tag checkout jobid modules with specific tag
- --canl-tag=tag checkout canl modules with specific tag
-
-Dependencies (summary of what will be used is always printed):
- --with-EXTERNAL=PATH where to look for an external [autodetect]
- --with-JAR=JAR where to look for jars
-
-Available nodes:
- @nodes
-
-Default nodes:
- @default_nodes
-
-Externals (not all for all modules) are:
- @ext
-
-External jars are:
- @myjars
-
-};
-
-}
+++ /dev/null
-/sbin/ldconfig
+++ /dev/null
-/sbin/ldconfig
+++ /dev/null
-1.0.0-1
-- Initial release of the LOG module
-
-1.0.1-1
-- log4c config file name hardcoded to 'log4crc'
-- config files moved
-- LCAS logging configuration from log4c
-
-1.0.2-1
-- A new logging category added for notification interlogger
-
-1.0.2-2
-- Module rebuilt
-
-1.0.3-1
-- Fixed target 'clean' in the Makefile
-
-1.0.3-2
-- Module rebuilt
-
-1.0.4-1
-- Makefile adopts compilation and linking flags from the environment.
-
-1.0.5-1
-- Increase message size -- syslog can use it (RFC #3164).
-- Workaround for a bug in log4c included in configuration (non-zero buffer required)
-- Fixes to build-time warnings in logging calls
-
-1.0.5-2
-- Module rebuilt
-
-1.0.5-3
-- Module rebuilt
-
-1.1.0-1
-- Fixes for parallel release in EMI & gLite
-
-1.1.0-2
-- Module rebuilt
-
-1.1.1-1
-- Root directory option (ETICS performs own files relocation)
-- Prefix option as prefix inside stage
-- Sysconfdir option (for /etc vs /usr)
-- DESTDIR in makefiles
-
-1.1.2-1
-- Relocatable build directory.
-
-1.1.2-2
-- Module rebuilt
-
-1.1.2-3
-- Module rebuilt
-
-1.1.2-4
-- Module rebuilt
-
-1.1.2-5
-- Module rebuilt
-
-1.1.2-6
-- Module rebuilt
-
-1.1.2-7
-- Module rebuilt
-
-1.2.0-1
-- Preparation for a new multiplatform release
-
-1.2.0-2
-- Module rebuilt
-
-1.2.0-3
-- Module rebuilt
-
-1.2.0-4
-- Module rebuilt
-
-1.2.0-5
-- Module rebuilt
-
+++ /dev/null
-Source: glite-lbjp-common-log
-Priority: extra
-Maintainer: @MAINTAINER@
-Uploaders: @UPLOADERS@
-Build-Depends: debhelper (>= 7.0.50~), chrpath, libtool, liblog4c3, liblog4c-dev
-Standards-Version: 3.9.1
-Section: libs
-Homepage: @URL@
-DM-Upload-Allowed: yes
-@DEBIAN_VCS@
-
-Package: libglite-lbu-log1
-Section: libs
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: @SUMMARY@
-@DEBIAN_DESCRIPTION@
-
-Package: libglite-lbjp-common-log-dev
-Section: libdevel
-Architecture: any
-Provides: glite-lbjp-common-log
-Depends: libglite-lbu-log1 (= ${binary:Version}), ${misc:Depends}
-Description: Development files for gLite L&B/JP common log module
- This package contains development libraries and header files for gLite L&B/JP
- common log module.
-
-Package: glite-lbjp-common-log-dbg
-Section: debug
-Architecture: any
-Priority: extra
-Depends: libglite-lbu-log1 (= ${binary:Version}), ${misc:Depends}
-Description: gLite L&B/JP common log module debugging symbols
- This package contains debugging symbols for gLite L&B/JP common log module.
+++ /dev/null
-This work was packaged for Debian by:
-
- @MAINTAINER@ on Thu, 08 Dec 2011 00:46:07 +0100
-
-It was downloaded from:
-
- @URL@
-
-Upstream Author(s):
-
- @MAINTAINER@
-
-Copyright:
-
- <Copyright (C) 2004-2011 Members of the EGEE Collaboration>
-
-License:
-
- 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.
-
-On Debian systems, the complete text of the Apache version 2.0 license
-can be found in "/usr/share/common-licenses/Apache-2.0".
-
-The Debian packaging is:
-
- Copyright (C) 2004-2011 Members of the EGEE Collaboration
-
-and is licensed under the Apache License, Version 2.0.
+++ /dev/null
-usr/include/glite/lbu
-usr/lib
+++ /dev/null
-usr/include/glite/lbu/*.h
-usr/lib/lib*.so
+++ /dev/null
-etc/glite-lb
-usr/lib
-usr/share/doc/glite-lbjp-common-log
+++ /dev/null
-etc/glite-lb/*
-usr/lib/lib*.so.*
-usr/share/doc/glite-lbjp-common-log/*
+++ /dev/null
-#!/usr/bin/make -f
-# -*- makefile -*-
-
--include /usr/share/dpkg/buildflags.mk
-
-# Uncomment this to turn on verbose mode.
-export DH_VERBOSE=1
-
-configure: configure-stamp
-configure-stamp:
- dh_testdir
- /usr/bin/perl ./configure --thrflavour= --nothrflavour= --root=/ --prefix=/usr --libdir=lib --project=emi --module lbjp-common.log
- touch $@
-
-build: build-arch build-indep
-
-build-arch build-indep: build-stamp
-
-build-stamp: configure-stamp
- dh_testdir
- CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE)
- CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) check
- touch $@
-
-clean: configure-stamp
- dh_testdir
- dh_testroot
- rm -f configure-stamp build-stamp
- $(MAKE) clean
- rm -f Makefile.inc config.status
- dh_clean
-
-install: build-stamp
- dh_testdir
- dh_testroot
- dh_prep
- dh_installdirs
- $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
- rm -vf $(CURDIR)/debian/tmp/usr/share/doc/glite-lbjp-common-log*/LICENSE
- rm -vf $(CURDIR)/debian/tmp/usr/lib/*.la
- rm -vf $(CURDIR)/debian/tmp/usr/lib/*.a
- find $(CURDIR)/debian/tmp -name '*' -print | xargs -I {} -i bash -c "chrpath -d {} > /dev/null 2>&1" || echo 'Stripped RPATH'
- mv $(CURDIR)/debian/tmp/usr/share/doc/glite-lbjp-common-log-@MAJOR@.@MINOR@.@REVISION@ $(CURDIR)/debian/tmp/usr/share/doc/glite-lbjp-common-log
- (cd $(CURDIR)/debian/tmp/usr/share/doc/glite-lbjp-common-log; \
- rm -fv ChangeLog LICENSE; \
- cat $(CURDIR)/project/ChangeLog | gzip -9 > changelog.gz)
-
-binary-indep:
-
-binary-arch: install
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_installexamples
- dh_installman
- dh_installlogrotate
- dh_installcron
- dh_install --fail-missing
- dh_link
- dh_strip --dbg-package=glite-lbjp-common-log-dbg
- dh_compress
- dh_fixperms
- dh_makeshlibs
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-arch binary-indep
+++ /dev/null
-Summary: @SUMMARY@
-Name: glite-lbjp-common-log
-Version: @MAJOR@.@MINOR@.@REVISION@
-Release: @AGE@%{?dist}
-Url: @URL@
-License: ASL 2.0
-Vendor: EMI
-Group: System Environment/Libraries
-BuildRequires: chrpath
-BuildRequires: libtool
-BuildRequires: log4c-devel
-BuildRequires: log4c
-BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
-AutoReqProv: yes
-Source: http://eticssoft.web.cern.ch/eticssoft/repository/emi/emi.lbjp-common.log/%{version}/src/%{name}-@VERSION@.src.tar.gz
-
-
-%description
-@DESCRIPTION@
-
-
-%package devel
-Summary: Development files for gLite L&B/JP common log module
-Group: Development/Libraries
-Requires: %{name}%{?_isa} = %{version}-%{release}
-
-
-%description devel
-This package contains development libraries and header files for gLite L&B/JP
-common log module.
-
-
-%prep
-%setup -q
-
-
-%build
-/usr/bin/perl ./configure --thrflavour= --nothrflavour= --root=/ --prefix=/usr --libdir=%{_lib} --project=emi --module lbjp-common.log
-make
-
-
-%check
-make check
-
-
-%install
-rm -rf $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
-find $RPM_BUILD_ROOT -name '*.la' -exec rm -rf {} \;
-find $RPM_BUILD_ROOT -name '*.a' -exec rm -rf {} \;
-find $RPM_BUILD_ROOT -name '*' -print | xargs -I {} -i bash -c "chrpath -d {} > /dev/null 2>&1" || echo 'Stripped RPATH'
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
-%post -p /sbin/ldconfig
-
-
-%postun -p /sbin/ldconfig
-
-
-%files
-%defattr(-,root,root)
-%dir /usr/share/doc/%{name}-%{version}
-%dir /etc/glite-lb
-%config(noreplace) /etc/glite-lb/log4crc
-%doc /usr/share/doc/%{name}-%{version}/LICENSE
-%doc /usr/share/doc/%{name}-%{version}/README
-%doc /usr/share/doc/%{name}-%{version}/log4crc.example-debugging
-%doc /usr/share/doc/%{name}-%{version}/log4crc.example-production
-/usr/%{_lib}/libglite_lbu_log.so.@MAJOR@.@MINOR@.@REVISION@
-/usr/%{_lib}/libglite_lbu_log.so.@MAJOR@
-
-
-%files devel
-%defattr(-,root,root)
-%dir /usr/include/glite
-%dir /usr/include/glite/lbu
-/usr/include/glite/lbu/log.h
-/usr/%{_lib}/libglite_lbu_log.so
-
-
-%changelog
-* @SPEC_DATE@ @MAINTAINER@ - @MAJOR@.@MINOR@.@REVISION@-@AGE@%{?dist}
-- automatically generated package
+++ /dev/null
-Definitions of glite common logging formats for LB and JP.
+++ /dev/null
-Definitions of glite common logging formats for LB and JP
+++ /dev/null
-# $Header$
-module.version=1.2.0
-module.age=5
+++ /dev/null
-#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 <stdarg.h>
-#include <stdio.h>
-#include <log4c.h>
-#include "log.h"
-
-/**
- * constructor
- *
- * @returns 0 for success
- */
-int glite_common_log_init(void) {
-#ifndef WITHOUT_LOG4C
- return(log4c_init());
-#else
- return 0;
-#endif
-}
-
-/**
- * destructor
- *
- * @returns 0 for success
- */
-int glite_common_log_fini(void) {
-#ifndef WITHOUT_LOG4C
- return(log4c_fini());
-#else
- return 0;
-#endif
-}
-
-/**
- * Log a message with the specified priority.
- * @param catName category name
- * @param a_priority The priority of this log message.
- * @param msg message
- **/
-void glite_common_log_msg(char *catName,int a_priority, char *msg) {
-#ifndef WITHOUT_LOG4C
- 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, "%s", msg);
- }
-#else
- printf(msg);
-#endif
-}
-
-/**
- * Log a message with the specified priority.
- * @param catName category name
- * @param a_priority The priority of this log message.
- * @param a_format Format specifier for the string to write in the log file.
- * @param ... The arguments for a_format
- **/
-void glite_common_log(char *catName,int a_priority, const char* a_format,...) {
-#ifndef WITHOUT_LOG4C
- const log4c_category_t* a_category = log4c_category_get(catName);
-
- if (log4c_category_is_priority_enabled(a_category, a_priority)) {
- va_list va;
-
- va_start(va, a_format);
- log4c_category_vlog(a_category, a_priority, a_format, va);
- va_end(va);
- }
- if (a_priority == LOG_PRIORITY_FATAL) {
- va_list va;
- va_start(va,a_format);
- vfprintf(stderr,a_format,va);
- fputc('\n',stderr);
- va_end(va);
- }
-#else
- va_list va;
-
- va_start(va, a_format);
- vprintf(a_format,va);
- va_end(va);
-#endif
-}
-
-const char *glite_common_log_priority_to_string(int a_priority) {
-#ifndef WITHOUT_LOG4C
- return log4c_priority_to_string(a_priority);
-#else
- char *out;
-
- switch (priority) {
- case LOG_PRIORITY_FATAL: out=strdup("FATAL"); break;
- case LOG_PRIORITY_ERROR: out=strdup("ERROR"); break;
- case LOG_PRIORITY_WARN: out=strdup("WARNING"); break;
- case LOG_PRIORITY_INFO: out=strdup("INFO"); break;
- case LOG_PRIORITY_DEBUG: out=strdup("DEBUG"); break;
- case LOG_PRIORITY_NOTSET:
- default:
- out=strdup("PRIORITY_NOT_SET");
- }
- return out;
-#endif
-}
-
-/**
- * Returns priority of a given category
- */
-int glite_common_log_get_priority(const char *catName) {
-#ifndef WITHOUT_LOG4C
- return log4c_category_get_priority(log4c_category_get(catName));
-#else
- /* if not LOG4C, mapping of priorities to categories
- * must be specified somehow differently (not specified at the moment)
- */
- return LOG_PRIORITY_NOTSET;
-#endif
-}
-
-/*
- * Rereads any log4crc files that have changed
- */
-void glite_common_log_reread(void) {
-#ifndef WITHOUT_LOG4C
- log4c_reread();
-#endif
-}
-
-
+++ /dev/null
-#ifndef GLITE_LBU_LOG_H
-#define GLITE_LBU_LOG_H
-
-#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.
-*/
-
-/* gLite common logging recommendations v1.1
- https://twiki.cern.ch/twiki/pub/EGEE/EGEEgLite/logging.html */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* default categories */
-#define LOG_CATEGORY_NAME "root"
-#define LOG_CATEGORY_SECURITY "SECURITY"
-#define LOG_CATEGORY_ACCESS "ACCESS"
-#define LOG_CATEGORY_CONTROL "CONTROL"
-#define LOG_CATEGORY_LB "LB"
-#define LOG_CATEGORY_LB_LOGD "LB.LOGD"
-#define LOG_CATEGORY_LB_IL "LB.INTERLOGD"
-#define LOG_CATEGORY_LB_ILNOTIF "LB.NOTIFINTERLOGD"
-#define LOG_CATEGORY_LB_SERVER "LB.SERVER"
-#define LOG_CATEGORY_LB_SERVER_DB "LB.SERVER.DB"
-#define LOG_CATEGORY_LB_SERVER_REQUEST "LB.SERVER.REQUEST"
-#define LOG_CATEGORY_LB_HARVESTER "LB.HARVESTER"
-#define LOG_CATEGORY_LB_HARVESTER_DB "LB.HARVESTER.DB"
-#define LOG_CATEGORY_LB_AUTHZ "LB.AUTHZ"
-
-/* default priorities
- * - follow LOG4C_PRIORITY_* defined in <log4c/priority.h>
- */
-#define LOG_PRIORITY_FATAL 000 // LOG4C_PRIORITY_FATAL
-#define LOG_PRIORITY_ERROR 300 // LOG4C_PRIORITY_ERROR
-#define LOG_PRIORITY_WARN 400 // LOG4C_PRIORITY_WARN
-#define LOG_PRIORITY_INFO 600 // LOG4C_PRIORITY_INFO
-#define LOG_PRIORITY_DEBUG 700 // LOG4C_PRIORITY_DEBUG
-#define LOG_PRIORITY_NOTSET 900 // LOG4C_PRIORITY_NOTSET
-
-/* logging functions */
-
-/**
- * constructor
- *
- * @returns 0 for success
- */
-extern int glite_common_log_init(void);
-
-/**
- * destructor
- *
- * @returns 0 for success
- */
-extern int glite_common_log_fini(void);
-
-/**
- * Log a message with the specified priority.
- * @param catName category name
- * @param a_priority priority of this log message.
- * @param msg message
- **/
-extern void glite_common_log_msg(char *catName,int a_priority, char *msg);
-
-/**
- * Log a message with the specified priority.
- * @param catName category name
- * @param a_priority The priority of this log message.
- * @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,...) __attribute__((format(printf, 3, 4)));
-
-/**
- * Returns priority as a string
- * @param a_priority priority number
- */
-extern const char *glite_common_log_priority_to_string(int a_priority);
-
-/**
- * Returns priority of a given category
- * @param catName category name
- */
-extern int glite_common_log_get_priority(const char *catName);
-
-/**
- * Rereads any log4crc files that have changed
- */
-extern void glite_common_log_reread(void);
-
-/* simple wrappers around glite_common_log() that include also errno */
-#define glite_common_log_SYS_ERROR(my_err) { \
- if (errno !=0 ) \
- glite_common_log(LOG_CATEGORY_CONTROL,LOG_PRIORITY_ERROR,"%s: %s\n",my_err,strerror(errno)); \
- else \
- glite_common_log(LOG_CATEGORY_CONTROL,LOG_PRIORITY_ERROR,"%s\n",my_err); }
-
-#define glite_common_log_SYS_FATAL(my_err) { \
- if (errno !=0 ) \
- glite_common_log(LOG_CATEGORY_CONTROL,LOG_PRIORITY_FATAL,"%s: %s\n",my_err,strerror(errno)); \
- else \
- glite_common_log(LOG_CATEGORY_CONTROL,LOG_PRIORITY_FATAL,"%s\n",my_err); }
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GLITE_LBU_LOG_H */
+++ /dev/null
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE log4c SYSTEM "">
-
-<log4c version="1.2.1">
- <config>
- <bufsize>512</bufsize>
- <debug level="0"/>
- <nocleanup>0</nocleanup>
- </config>
-
- <category name="root" priority="notice"/>
- <category name="miaow" priority="debug" appender="stderr"/>
- <appender name="stderr" type="stream" layout="basic"/>
-
- <layout name="basic" type="basic"/>
- <layout name="dated" type="dated"/>
-</log4c>
+++ /dev/null
-#include <stdio.h>
-#include <stdlib.h>
-
-#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;
-}
+++ /dev/null
-# defaults
-top_srcdir=..
-builddir=build
-stagedir=.
-distdir=.
-globalprefix=glite
-lbutilsprefix=lbu
-package=glite-lbjp-common-maildir
-version=1.0.0
-PREFIX=/opt/glite
-prefix=
-
-glite_location=/opt/glite
-cppunit_prefix=/opt/cppunit
-thrflavour=gcc32pthr
-nothrflavour=gcc32
-
--include Makefile.inc
--include ${top_srcdir}/project/version.properties
-
-version=${module.version}
-
-CC=gcc
-
-VPATH=${top_srcdir}/interface:${top_srcdir}/src:${top_srcdir}/examples
-
-DEBUG:=-g -O0 -W -Wall
-
-CFLAGS:= ${CFLAGS} \
- ${DEBUG} \
- -DVERSION=\"${version}\" \
- -I${stagedir}${prefix}/include -I${top_srcdir}/src -I. \
- -I${top_srcdir}/interface \
- ${COVERAGE_FLAGS} \
- -D_GNU_SOURCE
-
-LDFLAGS:=${LDFLAGS} -L${stagedir}${prefix}/${libdir} ${COVERAGE_FLAGS}
-
-COMPILE:=libtool --mode=compile ${CC} ${CFLAGS}
-LINK:=libtool --mode=link ${CC} -rpath ${stagedir}${prefix}/${libdir} ${LDFLAGS}
-INSTALL:=libtool --mode=install install
-
-EXT_LIBS:=
-OBJS:=maildir.o
-HDRS:=maildir.h
-LOBJS:=${OBJS:.o=.lo}
-
-# In order to use libtool versioning correcty, we must have:
-#
-# current = major + minor + offset
-# revision = patch
-# age = minor
-#
-# where offset is a sum of maximal released minor's of all previous major's
-#
-
-# counted minors: n/a
-offset=0
-
-version_info:=-version-info ${shell \
- perl -e '$$,=":"; @F=split "\\.","${version}"; print $$F[0]+$$F[1]+${offset},$$F[2],$$F[1]' }
-
-default all: compile doc
-
-libglite_lbu_maildir.la: ${LOBJS}
- ${LINK} ${version_info} -o $@ $< ${EXT_LIBS}
-
-compile: libglite_lbu_maildir.la
-
-check:
- -echo No checks here yet.
-
-test_coverage:
- -mkdir coverage
- cd coverage && $(MAKE) -f ../Makefile top_srcdir=../../ COVERAGE_FLAGS="-fprofile-arcs -ftest-coverage" check
- cd coverage && for i in `echo ${OBJS} | tr ' ' '\012' | sort -u`; do gcov $$i ; done
-
-examples:
-
-#doc:
-# cp ${top_srcdir}/doc/*.dox .
-# echo "PROJECT_NUMBER = ${version}" >> C.dox
-# doxygen C.dox
-
-stage: compile
- $(MAKE) install PREFIX=${stagedir} DOSTAGE=yes
-
-install: all
- -mkdir -p ${DESTDIR}${PREFIX}${prefix}/${libdir}
- -mkdir -p ${DESTDIR}${PREFIX}${prefix}/include/${globalprefix}/${lbutilsprefix}
- ${INSTALL} -m 755 "libglite_lbu_maildir.la" "${DESTDIR}${PREFIX}${prefix}/${libdir}/libglite_lbu_maildir.la"; \
- ${INSTALL} -m 644 ${top_srcdir}/interface/${HDRS} ${DESTDIR}${PREFIX}${prefix}/include/${globalprefix}/${lbutilsprefix}
-
-clean:
- rm -rvf *.o *.lo .libs lib* *.c *.h *.dox C/ CPP/
-
-distclean:
- rm -rvf Makefile.inc *.spec debian/
-
-%.o %.lo: %.c
- ${COMPILE} -c $<
-
-maildir.lo: maildir.c maildir.h
-
-.PHONY: default all compile check examples doc stage dist distsrc distbin install clean distclean test_coverage
+++ /dev/null
-#!/usr/bin/perl
-
-# WARNING: Don't edit this file unless it is the master copy in org.glite.lb
-#
-# For the purpose of standalone builds of lb/jobid/lbjp-common components
-# it is copied on tagging
-
-# $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.
-#
-
-use Getopt::Long;
-use POSIX qw(locale_h strftime);
-
-my $pwd = `pwd`; chomp $pwd;
-my $prefix = '/usr';
-my $stagedir = undef;
-my $root = $pwd.'/stage';
-my $sysroot = '';
-my $sysconfdir;
-my $localstatedir;
-my $staged;
-my $module;
-my $thrflavour = 'gcc64dbgpthr';
-my $nothrflavour = 'gcc64dbg';
-my $mode = 'build';
-my $help = 0;
-my $listmodules;
-my ($version, $force_version);
-my $branch;
-my $output;
-my $lb_tag = '';
-my $lbjp_tag = '';
-my $jp_tag = '';
-my $jobid_tag = '';
-my $libdir = getlibdir();
-my $project = 'emi';
-my $project_version;
-my (%projects, %project);
-my $debug = 0;
-my $pkg_config_env = (defined $ENV{PKG_CONFIG_PATH}) ? "$ENV{PKG_CONFIG_PATH}:" : '';
-
-my @nodes = qw/client server logger logger-msg nagios utils client-java doc ws-test db jpprimary jpindex jpclient harvester lb px proxyrenewal/;
-my @default_nodes = qw/lb px proxyrenewal nagios/;
-my %enable_nodes;
-my %disable_nodes;
-my %default_nodes; @default_nodes{@default_nodes} = (1) x ($#default_nodes + 1);
-
-my %package = (
- 'maintainer' => 'CESNET Product Teams <emi-lb@metacentrum.cz>',
- 'uploaders' => 'František Dvořák <valtri@civ.zcu.cz>',
- 'url' => 'http://glite.cern.ch',
- 'debian_vcs' => 'Vcs-Cvs: :pserver:anonymous@jra1mw.cvs.cern.ch:/cvs/jra1mw
-Vcs-Browser: http://jra1mw.cvs.cern.ch/cgi-bin/jra1mw.cgi',
-);
-
-# key: internal package name (arguments, ...)
-# 'pkg': pkg-config name
-# 'prefix': used when pkg-config fails
-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-devel' => {
- prefix=> '/opt/globus',
- pkg => 'myproxy'
- },
- 'myproxy-server' => {
- prefix=> '',
- },
- 'myproxy-admin' => {
- prefix=> '',
- },
- gsoap => {
- prefix=> '/usr',
- pkg => 'gsoap'
- },
- gsoapxx => {
- prefix=> '/usr',
- pkg => 'gsoap++'
- },
- mysql => {
- prefix=> '/usr'
- },
- 'mysql-devel' => {
- prefix=> ''
- },
- 'mysql-server' => {
- prefix => ''
- },
- voms => {
- prefix => '/opt/glite',
- pkg => 'voms-2.0'
- },
- gridsite => {
- prefix => '/opt/glite'
- },
- lcas => {
- prefix => '/opt/glite',
- pkg => 'lcas'
- },
- trustmanager => {
- prefix => '/opt/glite'
- },
- trustmanager_axis => {
- prefix => '/opt/glite'
- },
- utiljava => {
- prefix=> '/opt/glite'
- },
- ant => {
- prefix=> '/usr'
- },
- jdk => {
- prefix=> '/usr/java/latest',
- locations => [ '/usr/lib/jvm/java', '/usr/lib/jvm/default-java', '/usr/java/latest' ],
- },
- libtar => {
- prefix=> '/usr'
- },
- axis => {
- prefix=> '/usr'
- },
- log4c => {
- prefix=> '/usr'
- },
- postgresql => {
- prefix=> '/usr'
- },
- activemq => {
- prefix=>'/opt/activemq-cpp-library',
- pkg => 'activemq-cpp'
- },
-);
-
-my %jar = (
- 'jakarta-commons-codec' => '/usr/share/java/commons-codec.jar',
- 'jakarta-commons-lang' => '/usr/share/java/commons-lang.jar',
-);
-
-
-my %glite_prefix;
-my %need_externs;
-my %need_externs_type;
-my %need_jars;
-my %extrafull;
-my %extranodmod;
-my %deps;
-my %deps_type;
-my %buildroot;
-my (%etics_externs, %etics_projects);
-
-#
-# modules of the subsystems
-#
-# additional modules from $project{modules} are automatically added
-#
-my %lbmodules = (
- 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim logger-msg nagios client-devel client-progs common-devel logger-devel state-machine-devel/],
- 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin db-devel log-devel maildir-devel server-bones-devel trio-devel jp-interface-devel gss-devel gsoap-plugin-devel/],
- 'jobid' => [qw/api-c api-c-devel api-cpp api-cpp-devel api-java/],
- 'jp' => [ qw/client doc index primary server-common ws-interface/ ],
- 'gridsite' => [ qw/apache libs commands core devel slashgrid services service-clients gsexec/ ],
- 'px' => [ qw/proxyrenewal myproxy-yaim proxyrenewal-devel proxyrenewal-progs/ ],
- 'canl' => [ qw/c c-devel/ ],
- );
-
-#
-# sub-packages
-#
-# modify %lbmodules, %deps_aux, %extrafull, and %properties accodingly
-#
-my %subpackages = (
- 'jobid.api-c-devel' => 'jobid.api-c',
- 'jobid.api-cpp-devel' => 'jobid.api-cpp',
- 'lbjp-common.db-devel' => 'lbjp-common.db',
- 'lbjp-common.gsoap-plugin-devel' => 'lbjp-common.gsoap-plugin',
- 'lbjp-common.gss-devel' => 'lbjp-common.gss',
- 'lbjp-common.jp-interface-devel' => 'lbjp-common.jp-interface',
- 'lbjp-common.log-devel' => 'lbjp-common.log',
- 'lbjp-common.maildir-devel' => 'lbjp-common.maildir',
- 'lbjp-common.server-bones-devel' => 'lbjp-common.server-bones',
- 'lbjp-common.trio-devel' => 'lbjp-common.trio',
- 'lb.client-progs' => 'lb.client',
- 'lb.client-devel' => 'lb.client',
- 'lb.common-devel' => 'lb.common',
- 'lb.logger-devel' => 'lb.logger',
- 'lb.state-machine-devel' => 'lb.state-machine',
- 'px.proxyrenewal-devel' => 'px.proxyrenewal',
- 'px.proxyrenewal-progs' => 'px.proxyrenewal',
- 'canl.c-devel' => 'canl.c',
-);
-
-my @opts = (
- 'prefix:s' => \$prefix,
- 'staged=s' => \$staged,
- 'module=s' => \$module,
- 'thrflavour:s' => \$thrflavour,
- 'nothrflavour:s' => \$nothrflavour,
- 'mode=s' => \$mode,
- 'listmodules=s' => \$listmodules,
- 'version=s' => \$force_version,
- 'branch=s' => \$branch,
- 'output=s' => \$output,
- 'stage=s' => \$stagedir,
- 'root:s' => \$root,
- 'sysroot:s' => \$sysroot,
- 'sysconfdir=s' => \$sysconfdir,
- 'localstatedir=s' => \$localstatedir,
- 'lb-tag=s' => \$lb_tag,
- 'lbjp-common-tag=s' => \$lbjp_tag,
- 'jp-tag=s' => \$jp_tag,
- 'jobid-tag=s' => \$jobid_tag,
- 'canl-tag=s' => \$canl_tag,
- 'help' => \$help,
- 'libdir=s' => \$libdir,
- 'project=s' => \$project,
- 'debug' => \$debug,
-);
-
-for (@nodes) {
- $enable_nodes{$_} = 0;
- $disable_nodes{$_} = 0;
-
- push @opts,"disable-$_",\$disable_nodes{$_};
- push @opts,"enable-$_",\$enable_nodes{$_};
-}
-
-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";
-$prefix=~s/\/$//;
-$root=~s/\/$//;
-$sysroot=~s/\/$//;
-if (not $sysconfdir) { $sysconfdir = $prefix eq '/usr' ? '/etc' : "$prefix/etc"; }
-if (not $localstatedir) { $localstatedir = $prefix eq '/usr' ? '/var' : "$prefix/var"; }
-$sysconfdir=~s/\/$//;
-$localstatedir=~s/\/$//;
-
-$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq '';
-$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq '';
-$externs{'gsoapxx'}{prefix}=$externs{gsoap}{prefix} if $externs{'gsoapxx'}{prefix} eq '';
-
-$externs{'mysql-server'}{withprefix}=$externs{mysql}{withprefix} if $externs{'mysql-server'}{withprefix} eq '';
-$externs{'mysql-devel'}{wihtprefix}=$externs{mysql}{withprefix} if $externs{'mysql-devel'}{withprefix} eq '';
-$externs{'gsoapxx'}{withprefix}=$externs{gsoap}{withprefix} if $externs{'gsoapxx'}{withprefix} eq '';
-
-if ($project =~ /^([^0-9]*)(.*)$/) {
- $project = $1;
- $project_version = $2;
-}
-%project = %{$projects{$project}};
-$project_version = $project{current_version} unless $project_version;
-for my $platform (keys %{$project{etics_externs}}) {
- for $_ (keys %{$project{etics_externs}{$platform}}) {
- $etics_externs{$platform}{$_} = $project{etics_externs}{$platform}{$_};
- }
-}
-reshuffle_platforms(\%etics_externs, $project{supported_platforms});
-reshuffle_platforms(\%{$project{etics_externs_devel}}, $project{supported_platforms});
-for $_ (keys %{$project{etics_projects}}) {
- $etics_projects{$_} = $project{etics_projects}{$_};
-}
-for $_ (keys %{$project{need_externs_aux}}) {
- $need_externs_aux{$_} = $project{need_externs_aux}{$_};
-}
-for my $ext (keys %need_externs_aux) {
- for (@{$need_externs_aux{$ext}}) {
- my ($pkg, $type) =/([^:]*)(?::(.*))?/;
- $type = 'BR' unless ($type);
-
- push @{$need_externs{$ext}},$pkg;
- $need_externs_type{$ext}->{$pkg} = $type;
- }
-}
-if ($project eq 'emi') {
- $extranodmod{lb} = 'lb.emi-lb';
- $extranodmod{px} = 'px.emi-px';
-}
-for $_ (keys %{$project{modules}}) {
- push @{$lbmodules{$_}},@{$project{modules}{$_}};
-}
-
-
-if ($help) { usage(); exit 0; }
-
-if ($listmodules) {
- my $name_prefix = ($listmodules eq 'gridsite' and $project eq 'glite') ? 'org' : $project{etics_name};
- my @m;
-
- if (exists $lbmodules{$listmodules}) {
- @m = map exists $subpackages{$listmodules . '.' . $_} ? "" : "$name_prefix.$listmodules.$_",@{$lbmodules{$listmodules}};
- } else {
- if ($project eq 'emi' and $project_version == 1) {
- # no sub-packages in EMI-1
- } else {
- for my $sub (keys %subpackages) {
- push @m, $sub if ($subpackages{$sub} eq $listmodules);
- }
- }
- }
- print map $_ eq "" ? "" : "$_ ", @m;
- print "\n";
- exit 0;
-}
-
-warn "$0: --branch and --output make sense only in --mode=etics\n"
- if ($output || $branch) && $mode ne 'etics';
-
-my $en;
-for (keys %enable_nodes) { $en = 1 if $enable_nodes{$_}; }
-
-my $dis;
-for (keys %disable_nodes) { $dis = 1 if $disable_nodes{$_}; }
-
-die "--enable-* and --disable-* are mutually exclusive\n"
- if $en && $dis;
-
-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{jp}};
-
-if ($dis) {
- for (@nodes) {
- $enable_nodes{$_} = 1 unless ($disable_nodes{$_} or not $default_nodes{$_});
- }
-}
-
-if (!$en && !$dis) { for (@nodes) { $enable_nodes{$_} = 1 if ($default_nodes{$_}) } };
-
-for (keys %enable_nodes) { delete $enable_nodes{$_} unless $enable_nodes{$_}; }
-
-$stagedir = $root unless $stagedir;
-$stagedir=~s/\/$// if ($stagedir);
-
-if ($mode eq 'build') { for my $ext (keys %externs) {
- if (defined $externs{$ext} and defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; }
- elsif (defined $externs{$ext}{pkg}) {
- my ($flag, $env, $cmd, $ret);
- my $pkg = $externs{$ext}{pkg};
- my $flagname = uc $externs{$ext}{pkg};
- $flagname =~ s/-[0-9\.]*$//;
- $flagname =~ y/-\+/_X/;
-
- print "Checking $pkg ... ";
- $env = "PKG_CONFIG_PATH=$pkg_config_env$stagedir$prefix/$libdir/pkgconfig";
- $cmd = "$env pkg-config $pkg --exists >/dev/null";
- `$cmd`; $ret = $?;
- print "('$cmd' => $ret)\n" if ($debug);
- if ($ret == 0) {
- $externs{$ext}{prefix}=`$env pkg-config $pkg --variable=prefix`;
- chomp $externs{$ext}{prefix};
- print "$externs{$ext}{prefix}\n";
-
- $flag=`$env pkg-config $pkg --cflags`;
- $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag);
- $flag=`$env pkg-config $pkg --libs`;
- $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag);
- } else {
- print "(using default $externs{$ext}{prefix})\n";
- }
- print "\n" if ($debug);
- }
- elsif ($ext eq 'jdk') {
- my $jdk_prefix;
-
- print "Looking for some caffein ... ";
- if (defined $ENV{'JDK_HOME'}) {
- $jdk_prefix = $ENV{'JDK_HOME'};
- print "JDK_HOME=$jdk_prefix\n";
- } elsif (defined $ENV{'JAVA_HOME'}) {
- $jdk_prefix = $ENV{'JAVA_HOME'};
- print "JAVA_HOME=$jdk_prefix\n";
- } else {
- foreach my $i (0..$#{$externs{$ext}{locations}}) {
- if (-e $externs{$ext}{locations}[$i]) {
- $jdk_prefix=$externs{$ext}{locations}[$i];
- print "(found directory $jdk_prefix)\n";
- last;
- }
- }
- print "(using default $externs{$ext}{prefix})\n" unless ($jdk_prefix);
- }
- $externs{$ext}{prefix} = $jdk_prefix if ($jdk_prefix);
- }
-} }
-
-if ($mode eq 'build') {
- print "Writing config.status\n";
- open CONF,">config.status" or die "config.status: $!\n";
- for ('JDK_HOME', 'JAVA_HOME', 'PKG_CONFIG_PATH') {
- print CONF "$_=$ENV{$_} " if (defined $ENV{$_});
- }
- print CONF "$0 @keeparg\n";
- close CONF;
-}
-
-
-my @modules;
-my %aux;
-
-if ($module) {
-# push @modules,split(/[,.]+/,$module);
- push @modules,$module;
-}
-else {
- @modules = map(($extranodmod{$_} ? $extranodmod{$_} : 'lb.'.$_),(keys %enable_nodes));
-
- my $n;
-
- do {
- local $"="\n";
- $n = $#modules;
- push @modules,(map @{$deps{$_}},@modules);
-
- undef %aux; @aux{@modules} = (1) x ($#modules+1);
- @modules = keys %aux;
- } while ($#modules > $n);
-}
-
-@aux{@modules} = (1) x ($#modules+1);
-delete $aux{$_} for (split /,/,$staged);
-@modules = keys %aux;
-
-mode_build() if $mode eq 'build';
-mode_checkout() if $mode eq 'checkout';
-mode_etics($module) if $mode eq 'etics';
-
-sub mode_build {
- print "\nBuilding modules: @modules\n";
- print "Mode: "; print $module ? "single module" : "multiple modules"; print "\n";
-
- my @ext = map @{$need_externs{$_}},@modules;
- my @myjars = map @{$need_jars{$_}},@modules;
- undef %aux; @aux{@ext} = 1;
- @ext = keys %aux;
- undef %aux; @aux{@myjars} = (1) x ($#myjars+1);
- @myjars = keys %aux;
-
- print "\nRequired externals:\n";
- print "\t$_: ".($externs{$_}{prefix}?$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;
-
- if ($module) {
- print "Not creating summary Makefile\n" if $debug;
- } else {
- print "Creating Makefile\n";
-
- open MAK,">Makefile" or die "Makefile: $!\n";
-
- print MAK "all: @modules\n\n";
- print MAK "stage: ".(join '-stage ', @modules)."-stage\n\n";
- print MAK "clean check install:\n";
-
- for (@modules) {
- my $full = full($_);
- print MAK "\tcd $full/$buildroot{$_} && \${MAKE} \$@\n"
- }
-
- print MAK "\ndistclean:\n";
-
- for (@modules) {
- my $full = full($_);
- print MAK $buildroot{$_} eq '' ?
- "\tcd $full && \${MAKE} distclean\n" :
- "\trm -rf $full/$buildroot{$_}\n"
- }
-
- print MAK "\n";
-
- for (@modules) {
- my %ldeps; undef %ldeps;
- @ldeps{@{$deps{$_}}} = 1;
- for my $x (split /,/,$staged) { delete $ldeps{$x}; }
- my @dnames = $module ? () : keys %ldeps;
- my $snames = $#dnames == -1 ? '' : join('-stage ', @dnames).'-stage';
-
- my $full = full($_);
- my $build = $buildroot{$_};
-
- print MAK "$_: @dnames\n\tcd $full/$build && \${MAKE} && \${MAKE} install\n\n";
- print MAK "$_-stage: $snames\n\tcd $full/$build && \${MAKE} && \${MAKE} stage\n\n";
- }
-
- close MAK;
- }
-}
-
-sub mode_checkout() {
- for (@modules) {
- my $module = $_;
- my $tag = "";
- if ($lb_tag){
- for (@{$lbmodules{lb}}){
- if ("lb.".$_ eq $module){
- $tag = '-r '.$lb_tag;
- }
- }
- }
- if ($lbjp_tag) {
- for (@{$lbmodules{'lbjp-common'}}){
- if ("lbjp-common.".$_ eq $module){
- $tag = '-r '.$lbjp_tag;
- }
- }
- }
- if ($jp_tag){
- for (@{$lbmodules{'jp'}}){
- if ("jp.".$_ eq $module){
- $tag = '-r '.$jp_tag;
- }
- }
- }
- if ($jobid_tag){
- for (@{$lbmodules{jobid}}){
- if ("jobid.".$_ eq $module){
- $tag = '-r '.$jobid_tag;
- }
- }
- }
- if ($canl_tag) {
- for (@{$lbmodules{'canl'}}){
- if ("canl.".$_ eq $module){
- $tag = '-r '.$canl_tag;
- }
- }
- }
- #if (grep {"lb.".$_ eq $module} @{$lbmodules{lb}}){
- # print "found";
- #}
- $_ = full($_);
- print "\n*** Checking out $_\n";
- system("cvs checkout $tag $_") == 0 or die "cvs checkout $tag $_: $?\n";
- }
-}
-
-BEGIN{
-%etics_externs = (
- default => {
- 'myproxy-devel'=>'myproxy-devel',
- 'myproxy-server'=>'myproxy-server',
- 'myproxy-admin'=>'myproxy-admin',
- cares=>'c-ares',
- utiljava=>'org.glite.security.util-java',
- gpt=>'gpt',
- fetchcrl=>'fetch-crl',
- activemq=>'activemq-cpp-library',
- },
-);
-
-%etics_projects = (
-);
-
-%need_externs_aux = (
- 'lb.client' => [ qw/cppunit:B classads libtool:B globus:B/ ],
- 'lb.common' => [ qw/expat cares:B cppunit:B classads libtool:B globus:B/ ],
- 'lb.doc' => [ qw/tetex-latex:B/ ],
- 'lb.logger' => [ qw/cppunit:B libtool:B globus:B/ ],
- 'lb.logger-msg' => [ qw/cppunit:B activemq libtool:B globus:B/ ],
- 'lb.nagios' => [ qw/globus_proxy_utils:R/ ],
- 'lb.server' => [ qw/globus_essentials:R globus:B expat cares mysql-server:R cppunit:B gsoap:B classads voms:B lcas gridsite:B bison:B libtool:B libxml2 flex:B/ ],
- 'lb.state-machine' => [ qw/classads libtool:B libxslt:B expat:B globus:B/ ],
- 'lb.utils' => [ qw/cppunit:B libtool:B globus:B/ ],
- 'lb.ws-interface' => [ qw/libxslt:B tidy:B/ ],
- 'lb.ws-test' => [ qw/gsoap:B libtool:B globus:B/ ],
- 'lb.types' => [ qw// ],
- 'lb.harvester' => [ qw/docbook-utils:B libtool:B globus:B/ ],
- 'lbjp-common.db' => [ qw/mysql-devel:B postgresql:B cppunit:B log4c:B libtool:B/ ],
- 'lbjp-common.log' => [ qw/log4c libtool:B/ ],
- 'lbjp-common.maildir' => [ qw/libtool:B/ ],
- 'lbjp-common.server-bones' => [ qw/libtool:B/ ],
- 'lbjp-common.trio' => [ qw/cppunit:B libtool:B/ ],
- 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B libtool:B/ ],
- 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B libtool:B/ ],
- 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap gsoapxx libtool:B/ ],
- 'jobid.api-c' => [ qw/cppunit:B libtool:B openssl:B/ ],
- 'jobid.api-cpp' => [ qw/cppunit:B libtool:B/ ],
- 'jobid.api-java' => [ qw/ant:B jdk:B/ ],
- 'jp.client' => [ qw/gsoap libtar globus_essentials:R globus:B/ ],
- 'jp.doc' => [],
- 'jp.index' => [ qw/gsoap globus_essentials:R globus:B mysql-server:R/ ],
- 'jp.primary' => [ qw/classads gsoap libtar globus_essentials:R globus:B mysql-server:R/ ],
- 'jp.server-common' => [],
- 'jp.ws-interface' => [],
- 'gridsite.core' => [ qw/httpd-devel:B gsoap:B globus:B curl:B doxygen:B fuse-devel:B libxml2:B openssl:B doxygen:B/ ],
- 'gridsite.commands' => [ qw/curl:R openssl:R/ ],
- 'gridsite.apache' => [ qw/libxml2:R openssl:R curl:R/ ],
- 'gridsite.libs' => [ qw/libxml2:R openssl:R/ ],
- 'gridsite.devel' => [ qw// ],
- 'gridsite.slashgrid' => [ qw/curl:R fuse:R/],
- 'gridsite.services' => [ qw/curl:R gsoap:R/ ],
- 'gridsite.service-clients' => [ qw/curl:R gsoap:R gsoapxx:R/ ],
- 'gridsite.gsexec' => [ qw// ],
- 'gridsite.1.5-compat' => [ qw/httpd-devel:B gsoap:B globus:B curl:B doxygen:B fuse-devel:B libxml2:B openssl:B doxygen:B/ ],
- 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-devel:B voms:B libtool:B/ ],
- 'px.myproxy-config' => [ qw/myproxy-admin:R/ ], # in myproxy-config.spec
- 'canl.c' => [ qw/cares:B openssl:B libtool:B bison:B flex:B krb5-devel:B/ ],
-);
-
-%need_jars = (
- 'jobid.api-java' => [ qw/jakarta-commons-codec/ ],
- 'lb.client-java' => [ qw/jakarta-commons-lang/ ],
-);
-
-for my $jar (keys %need_jars) {
- for (@{$need_jars{$jar}}) {
- $need_externs_type{$jar}->{$_} = 'BR'; # XXX
- }
-}
-
-%deps_aux = (
- 'lb.client' => [ qw/
- lb.types:B lb.common
- lbjp-common.trio
- jobid.api-cpp:B jobid.api-c
- lbjp-common.gss
- / ],
- 'lb.client-java' => [ qw/
- lb.types:B
- lb.ws-interface:B
- jobid.api-java
- / ],
- 'lb.common' => [ qw/
- jobid.api-cpp:B jobid.api-c
- lb.types:B lbjp-common.trio lbjp-common.gss
- / ],
- 'lb.doc' => [ qw/lb.types:B/ ],
- 'lb.logger' => [ qw/
- lbjp-common.trio
- lbjp-common.log
- jobid.api-c
- lb.common
- lbjp-common.gss
- / ],
- 'lb.logger-msg' => [ qw/
- lb.logger:B
- / ],
- 'lb.nagios' => [ qw/
- lb.client:R
- lb.ws-test:R
- lb.utils:R
- / ],
- 'lb.server' => [ qw/
- lb.ws-interface lb.types:B lb.common lb.state-machine lb.utils:R
- lbjp-common.db lbjp-common.server-bones lbjp-common.trio lbjp-common.maildir lbjp-common.log
- jobid.api-c
- lbjp-common.gsoap-plugin lbjp-common.gss
- / ],
- 'lb.state-machine' => [ qw/lb.types:B lb.common lbjp-common.jp-interface lbjp-common.gss/ ],
- 'lb.utils' => [ qw/
- lbjp-common.jp-interface
- jobid.api-c
- lbjp-common.trio lbjp-common.maildir
- lb.client lb.state-machine lb.types:B
- / ],
- 'lb.ws-test' => [ qw/lbjp-common.gsoap-plugin lb.ws-interface/ ],
- 'lb.ws-interface' => [ qw/lb.types:B/ ],
- 'lb.types' => [ qw// ],
- 'lb.harvester' => [ qw/
- jobid.api-c lbjp-common.trio lbjp-common.db lb.common lb.client
- lbjp-common.gss lbjp-common.log
- / ],
- 'lb.yaim' => [ qw// ],
- 'lb.glite-LB' => [ qw/
- lb.logger:R lb.server:R lb.utils:R lb.doc:R
- lb.ws-test:R lb.harvester:R lb.yaim:R lb.client-java:R
- lb.logger-msg:R
- / ],
- 'lb.emi-lb' => [ qw/
- lb.logger:R lb.server:R lb.utils:R lb.doc:R
- lb.ws-test:R lb.harvester:R lb.yaim:R lb.client-java:R
- lb.logger-msg:R
- / ],
- 'lbjp-common.db' => [ qw/lbjp-common.trio lbjp-common.log/ ],
- 'lbjp-common.maildir' => [ qw// ],
- 'lbjp-common.log' => [ qw// ],
- 'lbjp-common.server-bones' => [ qw/lbjp-common.log/ ],
- 'lbjp-common.trio' => [ qw// ],
- 'lbjp-common.gss' => [ qw// ],
- 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ],
- 'jobid.api-c' => [ qw// ],
- 'jobid.api-cpp' => [ qw/jobid.api-c/ ],
- 'jobid.api-java' => [ qw// ],
-
- 'lbjp-common.jp-interface' => [ qw/lbjp-common.trio lbjp-common.db jobid.api-c/ ],
-
- 'jp.client' => [ qw/
- jp.ws-interface
- lbjp-common.jp-interface lbjp-common.maildir
- jobid.api-c
- lbjp-common.gsoap-plugin
- / ],
- 'jp.doc' => [ qw// ],
- 'jp.index' => [ qw/
- jp.server-common jp.ws-interface
- lbjp-common.jp-interface lbjp-common.trio lbjp-common.db lbjp-common.server-bones
- lbjp-common.gsoap-plugin
- / ],
- 'jp.primary' => [ qw/
- jobid.api-c
- jp.server-common jp.ws-interface
- lb.state-machine
- lbjp-common.jp-interface lbjp-common.trio lbjp-common.db lbjp-common.server-bones
- lbjp-common.gsoap-plugin
- / ],
- 'jp.server-common' => [ qw/
- lbjp-common.jp-interface lbjp-common.db
- / ],
- 'jp.ws-interface' => [ qw// ],
-
- 'gridsite.core' => [ qw// ],
- 'gridsite.commands' => [ qw/gridsite.core:B/ ],
- 'gridsite.apache' => [ qw/gridsite.core:B/ ],
- 'gridsite.libs' => [ qw/gridsite.core:B / ],
- 'gridsite.devel' => [ qw/gridsite.core:B/ ],
- 'gridsite.slashgrid' => [ qw/gridsite.core:B/],
- 'gridsite.services' => [ qw/gridsite.core:B/ ],
- 'gridsite.service-clients' => [ qw/gridsite.core:B/ ],
- 'gridsite.gsexec' => [ qw/gridsite.core:B/ ],
-
- 'px.proxyrenewal' => [ qw// ],
- 'px.glite-PX' => [qw/px.myproxy-yaim:R/],
- 'px.emi-px' => [qw/px.myproxy-yaim:R/],
- 'px.myproxy-yaim' => [ qw// ],
- 'px.myproxy-config' => [],
-
- 'canl.c' => [],
-
- # sub-packages (virtual ETICS components depending on the main)
- 'jobid.api-c-devel' => [ qw/jobid.api-c:B/ ],
- 'jobid.api-cpp-devel' => [ qw/jobid.api-cpp:B/ ],
- 'lbjp-common.db-devel' => [ qw/lbjp-common.db:B/ ],
- 'lbjp-common.gsoap-plugin-devel' => [ qw/lbjp-common.gsoap-plugin:B/ ],
- 'lbjp-common.gss-devel' => [ qw/lbjp-common.gss:B/ ],
- 'lbjp-common.jp-interface-devel' => [ qw/lbjp-common.jp-interface:B/ ],
- 'lbjp-common.log-devel' => [ qw/lbjp-common.log:B/ ],
- 'lbjp-common.maildir-devel' => [ qw/lbjp-common.maildir:B/ ],
- 'lbjp-common.server-bones-devel' => [ qw/lbjp-common.server-bones:B/ ],
- 'lbjp-common.trio-devel' => [ qw/lbjp-common.trio:B/ ],
- 'lb.client-progs' => [ qw/lb.client:B/ ],
- 'lb.client-devel' => [ qw/lb.client:B/ ],
- 'lb.common-devel' => [ qw/lb.common:B/ ],
- 'lb.logger-devel' => [ qw/lb.logger:B/ ],
- 'lb.state-machine-devel' => [ qw/lb.state-machine:B/ ],
- 'px.proxyrenewal-devel' => [ qw/px.proxyrenewal:B/ ],
- 'px.proxyrenewal-progs' => [ qw/px.proxyrenewal:B/ ],
- 'canl.c-devel' => [ qw/canl.c:B/ ],
-);
-
-for my $ext (keys %deps_aux) {
- for (@{$deps_aux{$ext}}) {
- /([^:]*)(?::(.*))?/;
- push @{$deps{$ext}},$1;
- my $type = $2 ? $2 : 'BR';
- $deps_type{$ext}->{$1} = $type;
- }
-}
-
-
-%extrafull = (
- gridsite=>'org.gridsite.core',
- 'canl.c' => 'emi.canl.canl-c',
- 'canl.c-devel' => 'emi.canl.canl-c',
- 'jobid.api-c-devel' => 'org.glite.jobid.api-c',
- 'jobid.api-cpp-devel' => 'org.glite.jobid.api-cpp',
- 'lbjp-common.db-devel' => 'org.glite.lbjp-common.db',
- 'lbjp-common.gsoap-plugin-devel' => 'org.glite.lbjp-common.gsoap-plugin',
- 'lbjp-common.gss-devel' => 'org.glite.lbjp-common.gss',
- 'lbjp-common.jp-interface-devel' => 'org.glite.lbjp-common.jp-interface',
- 'lbjp-common.log-devel' => 'org.glite.lbjp-common.log',
- 'lbjp-common.maildir-devel' => 'org.glite.lbjp-common.maildir',
- 'lbjp-common.server-bones-devel' => 'org.glite.lbjp-common.server-bones',
- 'lbjp-common.trio-devel' => 'org.glite.lbjp-common.trio',
- 'lb.client-devel' => 'org.glite.lb.client',
- 'lb.client-progs' => 'org.glite.lb.client',
- 'lb.common-devel' => 'org.glite.lb.common',
- 'lb.logger-devel' => 'org.glite.lb.logger',
- 'lb.state-machine-devel' => 'org.glite.lb.state-machine',
- 'px.proxyrenewal-devel' => 'org.glite.px.proxyrenewal',
- 'px.proxyrenewal-progs' => 'org.glite.px.proxyrenewal',
-);
-
-#( java => 'client-java' );
-%extranodmod = (
- db => 'lbjp-common.db',
- jpprimary => 'jp.primary',
- jpindex => 'jp.index',
- jpclient => 'jp.client',
- lb => 'lb.glite-LB',
- px => 'px.glite-PX',
- proxyrenewal => 'px.proxyrenewal',
- canl => 'canl.c',
-);
-
-%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/ ],
-);
-
-%conflicts = (
-);
-
-%provides = (
- 'lbjp-common.gss' => [ qq/glite-security-gss/ ],
- 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ],
- 'lb.nagios' => [ qq/glite-lb-nagios-plugins/ ],
-);
-
-%cvs_prefix = (
- 'lb' => 'org.glite',
- 'jp' => 'org.glite',
- 'jobid' => 'org.glite',
- 'lbjp-common' => 'org.glite',
- 'gridsite' => 'org',
- 'px' => 'org.glite',
- 'canl' => 'emi',
-);
-
-%cvs_tag_prefix = (
- 'lb' => 'glite-',
- 'jp' => 'glite-',
- 'jobid' => 'glite-',
- 'lbjp-common' => 'glite-',
- 'gridsite' => '',
- 'px' => 'glite-',
- 'canl' => 'emi-',
-);
-
-# ==== projects specification ====
-# etics_name ........... ETICS project name
-# conf_prefix .......... ETICS configurations name prefix
-# tag_prefix ........... VCS tag prefix
-# local_prefix ......... prefix (relative to stage)
-# etics_externs ........ ETICS modules names of externals
-# (${NAME.location}, ETICS conf. dependencies)
-# etics_projects ....... ETICS project names of externals
-# etics_externs_devel .. ETICS modules names of devel versions of externals
-# etics_locations ...... ETICS locations in ${NAME.location} properties
-# need_externs_aux ..... project-specific external dependencies
-# supported_platforms .. platforms supported by the project
-# modules .............. additional modules in subsystems
-%projects = (
- glite => {
- current_version => 3,
- etics_name => 'org.glite',
- conf_prefix => { %cvs_tag_prefix },
- tag_prefix => { %cvs_tag_prefix },
- flavours => '--thrflavour=${globus.thr.flavor} --nothrflavour=${globus.nothr.flavor}',
- local_prefix => '',
- etics_externs => {
- default => {
- globus_essentials=>'vdt_globus_essentials',
- globus=>'globus',
- globus_proxy_utils=>'vdt_globus_essentials',
- gridsite=>'org.gridsite.libs',
- yaim_core=>'org.glite.yaim.core',
- gip_release=>'glite-info-provider-release',
- gip_service=>'glite-info-provider-service',
- bdii=>'bdii',
- glite_version=>'glite-version',
- glite_info_templates=>'glite-info-templates',
- glue_schema=>'glue-schema',
- trustmanager=>'org.glite.security.trustmanager',
- axis=>'axis',
- lcas=>'org.glite.security.lcas',
- gsoapxx=>'-',
- jdk=>'jdk',
- voms=>'org.glite.security.voms-api-cpp',
- },
- },
- etics_externs_devel => {
- default => {
- gridsite=>'org.gridsite.devel',
- voms=>'org.glite.security.voms-api',
- },
- },
- etics_projects => {
- vdt=>[qw/globus globus_essentials globus_proxy_utils gpt/],
- 'org.glite'=>[qw/voms gridsite lcas gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/],
- },
- etics_locations => {
- '*' => '',
- },
- need_externs_aux => {
- 'lb.client-java' => [ qw/ant:B jdk:B axis:B trustmanager utiljava libtool:B/ ],
- 'lb.glite-LB' => [ qw/fetchcrl:R gpt:R gip_release:R gip_service:R bdii:R glite_version:R glite_info_templates:R glue_schema:R/ ],
- 'lb.yaim' => [ qw/yaim_core:R/ ],
- 'px.glite-PX' => [qw/myproxy-server:R myproxy-admin:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/],
- 'px.myproxy-yaim' => [ qw/yaim_core:R/ ],
- },
- supported_platforms => {
- sl5_x86_64_gcc412 => 1,
- sl5_ia32_gcc412 => 1,
- deb5_x86_64_gcc432 => 1,
- deb5_ia32_gcc432 => 1,
- slc4_x86_64_gcc346 => 1,
- slc4_ia32_gcc346 => 1,
- },
- modules => {
- 'lb' => [ qw/glite-LB/ ],
- 'px' => [ qw/glite-PX/ ],
- },
- },
-
- emi => {
- current_version => 2,
- etics_name => 'emi',
- conf_prefix => {
- 'lb' => 'emi-',
- 'jp' => 'emi-',
- 'jobid' => 'emi-',
- 'lbjp-common' => 'emi-',
- 'gridsite' => 'emi-',
- 'px' => 'emi-',
- 'canl' => 'emi-',
- },
- tag_prefix => { %cvs_tag_prefix },
- flavours => '--thrflavour= --nothrflavour=',
- local_prefix => '/usr',
- etics_externs => {
- default => {
- globus_essentials=>'globus-gssapi-gsi',
- globus=>'globus-gssapi-gsi-devel',
- globus_proxy_utils=>'globus-proxy-utils',
- gridsite=>'emi.gridsite.libs',
- yaim_core=>'emi.yaim.yaim-core',
- yaim_bdii=>'emi.bdii.yaim-bdii',
- gip_service=>'emi.bdii.glite-info-provider-service',
- bdii=>'emi.bdii.core',
- glite_version=>'emi.emi-version',
- glue_schema=>'emi.bdii.glue-schema',
- trustmanager=>'emi.java-security.trustmanager',
- trustmanager_axis=>'emi.java-security.trustmanager-axis',
- axis=>'axis1.4',
- lcas=>'emi.sac.lcas',
- gsoapxx=>'-',
- jdk=>'java',
- voms => 'emi.voms.voms-api',
- },
- sl5_x86_64_gcc412EPEL => {
- 'myproxy-devel' => 'myproxy-devel.x86_64',
- },
- sl6_x86_64_gcc446EPEL => {
- 'myproxy-devel' => 'myproxy-devel.x86_64',
- },
- deb6_x86_64_gcc445 => {
- axis => 'axis1.4',
- # mappings in ETICS project configuration
- #globus_essentials => 'libglobus-gssapi-gsi4',
- #globus => 'libglobus-gssapi-gsi-dev',
- #axis => 'libaxis-java',
- #cares => 'libc-ares2',
- #cppunit => 'libcppunit',
- #expat => 'libexpat1',
- #log4c => 'liblog4c3',
- #curl => 'libcurl3',
- #'mysql' => 'libmysqlclient16',
- #'mysql-devel' => 'libmysqlclient-dev',
- #libxslt => 'xsltproc',
- #'jakarta-commons-codec' => 'libcommons-codec-java',
- #'jakarta-commons-lang' => 'libcommons-lang-java',
- #'tetex-latex' => 'texlive-latex-extra',
- #'perl-LDAP' => 'libnet-ldap-perl',
- #'fuse-lib' => 'libfuse2',
- #'fuse' => 'fuse-utils',
- },
- },
- etics_externs_devel => {
- default => {
- cares => 'c-ares-devel',
- classads => 'classads-devel',
- cppunit => 'cppunit-devel',
- expat => 'expat-devel',
- gsoap => 'gsoap-devel',
- voms => 'emi.voms.voms-api-devel',
- libtar => 'libtar-devel',
- log4c => 'log4c-devel',
- postgresql => 'postgresql-devel',
- curl => 'curl-devel',
- libxml2 => 'libxml2-devel',
- openssl => 'openssl-devel',
- gridsite=>'emi.gridsite.devel',
- jdk=>'java-devel',
- },
- deb6_x86_64_gcc445 => {
- # mappings in ETICS project configuration
- #cares => 'libc-ares-dev',
- #cppunit => 'libcppunit-dev',
- #expat => 'libexpat1-dev',
- #libtar => 'libtar-dev',
- #log4c => 'liblog4c-dev',
- #postgresql => 'libpq-dev',
- #curl => 'libcurl4-openssl-dev',
- #libxml2 => 'libxml2-dev',
- #openssl => 'libssl-dev',
- #'tetex-latex' => 'texlive-latex-extra',
- #libxslt=>'xsltproc',
- #'httpd-devel' => 'apache2-prefork-dev',
- #'fuse-devel' => 'libfuse-dev',
- #gsoap => 'gsoap',
- #'krb5-devel' => 'libkrb5-dev',
- },
- },
- etics_projects => {
- 'emi'=>[qw/voms voms-devel gridsite lcas gip_service bdii glite_version glue_schema yaim_core yaim_bdii trustmanager trustmanager_axis/],
- },
- etics_locations => {
- axis => 'axis',
- },
- need_externs_aux => {
- 'lb.client-java' => [ qw/ant:B jdk:B axis:B trustmanager trustmanager_axis libtool:B/ ],
- 'lb.emi-lb' => [ qw/fetchcrl:R gip_service:R bdii:R glite_version:R glue_schema:R/ ],
- 'lb.yaim' => [ qw/yaim_core:R yaim_bdii:R/ ],
- 'px.emi-px' => [qw/myproxy-server:R myproxy-admin:R fetchcrl:R gip_service:R bdii:R glite_version:R glue_schema:R/],
- 'px.myproxy-yaim' => [ qw/yaim_core:R yaim_bdii:R/ ],
- },
- supported_platforms => {
- sl5_x86_64_gcc412EPEL => 1,
- sl5_ia32_gcc412EPEL => 1,
- sl6_x86_64_gcc446EPEL => 1,
- deb6_x86_64_gcc445 => 1,
- },
- modules => {
- 'lb' => [ qw/emi-lb/ ],
- 'px' => [ qw/emi-px/ ],
- },
- },
-);
-
-%platform_properties = (
- 'jobid.api-java' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.types' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.doc' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.ws-interface' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.yaim' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.nagios' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'px.yaim' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'px.myproxy-config' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'gridsite.devel' => {
- default => { 'packageName' => 'gridsite-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libgridsite-dev' },
- },
- 'canl.c-devel' => {
- default => { 'packageName' => 'canl-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libcanl-dev' },
- },
- 'jobid.api-c-devel' => {
- default => { 'packageName' => 'glite-jobid-api-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-jobid-dev' },
- },
- 'jobid.api-cpp-devel' => {
- default => { 'packageName' => 'glite-jobid-api-cpp-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-jobid-cpp-dev' },
- },
- 'lbjp-common.db-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-db-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-db-dev' },
- },
- 'lbjp-common.gsoap-plugin-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-gsoap-plugin-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-gsoap-plugin-dev' },
- },
- 'lbjp-common.gss-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-gss-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-gss-dev' },
- },
- 'lbjp-common.jp-interface-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-jp-interface-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-jp-interface-dev' },
- },
- 'lbjp-common.log-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-log-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-log-dev' },
- },
- 'lbjp-common.maildir-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-maildir-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-maildir-dev' },
- },
- 'lbjp-common.server-bones-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-server-bones-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-server-bones-dev' },
- },
- 'lbjp-common.trio-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-trio-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-trio-dev' },
- },
- 'lb.client-devel' => {
- default => { 'packageName' => 'glite-lb-client-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-client-dev' },
- },
- 'lb.common-devel' => {
- default => { 'packageName' => 'glite-lb-common-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-common-dev' },
- },
- 'lb.state-machine-devel' => {
- default => { 'packageName' => 'glite-lb-state-machine-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-state-machine-dev' },
- },
- 'lb.logger-devel' => {
- default => { 'packageName' => 'glite-lb-logger-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-logger-dev' },
- },
- 'px.proxyrenewal-devel' => {
- default => { 'packageName' => 'glite-px-proxyrenewal-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-security-proxyrenewal-dev' },
- },
- 'canl.c-devel' => {
- default => { 'packageName' => 'canl-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libcanl-c-dev' },
- },
-);
-
-my @k = keys %deps_aux;
-@buildroot{@k} = ('') x ($#k+1);
-
-$buildroot{'gridsite.core'} = 'src';
-}
-
-sub full
-{
- my ($short) = @_;
- my $subsys = $short;
- $subsys =~ s/\..*//;
-
- my $cvs_prefix = exists $cvs_prefix{$subsys} ? $cvs_prefix{$subsys} : 'org.glite';
- return $extrafull{$short} ? $extrafull{$short} : "$cvs_prefix.$short";
-}
-
-sub get_version
-{
- my ($fmod, $top_srcdir) = @_;
-
- my ($subsys,$mod) = split /\./,$fmod,2;
- my ($major,$minor,$rev,$age);
- my $old_;
-
- if ($force_version) {
- $force_version =~ /([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)-(.+)/;
- ($major,$minor,$rev,$age) = ($1,$2,$3,$4);
- }
- else {
- my $path = "$top_srcdir/project";
- if ($subsys eq 'gridsite') {
- $path = "$cvs_prefix{$subsys}.$subsys.core/project";
- }
- open V,"$path/version.properties"
- or die "$path/version.properties: $!\n";
-
- $old_ = $_;
- while (<V>) {
- chomp;
- ($major,$minor,$rev) = ($1,$2,$3) if /module\.version\s*=\s*([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/;
- $age = $1 if /module\.age\s*=\s*([[:digit:]]+)/;
- }
- close V;
- $_ = $old_;
- }
- $version = "$major.$minor.$rev-$age";
-
- return ($major, $minor, $rev, $age);
-}
-
-sub get_description
-{
- my ($top_srcdir) = @_;
-
- my $cvs_module = $top_srcdir;
- my $package_description = "";
- my $package_summary = "";
-
- if (-e "$cvs_module/project/package.description") {
- open V, "$cvs_module/project/package.description";
- $package_description = join ("", <V>);
- close V;
- chomp $package_description;
- }
- else {
- print STDERR "package.description not found for $subsys.$module!\n"; }
-
- if (-e "$cvs_module/project/package.summary") {
- open V, "$cvs_module/project/package.summary";
- $package_summary = join ("", <V>);
- close V;
- chomp $package_summary;
- $package_summary =~ s/\n/\\n/g;
- }
- else {
- print STDERR "package.summary not found for $subsys.$module!\n"; }
-
- return ($package_summary, $package_description);
-}
-
-sub mkinc
-{
- my %aux;
- undef %aux;
- my @m=qw/
-lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.nagios lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lb.emi-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
-px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config px.emi-px
-canl.c
-/;
- @aux{@m} = (1) x ($#m+1);
-
- my ($short) = @_;
- my $full = full $short;
- my ($subsys,$mod) = split /\./,$short,2;
- my $packageName = "$project{tag_prefix}{$subsys}$subsys-${mod}";
-
- unless ($aux{$short}) {
- print "Makefile.inc not needed in $full\n";
- return;
- }
-
- my $top_srcdir = '.';
- my $abs_srcdir = '';
- my $build = '';
-
- if ($module) {
- $top_srcdir = $0;
- $top_srcdir =~ s,/?[^/]*$,,;
- $abs_srcdir = $top_srcdir;
- $top_srcdir =~ s,^$,\.,;
- } else {
- $build = "$full/";
- $abs_srcdir = "$full/";
- unless ($buildroot{$_} eq '') {
- $top_srcdir = '..';
- $build .= "$buildroot{$_}/";
- unless (-d "$build") {
- mkdir "$build" or die "mkdir $build: $!\n";
- }
- }
- }
-
- my ($major, $minor, $rev, $age) = get_version $short, $abs_srcdir;
- my ($package_summary, $package_description) = get_description $abs_srcdir;
- if ($package_description) { $package_description =~ s/(.{1,78}\S|\S+)\s+/$1\n/mg; }
- my $package_description_debian = $package_description;
- $package_description_debian =~ s/^/ /mg;
-
- my ($old_locale, $specdate, $debdate);
-
- # files for ETICS always in root source directory
- mkdir $abs_srcdir."project" unless (-d $abs_srcdir."project");
- open PKGCHL,">".$abs_srcdir."project/changelog"
- or die $abs_srcdir."project/changelog: $!\n";
- $old_locale = setlocale(LC_TIME);
- setlocale(LC_TIME, "C");
- $specdate = strftime("%a %b %d %Y", gmtime());
- $debdate = strftime("%a, %d %b %Y %H:%M:%S %z", gmtime());
- setlocale(LC_TIME, $old_locale);
- print PKGCHL qq{* $specdate CESNET team <emi-lb\@metacentrum.cz>
-- automatically generated package
-};
- close PKGCHL;
-
- unless ($top_srcdir eq '.') {
- unlink $build."Makefile";
- symlink "$top_srcdir/Makefile",$build."Makefile" or die "symlink $top_srcdir/Makefile ".$build."Makefile: $!\n";
- }
-
- open MKINC,">".$build."Makefile.inc"
- or die $build."Makefile.inc: $!\n";
-
- print "Creating ".$build."Makefile.inc\n";
-
- print MKINC qq{project = $project
-PREFIX = $root
-prefix = $prefix
-stagedir = $stagedir
-sysroot = $sysroot
-sysconfdir = $sysconfdir
-localstatedir = $localstatedir
-thrflavour = $thrflavour
-nothrflavour = $nothrflavour
-libdir = $libdir
-top_srcdir = $top_srcdir
-};
-
- for (@{$need_externs{$short}}) {
- next unless defined $externs{$_} and defined $externs{$_}{prefix};
- print MKINC "${_}_prefix = $externs{$_}{prefix}\n";
- print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags};
- }
-
- for (@{$need_jars{$short}}) {
- print MKINC "${_}_jar = $jar{$_}\n"
- }
-
- my $need_gsoap = 0;
- for (@{$need_externs{$short}}) { $need_gsoap = 1 if $_ eq 'gsoap'; }
-
- print MKINC "gsoap_default_version=".gsoap_version()."\n" if $need_gsoap;
-
- close MKINC;
-
- my $dh;
- my $debian = 0;
-
- opendir $dh, "$abs_srcdir/project" || die "Can't open $abs_srcdir/project: $!";
- for my $dir (readdir $dh) {
- if ($dir=~/^(.*)\.spec$/) {
- if ($1 ne $packageName) {
- printf STDERR "Changed RPM name: $packageName --> $1\n" if ($debug);;
- $packageName=$1;
- }
- last;
- }
- }
- closedir $dh;
-
- for my $file ("$packageName.spec", "debian.rules", "debian.control", "debian.changelog", "debian.copyright") {
- if (-f "$abs_srcdir/project/$file") {
- my $old_ = $_;
- printf STDERR "Creating $build$file\n" if ($debug);;
- open DST, ">$build$file";
- open SRC, "<$abs_srcdir/project/$file";
- while (<SRC>) {
- if (/\@MODULE\@/) { s/\@MODULE\@/$full/g; }
- if (/\@URL\@/) { s/\@URL\@/$package{url}/g; }
- if (/\@SUMMARY\@/) { s/\@SUMMARY\@/$package_summary/g; }
- if (/\@DESCRIPTION\@/) { s/\@DESCRIPTION\@/$package_description/g; }
- if (/\@DEBIAN_DESCRIPTION\@/) { s/\@DEBIAN_DESCRIPTION\@/$package_description_debian/g; }
- if (/\@VERSION\@/) { s/\@VERSION\@/$version/g; }
- if (/\@MAJOR\@/) { s/\@MAJOR\@/$major/g; }
- if (/\@MINOR\@/) { s/\@MINOR\@/$minor/g; }
- if (/\@REVISION\@/) { s/\@REVISION\@/$rev/g; }
- if (/\@AGE\@/) { s/\@AGE\@/$age/g; }
- if (/\@MAINTAINER\@/) { s/\@MAINTAINER\@/$package{maintainer}/g; }
- if (/\@UPLOADERS\@/) { s/\@UPLOADERS\@/$package{uploaders}/g; }
- if (/\@DEBIAN_VCS\@/) { s/\@DEBIAN_VCS\@/$package{debian_vcs}/g; }
- if (/\@DEBIAN_DATE\@/) { s/\@DEBIAN_DATE\@/$debdate/g; }
- if (/\@SPEC_DATE\@/) { s/\@SPEC_DATE\@/$specdate/g; }
- if (/^\s*.+\/configure\s/ and $force_version) {
- print "Version forced to $version\n" if ($debug);;
- s/--version\s+\S+\s?//;
- s/$/ --version $version/;
- }
- printf DST "%s", "$_";
- }
- close SRC;
- close DST;
- $_ = $old_;
- }
- }
-
- print "Creating ${build}debian/\n" if ($debug);;
-
- `rm -rfv ${build}debian`;
- mkdir $build."debian" or die $!;
- `cp $abs_srcdir/project/debian.* ${build}debian/ 2>/dev/null`;
- `mv ${build}debian.* ${build}debian/ 2>/dev/null`;
- `rm -f ${build}debian/*.orig`;
- opendir $dh, "${build}debian" || die "Can't open ${build}debian: $!";
- for $_ (readdir $dh) {
- if (/^debian\.(.*)/) {
- `mv ${build}debian/$_ ${build}debian/$1`;
- $debian = 1;
- }
- }
- closedir $dh;
-
- if ($debian) {
- my ($dir, $file);
-
- chmod 0755, "${build}debian/rules";
- $file="${build}debian/docs"; if (not -f $file) { `touch $file`; }
- $dir="${build}debian/source"; if (not -d $dir) { mkdir $dir; }
- $file="${build}debian/source/format"; if (not -f $file) { `echo "3.0 (quilt)" > $file` }
- $file="${build}debian/compat"; if (not -f $file) { `echo "7" > $file` }
- $file="${build}debian/changelog"; if (not -f $file) {
- open FH, ">$file" or die $!;
- print FH qq{$packageName ($major.$minor.$rev-$age) unstable; urgency=low
-
- * Automatically generated package
-
- -- $package{maintainer} $debdate
-};
- close FH;
- }
-
- } else {
- `rm -rf ${build}debian`;
- }
-}
-
-BEGIN{
-};
-
-sub mode_etics_packaging {
- my ($fmod, $cmd, $rpmprepare, $debprepare) = @_;
- my ($workspaceDir, $srcPackageName, $srcAge, $topDir);
-
- # old-school packaging by ETICS for EMI-1
- if ($project eq 'emi' and $project_version == 1) { return; }
-
- if ($fmod eq 'gridsite.core') {
- $workspaceDir = '..';
- $srcPackageName = 'gridsite';
- $srcAge = '';
- $topDir = '../';
- } else {
- $workspaceDir = '${workspaceDir}';
- $srcPackageName = '${packageName}';
- $srcAge = '-${age}';
- $topDir = '';
- }
-
- $cmd->{clean} = 'make clean
- rm -rfv ${package.tgzLocation} ${package.SRPMSLocation}';
- $cmd->{default}{packaging} = $rpmprepare;
- $cmd->{default}{packaging} .= "dir=\${workspaceDir}/rpm_build_src_\$\$
- mkdir -p \${package.tgzLocation} \${package.SRPMSLocation} \$dir/{BUILD,RPMS,SOURCES,SRPMS} 2>/dev/null || true
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \${package.tgzLocation}/
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \$dir/SOURCES/
- rpmbuild -bs --nodeps --define \"_topdir \$dir\" $srcPackageName.spec
- cp -v \$dir/SRPMS/*.src.rpm \${package.SRPMSLocation}/
- rm -rf \$dir";
-
- for my $p ('deb5_x86_64_gcc432', 'deb5_ia32_gcc432', 'deb6_x86_64_gcc445', 'deb6_ia32_gcc445') {
- for my $c (keys %{$cmd->{default}}) { $cmd->{$p}{$c} = $cmd->{default}{$c}; }
- $cmd->{$p}{clean} = 'make clean
- rm -rfv ${package.tgzLocation} ${package.SDEBSLocation}';
- $cmd->{$p}{packaging} = $debprepare;
- $cmd->{$p}{packaging} .= "dir=\${workspaceDir}/dpkg_build_src_\$\$
- mkdir -p \${package.tgzLocation} \${package.SDEBSLocation} \$dir 2>/dev/null || true
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \${package.tgzLocation}/
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \$dir/${srcPackageName}_\${version}.orig.tar.gz
- tar xzf \$dir/${srcPackageName}_\${version}.orig.tar.gz -C \$dir
- cp -rf ${topDir}debian/ \$dir/$srcPackageName-\${version}/
- cd \$dir/$srcPackageName-\${version}
- dpkg-buildpackage -S -d -nc
- cd -
- cp -v \$dir/*.tar.gz \$dir/*.dsc \${package.SDEBSLocation}/
- rm -rf \$dir";
- }
-}
-
-sub mode_etics {
- $fmod = shift;
-
- die "$0: --module required with --etics\n" unless $fmod;
-
- my ($subsys,$module) = split /\./,$fmod,2;
- my $full = full "$subsys.$module";
-
- my ($major,$minor,$rev,$age) = get_version $fmod, $full;
-
- # XXX: --with ignored for platform-dependend packages
- my @copts = ();
- my %ge;
- @ge{@{$etics_projects{$project{etics_name}}}} = (1) x ($#{$etics_projects{$project{etics_name}}}+1);
-
- for (@{$need_externs{"$subsys.$module"}}) {
- if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/ and (defined $externs{$_} or defined $jar{$_})) {
- my $eext = $etics_externs{default}{$_} ? $etics_externs{default}{$_} : $_;
- next if ($eext eq '-');
- if (defined $project{etics_locations}{'*'} or defined $project{etics_locations}{$_}) {
- $eext = $project{etics_locations}{$_} if ($project{etics_locations}{$_});
- push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}";
- } else {
- if ($ge{$_} and not defined $externs{$_}{pkg}) {
- push @copts, "--with-$_=\${stageDir}";
- }
- }
- }
- }
-
- for (@{$need_jars{"$subsys.$module"}}) {
- my $eext = $etics_externs{default}{$_} ? $etics_externs{default}{$_} : $_;
-
- push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (defined $project{etics_locations}{'*'} or defined $project{etics_locations}{$_});
- }
-
- my $conf;
- my $conftag;
- my ($confprefix, $nameprefix, $packageName);
-
- $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n";
-
- $confprefix = $project{conf_prefix}{$subsys};
- $nameprefix = $confprefix;
- $nameprefix =~ s/-$//;
- $nameprefix =~ s/-/\./g;
- $packageName = "$project{tag_prefix}{$subsys}$subsys-${module}";
-
- if ($branch) {
- $conf = "$confprefix${subsys}-${module}_$branch";
- $conftag = $branch;
- # forced low age number
- $age = $branch eq 'HEAD' ? '0head' : '0dev';
- push @copts, '--version ${version}-${age}';
- }
- else {
- $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}";
-# XXX: gridsite hack
- $conftag = $subsys eq 'gridsite' ? "$project{tag_prefix}{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" :
- "$project{tag_prefix}{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}";
-
- # lowering age for older packaging
- if ($project eq 'emi' and $project_version == 1) {
- $age = $age - 1;
- }
- }
-
- # emi1 suffix for older packaging
- if ($project eq 'emi' and $project_version == 1) {
- $age = $age.$project.$project_version;
- $conf = $conf.$project.$project_version;
- }
-
- my $file = $output ? $output : "$conf.ini";
- open C,">$file" or die "$file: $!\n";
-
- my $buildroot = $buildroot{"$subsys.$module"} eq '' ? '#no build.root' : "build.root = " . $buildroot{"$subsys.$module"};
-
- my $confdir = $buildroot{"$subsys.$module"} eq '' ? '.' : '..';
-
- my $cvs_module = full "$subsys.$module";
- my ($package_summary, $package_description) = get_description $cvs_module;
- if ($package_description) {
- $package_description =~ s/\n/\\n/g;
- $package_description = "package.description = $package_description\n";
- }
- if ($package_summary) {
- $package_summary = "package.summary = $package_summary\n";
- }
-
- my %cmd;
- $cmd_vcs{checkout} = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_module 2>/dev/null";
- #$cmd_vcs{checkout} = "((test -d jra1mw/.git && (cd jra1mw; git pull)) || (git clone -q http://scientific.zcu.cz/git/jra1mw.git";
- #$cmd_vcs{checkout} .= " && (cd jra1mw; git checkout -b \${tag} --track origin/\${tag})" unless ($conftag eq /HEAD/);
- #$cmd_vcs{checkout} .= ")) && (test -d \${moduleName} || ln -s jra1mw/$cvs_module \${moduleName})";
- $cmd_vcs{checkout} .= "\n\ttest -f \${packageName}-\${version}-\${age}.src.tar.gz || (ln -s \${moduleName} \${packageName}-\${version}; tar -chf - \${packageName}-\${version} --exclude CVS --exclude .git --exclude .etics | gzip --best > \${packageName}-\${version}-\${age}.src.tar.gz; rm \${packageName}-\${version})";
- $cmd_vcs{tag} = "cvs -d \${vcsroot} tag -R \${tag} ${moduleName}";
-
- $cmd{default}{init} = 'None';
- $cmd{default}{configure} = 'None';
- $cmd{default}{compile} = 'None';
- $cmd{default}{test} = 'None';
- $cmd{default}{install} = 'None';
- $cmd{default}{packaging} = 'None';
- $cmd{default}{clean} = 'make clean';
-
- if (exists $subpackages{$fmod}) {
- $cmd{default}{clean} = 'None';
- $cmd{default}{packaging} = "echo building nothing, $subpackages{$fmod} will build this package";
- $cmd_vcs{checkout} = "mkdir -v \${moduleName} 2>/dev/null || true";
- } elsif ($subsys eq 'gridsite') {
- $cmd_vcs{tag} = 'None';
-
- if ($module eq 'core') {
- my $flags;
-
- if ($project ne 'glite') {
- # don't evaluate pkg-config calls to get them into source package
- $flags = 'RELEASE_VERSION=${age}
- GSOAPDIR=\`pkg-config gsoap --variable=prefix\`
- OPENSSL_GLOBUS_FLAGS=\`pkg-config globus-openssl --cflags\`
- OPENSSL_GLOBUS_LIBS=\`pkg-config globus-openssl --libs\`';
- } else {
- $flags = 'RELEASE_VERSION=${age}
- GSOAPDIR=${gsoap.location}
- OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor}
- OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}
- HTTPD_FLAGS=-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-1 -I${httpd-devel.location}/include/apr-1.0 -I${httpd-devel.location}/include/apr-0 -I${httpd-devel.location}/include/pcre';
- }
-
- $cmd{default}{configure} = "cat > Makefile.inc <<EOF
- project = $project
- top_srcdir = ..
- $flags
- EOF";
- $cmd{default}{compile} = "make prefix=\${prefix}$project{local_prefix} libdir=\${libdir}";
- $cmd{default}{install} = "make prefix=\${prefix}$project{local_prefix} libdir=\${libdir} install";
- mode_etics_packaging($fmod, \%cmd,
- "make prefix=\${prefix}$project{local_prefix} rpm-prepare
- cp gridsite.spec ../\n\t",
- "chmod +x \${moduleDir}/src/make-debian-files || true
- make prefix=\${prefix}$project{local_prefix} deb-prepare\n\t"
- );
- }
- elsif ($module eq '1.5-compat') {
- $cmd_vcs{checkout} = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.core 2>/dev/null";
- $cmd{default}{init} = 'echo "/sbin/ldconfig" > project/.post
- echo "/sbin/ldconfig" > project/.postun';
- $cmd{default}{configure} = "cat > src/Makefile.inc <<EOF
- project = emi
- libdir = \${libdir}
- MAJOR_VERSION=1
- MINOR_VERSION=1.5
- PATCH_VERSION=1.5.0
- VERSION=\\\$(PATCH_VERSION)
- RELEASE_VERSION=\${age}
- GSOAPDIR=\\`pkg-config gsoap --variable=prefix\\`
- OPENSSL_GLOBUS_FLAGS=\\`pkg-config globus-openssl --cflags\\`
- OPENSSL_GLOBUS_LIBS=\\`pkg-config globus-openssl --libs\\`
- EOF";
- $cmd{default}{compile} = "make -C src prefix=\${prefix}$project{local_prefix}
- rm -fv project/debian.changelog";
- $cmd{default}{install} = "make -C src prefix=\${prefix}$project{local_prefix} install-lib
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.so.1
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.so
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.a";
- $cmd{default}{packaging} = "None";
- }
- else {
- $cmd{default}{clean} = 'None';
- $cmd{default}{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this";
- $cmd_vcs{checkout} = "mkdir -v \${moduleName} 2>/dev/null || true";
- }
- }
- elsif ($subsys eq 'px' and $module eq 'myproxy-config') {
- $cmd{default}{configure} = "/usr/bin/perl $confdir/configure --root=\${prefix} --prefix= --stage=\${stageDir} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts";
- $cmd{default}{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config";
- }
- else {
- $cmd{default}{configure} = "/usr/bin/perl $confdir/configure $project{flavours} --root=\${prefix} --prefix=$project{local_prefix} --stage=\${stageDir} --sysroot=\${package.prefix} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts";
- $cmd{default}{compile} = 'make';
- $cmd{default}{test} = 'make check';
- $cmd{default}{install} = 'make install';
- if ($subsys eq 'lb' and $module eq 'client') {
- $cmd{default}{compile} = "make rpath=$project{local_prefix}/\${libdir}";
- $cmd{default}{install} = "make install post-install rpath=$project{local_prefix}/\${libdir}";
- }
- mode_etics_packaging($fmod, \%cmd);
- }
-
- 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 = $project{etics_name}.$subsys.$module
-displayName = $conf
-description = $cvs_prefix{$subsys}.$subsys.$module
-projectName = $project{etics_name}
-age = $age
-deploymentType = None
-vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite
-tag = $conftag
-version = $major.$minor.$rev
-$dwpath
-[Platform-default:VcsCommand]
-displayName = None
-description = None
-tag = $cmd_vcs{tag}
-branch = None
-commit = None
-checkout = $cmd_vcs{checkout}
-
-};
-
- for my $p (keys %cmd) {
- next if $p ne 'default' and exists $project{supported_platforms} and not exists $project{supported_platforms}{$p};
-
- print C qq{[Platform-$p:BuildCommand]
-postpublish = None
-packaging = $cmd{$p}{packaging}
-displayName = None
-description = None
-doc = None
-prepublish = None
-publish = None
-compile = $cmd{$p}{compile}
-init = $cmd{$p}{init}
-install = $cmd{$p}{install}
-clean = $cmd{$p}{clean}
-test = $cmd{$p}{test}
-configure = $cmd{$p}{configure}
-checkstyle = None
-
-};
- }
-
- print C qq{[Platform-default:Property]
-$buildroot
-package.preserve.libtool = false
-$package_description$package_summary$defprops};
-
- for (@{$obsoletes{"$subsys.$module"}}) {
- print C "package.obsoletes = $_\n";
- print C "package.replaces = $_\n";
- }
- for (@{$conflicts{"$subsys.$module"}}) {
- print C "package.conflicts = $_\n";
- }
- for (@{$provides{"$subsys.$module"}}) {
- print C "package.provides = $_\n";
- }
- print C "\n";
-
- for my $pp (keys %{$platform_properties{"$subsys.$module"}}) {
- next if $pp eq 'default';
- next if exists $project{supported_platforms} and not exists $project{supported_platforms}{$pp};
-
- print C "[Platform-$pp:Property]\n$buildroot\n";
-
- for my $p (keys %{$platform_properties{"$subsys.$module"}->{$pp}}) {
- print C $p . ' = ' . $platform_properties{"$subsys.$module"}->{$pp}->{$p} . "\n";
- }
- print C "$package_description$package_summary\n";
- }
-
- for my $platform ('default', keys %{$project{supported_platforms}}) {
- my $used = 0;
- my $output = '';
-
- for (@{$need_externs{"$subsys.$module"}},@{$need_jars{"$subsys.$module"}}) {
- my $eext = $etics_externs{$platform}{$_};
- my $edev = $project{etics_externs_devel}{$platform}{$_};
-
- # for the default platform using package of the same
- # name for runtime dependency
- if (not $eext) {
- if ($platform eq 'default') {
-#print "default runtime $_ on default\n";
- $eext = $_; }
- else {
-#print "no runtime $_ on $platform\n";
- $eext = '-'; }
- }
- if ($eext eq '-' and $edev eq '-') {
-#print "skipping $_ on $platform\n";
- next;
- }
-
- my $proj = 'externals';
- for my $p (keys %etics_projects) {
- for $m (@{$etics_projects{$p}}) {
- $proj = $p if $m eq $_;
- }
- }
-
- my $type = $need_externs_type{"$subsys.$module"}->{$_};
-
- if ($edev) {
- if ($type eq 'B') {
- # no runtime - change to devel pkg
- $eext = $edev;
- } elsif ($type eq 'BR' or $type eq 'RB') {
- # additional devel pkg
- if ($edev ne '-') { $output .= "$proj|$edev = B\n"; }
- }
- }
- if ($eext ne '-') { $output .= "$proj|$eext = $type\n"; }
- }
-
- if ($platform eq 'default') {
- for (@{$deps{"$subsys.$module"}}) {
- my $type = $deps_type{"$subsys.$module"}->{$_};
- if (not $used) {
- $used = 1;
- }
- $output .= "$project{etics_name}|$project{etics_name}.$_ = $type\n";
- }
- }
-
- if ($output) {
- print C qq{
-[Platform-$platform:DynamicDependency]
-$output};
- }
- }
-
- close C;
-
- for $file ("$cvs_module/project/debian.rules", "$cvs_module/project/$packageName.spec") {
- my $lib;
- my $main_module;
- @copts = ();
-
- if ($file =~ /debian\.rules$/) { $lib = 'lib'; }
- else { $lib = '%{_lib}'; }
-
- my $main_module = "$subsys.$module";
- if (exists $subpackages{$main_module}) { $main_module = $subpackages{$main_module}; }
-
- # locations hacks
- if ($file =~ /$packageName\.spec$/) {
- if ($fmod eq 'lb.client-java') {
- push @copts, '';
- push @copts, '--with-axis=/usr/local/axis1.4';
- }
- }
-
- if (-f $file) {
- open DST,">$file.new" or die "$file.new: $!\n";
- open SRC,"<$file" or die "$file: $!\n";
- while (<SRC>) {
- if (/^(\s*).+\/configure\s/) {
- printf DST "%s", "$1";
- printf DST "/usr/bin/perl $confdir/configure $project{flavours} --root=/ --prefix=$project{local_prefix} --libdir=$lib --project=$project --module $main_module@copts\n";
- } else {
- printf DST "%s", "$_";
- }
- }
- close SRC;
- close DST;
-
- `diff -b "$file" "$file.new"`;
- if ($? == 0) {
- print STDERR "($file not changed)\n";
- unlink "$file.new";
- } else {
- print STDERR "Writing $file\n";
- rename "$file", "$file.orig" unless -f "$file.orig";
- rename "$file.new", "$file";
- }
- }
- }
-}
-
-sub gsoap_version {
- local $_;
- my $gsoap_version;
- open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n";
-
- while ($_ = <S>) {
- 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;
-}
-
-sub getlibdir {
- if ( -e "/etc/debian_version") { # We are on Debian
- $lib64="lib";
- $lib32="lib32"; }
- else { # Another distribution
- $lib64="lib64";
- $lib32="lib"; }
- $libdir=$lib32;
-
- open INP, "uname -s | "; # Check kernel name
- $kname= <INP>;
- chomp($kname);
- close INP;
-
- if ( $kname eq "Linux") {
- $arch = ("x86_64\npowerpc\nppc64\n");
-
- open INP, "uname -p | "; # Check processor type
- $procname= <INP>;
- chomp($procname);
- close INP;
-
- if ($arch =~/^$procname\n/) {
- return ($lib64); }
-
- open INP, "uname -m | "; # Check machine hardware
- $machname= <INP>;
- chomp($machname);
- close INP;
-
- if ($arch =~/^$machname\n/) {
- return ($lib64); }
-
- # special cases (hyperlink lib64, Debian)
- if (-l "/usr/lib64") {
- $libdir=$lib32; }
-
- # if /usr/lib64 doesn't exist at all (AIX)
- unless ( -e "/usr/lib64" ) {
- $libdir=$lib32; }
- }
-
- if ( $kname eq "SunOS") {
- if (-e "/usr/lib/64") {
- $libdir="lib/64"; }
- }
-
- return $libdir;
-}
-
-sub reshuffle_platforms($$) {
- my ($data, $platforms) = @_;
- my ($platform, %blacklist, $value);
-
- return if not $platforms;
-
- for $platform (keys %$data) {
-#print "plat: $platform: $data->{$platform}\n";
- next if $platform eq 'default';
- for $_ (keys %{$data->{$platform}}) {
-#print " blacklist: $_ = $data->{$platform}{$_}\n";
- $blacklist{$_} = 1;
- }
- }
-
- for $_ (keys %blacklist) {
- $value = $data->{default}{$_} ? $data->{default}{$_} : $_;
- for $platform (keys %$platforms) {
- next if $platform eq 'default';
- if (not defined $data->{$platform}{$_}) {
- $data->{$platform}{$_} = $value;
-#print "added $value to $platform\n"
- }
- }
- $data->{default}{$_} = '-';
-#print "deleted $_ from default\n";
- }
-
- # merge dependencies across the supported platforms
- %blacklist = [];
- for $platform (keys %$platforms) {
- next if $platform eq 'default';
- for $_ (keys %{$data->{$platform}}) {
- $blacklist{$_} = 1;
- }
- }
- for $_ (keys %blacklist) {
- $value = undef;
- $same = 1;
- for $platform (keys %$platforms) {
- if (not $value) { $value = $data->{$platform}{$_}; }
- if (not $data->{$platform}{$_} or $value ne $data->{$platform}{$_}) {
- $same = 0;
- last;
- }
- }
- if ($same and $value) {
-#print "merged dependency $_\n";
- $data->{default}{$_} = $value;
- for $platform (keys %$platforms) {
- delete $data->{$platform}{$_};
- }
- }
- }
-}
-
-sub usage {
- my @ext = keys %externs;
- my @myjars = keys %jar;
-
- print STDERR qq{
-Usage: $0 options
-
-General options (defaults in []):
- --prefix=PREFIX destination directory [./stage]
- --stage=DIR staging directory [./stage]
- --root=DIR installation root (custom relocation root -> sysroot) [./stage]
- --sysroot=DIR system root (custom relocation root -> sysroot) []
- --sysconfdir=DIR system configuration directory [PREFIX/etc]
- --staged=module,module,... what is already in PREFIX (specify without org.glite.)
- --thrflavour=flavour
- --nothrflavour=flavour threaded and non-treaded flavours [gcc64dbgpthr,gcc64dbg]
- --listmodules=subsys list modules of a subsystem
- --listmodules=module list subpackages of a module
- --version=maj.min.rev-age version used instead of reading version.properties
- --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...)
- --libdir=libdir typically [lib,lib64] postfix
- --project=PROJECT build or generate etics for a project (glite/emi1/emi) [emi]
- --debug print more details
-
-Mode of operation:
- --mode=\{checkout|build|etics\} what to do [build]
-
-What to build:
- --module=module build this module only
- --enable-NODE build this "node" (set of modules) only
- --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
- --jobid-tag=tag checkout jobid modules with specific tag
- --canl-tag=tag checkout canl modules with specific tag
-
-Dependencies (summary of what will be used is always printed):
- --with-EXTERNAL=PATH where to look for an external [autodetect]
- --with-JAR=JAR where to look for jars
-
-Available nodes:
- @nodes
-
-Default nodes:
- @default_nodes
-
-Externals (not all for all modules) are:
- @ext
-
-External jars are:
- @myjars
-
-};
-
-}
+++ /dev/null
-/*
-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.
-*/
-
-#ifndef GLITE_LBU_MAILDIR_H
-#define GLITE_LBU_MAILDIR_H
-
-#include <time.h>
-
-/*
- * Functions for reading and writing messages via
- * maildir protocol.
- * Used when registering job to the JP, i.e.
- */
-
-enum {
- LBMD_TRANS_OK,
- LBMD_TRANS_FAILED,
- LBMD_TRANS_FAILED_RETRY,
-};
-
-extern char lbm_errdesc[];
-
-extern int glite_lbu_MaildirInit(const char *);
-extern int glite_lbu_MaildirStoreMsg(const char *, const char *, const char *);
-extern int glite_lbu_MaildirRetryTransStart(const char *, time_t, time_t, char **, char **);
-extern int glite_lbu_MaildirTransStart(const char *, char **, char **);
-extern int glite_lbu_MaildirTransEnd(const char *, char *, int);
-
-#endif /* GLITE_LBU_MAILDIR_H */
+++ /dev/null
-/sbin/ldconfig
+++ /dev/null
-/sbin/ldconfig
+++ /dev/null
-1.0.0-1
-- initial version
-
-1.0.0-2
-- configure script update (globus flavors added to configure call)
-
-1.0.0-3
-- configure script update
-
-1.0.0-4
-- install libraries into $libdir
-
-2.0.0-1
-- Fixed library version numbering
-- Improved portability
-
-2.0.0-2
-- Module rebuilt
-
-2.0.1-1
-- Fixed target 'clean' in the Makefile
-
-2.0.1-2
-- Module rebuilt
-
-2.0.2-1
-- Makefile adopts compilation and linking flags from the environment.
-
-2.0.2-2
-- Module rebuilt
-
-2.0.2-3
-- Module rebuilt
-
-2.0.2-4
-- Module rebuilt
-
-2.1.0-1
-- Fixes for parallel release in EMI & gLite
-
-2.1.0-2
-- Module rebuilt
-
-2.1.1-1
-- Root directory option (ETICS performs own files relocation)
-- Prefix option as prefix inside stage
-- Sysconfdir option (for /etc vs /usr)
-- DESTDIR in makefiles
-
-2.1.2-1
-- Relocatable build directory.
-
-2.1.2-2
-- Module rebuilt
-
-2.1.2-3
-- Module rebuilt
-
-2.1.2-4
-- Module rebuilt
-
-2.1.2-5
-- Module rebuilt
-
-2.1.2-6
-- Module rebuilt
-
-2.1.2-7
-- Module rebuilt
-
-2.1.2-8
-- Module rebuilt
-
-2.2.0-1
-- Preparation for a new multiplatform release
-
-2.2.1-1
-- Fixes in packaging and install
-- Adaptation for Debian packaging
-
-2.2.1-2
-- Module rebuilt
-
-2.2.1-3
-- Module rebuilt
-
-2.2.1-4
-- Module rebuilt
-
+++ /dev/null
-Source: glite-lbjp-common-maildir
-Priority: extra
-Maintainer: @MAINTAINER@
-Uploaders: @UPLOADERS@
-Build-Depends: debhelper (>= 7.0.50~), chrpath, libtool
-Standards-Version: 3.9.1
-Section: libs
-Homepage: @URL@
-DM-Upload-Allowed: yes
-@DEBIAN_VCS@
-
-Package: libglite-lbu-maildir2
-Section: libs
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: @SUMMARY@
-@DEBIAN_DESCRIPTION@
-
-Package: libglite-lbjp-common-maildir-dev
-Section: libdevel
-Architecture: any
-Provides: glite-lbjp-common-maildir
-Depends: libglite-lbu-maildir2 (= ${binary:Version}), ${misc:Depends}
-Description: Development files for gLite L&B/JP common maildir library
- This package contains development libraries and header files for gLite L&B/JP
- common maildir library.
-
-Package: glite-lbjp-common-maildir-dbg
-Section: debug
-Architecture: any
-Priority: extra
-Depends: libglite-lbu-maildir2 (= ${binary:Version}), ${misc:Depends}
-Description: gLite L&B/JP common maildir library debugging symbols
- This package contains debugging symbols for gLite L&B/JP common maildir
- library.
+++ /dev/null
-This work was packaged for Debian by:
-
- @MAINTAINER@ on Thu, 08 Dec 2011 00:46:07 +0100
-
-It was downloaded from:
-
- @URL@
-
-Upstream Author(s):
-
- @MAINTAINER@
-
-Copyright:
-
- <Copyright (C) 2004-2011 Members of the EGEE Collaboration>
-
-License:
-
- 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.
-
-On Debian systems, the complete text of the Apache version 2.0 license
-can be found in "/usr/share/common-licenses/Apache-2.0".
-
-The Debian packaging is:
-
- Copyright (C) 2004-2011 Members of the EGEE Collaboration
-
-and is licensed under the Apache License, Version 2.0.
+++ /dev/null
-usr/include/glite/lbu
-usr/lib
+++ /dev/null
-usr/include/glite/lbu/*.h
-usr/lib/lib*.so
+++ /dev/null
-usr/lib/lib*.so.*
+++ /dev/null
-#!/usr/bin/make -f
-# -*- makefile -*-
-
--include /usr/share/dpkg/buildflags.mk
-
-# Uncomment this to turn on verbose mode.
-export DH_VERBOSE=1
-
-configure: configure-stamp
-configure-stamp:
- dh_testdir
- /usr/bin/perl ./configure --thrflavour= --nothrflavour= --root=/ --prefix=/usr --libdir=lib --project=emi --module lbjp-common.maildir
- touch $@
-
-build: build-arch build-indep
-
-build-arch build-indep: build-stamp
-
-build-stamp: configure-stamp
- dh_testdir
- CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE)
- CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) check
- touch $@
-
-clean: configure-stamp
- dh_testdir
- dh_testroot
- rm -f configure-stamp build-stamp
- $(MAKE) clean
- rm -f Makefile.inc config.status
- dh_clean
-
-install: build-stamp
- dh_testdir
- dh_testroot
- dh_prep
- dh_installdirs
- $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
- rm -rvf $(CURDIR)/debian/tmp/usr/share
- rm -vf $(CURDIR)/debian/tmp/usr/lib/*.la
- rm -vf $(CURDIR)/debian/tmp/usr/lib/*.a
- find $(CURDIR)/debian/tmp -name '*' -print | xargs -I {} -i bash -c "chrpath -d {} > /dev/null 2>&1" || echo 'Stripped RPATH'
-
-binary-indep:
-
-binary-arch: install
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_installexamples
- dh_installman
- dh_installlogrotate
- dh_installcron
- dh_install --fail-missing
- dh_link
- dh_strip --dbg-package=glite-lbjp-common-maildir-dbg
- dh_compress
- dh_fixperms
- dh_makeshlibs
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-arch binary-indep
+++ /dev/null
-Summary: @SUMMARY@
-Name: glite-lbjp-common-maildir
-Version: @MAJOR@.@MINOR@.@REVISION@
-Release: @AGE@%{?dist}
-Url: @URL@
-License: ASL 2.0
-Vendor: EMI
-Group: System Environment/Libraries
-BuildRequires: chrpath
-BuildRequires: libtool
-BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
-AutoReqProv: yes
-Source: http://eticssoft.web.cern.ch/eticssoft/repository/emi/emi.lbjp-common.maildir/%{version}/src/%{name}-@VERSION@.src.tar.gz
-
-
-%description
-@DESCRIPTION@
-
-
-%package devel
-Summary: Development files for gLite L&B/JP common maildir library
-Group: Development/Libraries
-Requires: %{name}%{?_isa} = %{version}-%{release}
-
-
-%description devel
-This package contains development libraries and header files for gLite L&B/JP
-common maildir library.
-
-
-%prep
-%setup -q
-
-
-%build
-/usr/bin/perl ./configure --thrflavour= --nothrflavour= --root=/ --prefix=/usr --libdir=%{_lib} --project=emi --module lbjp-common.maildir
-make
-
-
-%check
-make check
-
-
-%install
-rm -rf $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
-find $RPM_BUILD_ROOT -name '*.la' -exec rm -rf {} \;
-find $RPM_BUILD_ROOT -name '*.a' -exec rm -rf {} \;
-find $RPM_BUILD_ROOT -name '*' -print | xargs -I {} -i bash -c "chrpath -d {} > /dev/null 2>&1" || echo 'Stripped RPATH'
-
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
-%post -p /sbin/ldconfig
-
-
-%postun -p /sbin/ldconfig
-
-
-%files
-%defattr(-,root,root)
-/usr/%{_lib}/libglite_lbu_maildir.so.@MAJOR@.@MINOR@.@REVISION@
-/usr/%{_lib}/libglite_lbu_maildir.so.@MAJOR@
-
-
-%files devel
-%defattr(-,root,root)
-%dir /usr/include/glite
-%dir /usr/include/glite/lbu
-/usr/include/glite/lbu/maildir.h
-/usr/%{_lib}/libglite_lbu_maildir.so
-
-
-%changelog
-* @SPEC_DATE@ @MAINTAINER@ - @MAJOR@.@MINOR@.@REVISION@-@AGE@%{?dist}
-- automatically generated package
+++ /dev/null
-Single-purpose implementation of maildir-like queue. It is used to pass data from LB to JP.
+++ /dev/null
-Single-purpose implementation of maildir-like queue
+++ /dev/null
-# : /cvs/jra1mw/org.glite.lbjp-common.maildir/project/version.properties,v 1.1 2007/11/01 20:17:45 valtri Exp $
-module.version=2.2.1
-module.age=4
+++ /dev/null
-/*
-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 <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <dirent.h>
-#include <limits.h>
-#include <time.h>
-#include <fcntl.h>
-#include <sys/time.h>
-#include <errno.h>
-#include <string.h>
-
-#include "maildir.h"
-
-#define DEFAULT_ROOT "/tmp/lb_maildir"
-
-enum {
- LBMD_DIR_TMP = 0,
- LBMD_DIR_NEW,
- LBMD_DIR_WORK,
- LBMD_DIR_POST,
- LBMD_DIR_UNDELIVERABLE
-};
-
-static const char *dirs[] = { "tmp", "new", "work", "post", "undeliverable" };
-
-
-#define MAX_ERR_LEN 1024
-char lbm_errdesc[MAX_ERR_LEN];
-
-
-static int check_mkdir(const char *dir)
-{
- struct stat sbuf;
-
- if ( stat(dir, &sbuf) ) {
- if ( errno == ENOENT ) {
- if ( mkdir(dir, S_IRWXU) ) return 1;
- if ( stat(dir, &sbuf) ) return 1;
- }
- else return 1;
- }
-
- if (!S_ISDIR(sbuf.st_mode)) return 1;
-
- if (access(dir, R_OK | W_OK)) return 1;
-
- return 0;
-}
-
-
-int glite_lbu_MaildirInit(
- const char *dir)
-{
- const char *root = dir? : DEFAULT_ROOT;
- char dirname[PATH_MAX];
- size_t i;
-
- lbm_errdesc[0] = '\0';
- if ( check_mkdir(root) ) {
- snprintf(lbm_errdesc, MAX_ERR_LEN, "%s: %s\n", root, strerror(errno));
- return 1;
- }
-
- for ( i = 0; i < sizeof(dirs)/sizeof((dirs)[0]); i++ ) {
- snprintf(dirname, PATH_MAX, "%s/%s", root, dirs[i]);
- if ( check_mkdir(dirname) ) {
- snprintf(lbm_errdesc, MAX_ERR_LEN, "%s: %s\n", dirname, strerror(errno));
- return 1;
- }
- }
-
- return 0;
-}
-
-
-int glite_lbu_MaildirStoreMsg(
- const char *root,
- const char *srvname,
- const char *msg)
-{
- char fname[PATH_MAX],
- newfname[PATH_MAX];
- int fhnd,
- written,
- msgsz,
- ct, i;
- struct timeval tv;
-
-
- lbm_errdesc[0] = '\0';
- if ( !root ) root = DEFAULT_ROOT;
-
- errno = 0;
- i = 0;
- while ( 1 ) {
- if ( ++i > 10 ) {
- errno = ECANCELED;
- snprintf(lbm_errdesc, MAX_ERR_LEN, "Maximum tries limit reached with unsuccessful file creation");
- return -1;
- }
- gettimeofday(&tv, NULL);
- snprintf(fname, PATH_MAX, "%s/%s/%ld_%ld.%s", root, dirs[LBMD_DIR_TMP], tv.tv_sec, tv.tv_usec, srvname);
- if ( (fhnd = open(fname, O_CREAT|O_EXCL|O_WRONLY, 00600)) < 0 ) {
- if ( errno == EEXIST ) { usleep(1000); continue; }
- snprintf(lbm_errdesc, MAX_ERR_LEN, "Can't create file %s", fname);
- return -1;
- }
- break;
- }
-
- msgsz = strlen(msg);
- written = 0;
- while ( written < msgsz ) {
- if ( (ct = write(fhnd, msg+written, msgsz-written)) < 0 ) {
- if ( errno == EINTR ) { errno = 0; continue; }
- snprintf(lbm_errdesc, MAX_ERR_LEN, "Can't write into file %s", fname);
- return -1;
- }
- written += msgsz;
- }
- if ( fsync(fhnd) ) {
- snprintf(lbm_errdesc, MAX_ERR_LEN, "Can't fsync file %s", fname);
- return -1;
- }
- if ( close(fhnd) ) {
- snprintf(lbm_errdesc, MAX_ERR_LEN, "Can't close file %s", fname);
- return -1;
- }
- snprintf(newfname, PATH_MAX, "%s/%s/%s", root, dirs[LBMD_DIR_NEW], strrchr(fname, '/')+1);
- if ( link(fname, newfname) ) {
- snprintf(lbm_errdesc, MAX_ERR_LEN, "Can't link new file %s", newfname);
- return -1;
- }
-
- return 0;
-}
-
-
-int glite_lbu_MaildirTransEnd(
- const char *root,
- char *fname,
- int tstate)
-{
- char workfname[PATH_MAX],
- newfname[PATH_MAX],
- origfname[PATH_MAX];
- struct stat st;
-
-
- lbm_errdesc[0] = '\0';
- if ( !root ) root = DEFAULT_ROOT;
-
- snprintf(workfname, PATH_MAX, "%s/%s/%s", root, dirs[LBMD_DIR_WORK], fname);
- unlink(workfname);
-
- snprintf(origfname, PATH_MAX, "%s/%s/%s", root, dirs[LBMD_DIR_TMP], fname);
- if ( tstate == LBMD_TRANS_OK ) {
- unlink(origfname);
- return 0;
- }
-
- if ( tstate == LBMD_TRANS_FAILED ) return 0;
-
- if ( stat(origfname, &st) ) {
- snprintf(lbm_errdesc, MAX_ERR_LEN, "Can't stat file '%s'", origfname);
- return -1;
- }
-
- snprintf(newfname, PATH_MAX, "%s/%s/%s", root, dirs[LBMD_DIR_POST], fname);
- if ( link(origfname, newfname) ) {
- snprintf(lbm_errdesc, MAX_ERR_LEN, "Can't link new file %s", newfname);
- return -1;
- }
-
- return 0;
-}
-
-
-int glite_lbu_MaildirRetryTransStart(
- const char *root,
- time_t retry,
- time_t remove,
- char **msg,
- char **fname)
-{
- static DIR *dir = NULL;
- struct dirent *ent;
- time_t tlimit_retry, tlimit_remove;
- struct stat st;
- char newfname[PATH_MAX],
- oldfname[PATH_MAX],
- *buf = NULL;
- int fhnd,
- toread, ct,
- bufsz, bufuse;
-
-
- lbm_errdesc[0] = '\0';
- if ( !root ) root = DEFAULT_ROOT;
-
- if ( !dir ) {
- char dirname[PATH_MAX];
- snprintf(dirname, PATH_MAX, "%s/%s", root, dirs[LBMD_DIR_POST]);
- if ( !(dir = opendir(dirname)) ) {
- snprintf(lbm_errdesc, MAX_ERR_LEN, "Can't open directory '%s'", root);
- goto err;
- }
- }
-
- tlimit_retry = time(NULL) - retry;
- tlimit_remove = time(NULL) - remove;
- do {
- errno = 0;
- if ( !(ent = readdir(dir)) ) {
- if ( errno == EBADF ) {
- snprintf(lbm_errdesc, MAX_ERR_LEN, "Can't read directory '%s'", root);
- dir = NULL;
- goto err;
- } else {
- closedir(dir);
- dir = NULL;
- return 0;
- }
- }
- if ( ent->d_name[0] == '.' ) continue;
-
- snprintf(oldfname, PATH_MAX, "%s/%s/%s", root, dirs[LBMD_DIR_POST], ent->d_name);
- snprintf(newfname, PATH_MAX, "%s/%s/%s", root, dirs[LBMD_DIR_WORK], ent->d_name);
-
- if ( stat(oldfname, &st) < 0 ) {
- snprintf(lbm_errdesc, MAX_ERR_LEN, "Can't stat file '%s'", oldfname);
- goto err;
- }
-
- /* if we cannot deliver the file for 'remove' time limit, */
- /* it is moved to undeliverable folder and forgotten */
- if ( st.st_mtime < tlimit_remove ) {
- snprintf(newfname, PATH_MAX, "%s/%s/%s",
- root, dirs[LBMD_DIR_UNDELIVERABLE], ent->d_name);
- }
- /* try to deliver file every 'retry' seconds */
- else if ( st.st_ctime > tlimit_retry ) continue;
-
-
- if ( rename(oldfname, newfname) ) {
- if ( errno == ENOENT ) {
- /* maybe some other instance moved this file away... */
- continue;
- } else {
- snprintf(lbm_errdesc, MAX_ERR_LEN, "Can't move file '%s'", oldfname);
- goto err;
- }
- } else {
- if (st.st_mtime < tlimit_remove) {
- /* we have moved undeliverable file to undeliverable folder */
- /* no other action needed */
- snprintf(oldfname, PATH_MAX, "%s/%s/%s", root, dirs[LBMD_DIR_TMP], ent->d_name);
- unlink(oldfname);
- continue;
- } else {
- /* we have found and moved the file to work folder */
- /* going to process it */
- break;
- }
- }
- } while ( 1 );
-
- if ( (fhnd = open(newfname, O_RDONLY)) < 0 ) {
- snprintf(lbm_errdesc, MAX_ERR_LEN, "Can't open file '%s'", newfname);
- goto err;
- }
-
- bufuse = bufsz = toread = ct = 0;
- do {
- errno = 0;
- if ( bufuse == bufsz ) {
- char *tmp = realloc(buf, bufsz+BUFSIZ);
- if ( !tmp ) goto err;
- buf = tmp;
- bufsz += BUFSIZ;
- }
- toread = bufsz - bufuse;
- if ( (ct = read(fhnd, buf+bufuse, toread)) < 0 ) {
- if ( errno == EINTR ) continue;
- snprintf(lbm_errdesc, MAX_ERR_LEN, "Can't read file '%s'", newfname);
- goto err;
- }
- if ( ct == 0 ) break;
- bufuse += ct;
- } while ( ct == toread );
- close(fhnd);
-
- if ( !(*fname = strdup(ent->d_name)) ) goto err;
- buf[bufuse] = 0;
- *msg = buf;
- return 1;
-
-
-err:
- if ( buf ) free(buf);
-
- return -1;
-}
-
-
-int glite_lbu_MaildirTransStart(
- const char *root,
- char **msg,
- char **fname)
-{
- static DIR *dir = NULL;
- struct dirent *ent;
- char newfname[PATH_MAX],
- oldfname[PATH_MAX],
- *buf = NULL;
- int fhnd,
- toread, ct,
- bufsz, bufuse;
-
-
- lbm_errdesc[0] = '\0';
- if ( !root ) root = DEFAULT_ROOT;
-
- if ( !dir ) {
- char dirname[PATH_MAX];
- snprintf(dirname, PATH_MAX, "%s/%s", root, dirs[LBMD_DIR_NEW]);
- if ( !(dir = opendir(dirname)) ) {
- snprintf(lbm_errdesc, MAX_ERR_LEN, "Can't open directory '%s'", root);
- goto err;
- }
- }
-
- do {
- errno = 0;
- if ( !(ent = readdir(dir)) ) {
- if ( errno == EBADF ) {
- snprintf(lbm_errdesc, MAX_ERR_LEN, "Can't read directory '%s'", root);
- dir = NULL;
- goto err;
- } else {
- closedir(dir);
- dir = NULL;
- return 0;
- }
- }
- if ( ent->d_name[0] == '.' ) continue;
- snprintf(newfname, PATH_MAX, "%s/%s/%s", root, dirs[LBMD_DIR_WORK], ent->d_name);
- snprintf(oldfname, PATH_MAX, "%s/%s/%s", root, dirs[LBMD_DIR_NEW], ent->d_name);
- if ( rename(oldfname, newfname) ) {
- if ( errno == ENOENT ) {
- /* maybe some other instance moved this file away... */
- continue;
- } else {
- snprintf(lbm_errdesc, MAX_ERR_LEN, "Can't move file '%s'", oldfname);
- goto err;
- }
- } else {
- /* we have found and moved the file with which we will work now */
- break;
- }
- } while ( 1 );
-
- if ( (fhnd = open(newfname, O_RDONLY)) < 0 ) {
- snprintf(lbm_errdesc, MAX_ERR_LEN, "Can't open file '%s'", newfname);
- goto err;
- }
-
- bufuse = bufsz = toread = ct = 0;
- do {
- errno = 0;
- if ( bufuse == bufsz ) {
- char *tmp = realloc(buf, bufsz+BUFSIZ);
- if ( !tmp ) goto err;
- buf = tmp;
- bufsz += BUFSIZ;
- }
- toread = bufsz - bufuse;
- if ( (ct = read(fhnd, buf+bufuse, toread)) < 0 ) {
- if ( errno == EINTR ) continue;
- snprintf(lbm_errdesc, MAX_ERR_LEN, "Can't read file '%s'", newfname);
- goto err;
- }
- if ( ct == 0 ) break;
- bufuse += ct;
- } while ( ct == toread );
- close(fhnd);
-
- if ( !(*fname = strdup(ent->d_name)) ) goto err;
- buf[bufuse] = 0;
- *msg = buf;
- return 1;
-
-
-err:
- if ( buf ) free(buf);
-
- return -1;
-}
+++ /dev/null
-# defaults
-top_srcdir=..
-stagedir=.
-globalprefix=glite
-lbutilsprefix=lbu
-package=glite-lbjp-common-server-bones
-version=0.0.1
-PREFIX=/opt/glite
-prefix=
-
-CC=gcc
-
--include Makefile.inc
--include ${top_srcdir}/project/version.properties
-
-version=${module.version}
-
-VPATH=${top_srcdir}/src:${top_srcdir}/examples
-
-DEBUG:=-g -O0 -Wall
-CFLAGS:=${DEBUG} \
- -I${top_srcdir}/interface \
- -I${stagedir}${prefix}/include \
- -D_GNU_SOURCE ${CFLAGS}
-LDFLAGS:=${LDFLAGS} -L${stagedir}${prefix}/${libdir}
-
-ifdef LB_PROF
- CFLAGS:= ${CFLAGS} -pg -g
- LDFLAGS:= ${LDFLAGS} -pg
-endif
-
-COMPILE:=libtool --mode=compile ${CC} ${CFLAGS}
-LINK:=libtool --mode=link ${CC} -rpath ${stagedir}${prefix}/${libdir} ${LDFLAGS}
-INSTALL:=libtool --mode=install install
-
-STATICLIB:=libglite_lbu_server_bones.a
-LTLIB:=libglite_lbu_server_bones.la
-
-OBJS:=srvbones.o
-LOBJS:=${OBJS:.o=.lo}
-
-HDRS:=srvbones.h
-
-# In order to use libtool versioning correcty, we must have:
-#
-# current = major + minor + offset
-# revision = patch
-# age = minor
-#
-# where offset is a sum of maximal released minor's of all previous major's
-#
-
-# counted minors: n/a
-offset=0
-
-version_info:=-version-info ${shell \
- perl -e '$$,=":"; @F=split "\\.","${version}"; print $$F[0]+$$F[1]+${offset},$$F[2],$$F[1]' }
-
-default all: compile
-
-compile: ${STATICLIB} ${LTLIB} example
-
-${STATICLIB}: ${OBJS}
- ar crv $@ ${OBJS}
- ranlib $@
-
-${LTLIB}: ${LOBJS}
- ${LINK} ${version_info} -o $@ ${LOBJS} -lglite_lbu_log
-
-stage: compile
- $(MAKE) install PREFIX=${stagedir} DOSTAGE=yes
-
-check: example
- LOG4C_RCPATH=${PREFIX}${sysconfdir}/glite-lb ${top_srcdir}/examples/run_test.sh
-
-example: srv_example cnt_example
-
-srv_example: srv_example.o ${LTLIB}
- ${LINK} -o $@ ${LTLIB} srv_example.o
-
-cnt_example: cnt_example.o ${LTLIB}
- ${LINK} -o $@ cnt_example.o
-
-doc:
-
-install:
- mkdir -p ${DESTDIR}${PREFIX}${prefix}/include/${globalprefix}/${lbutilsprefix}
- mkdir -p ${DESTDIR}${PREFIX}${prefix}/${libdir}
- ${INSTALL} -m 755 ${LTLIB} ${DESTDIR}${PREFIX}${prefix}/${libdir}
- ${INSTALL} -m 644 ${STATICLIB} ${DESTDIR}${PREFIX}${prefix}/${libdir} ; \
- cd ${top_srcdir}/interface && install -m 644 ${HDRS} ${DESTDIR}${PREFIX}${prefix}/include/${globalprefix}/${lbutilsprefix}
-
-clean:
- rm -rvf *.o *.lo .libs lib* srv_example cnt_example
-
-distclean:
- rm -rvf Makefile.inc *.spec debian/
-
-%.o %.lo: %.c
- ${COMPILE} -c $<
+++ /dev/null
-#!/usr/bin/perl
-
-# WARNING: Don't edit this file unless it is the master copy in org.glite.lb
-#
-# For the purpose of standalone builds of lb/jobid/lbjp-common components
-# it is copied on tagging
-
-# $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.
-#
-
-use Getopt::Long;
-use POSIX qw(locale_h strftime);
-
-my $pwd = `pwd`; chomp $pwd;
-my $prefix = '/usr';
-my $stagedir = undef;
-my $root = $pwd.'/stage';
-my $sysroot = '';
-my $sysconfdir;
-my $localstatedir;
-my $staged;
-my $module;
-my $thrflavour = 'gcc64dbgpthr';
-my $nothrflavour = 'gcc64dbg';
-my $mode = 'build';
-my $help = 0;
-my $listmodules;
-my ($version, $force_version);
-my $branch;
-my $output;
-my $lb_tag = '';
-my $lbjp_tag = '';
-my $jp_tag = '';
-my $jobid_tag = '';
-my $libdir = getlibdir();
-my $project = 'emi';
-my $project_version;
-my (%projects, %project);
-my $debug = 0;
-my $pkg_config_env = (defined $ENV{PKG_CONFIG_PATH}) ? "$ENV{PKG_CONFIG_PATH}:" : '';
-
-my @nodes = qw/client server logger logger-msg nagios utils client-java doc ws-test db jpprimary jpindex jpclient harvester lb px proxyrenewal/;
-my @default_nodes = qw/lb px proxyrenewal nagios/;
-my %enable_nodes;
-my %disable_nodes;
-my %default_nodes; @default_nodes{@default_nodes} = (1) x ($#default_nodes + 1);
-
-my %package = (
- 'maintainer' => 'CESNET Product Teams <emi-lb@metacentrum.cz>',
- 'uploaders' => 'František Dvořák <valtri@civ.zcu.cz>',
- 'url' => 'http://glite.cern.ch',
- 'debian_vcs' => 'Vcs-Cvs: :pserver:anonymous@jra1mw.cvs.cern.ch:/cvs/jra1mw
-Vcs-Browser: http://jra1mw.cvs.cern.ch/cgi-bin/jra1mw.cgi',
-);
-
-# key: internal package name (arguments, ...)
-# 'pkg': pkg-config name
-# 'prefix': used when pkg-config fails
-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-devel' => {
- prefix=> '/opt/globus',
- pkg => 'myproxy'
- },
- 'myproxy-server' => {
- prefix=> '',
- },
- 'myproxy-admin' => {
- prefix=> '',
- },
- gsoap => {
- prefix=> '/usr',
- pkg => 'gsoap'
- },
- gsoapxx => {
- prefix=> '/usr',
- pkg => 'gsoap++'
- },
- mysql => {
- prefix=> '/usr'
- },
- 'mysql-devel' => {
- prefix=> ''
- },
- 'mysql-server' => {
- prefix => ''
- },
- voms => {
- prefix => '/opt/glite',
- pkg => 'voms-2.0'
- },
- gridsite => {
- prefix => '/opt/glite'
- },
- lcas => {
- prefix => '/opt/glite',
- pkg => 'lcas'
- },
- trustmanager => {
- prefix => '/opt/glite'
- },
- trustmanager_axis => {
- prefix => '/opt/glite'
- },
- utiljava => {
- prefix=> '/opt/glite'
- },
- ant => {
- prefix=> '/usr'
- },
- jdk => {
- prefix=> '/usr/java/latest',
- locations => [ '/usr/lib/jvm/java', '/usr/lib/jvm/default-java', '/usr/java/latest' ],
- },
- libtar => {
- prefix=> '/usr'
- },
- axis => {
- prefix=> '/usr'
- },
- log4c => {
- prefix=> '/usr'
- },
- postgresql => {
- prefix=> '/usr'
- },
- activemq => {
- prefix=>'/opt/activemq-cpp-library',
- pkg => 'activemq-cpp'
- },
-);
-
-my %jar = (
- 'jakarta-commons-codec' => '/usr/share/java/commons-codec.jar',
- 'jakarta-commons-lang' => '/usr/share/java/commons-lang.jar',
-);
-
-
-my %glite_prefix;
-my %need_externs;
-my %need_externs_type;
-my %need_jars;
-my %extrafull;
-my %extranodmod;
-my %deps;
-my %deps_type;
-my %buildroot;
-my (%etics_externs, %etics_projects);
-
-#
-# modules of the subsystems
-#
-# additional modules from $project{modules} are automatically added
-#
-my %lbmodules = (
- 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim logger-msg nagios client-devel client-progs common-devel logger-devel state-machine-devel/],
- 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin db-devel log-devel maildir-devel server-bones-devel trio-devel jp-interface-devel gss-devel gsoap-plugin-devel/],
- 'jobid' => [qw/api-c api-c-devel api-cpp api-cpp-devel api-java/],
- 'jp' => [ qw/client doc index primary server-common ws-interface/ ],
- 'gridsite' => [ qw/apache libs commands core devel slashgrid services service-clients gsexec/ ],
- 'px' => [ qw/proxyrenewal myproxy-yaim proxyrenewal-devel proxyrenewal-progs/ ],
- 'canl' => [ qw/c c-devel/ ],
- );
-
-#
-# sub-packages
-#
-# modify %lbmodules, %deps_aux, %extrafull, and %properties accodingly
-#
-my %subpackages = (
- 'jobid.api-c-devel' => 'jobid.api-c',
- 'jobid.api-cpp-devel' => 'jobid.api-cpp',
- 'lbjp-common.db-devel' => 'lbjp-common.db',
- 'lbjp-common.gsoap-plugin-devel' => 'lbjp-common.gsoap-plugin',
- 'lbjp-common.gss-devel' => 'lbjp-common.gss',
- 'lbjp-common.jp-interface-devel' => 'lbjp-common.jp-interface',
- 'lbjp-common.log-devel' => 'lbjp-common.log',
- 'lbjp-common.maildir-devel' => 'lbjp-common.maildir',
- 'lbjp-common.server-bones-devel' => 'lbjp-common.server-bones',
- 'lbjp-common.trio-devel' => 'lbjp-common.trio',
- 'lb.client-progs' => 'lb.client',
- 'lb.client-devel' => 'lb.client',
- 'lb.common-devel' => 'lb.common',
- 'lb.logger-devel' => 'lb.logger',
- 'lb.state-machine-devel' => 'lb.state-machine',
- 'px.proxyrenewal-devel' => 'px.proxyrenewal',
- 'px.proxyrenewal-progs' => 'px.proxyrenewal',
- 'canl.c-devel' => 'canl.c',
-);
-
-my @opts = (
- 'prefix:s' => \$prefix,
- 'staged=s' => \$staged,
- 'module=s' => \$module,
- 'thrflavour:s' => \$thrflavour,
- 'nothrflavour:s' => \$nothrflavour,
- 'mode=s' => \$mode,
- 'listmodules=s' => \$listmodules,
- 'version=s' => \$force_version,
- 'branch=s' => \$branch,
- 'output=s' => \$output,
- 'stage=s' => \$stagedir,
- 'root:s' => \$root,
- 'sysroot:s' => \$sysroot,
- 'sysconfdir=s' => \$sysconfdir,
- 'localstatedir=s' => \$localstatedir,
- 'lb-tag=s' => \$lb_tag,
- 'lbjp-common-tag=s' => \$lbjp_tag,
- 'jp-tag=s' => \$jp_tag,
- 'jobid-tag=s' => \$jobid_tag,
- 'canl-tag=s' => \$canl_tag,
- 'help' => \$help,
- 'libdir=s' => \$libdir,
- 'project=s' => \$project,
- 'debug' => \$debug,
-);
-
-for (@nodes) {
- $enable_nodes{$_} = 0;
- $disable_nodes{$_} = 0;
-
- push @opts,"disable-$_",\$disable_nodes{$_};
- push @opts,"enable-$_",\$enable_nodes{$_};
-}
-
-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";
-$prefix=~s/\/$//;
-$root=~s/\/$//;
-$sysroot=~s/\/$//;
-if (not $sysconfdir) { $sysconfdir = $prefix eq '/usr' ? '/etc' : "$prefix/etc"; }
-if (not $localstatedir) { $localstatedir = $prefix eq '/usr' ? '/var' : "$prefix/var"; }
-$sysconfdir=~s/\/$//;
-$localstatedir=~s/\/$//;
-
-$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq '';
-$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq '';
-$externs{'gsoapxx'}{prefix}=$externs{gsoap}{prefix} if $externs{'gsoapxx'}{prefix} eq '';
-
-$externs{'mysql-server'}{withprefix}=$externs{mysql}{withprefix} if $externs{'mysql-server'}{withprefix} eq '';
-$externs{'mysql-devel'}{wihtprefix}=$externs{mysql}{withprefix} if $externs{'mysql-devel'}{withprefix} eq '';
-$externs{'gsoapxx'}{withprefix}=$externs{gsoap}{withprefix} if $externs{'gsoapxx'}{withprefix} eq '';
-
-if ($project =~ /^([^0-9]*)(.*)$/) {
- $project = $1;
- $project_version = $2;
-}
-%project = %{$projects{$project}};
-$project_version = $project{current_version} unless $project_version;
-for my $platform (keys %{$project{etics_externs}}) {
- for $_ (keys %{$project{etics_externs}{$platform}}) {
- $etics_externs{$platform}{$_} = $project{etics_externs}{$platform}{$_};
- }
-}
-reshuffle_platforms(\%etics_externs, $project{supported_platforms});
-reshuffle_platforms(\%{$project{etics_externs_devel}}, $project{supported_platforms});
-for $_ (keys %{$project{etics_projects}}) {
- $etics_projects{$_} = $project{etics_projects}{$_};
-}
-for $_ (keys %{$project{need_externs_aux}}) {
- $need_externs_aux{$_} = $project{need_externs_aux}{$_};
-}
-for my $ext (keys %need_externs_aux) {
- for (@{$need_externs_aux{$ext}}) {
- my ($pkg, $type) =/([^:]*)(?::(.*))?/;
- $type = 'BR' unless ($type);
-
- push @{$need_externs{$ext}},$pkg;
- $need_externs_type{$ext}->{$pkg} = $type;
- }
-}
-if ($project eq 'emi') {
- $extranodmod{lb} = 'lb.emi-lb';
- $extranodmod{px} = 'px.emi-px';
-}
-for $_ (keys %{$project{modules}}) {
- push @{$lbmodules{$_}},@{$project{modules}{$_}};
-}
-
-
-if ($help) { usage(); exit 0; }
-
-if ($listmodules) {
- my $name_prefix = ($listmodules eq 'gridsite' and $project eq 'glite') ? 'org' : $project{etics_name};
- my @m;
-
- if (exists $lbmodules{$listmodules}) {
- @m = map exists $subpackages{$listmodules . '.' . $_} ? "" : "$name_prefix.$listmodules.$_",@{$lbmodules{$listmodules}};
- } else {
- if ($project eq 'emi' and $project_version == 1) {
- # no sub-packages in EMI-1
- } else {
- for my $sub (keys %subpackages) {
- push @m, $sub if ($subpackages{$sub} eq $listmodules);
- }
- }
- }
- print map $_ eq "" ? "" : "$_ ", @m;
- print "\n";
- exit 0;
-}
-
-warn "$0: --branch and --output make sense only in --mode=etics\n"
- if ($output || $branch) && $mode ne 'etics';
-
-my $en;
-for (keys %enable_nodes) { $en = 1 if $enable_nodes{$_}; }
-
-my $dis;
-for (keys %disable_nodes) { $dis = 1 if $disable_nodes{$_}; }
-
-die "--enable-* and --disable-* are mutually exclusive\n"
- if $en && $dis;
-
-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{jp}};
-
-if ($dis) {
- for (@nodes) {
- $enable_nodes{$_} = 1 unless ($disable_nodes{$_} or not $default_nodes{$_});
- }
-}
-
-if (!$en && !$dis) { for (@nodes) { $enable_nodes{$_} = 1 if ($default_nodes{$_}) } };
-
-for (keys %enable_nodes) { delete $enable_nodes{$_} unless $enable_nodes{$_}; }
-
-$stagedir = $root unless $stagedir;
-$stagedir=~s/\/$// if ($stagedir);
-
-if ($mode eq 'build') { for my $ext (keys %externs) {
- if (defined $externs{$ext} and defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; }
- elsif (defined $externs{$ext}{pkg}) {
- my ($flag, $env, $cmd, $ret);
- my $pkg = $externs{$ext}{pkg};
- my $flagname = uc $externs{$ext}{pkg};
- $flagname =~ s/-[0-9\.]*$//;
- $flagname =~ y/-\+/_X/;
-
- print "Checking $pkg ... ";
- $env = "PKG_CONFIG_PATH=$pkg_config_env$stagedir$prefix/$libdir/pkgconfig";
- $cmd = "$env pkg-config $pkg --exists >/dev/null";
- `$cmd`; $ret = $?;
- print "('$cmd' => $ret)\n" if ($debug);
- if ($ret == 0) {
- $externs{$ext}{prefix}=`$env pkg-config $pkg --variable=prefix`;
- chomp $externs{$ext}{prefix};
- print "$externs{$ext}{prefix}\n";
-
- $flag=`$env pkg-config $pkg --cflags`;
- $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag);
- $flag=`$env pkg-config $pkg --libs`;
- $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag);
- } else {
- print "(using default $externs{$ext}{prefix})\n";
- }
- print "\n" if ($debug);
- }
- elsif ($ext eq 'jdk') {
- my $jdk_prefix;
-
- print "Looking for some caffein ... ";
- if (defined $ENV{'JDK_HOME'}) {
- $jdk_prefix = $ENV{'JDK_HOME'};
- print "JDK_HOME=$jdk_prefix\n";
- } elsif (defined $ENV{'JAVA_HOME'}) {
- $jdk_prefix = $ENV{'JAVA_HOME'};
- print "JAVA_HOME=$jdk_prefix\n";
- } else {
- foreach my $i (0..$#{$externs{$ext}{locations}}) {
- if (-e $externs{$ext}{locations}[$i]) {
- $jdk_prefix=$externs{$ext}{locations}[$i];
- print "(found directory $jdk_prefix)\n";
- last;
- }
- }
- print "(using default $externs{$ext}{prefix})\n" unless ($jdk_prefix);
- }
- $externs{$ext}{prefix} = $jdk_prefix if ($jdk_prefix);
- }
-} }
-
-if ($mode eq 'build') {
- print "Writing config.status\n";
- open CONF,">config.status" or die "config.status: $!\n";
- for ('JDK_HOME', 'JAVA_HOME', 'PKG_CONFIG_PATH') {
- print CONF "$_=$ENV{$_} " if (defined $ENV{$_});
- }
- print CONF "$0 @keeparg\n";
- close CONF;
-}
-
-
-my @modules;
-my %aux;
-
-if ($module) {
-# push @modules,split(/[,.]+/,$module);
- push @modules,$module;
-}
-else {
- @modules = map(($extranodmod{$_} ? $extranodmod{$_} : 'lb.'.$_),(keys %enable_nodes));
-
- my $n;
-
- do {
- local $"="\n";
- $n = $#modules;
- push @modules,(map @{$deps{$_}},@modules);
-
- undef %aux; @aux{@modules} = (1) x ($#modules+1);
- @modules = keys %aux;
- } while ($#modules > $n);
-}
-
-@aux{@modules} = (1) x ($#modules+1);
-delete $aux{$_} for (split /,/,$staged);
-@modules = keys %aux;
-
-mode_build() if $mode eq 'build';
-mode_checkout() if $mode eq 'checkout';
-mode_etics($module) if $mode eq 'etics';
-
-sub mode_build {
- print "\nBuilding modules: @modules\n";
- print "Mode: "; print $module ? "single module" : "multiple modules"; print "\n";
-
- my @ext = map @{$need_externs{$_}},@modules;
- my @myjars = map @{$need_jars{$_}},@modules;
- undef %aux; @aux{@ext} = 1;
- @ext = keys %aux;
- undef %aux; @aux{@myjars} = (1) x ($#myjars+1);
- @myjars = keys %aux;
-
- print "\nRequired externals:\n";
- print "\t$_: ".($externs{$_}{prefix}?$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;
-
- if ($module) {
- print "Not creating summary Makefile\n" if $debug;
- } else {
- print "Creating Makefile\n";
-
- open MAK,">Makefile" or die "Makefile: $!\n";
-
- print MAK "all: @modules\n\n";
- print MAK "stage: ".(join '-stage ', @modules)."-stage\n\n";
- print MAK "clean check install:\n";
-
- for (@modules) {
- my $full = full($_);
- print MAK "\tcd $full/$buildroot{$_} && \${MAKE} \$@\n"
- }
-
- print MAK "\ndistclean:\n";
-
- for (@modules) {
- my $full = full($_);
- print MAK $buildroot{$_} eq '' ?
- "\tcd $full && \${MAKE} distclean\n" :
- "\trm -rf $full/$buildroot{$_}\n"
- }
-
- print MAK "\n";
-
- for (@modules) {
- my %ldeps; undef %ldeps;
- @ldeps{@{$deps{$_}}} = 1;
- for my $x (split /,/,$staged) { delete $ldeps{$x}; }
- my @dnames = $module ? () : keys %ldeps;
- my $snames = $#dnames == -1 ? '' : join('-stage ', @dnames).'-stage';
-
- my $full = full($_);
- my $build = $buildroot{$_};
-
- print MAK "$_: @dnames\n\tcd $full/$build && \${MAKE} && \${MAKE} install\n\n";
- print MAK "$_-stage: $snames\n\tcd $full/$build && \${MAKE} && \${MAKE} stage\n\n";
- }
-
- close MAK;
- }
-}
-
-sub mode_checkout() {
- for (@modules) {
- my $module = $_;
- my $tag = "";
- if ($lb_tag){
- for (@{$lbmodules{lb}}){
- if ("lb.".$_ eq $module){
- $tag = '-r '.$lb_tag;
- }
- }
- }
- if ($lbjp_tag) {
- for (@{$lbmodules{'lbjp-common'}}){
- if ("lbjp-common.".$_ eq $module){
- $tag = '-r '.$lbjp_tag;
- }
- }
- }
- if ($jp_tag){
- for (@{$lbmodules{'jp'}}){
- if ("jp.".$_ eq $module){
- $tag = '-r '.$jp_tag;
- }
- }
- }
- if ($jobid_tag){
- for (@{$lbmodules{jobid}}){
- if ("jobid.".$_ eq $module){
- $tag = '-r '.$jobid_tag;
- }
- }
- }
- if ($canl_tag) {
- for (@{$lbmodules{'canl'}}){
- if ("canl.".$_ eq $module){
- $tag = '-r '.$canl_tag;
- }
- }
- }
- #if (grep {"lb.".$_ eq $module} @{$lbmodules{lb}}){
- # print "found";
- #}
- $_ = full($_);
- print "\n*** Checking out $_\n";
- system("cvs checkout $tag $_") == 0 or die "cvs checkout $tag $_: $?\n";
- }
-}
-
-BEGIN{
-%etics_externs = (
- default => {
- 'myproxy-devel'=>'myproxy-devel',
- 'myproxy-server'=>'myproxy-server',
- 'myproxy-admin'=>'myproxy-admin',
- cares=>'c-ares',
- utiljava=>'org.glite.security.util-java',
- gpt=>'gpt',
- fetchcrl=>'fetch-crl',
- activemq=>'activemq-cpp-library',
- },
-);
-
-%etics_projects = (
-);
-
-%need_externs_aux = (
- 'lb.client' => [ qw/cppunit:B classads libtool:B globus:B/ ],
- 'lb.common' => [ qw/expat cares:B cppunit:B classads libtool:B globus:B/ ],
- 'lb.doc' => [ qw/tetex-latex:B/ ],
- 'lb.logger' => [ qw/cppunit:B libtool:B globus:B/ ],
- 'lb.logger-msg' => [ qw/cppunit:B activemq libtool:B globus:B/ ],
- 'lb.nagios' => [ qw/globus_proxy_utils:R/ ],
- 'lb.server' => [ qw/globus_essentials:R globus:B expat cares mysql-server:R cppunit:B gsoap:B classads voms:B lcas gridsite:B bison:B libtool:B libxml2 flex:B/ ],
- 'lb.state-machine' => [ qw/classads libtool:B libxslt:B expat:B globus:B/ ],
- 'lb.utils' => [ qw/cppunit:B libtool:B globus:B/ ],
- 'lb.ws-interface' => [ qw/libxslt:B tidy:B/ ],
- 'lb.ws-test' => [ qw/gsoap:B libtool:B globus:B/ ],
- 'lb.types' => [ qw// ],
- 'lb.harvester' => [ qw/docbook-utils:B libtool:B globus:B/ ],
- 'lbjp-common.db' => [ qw/mysql-devel:B postgresql:B cppunit:B log4c:B libtool:B/ ],
- 'lbjp-common.log' => [ qw/log4c libtool:B/ ],
- 'lbjp-common.maildir' => [ qw/libtool:B/ ],
- 'lbjp-common.server-bones' => [ qw/libtool:B/ ],
- 'lbjp-common.trio' => [ qw/cppunit:B libtool:B/ ],
- 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B libtool:B/ ],
- 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B libtool:B/ ],
- 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap gsoapxx libtool:B/ ],
- 'jobid.api-c' => [ qw/cppunit:B libtool:B openssl:B/ ],
- 'jobid.api-cpp' => [ qw/cppunit:B libtool:B/ ],
- 'jobid.api-java' => [ qw/ant:B jdk:B/ ],
- 'jp.client' => [ qw/gsoap libtar globus_essentials:R globus:B/ ],
- 'jp.doc' => [],
- 'jp.index' => [ qw/gsoap globus_essentials:R globus:B mysql-server:R/ ],
- 'jp.primary' => [ qw/classads gsoap libtar globus_essentials:R globus:B mysql-server:R/ ],
- 'jp.server-common' => [],
- 'jp.ws-interface' => [],
- 'gridsite.core' => [ qw/httpd-devel:B gsoap:B globus:B curl:B doxygen:B fuse-devel:B libxml2:B openssl:B doxygen:B/ ],
- 'gridsite.commands' => [ qw/curl:R openssl:R/ ],
- 'gridsite.apache' => [ qw/libxml2:R openssl:R curl:R/ ],
- 'gridsite.libs' => [ qw/libxml2:R openssl:R/ ],
- 'gridsite.devel' => [ qw// ],
- 'gridsite.slashgrid' => [ qw/curl:R fuse:R/],
- 'gridsite.services' => [ qw/curl:R gsoap:R/ ],
- 'gridsite.service-clients' => [ qw/curl:R gsoap:R gsoapxx:R/ ],
- 'gridsite.gsexec' => [ qw// ],
- 'gridsite.1.5-compat' => [ qw/httpd-devel:B gsoap:B globus:B curl:B doxygen:B fuse-devel:B libxml2:B openssl:B doxygen:B/ ],
- 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-devel:B voms:B libtool:B/ ],
- 'px.myproxy-config' => [ qw/myproxy-admin:R/ ], # in myproxy-config.spec
- 'canl.c' => [ qw/cares:B openssl:B libtool:B bison:B flex:B krb5-devel:B/ ],
-);
-
-%need_jars = (
- 'jobid.api-java' => [ qw/jakarta-commons-codec/ ],
- 'lb.client-java' => [ qw/jakarta-commons-lang/ ],
-);
-
-for my $jar (keys %need_jars) {
- for (@{$need_jars{$jar}}) {
- $need_externs_type{$jar}->{$_} = 'BR'; # XXX
- }
-}
-
-%deps_aux = (
- 'lb.client' => [ qw/
- lb.types:B lb.common
- lbjp-common.trio
- jobid.api-cpp:B jobid.api-c
- lbjp-common.gss
- / ],
- 'lb.client-java' => [ qw/
- lb.types:B
- lb.ws-interface:B
- jobid.api-java
- / ],
- 'lb.common' => [ qw/
- jobid.api-cpp:B jobid.api-c
- lb.types:B lbjp-common.trio lbjp-common.gss
- / ],
- 'lb.doc' => [ qw/lb.types:B/ ],
- 'lb.logger' => [ qw/
- lbjp-common.trio
- lbjp-common.log
- jobid.api-c
- lb.common
- lbjp-common.gss
- / ],
- 'lb.logger-msg' => [ qw/
- lb.logger:B
- / ],
- 'lb.nagios' => [ qw/
- lb.client:R
- lb.ws-test:R
- lb.utils:R
- / ],
- 'lb.server' => [ qw/
- lb.ws-interface lb.types:B lb.common lb.state-machine lb.utils:R
- lbjp-common.db lbjp-common.server-bones lbjp-common.trio lbjp-common.maildir lbjp-common.log
- jobid.api-c
- lbjp-common.gsoap-plugin lbjp-common.gss
- / ],
- 'lb.state-machine' => [ qw/lb.types:B lb.common lbjp-common.jp-interface lbjp-common.gss/ ],
- 'lb.utils' => [ qw/
- lbjp-common.jp-interface
- jobid.api-c
- lbjp-common.trio lbjp-common.maildir
- lb.client lb.state-machine lb.types:B
- / ],
- 'lb.ws-test' => [ qw/lbjp-common.gsoap-plugin lb.ws-interface/ ],
- 'lb.ws-interface' => [ qw/lb.types:B/ ],
- 'lb.types' => [ qw// ],
- 'lb.harvester' => [ qw/
- jobid.api-c lbjp-common.trio lbjp-common.db lb.common lb.client
- lbjp-common.gss lbjp-common.log
- / ],
- 'lb.yaim' => [ qw// ],
- 'lb.glite-LB' => [ qw/
- lb.logger:R lb.server:R lb.utils:R lb.doc:R
- lb.ws-test:R lb.harvester:R lb.yaim:R lb.client-java:R
- lb.logger-msg:R
- / ],
- 'lb.emi-lb' => [ qw/
- lb.logger:R lb.server:R lb.utils:R lb.doc:R
- lb.ws-test:R lb.harvester:R lb.yaim:R lb.client-java:R
- lb.logger-msg:R
- / ],
- 'lbjp-common.db' => [ qw/lbjp-common.trio lbjp-common.log/ ],
- 'lbjp-common.maildir' => [ qw// ],
- 'lbjp-common.log' => [ qw// ],
- 'lbjp-common.server-bones' => [ qw/lbjp-common.log/ ],
- 'lbjp-common.trio' => [ qw// ],
- 'lbjp-common.gss' => [ qw// ],
- 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ],
- 'jobid.api-c' => [ qw// ],
- 'jobid.api-cpp' => [ qw/jobid.api-c/ ],
- 'jobid.api-java' => [ qw// ],
-
- 'lbjp-common.jp-interface' => [ qw/lbjp-common.trio lbjp-common.db jobid.api-c/ ],
-
- 'jp.client' => [ qw/
- jp.ws-interface
- lbjp-common.jp-interface lbjp-common.maildir
- jobid.api-c
- lbjp-common.gsoap-plugin
- / ],
- 'jp.doc' => [ qw// ],
- 'jp.index' => [ qw/
- jp.server-common jp.ws-interface
- lbjp-common.jp-interface lbjp-common.trio lbjp-common.db lbjp-common.server-bones
- lbjp-common.gsoap-plugin
- / ],
- 'jp.primary' => [ qw/
- jobid.api-c
- jp.server-common jp.ws-interface
- lb.state-machine
- lbjp-common.jp-interface lbjp-common.trio lbjp-common.db lbjp-common.server-bones
- lbjp-common.gsoap-plugin
- / ],
- 'jp.server-common' => [ qw/
- lbjp-common.jp-interface lbjp-common.db
- / ],
- 'jp.ws-interface' => [ qw// ],
-
- 'gridsite.core' => [ qw// ],
- 'gridsite.commands' => [ qw/gridsite.core:B/ ],
- 'gridsite.apache' => [ qw/gridsite.core:B/ ],
- 'gridsite.libs' => [ qw/gridsite.core:B / ],
- 'gridsite.devel' => [ qw/gridsite.core:B/ ],
- 'gridsite.slashgrid' => [ qw/gridsite.core:B/],
- 'gridsite.services' => [ qw/gridsite.core:B/ ],
- 'gridsite.service-clients' => [ qw/gridsite.core:B/ ],
- 'gridsite.gsexec' => [ qw/gridsite.core:B/ ],
-
- 'px.proxyrenewal' => [ qw// ],
- 'px.glite-PX' => [qw/px.myproxy-yaim:R/],
- 'px.emi-px' => [qw/px.myproxy-yaim:R/],
- 'px.myproxy-yaim' => [ qw// ],
- 'px.myproxy-config' => [],
-
- 'canl.c' => [],
-
- # sub-packages (virtual ETICS components depending on the main)
- 'jobid.api-c-devel' => [ qw/jobid.api-c:B/ ],
- 'jobid.api-cpp-devel' => [ qw/jobid.api-cpp:B/ ],
- 'lbjp-common.db-devel' => [ qw/lbjp-common.db:B/ ],
- 'lbjp-common.gsoap-plugin-devel' => [ qw/lbjp-common.gsoap-plugin:B/ ],
- 'lbjp-common.gss-devel' => [ qw/lbjp-common.gss:B/ ],
- 'lbjp-common.jp-interface-devel' => [ qw/lbjp-common.jp-interface:B/ ],
- 'lbjp-common.log-devel' => [ qw/lbjp-common.log:B/ ],
- 'lbjp-common.maildir-devel' => [ qw/lbjp-common.maildir:B/ ],
- 'lbjp-common.server-bones-devel' => [ qw/lbjp-common.server-bones:B/ ],
- 'lbjp-common.trio-devel' => [ qw/lbjp-common.trio:B/ ],
- 'lb.client-progs' => [ qw/lb.client:B/ ],
- 'lb.client-devel' => [ qw/lb.client:B/ ],
- 'lb.common-devel' => [ qw/lb.common:B/ ],
- 'lb.logger-devel' => [ qw/lb.logger:B/ ],
- 'lb.state-machine-devel' => [ qw/lb.state-machine:B/ ],
- 'px.proxyrenewal-devel' => [ qw/px.proxyrenewal:B/ ],
- 'px.proxyrenewal-progs' => [ qw/px.proxyrenewal:B/ ],
- 'canl.c-devel' => [ qw/canl.c:B/ ],
-);
-
-for my $ext (keys %deps_aux) {
- for (@{$deps_aux{$ext}}) {
- /([^:]*)(?::(.*))?/;
- push @{$deps{$ext}},$1;
- my $type = $2 ? $2 : 'BR';
- $deps_type{$ext}->{$1} = $type;
- }
-}
-
-
-%extrafull = (
- gridsite=>'org.gridsite.core',
- 'canl.c' => 'emi.canl.canl-c',
- 'canl.c-devel' => 'emi.canl.canl-c',
- 'jobid.api-c-devel' => 'org.glite.jobid.api-c',
- 'jobid.api-cpp-devel' => 'org.glite.jobid.api-cpp',
- 'lbjp-common.db-devel' => 'org.glite.lbjp-common.db',
- 'lbjp-common.gsoap-plugin-devel' => 'org.glite.lbjp-common.gsoap-plugin',
- 'lbjp-common.gss-devel' => 'org.glite.lbjp-common.gss',
- 'lbjp-common.jp-interface-devel' => 'org.glite.lbjp-common.jp-interface',
- 'lbjp-common.log-devel' => 'org.glite.lbjp-common.log',
- 'lbjp-common.maildir-devel' => 'org.glite.lbjp-common.maildir',
- 'lbjp-common.server-bones-devel' => 'org.glite.lbjp-common.server-bones',
- 'lbjp-common.trio-devel' => 'org.glite.lbjp-common.trio',
- 'lb.client-devel' => 'org.glite.lb.client',
- 'lb.client-progs' => 'org.glite.lb.client',
- 'lb.common-devel' => 'org.glite.lb.common',
- 'lb.logger-devel' => 'org.glite.lb.logger',
- 'lb.state-machine-devel' => 'org.glite.lb.state-machine',
- 'px.proxyrenewal-devel' => 'org.glite.px.proxyrenewal',
- 'px.proxyrenewal-progs' => 'org.glite.px.proxyrenewal',
-);
-
-#( java => 'client-java' );
-%extranodmod = (
- db => 'lbjp-common.db',
- jpprimary => 'jp.primary',
- jpindex => 'jp.index',
- jpclient => 'jp.client',
- lb => 'lb.glite-LB',
- px => 'px.glite-PX',
- proxyrenewal => 'px.proxyrenewal',
- canl => 'canl.c',
-);
-
-%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/ ],
-);
-
-%conflicts = (
-);
-
-%provides = (
- 'lbjp-common.gss' => [ qq/glite-security-gss/ ],
- 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ],
- 'lb.nagios' => [ qq/glite-lb-nagios-plugins/ ],
-);
-
-%cvs_prefix = (
- 'lb' => 'org.glite',
- 'jp' => 'org.glite',
- 'jobid' => 'org.glite',
- 'lbjp-common' => 'org.glite',
- 'gridsite' => 'org',
- 'px' => 'org.glite',
- 'canl' => 'emi',
-);
-
-%cvs_tag_prefix = (
- 'lb' => 'glite-',
- 'jp' => 'glite-',
- 'jobid' => 'glite-',
- 'lbjp-common' => 'glite-',
- 'gridsite' => '',
- 'px' => 'glite-',
- 'canl' => 'emi-',
-);
-
-# ==== projects specification ====
-# etics_name ........... ETICS project name
-# conf_prefix .......... ETICS configurations name prefix
-# tag_prefix ........... VCS tag prefix
-# local_prefix ......... prefix (relative to stage)
-# etics_externs ........ ETICS modules names of externals
-# (${NAME.location}, ETICS conf. dependencies)
-# etics_projects ....... ETICS project names of externals
-# etics_externs_devel .. ETICS modules names of devel versions of externals
-# etics_locations ...... ETICS locations in ${NAME.location} properties
-# need_externs_aux ..... project-specific external dependencies
-# supported_platforms .. platforms supported by the project
-# modules .............. additional modules in subsystems
-%projects = (
- glite => {
- current_version => 3,
- etics_name => 'org.glite',
- conf_prefix => { %cvs_tag_prefix },
- tag_prefix => { %cvs_tag_prefix },
- flavours => '--thrflavour=${globus.thr.flavor} --nothrflavour=${globus.nothr.flavor}',
- local_prefix => '',
- etics_externs => {
- default => {
- globus_essentials=>'vdt_globus_essentials',
- globus=>'globus',
- globus_proxy_utils=>'vdt_globus_essentials',
- gridsite=>'org.gridsite.libs',
- yaim_core=>'org.glite.yaim.core',
- gip_release=>'glite-info-provider-release',
- gip_service=>'glite-info-provider-service',
- bdii=>'bdii',
- glite_version=>'glite-version',
- glite_info_templates=>'glite-info-templates',
- glue_schema=>'glue-schema',
- trustmanager=>'org.glite.security.trustmanager',
- axis=>'axis',
- lcas=>'org.glite.security.lcas',
- gsoapxx=>'-',
- jdk=>'jdk',
- voms=>'org.glite.security.voms-api-cpp',
- },
- },
- etics_externs_devel => {
- default => {
- gridsite=>'org.gridsite.devel',
- voms=>'org.glite.security.voms-api',
- },
- },
- etics_projects => {
- vdt=>[qw/globus globus_essentials globus_proxy_utils gpt/],
- 'org.glite'=>[qw/voms gridsite lcas gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/],
- },
- etics_locations => {
- '*' => '',
- },
- need_externs_aux => {
- 'lb.client-java' => [ qw/ant:B jdk:B axis:B trustmanager utiljava libtool:B/ ],
- 'lb.glite-LB' => [ qw/fetchcrl:R gpt:R gip_release:R gip_service:R bdii:R glite_version:R glite_info_templates:R glue_schema:R/ ],
- 'lb.yaim' => [ qw/yaim_core:R/ ],
- 'px.glite-PX' => [qw/myproxy-server:R myproxy-admin:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/],
- 'px.myproxy-yaim' => [ qw/yaim_core:R/ ],
- },
- supported_platforms => {
- sl5_x86_64_gcc412 => 1,
- sl5_ia32_gcc412 => 1,
- deb5_x86_64_gcc432 => 1,
- deb5_ia32_gcc432 => 1,
- slc4_x86_64_gcc346 => 1,
- slc4_ia32_gcc346 => 1,
- },
- modules => {
- 'lb' => [ qw/glite-LB/ ],
- 'px' => [ qw/glite-PX/ ],
- },
- },
-
- emi => {
- current_version => 2,
- etics_name => 'emi',
- conf_prefix => {
- 'lb' => 'emi-',
- 'jp' => 'emi-',
- 'jobid' => 'emi-',
- 'lbjp-common' => 'emi-',
- 'gridsite' => 'emi-',
- 'px' => 'emi-',
- 'canl' => 'emi-',
- },
- tag_prefix => { %cvs_tag_prefix },
- flavours => '--thrflavour= --nothrflavour=',
- local_prefix => '/usr',
- etics_externs => {
- default => {
- globus_essentials=>'globus-gssapi-gsi',
- globus=>'globus-gssapi-gsi-devel',
- globus_proxy_utils=>'globus-proxy-utils',
- gridsite=>'emi.gridsite.libs',
- yaim_core=>'emi.yaim.yaim-core',
- yaim_bdii=>'emi.bdii.yaim-bdii',
- gip_service=>'emi.bdii.glite-info-provider-service',
- bdii=>'emi.bdii.core',
- glite_version=>'emi.emi-version',
- glue_schema=>'emi.bdii.glue-schema',
- trustmanager=>'emi.java-security.trustmanager',
- trustmanager_axis=>'emi.java-security.trustmanager-axis',
- axis=>'axis1.4',
- lcas=>'emi.sac.lcas',
- gsoapxx=>'-',
- jdk=>'java',
- voms => 'emi.voms.voms-api',
- },
- sl5_x86_64_gcc412EPEL => {
- 'myproxy-devel' => 'myproxy-devel.x86_64',
- },
- sl6_x86_64_gcc446EPEL => {
- 'myproxy-devel' => 'myproxy-devel.x86_64',
- },
- deb6_x86_64_gcc445 => {
- axis => 'axis1.4',
- # mappings in ETICS project configuration
- #globus_essentials => 'libglobus-gssapi-gsi4',
- #globus => 'libglobus-gssapi-gsi-dev',
- #axis => 'libaxis-java',
- #cares => 'libc-ares2',
- #cppunit => 'libcppunit',
- #expat => 'libexpat1',
- #log4c => 'liblog4c3',
- #curl => 'libcurl3',
- #'mysql' => 'libmysqlclient16',
- #'mysql-devel' => 'libmysqlclient-dev',
- #libxslt => 'xsltproc',
- #'jakarta-commons-codec' => 'libcommons-codec-java',
- #'jakarta-commons-lang' => 'libcommons-lang-java',
- #'tetex-latex' => 'texlive-latex-extra',
- #'perl-LDAP' => 'libnet-ldap-perl',
- #'fuse-lib' => 'libfuse2',
- #'fuse' => 'fuse-utils',
- },
- },
- etics_externs_devel => {
- default => {
- cares => 'c-ares-devel',
- classads => 'classads-devel',
- cppunit => 'cppunit-devel',
- expat => 'expat-devel',
- gsoap => 'gsoap-devel',
- voms => 'emi.voms.voms-api-devel',
- libtar => 'libtar-devel',
- log4c => 'log4c-devel',
- postgresql => 'postgresql-devel',
- curl => 'curl-devel',
- libxml2 => 'libxml2-devel',
- openssl => 'openssl-devel',
- gridsite=>'emi.gridsite.devel',
- jdk=>'java-devel',
- },
- deb6_x86_64_gcc445 => {
- # mappings in ETICS project configuration
- #cares => 'libc-ares-dev',
- #cppunit => 'libcppunit-dev',
- #expat => 'libexpat1-dev',
- #libtar => 'libtar-dev',
- #log4c => 'liblog4c-dev',
- #postgresql => 'libpq-dev',
- #curl => 'libcurl4-openssl-dev',
- #libxml2 => 'libxml2-dev',
- #openssl => 'libssl-dev',
- #'tetex-latex' => 'texlive-latex-extra',
- #libxslt=>'xsltproc',
- #'httpd-devel' => 'apache2-prefork-dev',
- #'fuse-devel' => 'libfuse-dev',
- #gsoap => 'gsoap',
- #'krb5-devel' => 'libkrb5-dev',
- },
- },
- etics_projects => {
- 'emi'=>[qw/voms voms-devel gridsite lcas gip_service bdii glite_version glue_schema yaim_core yaim_bdii trustmanager trustmanager_axis/],
- },
- etics_locations => {
- axis => 'axis',
- },
- need_externs_aux => {
- 'lb.client-java' => [ qw/ant:B jdk:B axis:B trustmanager trustmanager_axis libtool:B/ ],
- 'lb.emi-lb' => [ qw/fetchcrl:R gip_service:R bdii:R glite_version:R glue_schema:R/ ],
- 'lb.yaim' => [ qw/yaim_core:R yaim_bdii:R/ ],
- 'px.emi-px' => [qw/myproxy-server:R myproxy-admin:R fetchcrl:R gip_service:R bdii:R glite_version:R glue_schema:R/],
- 'px.myproxy-yaim' => [ qw/yaim_core:R yaim_bdii:R/ ],
- },
- supported_platforms => {
- sl5_x86_64_gcc412EPEL => 1,
- sl5_ia32_gcc412EPEL => 1,
- sl6_x86_64_gcc446EPEL => 1,
- deb6_x86_64_gcc445 => 1,
- },
- modules => {
- 'lb' => [ qw/emi-lb/ ],
- 'px' => [ qw/emi-px/ ],
- },
- },
-);
-
-%platform_properties = (
- 'jobid.api-java' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.types' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.doc' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.ws-interface' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.yaim' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.nagios' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'px.yaim' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'px.myproxy-config' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'gridsite.devel' => {
- default => { 'packageName' => 'gridsite-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libgridsite-dev' },
- },
- 'canl.c-devel' => {
- default => { 'packageName' => 'canl-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libcanl-dev' },
- },
- 'jobid.api-c-devel' => {
- default => { 'packageName' => 'glite-jobid-api-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-jobid-dev' },
- },
- 'jobid.api-cpp-devel' => {
- default => { 'packageName' => 'glite-jobid-api-cpp-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-jobid-cpp-dev' },
- },
- 'lbjp-common.db-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-db-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-db-dev' },
- },
- 'lbjp-common.gsoap-plugin-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-gsoap-plugin-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-gsoap-plugin-dev' },
- },
- 'lbjp-common.gss-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-gss-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-gss-dev' },
- },
- 'lbjp-common.jp-interface-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-jp-interface-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-jp-interface-dev' },
- },
- 'lbjp-common.log-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-log-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-log-dev' },
- },
- 'lbjp-common.maildir-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-maildir-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-maildir-dev' },
- },
- 'lbjp-common.server-bones-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-server-bones-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-server-bones-dev' },
- },
- 'lbjp-common.trio-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-trio-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-trio-dev' },
- },
- 'lb.client-devel' => {
- default => { 'packageName' => 'glite-lb-client-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-client-dev' },
- },
- 'lb.common-devel' => {
- default => { 'packageName' => 'glite-lb-common-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-common-dev' },
- },
- 'lb.state-machine-devel' => {
- default => { 'packageName' => 'glite-lb-state-machine-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-state-machine-dev' },
- },
- 'lb.logger-devel' => {
- default => { 'packageName' => 'glite-lb-logger-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-logger-dev' },
- },
- 'px.proxyrenewal-devel' => {
- default => { 'packageName' => 'glite-px-proxyrenewal-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-security-proxyrenewal-dev' },
- },
- 'canl.c-devel' => {
- default => { 'packageName' => 'canl-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libcanl-c-dev' },
- },
-);
-
-my @k = keys %deps_aux;
-@buildroot{@k} = ('') x ($#k+1);
-
-$buildroot{'gridsite.core'} = 'src';
-}
-
-sub full
-{
- my ($short) = @_;
- my $subsys = $short;
- $subsys =~ s/\..*//;
-
- my $cvs_prefix = exists $cvs_prefix{$subsys} ? $cvs_prefix{$subsys} : 'org.glite';
- return $extrafull{$short} ? $extrafull{$short} : "$cvs_prefix.$short";
-}
-
-sub get_version
-{
- my ($fmod, $top_srcdir) = @_;
-
- my ($subsys,$mod) = split /\./,$fmod,2;
- my ($major,$minor,$rev,$age);
- my $old_;
-
- if ($force_version) {
- $force_version =~ /([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)-(.+)/;
- ($major,$minor,$rev,$age) = ($1,$2,$3,$4);
- }
- else {
- my $path = "$top_srcdir/project";
- if ($subsys eq 'gridsite') {
- $path = "$cvs_prefix{$subsys}.$subsys.core/project";
- }
- open V,"$path/version.properties"
- or die "$path/version.properties: $!\n";
-
- $old_ = $_;
- while (<V>) {
- chomp;
- ($major,$minor,$rev) = ($1,$2,$3) if /module\.version\s*=\s*([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/;
- $age = $1 if /module\.age\s*=\s*([[:digit:]]+)/;
- }
- close V;
- $_ = $old_;
- }
- $version = "$major.$minor.$rev-$age";
-
- return ($major, $minor, $rev, $age);
-}
-
-sub get_description
-{
- my ($top_srcdir) = @_;
-
- my $cvs_module = $top_srcdir;
- my $package_description = "";
- my $package_summary = "";
-
- if (-e "$cvs_module/project/package.description") {
- open V, "$cvs_module/project/package.description";
- $package_description = join ("", <V>);
- close V;
- chomp $package_description;
- }
- else {
- print STDERR "package.description not found for $subsys.$module!\n"; }
-
- if (-e "$cvs_module/project/package.summary") {
- open V, "$cvs_module/project/package.summary";
- $package_summary = join ("", <V>);
- close V;
- chomp $package_summary;
- $package_summary =~ s/\n/\\n/g;
- }
- else {
- print STDERR "package.summary not found for $subsys.$module!\n"; }
-
- return ($package_summary, $package_description);
-}
-
-sub mkinc
-{
- my %aux;
- undef %aux;
- my @m=qw/
-lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.nagios lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lb.emi-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
-px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config px.emi-px
-canl.c
-/;
- @aux{@m} = (1) x ($#m+1);
-
- my ($short) = @_;
- my $full = full $short;
- my ($subsys,$mod) = split /\./,$short,2;
- my $packageName = "$project{tag_prefix}{$subsys}$subsys-${mod}";
-
- unless ($aux{$short}) {
- print "Makefile.inc not needed in $full\n";
- return;
- }
-
- my $top_srcdir = '.';
- my $abs_srcdir = '';
- my $build = '';
-
- if ($module) {
- $top_srcdir = $0;
- $top_srcdir =~ s,/?[^/]*$,,;
- $abs_srcdir = $top_srcdir;
- $top_srcdir =~ s,^$,\.,;
- } else {
- $build = "$full/";
- $abs_srcdir = "$full/";
- unless ($buildroot{$_} eq '') {
- $top_srcdir = '..';
- $build .= "$buildroot{$_}/";
- unless (-d "$build") {
- mkdir "$build" or die "mkdir $build: $!\n";
- }
- }
- }
-
- my ($major, $minor, $rev, $age) = get_version $short, $abs_srcdir;
- my ($package_summary, $package_description) = get_description $abs_srcdir;
- if ($package_description) { $package_description =~ s/(.{1,78}\S|\S+)\s+/$1\n/mg; }
- my $package_description_debian = $package_description;
- $package_description_debian =~ s/^/ /mg;
-
- my ($old_locale, $specdate, $debdate);
-
- # files for ETICS always in root source directory
- mkdir $abs_srcdir."project" unless (-d $abs_srcdir."project");
- open PKGCHL,">".$abs_srcdir."project/changelog"
- or die $abs_srcdir."project/changelog: $!\n";
- $old_locale = setlocale(LC_TIME);
- setlocale(LC_TIME, "C");
- $specdate = strftime("%a %b %d %Y", gmtime());
- $debdate = strftime("%a, %d %b %Y %H:%M:%S %z", gmtime());
- setlocale(LC_TIME, $old_locale);
- print PKGCHL qq{* $specdate CESNET team <emi-lb\@metacentrum.cz>
-- automatically generated package
-};
- close PKGCHL;
-
- unless ($top_srcdir eq '.') {
- unlink $build."Makefile";
- symlink "$top_srcdir/Makefile",$build."Makefile" or die "symlink $top_srcdir/Makefile ".$build."Makefile: $!\n";
- }
-
- open MKINC,">".$build."Makefile.inc"
- or die $build."Makefile.inc: $!\n";
-
- print "Creating ".$build."Makefile.inc\n";
-
- print MKINC qq{project = $project
-PREFIX = $root
-prefix = $prefix
-stagedir = $stagedir
-sysroot = $sysroot
-sysconfdir = $sysconfdir
-localstatedir = $localstatedir
-thrflavour = $thrflavour
-nothrflavour = $nothrflavour
-libdir = $libdir
-top_srcdir = $top_srcdir
-};
-
- for (@{$need_externs{$short}}) {
- next unless defined $externs{$_} and defined $externs{$_}{prefix};
- print MKINC "${_}_prefix = $externs{$_}{prefix}\n";
- print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags};
- }
-
- for (@{$need_jars{$short}}) {
- print MKINC "${_}_jar = $jar{$_}\n"
- }
-
- my $need_gsoap = 0;
- for (@{$need_externs{$short}}) { $need_gsoap = 1 if $_ eq 'gsoap'; }
-
- print MKINC "gsoap_default_version=".gsoap_version()."\n" if $need_gsoap;
-
- close MKINC;
-
- my $dh;
- my $debian = 0;
-
- opendir $dh, "$abs_srcdir/project" || die "Can't open $abs_srcdir/project: $!";
- for my $dir (readdir $dh) {
- if ($dir=~/^(.*)\.spec$/) {
- if ($1 ne $packageName) {
- printf STDERR "Changed RPM name: $packageName --> $1\n" if ($debug);;
- $packageName=$1;
- }
- last;
- }
- }
- closedir $dh;
-
- for my $file ("$packageName.spec", "debian.rules", "debian.control", "debian.changelog", "debian.copyright") {
- if (-f "$abs_srcdir/project/$file") {
- my $old_ = $_;
- printf STDERR "Creating $build$file\n" if ($debug);;
- open DST, ">$build$file";
- open SRC, "<$abs_srcdir/project/$file";
- while (<SRC>) {
- if (/\@MODULE\@/) { s/\@MODULE\@/$full/g; }
- if (/\@URL\@/) { s/\@URL\@/$package{url}/g; }
- if (/\@SUMMARY\@/) { s/\@SUMMARY\@/$package_summary/g; }
- if (/\@DESCRIPTION\@/) { s/\@DESCRIPTION\@/$package_description/g; }
- if (/\@DEBIAN_DESCRIPTION\@/) { s/\@DEBIAN_DESCRIPTION\@/$package_description_debian/g; }
- if (/\@VERSION\@/) { s/\@VERSION\@/$version/g; }
- if (/\@MAJOR\@/) { s/\@MAJOR\@/$major/g; }
- if (/\@MINOR\@/) { s/\@MINOR\@/$minor/g; }
- if (/\@REVISION\@/) { s/\@REVISION\@/$rev/g; }
- if (/\@AGE\@/) { s/\@AGE\@/$age/g; }
- if (/\@MAINTAINER\@/) { s/\@MAINTAINER\@/$package{maintainer}/g; }
- if (/\@UPLOADERS\@/) { s/\@UPLOADERS\@/$package{uploaders}/g; }
- if (/\@DEBIAN_VCS\@/) { s/\@DEBIAN_VCS\@/$package{debian_vcs}/g; }
- if (/\@DEBIAN_DATE\@/) { s/\@DEBIAN_DATE\@/$debdate/g; }
- if (/\@SPEC_DATE\@/) { s/\@SPEC_DATE\@/$specdate/g; }
- if (/^\s*.+\/configure\s/ and $force_version) {
- print "Version forced to $version\n" if ($debug);;
- s/--version\s+\S+\s?//;
- s/$/ --version $version/;
- }
- printf DST "%s", "$_";
- }
- close SRC;
- close DST;
- $_ = $old_;
- }
- }
-
- print "Creating ${build}debian/\n" if ($debug);;
-
- `rm -rfv ${build}debian`;
- mkdir $build."debian" or die $!;
- `cp $abs_srcdir/project/debian.* ${build}debian/ 2>/dev/null`;
- `mv ${build}debian.* ${build}debian/ 2>/dev/null`;
- `rm -f ${build}debian/*.orig`;
- opendir $dh, "${build}debian" || die "Can't open ${build}debian: $!";
- for $_ (readdir $dh) {
- if (/^debian\.(.*)/) {
- `mv ${build}debian/$_ ${build}debian/$1`;
- $debian = 1;
- }
- }
- closedir $dh;
-
- if ($debian) {
- my ($dir, $file);
-
- chmod 0755, "${build}debian/rules";
- $file="${build}debian/docs"; if (not -f $file) { `touch $file`; }
- $dir="${build}debian/source"; if (not -d $dir) { mkdir $dir; }
- $file="${build}debian/source/format"; if (not -f $file) { `echo "3.0 (quilt)" > $file` }
- $file="${build}debian/compat"; if (not -f $file) { `echo "7" > $file` }
- $file="${build}debian/changelog"; if (not -f $file) {
- open FH, ">$file" or die $!;
- print FH qq{$packageName ($major.$minor.$rev-$age) unstable; urgency=low
-
- * Automatically generated package
-
- -- $package{maintainer} $debdate
-};
- close FH;
- }
-
- } else {
- `rm -rf ${build}debian`;
- }
-}
-
-BEGIN{
-};
-
-sub mode_etics_packaging {
- my ($fmod, $cmd, $rpmprepare, $debprepare) = @_;
- my ($workspaceDir, $srcPackageName, $srcAge, $topDir);
-
- # old-school packaging by ETICS for EMI-1
- if ($project eq 'emi' and $project_version == 1) { return; }
-
- if ($fmod eq 'gridsite.core') {
- $workspaceDir = '..';
- $srcPackageName = 'gridsite';
- $srcAge = '';
- $topDir = '../';
- } else {
- $workspaceDir = '${workspaceDir}';
- $srcPackageName = '${packageName}';
- $srcAge = '-${age}';
- $topDir = '';
- }
-
- $cmd->{clean} = 'make clean
- rm -rfv ${package.tgzLocation} ${package.SRPMSLocation}';
- $cmd->{default}{packaging} = $rpmprepare;
- $cmd->{default}{packaging} .= "dir=\${workspaceDir}/rpm_build_src_\$\$
- mkdir -p \${package.tgzLocation} \${package.SRPMSLocation} \$dir/{BUILD,RPMS,SOURCES,SRPMS} 2>/dev/null || true
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \${package.tgzLocation}/
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \$dir/SOURCES/
- rpmbuild -bs --nodeps --define \"_topdir \$dir\" $srcPackageName.spec
- cp -v \$dir/SRPMS/*.src.rpm \${package.SRPMSLocation}/
- rm -rf \$dir";
-
- for my $p ('deb5_x86_64_gcc432', 'deb5_ia32_gcc432', 'deb6_x86_64_gcc445', 'deb6_ia32_gcc445') {
- for my $c (keys %{$cmd->{default}}) { $cmd->{$p}{$c} = $cmd->{default}{$c}; }
- $cmd->{$p}{clean} = 'make clean
- rm -rfv ${package.tgzLocation} ${package.SDEBSLocation}';
- $cmd->{$p}{packaging} = $debprepare;
- $cmd->{$p}{packaging} .= "dir=\${workspaceDir}/dpkg_build_src_\$\$
- mkdir -p \${package.tgzLocation} \${package.SDEBSLocation} \$dir 2>/dev/null || true
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \${package.tgzLocation}/
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \$dir/${srcPackageName}_\${version}.orig.tar.gz
- tar xzf \$dir/${srcPackageName}_\${version}.orig.tar.gz -C \$dir
- cp -rf ${topDir}debian/ \$dir/$srcPackageName-\${version}/
- cd \$dir/$srcPackageName-\${version}
- dpkg-buildpackage -S -d -nc
- cd -
- cp -v \$dir/*.tar.gz \$dir/*.dsc \${package.SDEBSLocation}/
- rm -rf \$dir";
- }
-}
-
-sub mode_etics {
- $fmod = shift;
-
- die "$0: --module required with --etics\n" unless $fmod;
-
- my ($subsys,$module) = split /\./,$fmod,2;
- my $full = full "$subsys.$module";
-
- my ($major,$minor,$rev,$age) = get_version $fmod, $full;
-
- # XXX: --with ignored for platform-dependend packages
- my @copts = ();
- my %ge;
- @ge{@{$etics_projects{$project{etics_name}}}} = (1) x ($#{$etics_projects{$project{etics_name}}}+1);
-
- for (@{$need_externs{"$subsys.$module"}}) {
- if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/ and (defined $externs{$_} or defined $jar{$_})) {
- my $eext = $etics_externs{default}{$_} ? $etics_externs{default}{$_} : $_;
- next if ($eext eq '-');
- if (defined $project{etics_locations}{'*'} or defined $project{etics_locations}{$_}) {
- $eext = $project{etics_locations}{$_} if ($project{etics_locations}{$_});
- push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}";
- } else {
- if ($ge{$_} and not defined $externs{$_}{pkg}) {
- push @copts, "--with-$_=\${stageDir}";
- }
- }
- }
- }
-
- for (@{$need_jars{"$subsys.$module"}}) {
- my $eext = $etics_externs{default}{$_} ? $etics_externs{default}{$_} : $_;
-
- push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (defined $project{etics_locations}{'*'} or defined $project{etics_locations}{$_});
- }
-
- my $conf;
- my $conftag;
- my ($confprefix, $nameprefix, $packageName);
-
- $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n";
-
- $confprefix = $project{conf_prefix}{$subsys};
- $nameprefix = $confprefix;
- $nameprefix =~ s/-$//;
- $nameprefix =~ s/-/\./g;
- $packageName = "$project{tag_prefix}{$subsys}$subsys-${module}";
-
- if ($branch) {
- $conf = "$confprefix${subsys}-${module}_$branch";
- $conftag = $branch;
- # forced low age number
- $age = $branch eq 'HEAD' ? '0head' : '0dev';
- push @copts, '--version ${version}-${age}';
- }
- else {
- $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}";
-# XXX: gridsite hack
- $conftag = $subsys eq 'gridsite' ? "$project{tag_prefix}{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" :
- "$project{tag_prefix}{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}";
-
- # lowering age for older packaging
- if ($project eq 'emi' and $project_version == 1) {
- $age = $age - 1;
- }
- }
-
- # emi1 suffix for older packaging
- if ($project eq 'emi' and $project_version == 1) {
- $age = $age.$project.$project_version;
- $conf = $conf.$project.$project_version;
- }
-
- my $file = $output ? $output : "$conf.ini";
- open C,">$file" or die "$file: $!\n";
-
- my $buildroot = $buildroot{"$subsys.$module"} eq '' ? '#no build.root' : "build.root = " . $buildroot{"$subsys.$module"};
-
- my $confdir = $buildroot{"$subsys.$module"} eq '' ? '.' : '..';
-
- my $cvs_module = full "$subsys.$module";
- my ($package_summary, $package_description) = get_description $cvs_module;
- if ($package_description) {
- $package_description =~ s/\n/\\n/g;
- $package_description = "package.description = $package_description\n";
- }
- if ($package_summary) {
- $package_summary = "package.summary = $package_summary\n";
- }
-
- my %cmd;
- $cmd_vcs{checkout} = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_module 2>/dev/null";
- #$cmd_vcs{checkout} = "((test -d jra1mw/.git && (cd jra1mw; git pull)) || (git clone -q http://scientific.zcu.cz/git/jra1mw.git";
- #$cmd_vcs{checkout} .= " && (cd jra1mw; git checkout -b \${tag} --track origin/\${tag})" unless ($conftag eq /HEAD/);
- #$cmd_vcs{checkout} .= ")) && (test -d \${moduleName} || ln -s jra1mw/$cvs_module \${moduleName})";
- $cmd_vcs{checkout} .= "\n\ttest -f \${packageName}-\${version}-\${age}.src.tar.gz || (ln -s \${moduleName} \${packageName}-\${version}; tar -chf - \${packageName}-\${version} --exclude CVS --exclude .git --exclude .etics | gzip --best > \${packageName}-\${version}-\${age}.src.tar.gz; rm \${packageName}-\${version})";
- $cmd_vcs{tag} = "cvs -d \${vcsroot} tag -R \${tag} ${moduleName}";
-
- $cmd{default}{init} = 'None';
- $cmd{default}{configure} = 'None';
- $cmd{default}{compile} = 'None';
- $cmd{default}{test} = 'None';
- $cmd{default}{install} = 'None';
- $cmd{default}{packaging} = 'None';
- $cmd{default}{clean} = 'make clean';
-
- if (exists $subpackages{$fmod}) {
- $cmd{default}{clean} = 'None';
- $cmd{default}{packaging} = "echo building nothing, $subpackages{$fmod} will build this package";
- $cmd_vcs{checkout} = "mkdir -v \${moduleName} 2>/dev/null || true";
- } elsif ($subsys eq 'gridsite') {
- $cmd_vcs{tag} = 'None';
-
- if ($module eq 'core') {
- my $flags;
-
- if ($project ne 'glite') {
- # don't evaluate pkg-config calls to get them into source package
- $flags = 'RELEASE_VERSION=${age}
- GSOAPDIR=\`pkg-config gsoap --variable=prefix\`
- OPENSSL_GLOBUS_FLAGS=\`pkg-config globus-openssl --cflags\`
- OPENSSL_GLOBUS_LIBS=\`pkg-config globus-openssl --libs\`';
- } else {
- $flags = 'RELEASE_VERSION=${age}
- GSOAPDIR=${gsoap.location}
- OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor}
- OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}
- HTTPD_FLAGS=-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-1 -I${httpd-devel.location}/include/apr-1.0 -I${httpd-devel.location}/include/apr-0 -I${httpd-devel.location}/include/pcre';
- }
-
- $cmd{default}{configure} = "cat > Makefile.inc <<EOF
- project = $project
- top_srcdir = ..
- $flags
- EOF";
- $cmd{default}{compile} = "make prefix=\${prefix}$project{local_prefix} libdir=\${libdir}";
- $cmd{default}{install} = "make prefix=\${prefix}$project{local_prefix} libdir=\${libdir} install";
- mode_etics_packaging($fmod, \%cmd,
- "make prefix=\${prefix}$project{local_prefix} rpm-prepare
- cp gridsite.spec ../\n\t",
- "chmod +x \${moduleDir}/src/make-debian-files || true
- make prefix=\${prefix}$project{local_prefix} deb-prepare\n\t"
- );
- }
- elsif ($module eq '1.5-compat') {
- $cmd_vcs{checkout} = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.core 2>/dev/null";
- $cmd{default}{init} = 'echo "/sbin/ldconfig" > project/.post
- echo "/sbin/ldconfig" > project/.postun';
- $cmd{default}{configure} = "cat > src/Makefile.inc <<EOF
- project = emi
- libdir = \${libdir}
- MAJOR_VERSION=1
- MINOR_VERSION=1.5
- PATCH_VERSION=1.5.0
- VERSION=\\\$(PATCH_VERSION)
- RELEASE_VERSION=\${age}
- GSOAPDIR=\\`pkg-config gsoap --variable=prefix\\`
- OPENSSL_GLOBUS_FLAGS=\\`pkg-config globus-openssl --cflags\\`
- OPENSSL_GLOBUS_LIBS=\\`pkg-config globus-openssl --libs\\`
- EOF";
- $cmd{default}{compile} = "make -C src prefix=\${prefix}$project{local_prefix}
- rm -fv project/debian.changelog";
- $cmd{default}{install} = "make -C src prefix=\${prefix}$project{local_prefix} install-lib
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.so.1
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.so
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.a";
- $cmd{default}{packaging} = "None";
- }
- else {
- $cmd{default}{clean} = 'None';
- $cmd{default}{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this";
- $cmd_vcs{checkout} = "mkdir -v \${moduleName} 2>/dev/null || true";
- }
- }
- elsif ($subsys eq 'px' and $module eq 'myproxy-config') {
- $cmd{default}{configure} = "/usr/bin/perl $confdir/configure --root=\${prefix} --prefix= --stage=\${stageDir} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts";
- $cmd{default}{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config";
- }
- else {
- $cmd{default}{configure} = "/usr/bin/perl $confdir/configure $project{flavours} --root=\${prefix} --prefix=$project{local_prefix} --stage=\${stageDir} --sysroot=\${package.prefix} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts";
- $cmd{default}{compile} = 'make';
- $cmd{default}{test} = 'make check';
- $cmd{default}{install} = 'make install';
- if ($subsys eq 'lb' and $module eq 'client') {
- $cmd{default}{compile} = "make rpath=$project{local_prefix}/\${libdir}";
- $cmd{default}{install} = "make install post-install rpath=$project{local_prefix}/\${libdir}";
- }
- mode_etics_packaging($fmod, \%cmd);
- }
-
- 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 = $project{etics_name}.$subsys.$module
-displayName = $conf
-description = $cvs_prefix{$subsys}.$subsys.$module
-projectName = $project{etics_name}
-age = $age
-deploymentType = None
-vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite
-tag = $conftag
-version = $major.$minor.$rev
-$dwpath
-[Platform-default:VcsCommand]
-displayName = None
-description = None
-tag = $cmd_vcs{tag}
-branch = None
-commit = None
-checkout = $cmd_vcs{checkout}
-
-};
-
- for my $p (keys %cmd) {
- next if $p ne 'default' and exists $project{supported_platforms} and not exists $project{supported_platforms}{$p};
-
- print C qq{[Platform-$p:BuildCommand]
-postpublish = None
-packaging = $cmd{$p}{packaging}
-displayName = None
-description = None
-doc = None
-prepublish = None
-publish = None
-compile = $cmd{$p}{compile}
-init = $cmd{$p}{init}
-install = $cmd{$p}{install}
-clean = $cmd{$p}{clean}
-test = $cmd{$p}{test}
-configure = $cmd{$p}{configure}
-checkstyle = None
-
-};
- }
-
- print C qq{[Platform-default:Property]
-$buildroot
-package.preserve.libtool = false
-$package_description$package_summary$defprops};
-
- for (@{$obsoletes{"$subsys.$module"}}) {
- print C "package.obsoletes = $_\n";
- print C "package.replaces = $_\n";
- }
- for (@{$conflicts{"$subsys.$module"}}) {
- print C "package.conflicts = $_\n";
- }
- for (@{$provides{"$subsys.$module"}}) {
- print C "package.provides = $_\n";
- }
- print C "\n";
-
- for my $pp (keys %{$platform_properties{"$subsys.$module"}}) {
- next if $pp eq 'default';
- next if exists $project{supported_platforms} and not exists $project{supported_platforms}{$pp};
-
- print C "[Platform-$pp:Property]\n$buildroot\n";
-
- for my $p (keys %{$platform_properties{"$subsys.$module"}->{$pp}}) {
- print C $p . ' = ' . $platform_properties{"$subsys.$module"}->{$pp}->{$p} . "\n";
- }
- print C "$package_description$package_summary\n";
- }
-
- for my $platform ('default', keys %{$project{supported_platforms}}) {
- my $used = 0;
- my $output = '';
-
- for (@{$need_externs{"$subsys.$module"}},@{$need_jars{"$subsys.$module"}}) {
- my $eext = $etics_externs{$platform}{$_};
- my $edev = $project{etics_externs_devel}{$platform}{$_};
-
- # for the default platform using package of the same
- # name for runtime dependency
- if (not $eext) {
- if ($platform eq 'default') {
-#print "default runtime $_ on default\n";
- $eext = $_; }
- else {
-#print "no runtime $_ on $platform\n";
- $eext = '-'; }
- }
- if ($eext eq '-' and $edev eq '-') {
-#print "skipping $_ on $platform\n";
- next;
- }
-
- my $proj = 'externals';
- for my $p (keys %etics_projects) {
- for $m (@{$etics_projects{$p}}) {
- $proj = $p if $m eq $_;
- }
- }
-
- my $type = $need_externs_type{"$subsys.$module"}->{$_};
-
- if ($edev) {
- if ($type eq 'B') {
- # no runtime - change to devel pkg
- $eext = $edev;
- } elsif ($type eq 'BR' or $type eq 'RB') {
- # additional devel pkg
- if ($edev ne '-') { $output .= "$proj|$edev = B\n"; }
- }
- }
- if ($eext ne '-') { $output .= "$proj|$eext = $type\n"; }
- }
-
- if ($platform eq 'default') {
- for (@{$deps{"$subsys.$module"}}) {
- my $type = $deps_type{"$subsys.$module"}->{$_};
- if (not $used) {
- $used = 1;
- }
- $output .= "$project{etics_name}|$project{etics_name}.$_ = $type\n";
- }
- }
-
- if ($output) {
- print C qq{
-[Platform-$platform:DynamicDependency]
-$output};
- }
- }
-
- close C;
-
- for $file ("$cvs_module/project/debian.rules", "$cvs_module/project/$packageName.spec") {
- my $lib;
- my $main_module;
- @copts = ();
-
- if ($file =~ /debian\.rules$/) { $lib = 'lib'; }
- else { $lib = '%{_lib}'; }
-
- my $main_module = "$subsys.$module";
- if (exists $subpackages{$main_module}) { $main_module = $subpackages{$main_module}; }
-
- # locations hacks
- if ($file =~ /$packageName\.spec$/) {
- if ($fmod eq 'lb.client-java') {
- push @copts, '';
- push @copts, '--with-axis=/usr/local/axis1.4';
- }
- }
-
- if (-f $file) {
- open DST,">$file.new" or die "$file.new: $!\n";
- open SRC,"<$file" or die "$file: $!\n";
- while (<SRC>) {
- if (/^(\s*).+\/configure\s/) {
- printf DST "%s", "$1";
- printf DST "/usr/bin/perl $confdir/configure $project{flavours} --root=/ --prefix=$project{local_prefix} --libdir=$lib --project=$project --module $main_module@copts\n";
- } else {
- printf DST "%s", "$_";
- }
- }
- close SRC;
- close DST;
-
- `diff -b "$file" "$file.new"`;
- if ($? == 0) {
- print STDERR "($file not changed)\n";
- unlink "$file.new";
- } else {
- print STDERR "Writing $file\n";
- rename "$file", "$file.orig" unless -f "$file.orig";
- rename "$file.new", "$file";
- }
- }
- }
-}
-
-sub gsoap_version {
- local $_;
- my $gsoap_version;
- open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n";
-
- while ($_ = <S>) {
- 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;
-}
-
-sub getlibdir {
- if ( -e "/etc/debian_version") { # We are on Debian
- $lib64="lib";
- $lib32="lib32"; }
- else { # Another distribution
- $lib64="lib64";
- $lib32="lib"; }
- $libdir=$lib32;
-
- open INP, "uname -s | "; # Check kernel name
- $kname= <INP>;
- chomp($kname);
- close INP;
-
- if ( $kname eq "Linux") {
- $arch = ("x86_64\npowerpc\nppc64\n");
-
- open INP, "uname -p | "; # Check processor type
- $procname= <INP>;
- chomp($procname);
- close INP;
-
- if ($arch =~/^$procname\n/) {
- return ($lib64); }
-
- open INP, "uname -m | "; # Check machine hardware
- $machname= <INP>;
- chomp($machname);
- close INP;
-
- if ($arch =~/^$machname\n/) {
- return ($lib64); }
-
- # special cases (hyperlink lib64, Debian)
- if (-l "/usr/lib64") {
- $libdir=$lib32; }
-
- # if /usr/lib64 doesn't exist at all (AIX)
- unless ( -e "/usr/lib64" ) {
- $libdir=$lib32; }
- }
-
- if ( $kname eq "SunOS") {
- if (-e "/usr/lib/64") {
- $libdir="lib/64"; }
- }
-
- return $libdir;
-}
-
-sub reshuffle_platforms($$) {
- my ($data, $platforms) = @_;
- my ($platform, %blacklist, $value);
-
- return if not $platforms;
-
- for $platform (keys %$data) {
-#print "plat: $platform: $data->{$platform}\n";
- next if $platform eq 'default';
- for $_ (keys %{$data->{$platform}}) {
-#print " blacklist: $_ = $data->{$platform}{$_}\n";
- $blacklist{$_} = 1;
- }
- }
-
- for $_ (keys %blacklist) {
- $value = $data->{default}{$_} ? $data->{default}{$_} : $_;
- for $platform (keys %$platforms) {
- next if $platform eq 'default';
- if (not defined $data->{$platform}{$_}) {
- $data->{$platform}{$_} = $value;
-#print "added $value to $platform\n"
- }
- }
- $data->{default}{$_} = '-';
-#print "deleted $_ from default\n";
- }
-
- # merge dependencies across the supported platforms
- %blacklist = [];
- for $platform (keys %$platforms) {
- next if $platform eq 'default';
- for $_ (keys %{$data->{$platform}}) {
- $blacklist{$_} = 1;
- }
- }
- for $_ (keys %blacklist) {
- $value = undef;
- $same = 1;
- for $platform (keys %$platforms) {
- if (not $value) { $value = $data->{$platform}{$_}; }
- if (not $data->{$platform}{$_} or $value ne $data->{$platform}{$_}) {
- $same = 0;
- last;
- }
- }
- if ($same and $value) {
-#print "merged dependency $_\n";
- $data->{default}{$_} = $value;
- for $platform (keys %$platforms) {
- delete $data->{$platform}{$_};
- }
- }
- }
-}
-
-sub usage {
- my @ext = keys %externs;
- my @myjars = keys %jar;
-
- print STDERR qq{
-Usage: $0 options
-
-General options (defaults in []):
- --prefix=PREFIX destination directory [./stage]
- --stage=DIR staging directory [./stage]
- --root=DIR installation root (custom relocation root -> sysroot) [./stage]
- --sysroot=DIR system root (custom relocation root -> sysroot) []
- --sysconfdir=DIR system configuration directory [PREFIX/etc]
- --staged=module,module,... what is already in PREFIX (specify without org.glite.)
- --thrflavour=flavour
- --nothrflavour=flavour threaded and non-treaded flavours [gcc64dbgpthr,gcc64dbg]
- --listmodules=subsys list modules of a subsystem
- --listmodules=module list subpackages of a module
- --version=maj.min.rev-age version used instead of reading version.properties
- --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...)
- --libdir=libdir typically [lib,lib64] postfix
- --project=PROJECT build or generate etics for a project (glite/emi1/emi) [emi]
- --debug print more details
-
-Mode of operation:
- --mode=\{checkout|build|etics\} what to do [build]
-
-What to build:
- --module=module build this module only
- --enable-NODE build this "node" (set of modules) only
- --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
- --jobid-tag=tag checkout jobid modules with specific tag
- --canl-tag=tag checkout canl modules with specific tag
-
-Dependencies (summary of what will be used is always printed):
- --with-EXTERNAL=PATH where to look for an external [autodetect]
- --with-JAR=JAR where to look for jars
-
-Available nodes:
- @nodes
-
-Default nodes:
- @default_nodes
-
-Externals (not all for all modules) are:
- @ext
-
-External jars are:
- @myjars
-
-};
-
-}
+++ /dev/null
-/*
-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 <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <getopt.h>
-#include <unistd.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-
-#ifndef dprintf
-#define dprintf(x) { if (debug) printf x; fflush(stdout); }
-#endif
-
-#define DEF_MSG "Test message\n"
-#define DEF_PORT 9999
-
-static struct option opts[] = {
- { "help", no_argument, NULL, 'h'},
- { "debug", no_argument, NULL, 'd'},
- { "msg", required_argument, NULL, 'm'},
- { "port", required_argument, NULL, 'p'},
- { "repeat", required_argument, NULL, 'r'},
-};
-
-int debug = 0;
-int port = DEF_PORT;
-char *msg = NULL;
-
-static int writen(int fd, char *ptr, int nbytes);
-static int readln(int fd, char *out);
-
-static void usage(char *me)
-{
- fprintf(stderr,
- "usage: %s [option]\n"
- " -h, --help print this screen\n"
- " -d, --debug prints debug messages\n"
- " -m, --msg <text> message to send\n"
- " -p, --port <num> service port\n", me);
-}
-
-
-static int try_connect(char *addr, char *port) {
- struct addrinfo hints;
- struct addrinfo *ai_all = NULL, *ai;
- int gaie, sock = -1;
-
- memset(&hints, 0, sizeof(hints));
- hints.ai_socktype = SOCK_STREAM;
- hints.ai_flags = AI_ADDRCONFIG | AI_NUMERICHOST | AI_NUMERICSERV;
- gaie = getaddrinfo(addr, port, &hints, &ai_all);
- if (gaie != 0 || !ai_all) return -1;
-
- for (ai = ai_all; ai; ai = ai->ai_next) {
- sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
- if (sock == -1) continue;
- if (connect(sock, ai->ai_addr, ai->ai_addrlen) == 0) {
- break;
- } else {
- close(sock);
- sock = -1;
- }
- }
- freeaddrinfo(ai_all);
-
- return sock;
-}
-
-
-int main(int argc, char **argv)
-{
- char portstr[10];
- char buff[512],
- *me;
- int opt,
- sock = -1,
- fd,
- n;
- int repeat = 1;
-
- me = strrchr(argv[0], '/');
- if ( me ) me++; else me = argv[0];
- while ( (opt = getopt_long(argc, argv,"p:m:hdr:", opts, NULL)) != EOF )
- {
- switch ( opt )
- {
- case 'm':
- msg = strdup(optarg);
- break;
- case 'p':
- port = atoi(optarg);
- break;
- case 'd': debug = 1; break;
- case 'r': repeat = atoi(optarg); break;
- case 'h': usage(me); return 0;
- case '?': usage(me); return 1;
- }
- }
-
- snprintf(portstr, sizeof(portstr), "%d", port);
-
- if ((sock = try_connect("127.0.0.1", portstr)) == -1 &&
- (sock = try_connect("::1", portstr)) == -1) {
- fprintf(stderr, "can't connect\n");
- exit(1);
- }
-
- n = strlen(msg? msg: DEF_MSG);
- fd = fileno(stdout);
- for (;repeat; repeat--) {
- if ( writen(sock, msg? msg: DEF_MSG, n) != n )
- {
- dprintf(("error writing message\n"));
- exit(1);
- }
- printf("reply: "); fflush(stdout);
- n = readln(sock, buff);
- if ( n < 0 )
- {
- perror("read() reply error");
- free(msg);
- return 1;
- }
- writen(fd, buff, n);
- }
- close(sock);
-
- free(msg);
- return 0;
-}
-
-int writen(int fd, char *ptr, int nbytes)
-{
- int nleft, nwritten = 0;
-
- nleft = nbytes;
- dprintf(("start writing %d bytes\n", nbytes));
- while ( nleft > 0 )
- {
- nwritten = write(fd, ptr, nleft);
- dprintf(("written %d bytes", nwritten));
- if ( nwritten <= 0 )
- return (nwritten);
-
- nleft -= nwritten;
- ptr += nwritten;
- dprintf((" (left %d bytes)\n", nleft));
- }
-
- dprintf(("written %d bytes (return: %d)\n", nwritten, nbytes - nleft));
- return (nbytes - nleft);
-}
-
-#define BUFFER_SZ 512
-
-int readln(int fd, char *out)
-{
- static char buffer[BUFFER_SZ];
- static char *buffer_end = buffer;
- int n;
-
-
- dprintf(("reading line\n"));
- while ( 1 ) {
- if ( buffer_end - buffer ) {
- /* buffer contains data
- */
- char *endl;
-
- dprintf(("nonempty buffer\n"));
- if ( (endl = memchr(buffer, '\n', buffer_end-buffer)) ) {
- int linesz = endl-buffer+1;
-
- dprintf(("using buffer data\n"));
- memcpy(out, buffer, linesz);
- if ( endl+1 != buffer_end )
- memmove(buffer, endl+1, buffer_end-endl-1);
- buffer_end -= linesz;
- return linesz;
- }
- }
- dprintf(("reading...\n"));
- n = read(fd, buffer_end, BUFFER_SZ-(buffer_end-buffer));
- if ( n < 0 ) {
- if ( errno == EAGAIN ) continue;
- dprintf(("reading error\n"));
- return n;
- }
- else if ( n == 0 ) {
- int ret = buffer_end-buffer;
- dprintf(("end of reading - returning %d bytes\n", ret));
- memcpy(out, buffer, ret);
- buffer_end = buffer;
- return ret;
- }
-
- dprintf(("read %d bytes\n", n));
- buffer_end += n;
- }
-
- return 0;
-}
+++ /dev/null
-#! /bin/bash
-
-./srv_example > /tmp/log.$$ &
-SRV_PID=$!
-disown $SRV_PID
-
-sleep 1
-
-a=`./cnt_example -p 9999 -m "Applejack
-"`
-ret1=$?
-
-b=`./cnt_example -p 9998 -m "Applejack
-"`
-ret2=$?
-
-kill -SIGTERM $SRV_PID
-
-n=`grep 'disconnect handler' /tmp/log.$$ | wc -l | sed 's/ //g'`
-rm -f /tmp/log.$$
-
-if [ $ret1 -ne 0 -o $ret2 -ne 0 ]; then
- echo "$0: error launching cnt_example"
- exit 1
-fi
-
-if [ "$a" != "reply: Applejack" -o "$b" != "reply: APPLEJACK" ]; then
- echo "$0: error in reply"
- exit 2
-fi
-
-if [ "$n" != "2" ]; then
- echo "$0: error running server"
- exit 3
-fi
-
-exit 0
+++ /dev/null
-/*
-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 <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <unistd.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include "glite/lbu/log.h"
-#include "srvbones.h"
-
-#ifndef dprintf
-#define dprintf(x) { if (debug) printf x; fflush(stdout); }
-#endif
-
-#define sizofa(a) (sizeof(a)/sizeof((a)[0]))
-
-int debug = 1;
-
-static int writen(int fd, char *ptr, int nbytes);
-static int readln(int fd, char *out, int nbytes);
-
-static int new_conn(int, struct timeval *, void *);
-static int reject(int);
-static int disconnect(int, struct timeval *, void *);
-
-static int echo(int, struct timeval *, void *);
-static int upper_echo(int, struct timeval *, void *);
-
-#define ECHO_PORT "9999"
-#define UPPER_ECHO_PORT "9998"
-
-#define SRV_ECHO 0
-#define SRV_UPPER_ECHO 1
-
-static struct glite_srvbones_service service_table[] = {
- { "Echo Service", -1, new_conn, echo, reject, disconnect },
- { "Upper Echo Service", -1, new_conn, upper_echo, reject, disconnect }
-};
-
-int main(void)
-{
- if (glite_common_log_init()) {
- fprintf(stderr,"glite_common_log_init() failed, exiting.");
- exit(1);
- }
-
- if (glite_srvbones_daemon_listen(NULL, ECHO_PORT, &service_table[SRV_ECHO].conn) != 0)
- exit(1);
-
- if (glite_srvbones_daemon_listen(NULL, UPPER_ECHO_PORT, &service_table[SRV_UPPER_ECHO].conn) != 0) {
- close(service_table[SRV_ECHO].conn);
- exit(1);
- }
-
- setpgid(0, getpid());
-
- glite_srvbones_set_param(GLITE_SBPARAM_SLAVES_COUNT, 1);
- glite_srvbones_run(NULL, service_table, sizofa(service_table), 1);
-
- return 0;
-}
-
-int upper_echo(int fd, struct timeval *to, void *data)
-{
- int n, i;
- char line[80];
-
- n = readln(fd, line, 80);
- if ( n < 0 )
- {
- perror("read() message");
- return n;
- }
- else if ( n == 0 )
- return ENOTCONN;
-
- for ( i = 0; i < n; i++ )
- line[i] = toupper(line[i]);
-
- if ( writen(fd, line, n) != n )
- {
- perror("write() message back");
- return -1;
- }
-
- return 0;
-}
-
-int echo(int fd, struct timeval *to, void *data)
-{
- int n;
- char line[80];
-
- n = readln(fd, line, 80);
- dprintf(("%d bytes read\n", n));
- if ( n < 0 )
- {
- perror("read() message");
- return n;
- }
- else if ( n == 0 )
- return ENOTCONN;
-
- if ( writen(fd, line, n) != n )
- {
- perror("write() message back");
- return -1;
- }
-
- return 0;
-}
-
-int new_conn(int conn, struct timeval *to, void *cdata)
-{
- dprintf(("srv-bones example: new_conn handler\n"));
- return 0;
-}
-
-int reject(int conn)
-{
- dprintf(("srv-bones example: reject handler\n"));
- return 0;
-}
-
-int disconnect(int conn, struct timeval *to, void *cdata)
-{
- dprintf(("srv-bones example: disconnect handler\n"));
- return 0;
-}
-
-int writen(int fd, char *ptr, int nbytes)
-{
- int nleft, nwritten = 0;
-
- nleft = nbytes;
- dprintf(("start writing %d bytes\n", nbytes));
- while ( nleft > 0 ) {
- nwritten = write(fd, ptr, nleft);
- dprintf(("written %d bytes", nwritten));
- if ( nwritten <= 0 )
- return (nwritten);
-
- nleft -= nwritten;
- ptr += nwritten;
- dprintf((" (left %d bytes)\n", nleft));
- }
-
- dprintf(("written %d bytes (return: %d)\n", nwritten, nbytes - nleft));
- return (nbytes - nleft);
-}
-
-#define BUFFER_SZ 512
-
-int readln(int fd, char *out, int nbytes)
-{
- static char buffer[BUFFER_SZ];
- static char *buffer_end = buffer;
- int n;
-
- dprintf(("reading line\n"));
- while ( 1 ) {
- if ( buffer_end - buffer ) {
- /* buffer contains data
- */
- char *endl;
-
- dprintf(("nonempty buffer\n"));
- if ( (endl = memchr(buffer, '\n', buffer_end-buffer)) ) {
- int linesz = endl-buffer+1;
-
- memcpy(out, buffer, linesz);
- if ( endl+1 != buffer_end ) memmove(buffer, endl+1, buffer_end-endl-1);
- buffer_end -= linesz;
- return linesz;
- }
- }
-
- dprintf(("reding...\n"));
- n = read(fd, buffer_end, BUFFER_SZ-(buffer_end-buffer));
- if ( n < 0 ) {
- if ( errno == EAGAIN ) n = 0;
- else return n;
- }
- if ( n == 0 ) {
- int ret = buffer_end-buffer;
- dprintf(("end of reading - returning %d bytes\n", ret));
- memcpy(out, buffer, ret);
- buffer_end = buffer;
- return ret;
- }
- dprintf(("read %d bytes\n", n));
-
- buffer_end += n;
- }
-
- return 0;
-}
+++ /dev/null
-/*
-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.
-*/
-
-#ifndef __ORG_GLITE_LB_SERVER_BONES_BONES_H__
-#define __ORG_GLITE_LB_SERVER_BONES_BONES_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef enum _glite_srvbones_param_t {
- GLITE_SBPARAM_SLAVES_COUNT, /**< number of slaves */
- GLITE_SBPARAM_SLAVE_OVERLOAD, /**< queue items per slave */
- GLITE_SBPARAM_SLAVE_CONNS_MAX, /**< commit suicide after that many connections */
-
-/* NULL for timeouts means infinity */
- GLITE_SBPARAM_IDLE_TIMEOUT, /**< keep idle connection that long (timeval) */
- GLITE_SBPARAM_CONNECT_TIMEOUT, /**< timeout for establishing a connection (timeval) */
- GLITE_SBPARAM_REQUEST_TIMEOUT, /**< timeout for a single request (timeval)*/
- GLITE_SBPARAM_LOG_REQ_CATEGORY, /**< common logging requests category (char*) */
-} glite_srvbones_param_t;
-
-typedef int (*slave_data_init_hnd)(void **);
-
-struct glite_srvbones_service {
- char *id; /**< name of the service */
- int conn; /**< listening socket */
-
-/** Handler called by slave on a newly established connection,
- * i.e. after accept(2).
- * \param[in] conn the accepted connection
- * \param[inout] timeout don't consume more, update with the remaining time
- * \param[inout] user_data arbitrary user data passed among the functions
- */
- int (*on_new_conn_hnd)(
- int conn,
- struct timeval *timeout,
- void *user_data
- );
-
-
-/** Handler called by slave to serve each request.
- * \param[in] conn connection to work with
- * \param[inout] timeout don't consume more, update with the remaining time
- * \param[inout] user_data arbitrary user data passed among the functions
- *
- * \retval 0 OK, connection remains open
- * \retval ENOTCON terminated gracefully, bones will clean up
- * \retval >0 other POSIX errno, non-fatal error
- * \retval <0 fatal error, terminate slave
- */
- int (*on_request_hnd)(
- int conn,
- struct timeval *timeout,
- void *user_data
- );
-
-/** Handler called by master to reject connection on server overload.
- * Should kick off the client quickly, not imposing aditional load
- * on server or blocking long time.
- */
- int (*on_reject_hnd)(int conn);
-
-/** Handler called by slave before closing the connection.
- * Perform server-side cleanup, and terminate the connection gracefully
- * if there is a way to do so (the disconnect is server-initiated).
- * close(conn) is called by bones then.
- * \param[in] conn connection to work with
- * \param[inout] timeout don't consume more time
- * \param[inout] user_data arbitrary user data passed among the functions
- */
- int (*on_disconnect_hnd)(
- int conn,
- struct timeval *timeout,
- void *user_data
- );
-};
-
-extern int glite_srvbones_set_param(glite_srvbones_param_t param, ...);
-
-
-/** Main server function.
- *
- * \param[in] slave_data_init_hnd callback initializing user data on every slave
- */
-extern int glite_srvbones_run(
- slave_data_init_hnd slave_data_init,
- struct glite_srvbones_service *service_table,
- size_t table_sz,
- int dbg);
-
-/**
- * helper common function to daemonize server
- *
- * \returns 1 OK, 0 error writtten to stderr
- */
-int glite_srvbones_daemonize(const char *servername, const char *custom_pidfile, const char *custom_logfile);
-
-/**
- * Create listening socket.
- *
- * \return 0 OK, non-zero error
- */
-int glite_srvbones_daemon_listen(const char *name, char *port, int *conn_out);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __ORG_GLITE_LB_SERVER_BONES_BONES_H__ */
+++ /dev/null
-/sbin/ldconfig
+++ /dev/null
-/sbin/ldconfig
+++ /dev/null
-1.0.0-2
-- initial version
-
-1.0.0-3
-- configure script update (globus flavors added to configure call)
-
-1.0.0-4
-- configure script update
-
-1.0.0-5
-- install libraries into $libdir
-
-2.0.0-1
-- Fixed library version numbering
-- Introduction of the common logginf format
-- Improved portability
-- IPv6 compliance
-
-2.0.0-2
-- Module rebuilt
-
-2.0.1-1
-- Fixed format of the package description file
-- Fixed target 'clean' in the Makefile
-
-2.0.1-2
-- Module rebuilt
-
-2.0.2-1
-- Makefile adopts compilation and linking flags from the environment.
-- Memory handling fixes
-
-2.0.3-1
-- Fixed build-time warnings in logging calls
-
-2.0.3-2
-- Module rebuilt
-
-2.0.3-3
-- Module rebuilt
-
-2.1.0-1
-- Documentation update and cleanup
-- Fixes for parallel release in EMI & gLite
-
-2.1.0-2
-- Module rebuilt
-
-2.1.1-1
-- Root directory option (ETICS performs own files relocation)
-- Prefix option as prefix inside stage
-- Sysconfdir option (for /etc vs /usr)
-- DESTDIR in makefiles
-
-2.1.2-1
-- Relocatable build directory.
-
-2.1.2-2
-- Module rebuilt
-
-2.1.2-3
-- Module rebuilt
-
-2.1.2-4
-- Module rebuilt
-
-2.1.2-5
-- Module rebuilt
-
-2.1.2-6
-- Module rebuilt
-
-2.1.3-1
-- Change log priority for slave suicide messages
-
-2.1.4-1
-- Quit parent process silently on background purge (improvement for SB #77974).
-
-2.2.0-1
-- Preparation for a new multiplatform release
-- Decrease the priority of the message about ended slave to stop scaring caring admins (SB #81369)
-
-2.2.0-2
-- Module rebuilt
-
-2.2.1-1
-- Packaging improvements (rpmlint and lintian checks)
-- proper provides
-- License string as recognized by rpmlint and packaging guidelines.
-
-2.2.2-1
-- Compile-time warning fixes
-- EMI-2-supported-platform adjustment
-
-2.2.2-2
-- Module rebuilt
-
+++ /dev/null
-Source: glite-lbjp-common-server-bones
-Priority: extra
-Maintainer: @MAINTAINER@
-Uploaders: @UPLOADERS@
-Build-Depends: debhelper (>= 7.0.50~), chrpath, libglite-lbjp-common-log-dev, libtool
-Standards-Version: 3.9.1
-Section: libs
-Homepage: @URL@
-DM-Upload-Allowed: yes
-@DEBIAN_VCS@
-
-Package: libglite-lbu-server-bones2
-Section: libs
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: @SUMMARY@
-@DEBIAN_DESCRIPTION@
-
-Package: libglite-lbjp-common-server-bones-dev
-Section: libdevel
-Architecture: any
-Provides: glite-lbjp-common-server-bones
-Depends: libglite-lbu-server-bones2 (= ${binary:Version}), ${misc:Depends}
-Description: Development files for gLite L&B/JP common server bones
- This package contains development libraries and header files for gLite L&B/JP
- common server-bones.
-
-Package: glite-lbjp-common-server-bones-dbg
-Section: debug
-Architecture: any
-Priority: extra
-Depends: libglite-lbu-server-bones2 (= ${binary:Version}), ${misc:Depends}
-Description: gLite L&B/JP common server bones debugging symbols
- This package contains debugging symbols for gLite L&B/JP common server-bones.
+++ /dev/null
-This work was packaged for Debian by:
-
- @MAINTAINER@ on Thu, 08 Dec 2011 00:46:07 +0100
-
-It was downloaded from:
-
- @URL@
-
-Upstream Author(s):
-
- @MAINTAINER@
-
-Copyright:
-
- <Copyright (C) 2004-2011 Members of the EGEE Collaboration>
-
-License:
-
- 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.
-
-On Debian systems, the complete text of the Apache version 2.0 license
-can be found in "/usr/share/common-licenses/Apache-2.0".
-
-The Debian packaging is:
-
- Copyright (C) 2004-2011 Members of the EGEE Collaboration
-
-and is licensed under the Apache License, Version 2.0.
+++ /dev/null
-usr/include/glite/lbu
-usr/lib
+++ /dev/null
-usr/include/glite/lbu/*.h
-usr/lib/lib*.so
+++ /dev/null
-usr/lib/lib*.so.*
+++ /dev/null
-#!/usr/bin/make -f
-# -*- makefile -*-
-
--include /usr/share/dpkg/buildflags.mk
-
-# Uncomment this to turn on verbose mode.
-export DH_VERBOSE=1
-
-configure: configure-stamp
-configure-stamp:
- dh_testdir
- /usr/bin/perl ./configure --thrflavour= --nothrflavour= --root=/ --prefix=/usr --libdir=lib --project=emi --module lbjp-common.server-bones
- touch $@
-
-build: build-arch build-indep
-
-build-arch build-indep: build-stamp
-
-build-stamp: configure-stamp
- dh_testdir
- CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE)
- CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) check
- touch $@
-
-clean: configure-stamp
- dh_testdir
- dh_testroot
- rm -f configure-stamp build-stamp
- $(MAKE) clean
- rm -f Makefile.inc config.status
- dh_clean
-
-install: build-stamp
- dh_testdir
- dh_testroot
- dh_prep
- dh_installdirs
- $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
- rm -rvf $(CURDIR)/debian/tmp/usr/share
- rm -vf $(CURDIR)/debian/tmp/usr/lib/*.la
- rm -vf $(CURDIR)/debian/tmp/usr/lib/*.a
- find $(CURDIR)/debian/tmp -name '*' -print | xargs -I {} -i bash -c "chrpath -d {} > /dev/null 2>&1" || echo 'Stripped RPATH'
-
-binary-indep:
-
-binary-arch: install
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_installexamples
- dh_installman
- dh_installlogrotate
- dh_installcron
- dh_install --fail-missing
- dh_link
- dh_strip --dbg-package=glite-lbjp-common-server-bones-dbg
- dh_compress
- dh_fixperms
- dh_makeshlibs
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-arch binary-indep
+++ /dev/null
-Summary: @SUMMARY@
-Name: glite-lbjp-common-server-bones
-Version: @MAJOR@.@MINOR@.@REVISION@
-Release: @AGE@%{?dist}
-Url: @URL@
-License: ASL 2.0
-Vendor: EMI
-Group: System Environment/Libraries
-BuildRequires: chrpath
-BuildRequires: glite-lbjp-common-log-devel
-BuildRequires: libtool
-BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
-AutoReqProv: yes
-Source: http://eticssoft.web.cern.ch/eticssoft/repository/emi/emi.lbjp-common.server-bones/%{version}/src/%{name}-@VERSION@.src.tar.gz
-
-
-%description
-@DESCRIPTION@
-
-
-%package devel
-Summary: Development files for gLite L&B/JP common server-bones
-Group: Development/Libraries
-Requires: %{name}%{?_isa} = %{version}-%{release}
-
-
-%description devel
-This package contains development libraries and header files for gLite L&B/JP
-common server-bones.
-
-
-%prep
-%setup -q
-
-
-%build
-/usr/bin/perl ./configure --thrflavour= --nothrflavour= --root=/ --prefix=/usr --libdir=%{_lib} --project=emi --module lbjp-common.server-bones
-make
-
-
-%check
-make check
-
-
-%install
-rm -rf $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
-find $RPM_BUILD_ROOT -name '*.la' -exec rm -rf {} \;
-find $RPM_BUILD_ROOT -name '*.a' -exec rm -rf {} \;
-find $RPM_BUILD_ROOT -name '*' -print | xargs -I {} -i bash -c "chrpath -d {} > /dev/null 2>&1" || echo 'Stripped RPATH'
-
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
-%post -p /sbin/ldconfig
-
-
-%postun -p /sbin/ldconfig
-
-
-%files
-%defattr(-,root,root)
-/usr/%{_lib}/libglite_lbu_server_bones.so.@MAJOR@.@MINOR@.@REVISION@
-/usr/%{_lib}/libglite_lbu_server_bones.so.@MAJOR@
-
-
-%files devel
-%defattr(-,root,root)
-%dir /usr/include/glite
-%dir /usr/include/glite/lbu
-/usr/include/glite/lbu/srvbones.h
-/usr/%{_lib}/libglite_lbu_server_bones.so
-
-
-%changelog
-* @SPEC_DATE@ @MAINTAINER@ - @MAJOR@.@MINOR@.@REVISION@-@AGE@%{?dist}
-- automatically generated package
+++ /dev/null
-Multi-process network server. A server listening on multiple ports, passing inbound requests to slaves and maintaining connections to specific slaves if possible. The library provides callback handles on connection init, incoming request, etc.
+++ /dev/null
-Skeleton of multi-process network server
+++ /dev/null
-# : /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.2.2
-module.age=2
+++ /dev/null
-/*
-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 <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/wait.h>
-#include <errno.h>
-#include <netdb.h>
-#include <assert.h>
-#include <sys/time.h>
-#include <time.h>
-#include <stdarg.h>
-#include <signal.h>
-
-#include "glite/lbu/log.h"
-
-#include "srvbones.h"
-
-/* defaults for GLITE_SBPARAM_* */
-
-#define SLAVES_COUNT 5 /* default number of slaves */
-#define SLAVE_OVERLOAD 10 /* queue items per slave */
-#define SLAVE_REQS_MAX 500 /* commit suicide after that many connections */
-#define IDLE_TIMEOUT 30 /* keep idle connection that many seconds */
-#define CONNECT_TIMEOUT 5 /* timeout for establishing a connection */
-#define REQUEST_TIMEOUT 10 /* timeout for a single request */
-#define NEW_CLIENT_DURATION 10 /* how long a client is considered new, i.e. busy
- connection is not closed to serve other clients */
-#define CON_QUEUE 10 /* listen() connection queue */
-
-#ifdef LB_PROF
-extern void _start (void), etext (void);
-#endif
-
-static int running = 0;
-static volatile int die = 0,
- child_died = 0;
-static unsigned long clnt_dispatched = 0,
- clnt_accepted = 0;
-
-static struct glite_srvbones_service *services;
-static int services_ct;
-
-static int set_slaves_ct = SLAVES_COUNT;
-static int set_slave_overload = SLAVE_OVERLOAD;
-static int set_slave_reqs_max = SLAVE_REQS_MAX;
-static struct timeval set_idle_to = {IDLE_TIMEOUT, 0};
-static struct timeval set_connect_to = {CONNECT_TIMEOUT, 0};
-static struct timeval set_request_to = {REQUEST_TIMEOUT, 0};
-static char *set_log_category = NULL;
-
-static int dispatchit(int, int, int);
-static int do_sendmsg(int, int, unsigned long, int);
-static int do_recvmsg(int, int *, unsigned long *, int *);
-static int check_timeout(struct timeval, struct timeval, struct timeval);
-static void catchsig(int);
-static void catch_chld(int sig);
-static int slave(int (*)(void **), int);
-
-static void glite_srvbones_set_slaves_ct(int);
-static void glite_srvbones_set_slave_overload(int);
-static void glite_srvbones_set_slave_conns_max(int);
-static void set_timeout(struct timeval *,struct timeval *);
-static void glite_srvbones_set_log_category(char *);
-
-int glite_srvbones_set_param(glite_srvbones_param_t param, ...)
-{
- va_list ap;
-
- if ( running ) {
- glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_ERROR, "Attempting to set srv-bones parameter on running server");
- return -1;
- }
-
- va_start(ap, param);
- switch ( param ) {
- case GLITE_SBPARAM_SLAVES_COUNT:
- glite_srvbones_set_slaves_ct(va_arg(ap,int)); break;
- case GLITE_SBPARAM_SLAVE_OVERLOAD:
- glite_srvbones_set_slave_overload(va_arg(ap,int)); break;
- case GLITE_SBPARAM_SLAVE_CONNS_MAX:
- glite_srvbones_set_slave_conns_max(va_arg(ap,int)); break;
- case GLITE_SBPARAM_IDLE_TIMEOUT:
- set_timeout(&set_idle_to,va_arg(ap,struct timeval *)); break;
- case GLITE_SBPARAM_CONNECT_TIMEOUT:
- set_timeout(&set_connect_to,va_arg(ap,struct timeval *)); break;
- case GLITE_SBPARAM_REQUEST_TIMEOUT:
- set_timeout(&set_request_to,va_arg(ap,struct timeval *)); break;
- case GLITE_SBPARAM_LOG_REQ_CATEGORY:
- glite_srvbones_set_log_category(va_arg(ap,char*)); break;
- }
- va_end(ap);
-
- return 0;
-}
-
-int glite_srvbones_run(
- slave_data_init_hnd slave_data_init,
- struct glite_srvbones_service *service_table,
- size_t table_sz,
- int dbg)
-{
- struct sigaction sa;
- sigset_t sset;
- int sock_slave[2], i;
- int pstat;
-
-
- assert(service_table);
- assert(table_sz > 0);
-
- services = service_table;
- services_ct = table_sz;
-
- setlinebuf(stdout);
- setlinebuf(stderr);
- glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_INFO,
- "Master pid %d", getpid());
-
- if ( socketpair(AF_UNIX, SOCK_STREAM, 0, sock_slave) )
- {
- glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_ERROR,
- "socketpair()");
- return 1;
- }
-
- memset(&sa, 0, sizeof(sa)); assert(sa.sa_handler == NULL);
- sa.sa_handler = catchsig;
- sigaction(SIGINT, &sa, NULL);
- sigaction(SIGTERM, &sa, NULL);
-
- sa.sa_handler = catch_chld;
- sigaction(SIGCHLD, &sa, NULL);
-
- sa.sa_handler = SIG_IGN;
- sigaction(SIGUSR1, &sa, NULL);
- sigaction(SIGXFSZ, &sa, NULL);
-
- sigemptyset(&sset);
- sigaddset(&sset, SIGCHLD);
- sigaddset(&sset, SIGTERM);
- sigaddset(&sset, SIGINT);
- sigprocmask(SIG_BLOCK, &sset, NULL);
-
- for ( i = 0; i < set_slaves_ct; i++ )
- slave(slave_data_init, sock_slave[1]);
-
- while ( !die )
- {
- fd_set fds;
- int ret, mx;
-
-
- FD_ZERO(&fds);
- FD_SET(sock_slave[0], &fds);
- for ( i = 0, mx = sock_slave[0]; i < services_ct; i++ )
- {
- FD_SET(services[i].conn, &fds);
- if ( mx < services[i].conn ) mx = services[i].conn;
- }
-
- sigprocmask(SIG_UNBLOCK, &sset, NULL);
- ret = select(mx+1, &fds, NULL, NULL, NULL);
- sigprocmask(SIG_BLOCK, &sset, NULL);
-
- if ( ret == -1 && errno != EINTR )
- {
- glite_common_log(LOG_CATEGORY_ACCESS, LOG_PRIORITY_ERROR, "select()");
-
- return 1;
- }
-
- if ( child_died )
- {
- int pid;
-
- while ( (pid = waitpid(-1, &pstat, WNOHANG)) > 0 )
- {
- if (WIFEXITED(pstat)) {
- glite_common_log(LOG_CATEGORY_CONTROL, WEXITSTATUS(pstat) ? LOG_PRIORITY_ERROR : LOG_PRIORITY_INFO, "[master] Slave %d exited with return code %d.", pid, WEXITSTATUS(pstat));
-
- }
- if (WIFSIGNALED(pstat)) {
- int logged = 0;
- switch (WTERMSIG(pstat)) {
- case SIGINT:
- case SIGTERM:
- case SIGUSR1: if (die) break;
- default:
- glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_ERROR, "[master] Slave %d terminated with signal %d.", pid, WTERMSIG(pstat));
- logged = 1;
- break;
- }
- if (! logged)
- glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_INFO, "[master] Slave %d terminated with signal %d.", pid, WTERMSIG(pstat));
- }
- if ( !die )
- {
- int newpid = slave(slave_data_init, sock_slave[1]);
- glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_INFO, "[master] Servus mortuus [%d] miraculo resurrexit [%d]", pid, newpid);
- }
- }
- child_died = 0;
- continue;
- }
-
- if ( die ) continue;
-
-
- if (FD_ISSET(sock_slave[0],&fds)) {
- /* slave accepted a request
- */
- unsigned long a;
-
- if ( (recv(sock_slave[0], &a, sizeof(a), MSG_WAITALL) == sizeof(a))
- && (a <= clnt_dispatched)
- && (a > clnt_accepted || clnt_accepted > clnt_dispatched) )
- clnt_accepted = a;
- }
-
- for ( i = 0; i < services_ct; i++ )
- if ( FD_ISSET(services[i].conn, &fds)
- && dispatchit(sock_slave[0], services[i].conn ,i) )
- /* Be carefull!!!
- * This must break this for cykle but start the
- * while (!die) master cykle from the top also
- */
- break;
- }
-
- glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_INFO, "[master] Terminating on signal %d", die);
- kill(0, die);
-
- return 0;
-}
-
-int glite_srvbones_daemonize(const char *servername, const char *custom_pidfile, const char *custom_logfile) {
- int lfd, opid;
- FILE *fpid;
- pid_t master;
- char *pidfile, *logfile;
-
- if (!custom_logfile) {
- asprintf(&logfile, "%s/%s.log", geteuid() == 0 ? "/var/log" : getenv("HOME"), servername);
- } else {
- logfile = NULL;
- }
- lfd = open(logfile ? logfile : custom_logfile,O_CREAT|O_TRUNC|O_WRONLY,0600);
- if (lfd < 0) {
- glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_FATAL,
- "%s: %s: %s",servername,logfile,strerror(errno));
- free(logfile);
- return 0;
- }
- free(logfile);
-
- if (daemon(0,1) == -1) {
- glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_FATAL,
- "can't daemonize");
- return 0;
- }
- dup2(lfd,1);
- dup2(lfd,2);
-
- if (!custom_pidfile) {
- asprintf(&pidfile, "%s/%s.pid", geteuid() == 0 ? "/var/run" : getenv("HOME"), servername);
- } else {
- pidfile = strdup(custom_pidfile);
- }
- setpgid(0, 0); /* needs for signalling */
- master = getpid();
- fpid = fopen(pidfile,"r");
- if ( fpid )
- {
- opid = -1;
-
- if ( fscanf(fpid,"%d",&opid) == 1 )
- {
- if ( !kill(opid,0) )
- {
- glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_FATAL, "%s: another instance running, pid = %d", servername, opid);
- return 0;
- }
- else if (errno != ESRCH) {
- glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_FATAL, "kill()");
- return 0;
- }
- }
- fclose(fpid);
- } else if (errno != ENOENT) {
- glite_common_log_msg(LOG_CATEGORY_CONTROL, LOG_PRIORITY_FATAL, pidfile);
- free(pidfile);
- return 0;
- }
-
- if (((fpid = fopen(pidfile, "w")) == NULL) ||
- (fprintf(fpid, "%d", getpid()) <= 0) ||
- (fclose(fpid) != 0)) {
- glite_common_log_msg(LOG_CATEGORY_CONTROL, LOG_PRIORITY_FATAL, pidfile);
- free(pidfile);
- return 0;
- }
-
- free(pidfile);
- return 1;
-}
-
-int glite_srvbones_daemon_listen(const char *name, char *port, int *conn_out) {
- struct addrinfo *ai;
- struct addrinfo hints;
- int conn;
- int gaie;
- static const int zero = 0;
- static const int one = 1;
-
- memset (&hints, '\0', sizeof (hints));
- hints.ai_flags = AI_NUMERICSERV | AI_PASSIVE | AI_ADDRCONFIG;
- hints.ai_socktype = SOCK_STREAM;
- hints.ai_family = AF_INET6;
-
- gaie = getaddrinfo (name, port, &hints, &ai);
- if (gaie != 0 || ai == NULL) {
- hints.ai_family = 0;
- gaie = getaddrinfo (NULL, port, &hints, &ai);
- }
-
- gaie = getaddrinfo (name, port, &hints, &ai);
- if (gaie != 0) {
- glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_FATAL, "getaddrinfo: %s", gai_strerror (gaie));
- return 1;
- }
- if (ai == NULL) {
- glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_FATAL, "getaddrinfo: no result");
- return 1;
- }
-
- conn = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
- if ( conn < 0 ) {
- glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_FATAL, "socket(): %s", strerror(errno));
- freeaddrinfo(ai);
- return 1;
- }
- setsockopt(conn, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
- if (ai->ai_family == AF_INET6)
- setsockopt(conn, IPPROTO_IPV6, IPV6_V6ONLY, &zero, sizeof(zero));
-
- if ( bind(conn, ai->ai_addr, ai->ai_addrlen) )
- {
- glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_FATAL, "bind(%s): %s", port, strerror(errno));
- close(conn);
- freeaddrinfo(ai);
- return 1;
- }
-
- if ( listen(conn, CON_QUEUE) ) {
- glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_FATAL, "listen(): %s", strerror(errno));
- close(conn);
- freeaddrinfo(ai);
- return 1;
- }
-
- freeaddrinfo(ai);
-
- *conn_out = conn;
- return 0;
-}
-
-static int dispatchit(int sock_slave, int sock, int sidx)
-{
- struct sockaddr_storage a;
- char peerhost[64], peerserv[16];
- int conn, ret;
- socklen_t alen;
-
-
- alen = sizeof(a);
- if ( (conn = accept(sock, (struct sockaddr *)&a, &alen)) < 0 )
- {
- glite_common_log(set_log_category, LOG_PRIORITY_WARN, "accept()");
- sleep(5);
- return -1;
- }
-
- getpeername(conn, (struct sockaddr *)&a, &alen);
- if (a.ss_family == PF_LOCAL) {
- glite_common_log(set_log_category,
- LOG_PRIORITY_DEBUG,
- "[master] %s connection from local socket",
- services[sidx].id ? services[sidx].id : "");
- }
- else {
- ret = getnameinfo ((struct sockaddr *) &a, alen,
- peerhost, sizeof(peerhost), peerserv, sizeof(peerserv), NI_NUMERICHOST | NI_NUMERICSERV);
- if (ret) {
- glite_common_log(set_log_category, LOG_PRIORITY_WARN, "getnameinfo: %s", gai_strerror (ret));
- strcpy(peerhost, "unknown"); strcpy(peerserv, "unknown");
- }
-
- glite_common_log(set_log_category,
- LOG_PRIORITY_DEBUG,
- "[master] %s connection from %s:%s",
- services[sidx].id ? services[sidx].id : "",
- peerhost, peerserv);
- }
-
- ret = 0;
- if ( ( clnt_dispatched < clnt_accepted /* wraparound */
- || clnt_dispatched - clnt_accepted < set_slaves_ct * set_slave_overload)
- && !(ret = do_sendmsg(sock_slave, conn, clnt_dispatched++, sidx)) )
- {
- /* all done
- */
- glite_common_log(set_log_category,
- LOG_PRIORITY_DEBUG,
- "[master] Dispatched %lu, last known served %lu",
- clnt_dispatched-1, clnt_accepted);
- }
- else
- {
- services[sidx].on_reject_hnd(conn);
- glite_common_log(set_log_category,
- LOG_PRIORITY_ERROR,
- "[master] Rejected new connection due to overload");
- }
-
- close(conn);
- if (ret)
- {
- glite_common_log(set_log_category,
- LOG_PRIORITY_WARN, "sendmsg()");
- }
-
-
- return 0;
-}
-
-
-static int slave(slave_data_init_hnd data_init_hnd, int sock)
-{
- sigset_t sset;
- struct sigaction sa;
- struct timeval client_done,
- client_start,
- new_client_duration = { NEW_CLIENT_DURATION, 0 };
-
- void *clnt_data = NULL;
- int conn = -1,
- srv = -1,
- req_cnt = 0,
- sockflags,
- h_errno,
- pid, i,
- first_request = 0; /* 1 -> first request from connected client expected */
-
-
-
- if ( (pid = fork()) ) return pid;
-
-#ifdef LB_PROF
- monstartup((u_long)&_start, (u_long)&etext);
-#endif
-
- srandom(getpid()+time(NULL));
-
- for ( i = 0; i < services_ct; i++ )
- close(services[i].conn);
-
- sigemptyset(&sset);
- sigaddset(&sset, SIGTERM);
- sigaddset(&sset, SIGINT);
- sigaddset(&sset, SIGUSR1);
-
- memset(&sa, 0, sizeof(sa));
- sa.sa_handler = catchsig;
- sigaction(SIGUSR1, &sa, NULL);
-
- if ( (sockflags = fcntl(sock, F_GETFL, 0)) < 0
- || fcntl(sock, F_SETFL, sockflags | O_NONBLOCK) < 0 )
- {
- glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_ERROR,
- "[%d] fcntl(master_sock): %s",
- getpid(), strerror(errno));
- exit(1);
- }
-
- if ( data_init_hnd && data_init_hnd(&clnt_data) )
- /*
- * XXX: what if the error remains and master will start new slave
- * again and again?
- *
- * Then we are in a deep shit.
- */
- exit(1);
-
- while ( !die && (req_cnt < set_slave_reqs_max || (conn >= 0 && first_request)))
- {
- fd_set fds;
- int max = sock,
- connflags,
- newconn = -1,
- newsrv = -1;
-
- enum { KICK_DONT = 0, KICK_IDLE, KICK_LOAD, KICK_HANDLER, KICK_COUNT }
- kick_client = KICK_DONT;
-
- static char * kicks[] = {
- "don't kick",
- "idle client",
- "high load",
- "no request handler",
- "request count limit reached",
- };
- unsigned long seq;
- struct timeval now,to;
-
-
- FD_ZERO(&fds);
- if ( conn < 0 || !first_request) FD_SET(sock, &fds);
- if ( conn >= 0 ) FD_SET(conn, &fds);
- if ( conn > sock ) max = conn;
-
- to = set_idle_to;
- sigprocmask(SIG_UNBLOCK, &sset, NULL);
- switch (select(max+1, &fds, NULL, NULL, to.tv_sec >= 0 ? &to : NULL))
- {
- case -1:
- if ( errno != EINTR )
- {
- glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_ERROR, "[%d] select(): %s", getpid(), strerror(errno));
- exit(1);
- }
- continue;
-
- case 0:
- if ( conn < 0 ) continue;
-
- default:
- break;
- }
- sigprocmask(SIG_BLOCK, &sset, NULL);
-
- gettimeofday(&now,NULL);
-
- if ( conn >= 0 && FD_ISSET(conn, &fds) )
- {
- /*
- * serve the request
- */
- int rv;
-
- glite_common_log(set_log_category, LOG_PRIORITY_DEBUG, "[%d] incoming request", getpid());
-
- if ( !services[srv].on_request_hnd )
- {
- kick_client = KICK_HANDLER;
- } else {
- req_cnt++;
- first_request = 0;
- to = set_request_to;
- rv = services[srv].on_request_hnd(conn,to.tv_sec>=0 ? &to : NULL,clnt_data);
- if ( (rv == ENOTCONN) || (rv == ECONNREFUSED) ) {
- if (services[srv].on_disconnect_hnd
- && (rv = services[srv].on_disconnect_hnd(conn,NULL,clnt_data)))
- {
- glite_common_log(set_log_category, LOG_PRIORITY_DEBUG, "[%d] disconnect handler: %s, terminating",getpid(),strerror(rv));
- exit(1);
- }
- close(conn);
- conn = -1;
- srv = -1;
- glite_common_log(set_log_category, LOG_PRIORITY_DEBUG, "[%d] Connection closed", getpid());
- }
- else if (rv > 0) {
- /* non-fatal error -> close connection and contiue
- * XXX: likely to leak resources but can we call on_disconnect_hnd() on error?
- */
- close(conn);
- conn = -1;
- srv = -1;
- glite_common_log(set_log_category, LOG_PRIORITY_DEBUG, "[%d] %s, connection closed",getpid(),strerror(rv));
- continue;
- } else if (rv == -EINPROGRESS) {
- /* background operation -> parent forked -> kill slave */
- glite_common_log(set_log_category, LOG_PRIORITY_DEBUG, "[%d] terminating parent",getpid());
- exit(0);
- } else if ( rv < 0 ) {
- /* unknown error -> clasified as FATAL -> kill slave
- */
- glite_common_log(set_log_category, LOG_PRIORITY_INFO, "[%d] %s, terminating",getpid(),strerror(-rv));
- exit(1);
- }
- else {
- glite_common_log(set_log_category, LOG_PRIORITY_DEBUG, "[%d] request done", getpid());
- gettimeofday(&client_done, NULL);
- }
-
- if (!check_timeout(new_client_duration,client_start,now)) continue;
-
- }
- } else {
- if (conn >= 0 && check_timeout(set_idle_to, client_done, now))
- kick_client = KICK_IDLE;
- }
-
- if ( !die && (conn < 0 || !first_request) && FD_ISSET(sock, &fds) && req_cnt < set_slave_reqs_max )
- {
- /* Prefer slaves with no connection, then kick idle clients,
- * active ones last. Wait less if we have serviced a request in the meantime.
- * Tuned for HZ=100 timer. */
- if ( conn >= 0 ) usleep( kick_client || FD_ISSET(conn, &fds) ? 11000 : 21000);
- if ( do_recvmsg(sock, &newconn, &seq, &newsrv) ) switch ( errno )
- {
- case EINTR: /* XXX: signals are blocked */
- case EAGAIN:
- continue;
- default:
- glite_common_log(set_log_category, LOG_PRIORITY_ERROR, "[%d] recvmsg(): %s", getpid(), strerror(errno));
- exit(1);
- }
- kick_client = KICK_LOAD;
- }
-
- if (req_cnt >= set_slave_reqs_max && !first_request) kick_client = KICK_COUNT;
-
- if ( kick_client && conn >= 0 )
- {
- if ( services[srv].on_disconnect_hnd )
- services[srv].on_disconnect_hnd(conn, NULL, clnt_data);
- close(conn);
- conn = -1;
- srv = -1;
- glite_common_log(set_log_category, LOG_PRIORITY_DEBUG, "[%d] Connection closed, %s", getpid(), kicks[kick_client]);
- }
-
- if ( newconn >= 0 )
- {
- int ret;
-
- conn = newconn;
- srv = newsrv;
- gettimeofday(&client_start, NULL);
-
- switch ( send(sock, &seq, sizeof(seq), 0) )
- {
- case -1:
- glite_common_log(set_log_category, LOG_PRIORITY_ERROR, "send()");
- exit(1);
-
- case sizeof(seq):
- break;
-
- default:
- glite_common_log(set_log_category, LOG_PRIORITY_DEBUG, "[%d] send(): incomplete message", getpid());
- exit(1);
- }
-
- req_cnt++;
- glite_common_log(set_log_category,
- LOG_PRIORITY_DEBUG,
- "[%d] serving %s connection %lu", getpid(),
- services[srv].id ? services[srv].id : "", seq);
-
- connflags = fcntl(conn, F_GETFL, 0);
- if ( fcntl(conn, F_SETFL, connflags | O_NONBLOCK) < 0 )
- {
- glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_WARN, "[%d] can't set O_NONBLOCK mode (%s), closing.", getpid(), strerror(errno));
- close(conn);
- conn = srv = -1;
- continue;
- }
-
- to = set_connect_to;
- if ( services[srv].on_new_conn_hnd
- && (ret = services[srv].on_new_conn_hnd(conn, to.tv_sec >= 0 ? &to : NULL, clnt_data)) )
- {
- glite_common_log(set_log_category, LOG_PRIORITY_WARN, "[%d] Connection not established, err = %d.", getpid(),ret);
- close(conn);
- conn = srv = -1;
- if (ret < 0) exit(1);
- continue;
- }
- gettimeofday(&client_done, NULL);
- first_request = 1;
- }
- }
-
- if ( die )
- {
- glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_INFO,
- "[%d] Terminating on signal %d", getpid(), die);
- }
-
- if (conn >= 0 && services[srv].on_disconnect_hnd )
- services[srv].on_disconnect_hnd(conn, NULL, clnt_data);
-
- glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_INFO,
- "[%d] Terminating after %d requests", getpid(), req_cnt);
-
-
- exit(0);
-}
-
-static void catchsig(int sig)
-{
- die = sig;
-}
-
-static void catch_chld(int sig)
-{
- child_died = 1;
-}
-
-static int check_timeout(struct timeval timeout, struct timeval before, struct timeval after)
-{
- return (timeout.tv_usec <= after.tv_usec - before.tv_usec) ?
- (timeout.tv_sec <= after.tv_sec - before.tv_sec) :
- (timeout.tv_sec < after.tv_sec - before.tv_sec);
-}
-
-#define MSG_BUFSIZ 30
-
-/*
- * send socket sock through socket to_sock
- */
-static int do_sendmsg(int to_sock, int sock, unsigned long clnt_dispatched, int srv)
-{
- struct msghdr msg;
- struct cmsghdr *cmsg;
- struct iovec sendiov;
- int myfds, /* file descriptors to pass. */
- *fdptr;
- char buf[CMSG_SPACE(sizeof myfds)]; /* ancillary data buffer */
- char sendbuf[MSG_BUFSIZ]; /* to store unsigned int + \0 */
-
-
- memset(sendbuf, 0, sizeof(sendbuf));
- snprintf(sendbuf, sizeof(sendbuf), "%u %lu", srv, clnt_dispatched);
-
- memset(&msg, 0, sizeof(msg));
- msg.msg_name = NULL;
- msg.msg_namelen = 0;
- msg.msg_iov = &sendiov;
- msg.msg_iovlen = 1;
- sendiov.iov_base = sendbuf;
- sendiov.iov_len = sizeof(sendbuf);
-
- memset(buf, 0, sizeof(buf));
- msg.msg_control = buf;
- msg.msg_controllen = sizeof buf;
-
- cmsg = CMSG_FIRSTHDR(&msg);
- cmsg->cmsg_level = SOL_SOCKET;
- cmsg->cmsg_type = SCM_RIGHTS;
- cmsg->cmsg_len = CMSG_LEN(sizeof(int));
- fdptr = (int *)CMSG_DATA(cmsg);
- *fdptr = sock;
-
- msg.msg_controllen = cmsg->cmsg_len;
- /* send fd to server-slave to do rest of communication */
- if (sendmsg(to_sock, &msg, 0) < 0)
- return 1;
-
- return 0;
-}
-
-
-/* receive socket sock through socket from_sock */
-static int do_recvmsg(int from_sock, int *sock, unsigned long *clnt_accepted,int *srv)
-{
- struct msghdr msg;
- struct cmsghdr *cmsg;
- struct iovec recviov;
- int myfds; /* file descriptors to pass. */
- char buf[CMSG_SPACE(sizeof(myfds))]; /* ancillary data buffer */
- char recvbuf[MSG_BUFSIZ];
-
-
- memset(&msg, 0, sizeof(msg));
- msg.msg_name = NULL;
- msg.msg_namelen = 0;
- msg.msg_iov = &recviov;
- msg.msg_iovlen = 1;
- recviov.iov_base = recvbuf;
- recviov.iov_len = sizeof(recvbuf);
-
- msg.msg_control = buf;
- msg.msg_controllen = sizeof buf;
-
- cmsg = CMSG_FIRSTHDR(&msg);
- cmsg->cmsg_level = SOL_SOCKET;
- cmsg->cmsg_type = SCM_RIGHTS;
- cmsg->cmsg_len = CMSG_LEN(sizeof(int));
- msg.msg_controllen = cmsg->cmsg_len;
-
- if (recvmsg(from_sock, &msg, 0) < 0)
- return 1;
-
- *sock = *((int *)CMSG_DATA(cmsg));
- sscanf(recvbuf, "%u %lu", srv, clnt_accepted);
-
- return 0;
-}
-
-static void glite_srvbones_set_slaves_ct(int n)
-{
- set_slaves_ct = (n == -1)? SLAVES_COUNT: n;
-}
-
-static void glite_srvbones_set_slave_overload(int n)
-{
- set_slave_overload = (n == -1)? SLAVE_OVERLOAD: n;
-}
-
-static void glite_srvbones_set_slave_conns_max(int n)
-{
- set_slave_reqs_max = (n == -1)? SLAVE_REQS_MAX: n;
-}
-
-static void set_timeout(struct timeval *to, struct timeval *val)
-{
- if (val) {
- /* XXX: why not, negative timeouts don't make any sense, IMHO */
- assert(val->tv_sec >= 0);
- *to = *val;
- }
- else to->tv_sec = -1;
-}
-
-static void glite_srvbones_set_log_category(char *log_category)
-{
- free(set_log_category);
- set_log_category = strdup(log_category);
-}
+++ /dev/null
-build
\ No newline at end of file
+++ /dev/null
-LICENSE file for EGEE Middleware
-================================
-
-Copyright (c) 2004 on behalf of the EU EGEE Project:
-The European Organization for Nuclear Research (CERN),
-Istituto Nazionale di Fisica Nucleare (INFN), Italy
-Datamat Spa, Italy
-Centre National de la Recherche Scientifique (CNRS), France
-CS Systeme d'Information (CSSI), France
-Royal Institute of Technology, Center for Parallel Computers (KTH-PDC), Sweden
-Universiteit van Amsterdam (UvA), Netherlands
-University of Helsinki (UH.HIP), Finlan
-University of Bergen (UiB), Norway
-Council for the Central Laboratory of the Research Councils (CCLRC), United Kingdom
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-1. Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-
-3. The end-user documentation included with the redistribution, if
-any, must include the following acknowledgment: "This product includes
-software developed by The EU EGEE Project (http://cern.ch/eu-egee/)."
-Alternatively, this acknowledgment may appear in the software itself, if
-and wherever such third-party acknowledgments normally appear.
-
-4. The names EGEE and the EU EGEE Project must not be
-used to endorse or promote products derived from this software without
-prior written permission. For written permission, please contact
-<email address>.
-
-5. You are under no obligation whatsoever to provide anyone with any
-bug fixes, patches, or upgrades to the features, functionality or
-performance of the Software ("Enhancements") that you may develop over
-time; however, if you choose to provide your Enhancements to The EU
-EGEE Project, or if you choose to otherwise publish or distribute your
-Enhancements, in source code form without contemporaneously requiring
-end users of The EU EGEE Proejct to enter into a separate written license
-agreement for such Enhancements, then you hereby grant The EU EGEE Project
-a non-exclusive, royalty-free perpetual license to install, use, copy,
-modify, prepare derivative works, incorporate into the EGEE Middleware
-or any other computer software, distribute, and sublicense your
-Enhancements or derivative works thereof, in binary and source code
-form (if any), whether developed by The EU EGEE Project or third parties.
-
-THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL PROJECT OR ITS CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-This software consists of voluntary contributions made by many
-individuals on behalf of the EU EGEE Prject. For more information on The
-EU EGEE Project, please see http://cern.ch/eu-egee/. For more information on
-EGEE Middleware, please see http://egee-jra1.web.cern.ch/egee-jra1/
-
-
+++ /dev/null
-# Default values
-top_srcdir=..
-builddir=build
-top_builddir=${top_srcdir}/${builddir}
-stagedir=.
-distdir=.
-globalprefix=glite
-package=glite-lbjp-common-trio
-version=0.0.0
-PREFIX=/opt/glite
-lbuprefix=lbu
-prefix=
-
--include Makefile.inc
--include ${top_srcdir}/project/version.properties
-
-version=${module.version}
-
-VPATH=${top_srcdir}/src:${top_srcdir}/test::${top_srcdir}/doc
-
-CC=gcc
-
-DEBUG:=-g -O0 -Wall
-
-CFLAGS:=${DEBUG} -I${top_srcdir}/src -I${top_srcdir}/interface -I. -DDATAGRID_EXTENSION ${CFLAGS}
-
-COMPILE:=libtool --mode=compile ${CC}
-LINK:=libtool --mode=link ${CC} -rpath ${stagedir}${prefix}/${libdir} ${LDFLAGS}
-LINKXX:=libtool --mode=link ${CXX} -rpath ${stagedir}${prefix}/${libdir} ${LDFLAGS}
-INSTALL:=libtool --mode=install install
-
-os=${shell uname}
-DL_LIBS:=
-ifeq (${os},Linux)
- DL_LIBS:=-ldl
-endif
-
-REPORTS:=${top_srcdir}/reports
-TEST_LIBS:=-L${cppunit_prefix}/${libdir} -lcppunit ${DL_LIBS}
-TEST_INC:=-I${cppunit_prefix}/include
-
-
-OBJS:=trio.o strio.o escape.o
-LOBJS:=${OBJS:.o=.lo}
-
-HDRS:=trio.h escape.h
-
-STATICLIB:=libglite_lbu_trio.a
-LTLIB:=libglite_lbu_trio.la
-
-default: all
-
-all compile: ${STATICLIB} ${LTLIB}
-
-# to use libtool versioning correcty, we should have:
-#
-# current = major + minor + offset
-# revision = patch
-# age = minor
-#
-# where offset is a sum of maximal released minor's of all previous major's
-#
-# version_info=-version-info `echo ${version} | cut -d. -f1,2 | tr . :`
-
-# counted minors: n/a
-offset=0
-
-version_info:=-version-info ${shell \
- perl -e '$$,=":"; @F=split "\\.","${version}"; print $$F[0]+$$F[1]+${offset},$$F[2],$$F[1]' }
-
-${STATICLIB}: ${OBJS}
- ar crv $@ ${OBJS}
- ranlib $@
-
-${LTLIB}: ${OBJS}
- ${LINK} ${version_info} -o $@ ${LOBJS} -lm
-
-stage: compile
- $(MAKE) install PREFIX=${stagedir} DOSTAGE=yes
-
-check: compile mkreports runtest
-
-mkreports:
- -mkdir ${REPORTS}
-
-runtest: trio_test
- ./trio_test ${REPORTS}/trio.xml
-
-trio_test: trio_test.cpp
- ${CXX} -c ${CFLAGS} ${TEST_INC} $<
- ${LINKXX} -o $@ trio_test.o ${LTLIB} ${TEST_LIBS}
-
-dist: distsrc distbin
-
-distsrc:
- mkdir -p ${top_srcdir}/${package}-${version}
- cd ${top_srcdir} && GLOBIGNORE="${package}-${version}" && cp -Rf * ${package}-${version}
- cd ${top_srcdir} && tar -czf ${distdir}/${package}-${version}_src.tar.gz --exclude-from=project/tar_exclude ${package}-${version}
- rm -rf ${top_srcdir}/${package}-${version}
-
-distbin:
- $(MAKE) install PREFIX=`pwd`/tmpbuilddir${stagedir}
- save_dir=`pwd`; cd tmpbuilddir${stagedir} && tar -czf $$save_dir/${top_srcdir}/${distdir}/${package}-${version}_bin.tar.gz *; cd $$save_dir
- rm -rf tmpbuilddir
-
-install: all
- -mkdir -p ${DESTDIR}${PREFIX}${prefix}/${libdir}
- -mkdir -p ${DESTDIR}${PREFIX}${prefix}/share/doc/${package}-${version}
- -mkdir -p ${DESTDIR}${PREFIX}${prefix}/include/${globalprefix}/${lbutilsprefix}
- -mkdir -p ${DESTDIR}${PREFIX}${prefix}/include/${globalprefix}/${lbuprefix}
- ${INSTALL} -m 755 ${LTLIB} ${DESTDIR}${PREFIX}${prefix}/${libdir}
- ${INSTALL} -m 644 ${STATICLIB} ${DESTDIR}${PREFIX}${prefix}/${libdir}
- ${INSTALL} -m 644 ${top_srcdir}/LICENSE ${DESTDIR}${PREFIX}${prefix}/share/doc/${package}-${version}
- (cd ${top_srcdir}/interface && ${INSTALL} -m 644 ${HDRS} ${DESTDIR}${PREFIX}${prefix}/include/${globalprefix}/${lbuprefix})
-
-clean:
- rm -rvf *.o *.lo .libs lib* *.c *.h *.dox C/ CPP/
- rm -vf trio_test
-
-distclean:
- rm -rvf Makefile.inc *.spec debian/
-
-%.lo %.o: %.c
- ${COMPILE} ${CFLAGS} -c $<
+++ /dev/null
-#!/usr/bin/perl
-
-# WARNING: Don't edit this file unless it is the master copy in org.glite.lb
-#
-# For the purpose of standalone builds of lb/jobid/lbjp-common components
-# it is copied on tagging
-
-# $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.
-#
-
-use Getopt::Long;
-use POSIX qw(locale_h strftime);
-
-my $pwd = `pwd`; chomp $pwd;
-my $prefix = '/usr';
-my $stagedir = undef;
-my $root = $pwd.'/stage';
-my $sysroot = '';
-my $sysconfdir;
-my $localstatedir;
-my $staged;
-my $module;
-my $thrflavour = 'gcc64dbgpthr';
-my $nothrflavour = 'gcc64dbg';
-my $mode = 'build';
-my $help = 0;
-my $listmodules;
-my ($version, $force_version);
-my $branch;
-my $output;
-my $lb_tag = '';
-my $lbjp_tag = '';
-my $jp_tag = '';
-my $jobid_tag = '';
-my $libdir = getlibdir();
-my $project = 'emi';
-my $project_version;
-my (%projects, %project);
-my $debug = 0;
-my $pkg_config_env = (defined $ENV{PKG_CONFIG_PATH}) ? "$ENV{PKG_CONFIG_PATH}:" : '';
-
-my @nodes = qw/client server logger logger-msg nagios utils client-java doc ws-test db jpprimary jpindex jpclient harvester lb px proxyrenewal/;
-my @default_nodes = qw/lb px proxyrenewal nagios/;
-my %enable_nodes;
-my %disable_nodes;
-my %default_nodes; @default_nodes{@default_nodes} = (1) x ($#default_nodes + 1);
-
-my %package = (
- 'maintainer' => 'CESNET Product Teams <emi-lb@metacentrum.cz>',
- 'uploaders' => 'František Dvořák <valtri@civ.zcu.cz>',
- 'url' => 'http://glite.cern.ch',
- 'debian_vcs' => 'Vcs-Cvs: :pserver:anonymous@jra1mw.cvs.cern.ch:/cvs/jra1mw
-Vcs-Browser: http://jra1mw.cvs.cern.ch/cgi-bin/jra1mw.cgi',
-);
-
-# key: internal package name (arguments, ...)
-# 'pkg': pkg-config name
-# 'prefix': used when pkg-config fails
-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-devel' => {
- prefix=> '/opt/globus',
- pkg => 'myproxy'
- },
- 'myproxy-server' => {
- prefix=> '',
- },
- 'myproxy-admin' => {
- prefix=> '',
- },
- gsoap => {
- prefix=> '/usr',
- pkg => 'gsoap'
- },
- gsoapxx => {
- prefix=> '/usr',
- pkg => 'gsoap++'
- },
- mysql => {
- prefix=> '/usr'
- },
- 'mysql-devel' => {
- prefix=> ''
- },
- 'mysql-server' => {
- prefix => ''
- },
- voms => {
- prefix => '/opt/glite',
- pkg => 'voms-2.0'
- },
- gridsite => {
- prefix => '/opt/glite'
- },
- lcas => {
- prefix => '/opt/glite',
- pkg => 'lcas'
- },
- trustmanager => {
- prefix => '/opt/glite'
- },
- trustmanager_axis => {
- prefix => '/opt/glite'
- },
- utiljava => {
- prefix=> '/opt/glite'
- },
- ant => {
- prefix=> '/usr'
- },
- jdk => {
- prefix=> '/usr/java/latest',
- locations => [ '/usr/lib/jvm/java', '/usr/lib/jvm/default-java', '/usr/java/latest' ],
- },
- libtar => {
- prefix=> '/usr'
- },
- axis => {
- prefix=> '/usr'
- },
- log4c => {
- prefix=> '/usr'
- },
- postgresql => {
- prefix=> '/usr'
- },
- activemq => {
- prefix=>'/opt/activemq-cpp-library',
- pkg => 'activemq-cpp'
- },
-);
-
-my %jar = (
- 'jakarta-commons-codec' => '/usr/share/java/commons-codec.jar',
- 'jakarta-commons-lang' => '/usr/share/java/commons-lang.jar',
-);
-
-
-my %glite_prefix;
-my %need_externs;
-my %need_externs_type;
-my %need_jars;
-my %extrafull;
-my %extranodmod;
-my %deps;
-my %deps_type;
-my %buildroot;
-my (%etics_externs, %etics_projects);
-
-#
-# modules of the subsystems
-#
-# additional modules from $project{modules} are automatically added
-#
-my %lbmodules = (
- 'lb' => [ qw/client client-java common doc logger server state-machine types utils ws-interface ws-test harvester yaim logger-msg nagios client-devel client-progs common-devel logger-devel state-machine-devel/],
- 'lbjp-common' => [qw/db log maildir server-bones trio jp-interface gss gsoap-plugin db-devel log-devel maildir-devel server-bones-devel trio-devel jp-interface-devel gss-devel gsoap-plugin-devel/],
- 'jobid' => [qw/api-c api-c-devel api-cpp api-cpp-devel api-java/],
- 'jp' => [ qw/client doc index primary server-common ws-interface/ ],
- 'gridsite' => [ qw/apache libs commands core devel slashgrid services service-clients gsexec/ ],
- 'px' => [ qw/proxyrenewal myproxy-yaim proxyrenewal-devel proxyrenewal-progs/ ],
- 'canl' => [ qw/c c-devel/ ],
- );
-
-#
-# sub-packages
-#
-# modify %lbmodules, %deps_aux, %extrafull, and %properties accodingly
-#
-my %subpackages = (
- 'jobid.api-c-devel' => 'jobid.api-c',
- 'jobid.api-cpp-devel' => 'jobid.api-cpp',
- 'lbjp-common.db-devel' => 'lbjp-common.db',
- 'lbjp-common.gsoap-plugin-devel' => 'lbjp-common.gsoap-plugin',
- 'lbjp-common.gss-devel' => 'lbjp-common.gss',
- 'lbjp-common.jp-interface-devel' => 'lbjp-common.jp-interface',
- 'lbjp-common.log-devel' => 'lbjp-common.log',
- 'lbjp-common.maildir-devel' => 'lbjp-common.maildir',
- 'lbjp-common.server-bones-devel' => 'lbjp-common.server-bones',
- 'lbjp-common.trio-devel' => 'lbjp-common.trio',
- 'lb.client-progs' => 'lb.client',
- 'lb.client-devel' => 'lb.client',
- 'lb.common-devel' => 'lb.common',
- 'lb.logger-devel' => 'lb.logger',
- 'lb.state-machine-devel' => 'lb.state-machine',
- 'px.proxyrenewal-devel' => 'px.proxyrenewal',
- 'px.proxyrenewal-progs' => 'px.proxyrenewal',
- 'canl.c-devel' => 'canl.c',
-);
-
-my @opts = (
- 'prefix:s' => \$prefix,
- 'staged=s' => \$staged,
- 'module=s' => \$module,
- 'thrflavour:s' => \$thrflavour,
- 'nothrflavour:s' => \$nothrflavour,
- 'mode=s' => \$mode,
- 'listmodules=s' => \$listmodules,
- 'version=s' => \$force_version,
- 'branch=s' => \$branch,
- 'output=s' => \$output,
- 'stage=s' => \$stagedir,
- 'root:s' => \$root,
- 'sysroot:s' => \$sysroot,
- 'sysconfdir=s' => \$sysconfdir,
- 'localstatedir=s' => \$localstatedir,
- 'lb-tag=s' => \$lb_tag,
- 'lbjp-common-tag=s' => \$lbjp_tag,
- 'jp-tag=s' => \$jp_tag,
- 'jobid-tag=s' => \$jobid_tag,
- 'canl-tag=s' => \$canl_tag,
- 'help' => \$help,
- 'libdir=s' => \$libdir,
- 'project=s' => \$project,
- 'debug' => \$debug,
-);
-
-for (@nodes) {
- $enable_nodes{$_} = 0;
- $disable_nodes{$_} = 0;
-
- push @opts,"disable-$_",\$disable_nodes{$_};
- push @opts,"enable-$_",\$enable_nodes{$_};
-}
-
-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";
-$prefix=~s/\/$//;
-$root=~s/\/$//;
-$sysroot=~s/\/$//;
-if (not $sysconfdir) { $sysconfdir = $prefix eq '/usr' ? '/etc' : "$prefix/etc"; }
-if (not $localstatedir) { $localstatedir = $prefix eq '/usr' ? '/var' : "$prefix/var"; }
-$sysconfdir=~s/\/$//;
-$localstatedir=~s/\/$//;
-
-$externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq '';
-$externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq '';
-$externs{'gsoapxx'}{prefix}=$externs{gsoap}{prefix} if $externs{'gsoapxx'}{prefix} eq '';
-
-$externs{'mysql-server'}{withprefix}=$externs{mysql}{withprefix} if $externs{'mysql-server'}{withprefix} eq '';
-$externs{'mysql-devel'}{wihtprefix}=$externs{mysql}{withprefix} if $externs{'mysql-devel'}{withprefix} eq '';
-$externs{'gsoapxx'}{withprefix}=$externs{gsoap}{withprefix} if $externs{'gsoapxx'}{withprefix} eq '';
-
-if ($project =~ /^([^0-9]*)(.*)$/) {
- $project = $1;
- $project_version = $2;
-}
-%project = %{$projects{$project}};
-$project_version = $project{current_version} unless $project_version;
-for my $platform (keys %{$project{etics_externs}}) {
- for $_ (keys %{$project{etics_externs}{$platform}}) {
- $etics_externs{$platform}{$_} = $project{etics_externs}{$platform}{$_};
- }
-}
-reshuffle_platforms(\%etics_externs, $project{supported_platforms});
-reshuffle_platforms(\%{$project{etics_externs_devel}}, $project{supported_platforms});
-for $_ (keys %{$project{etics_projects}}) {
- $etics_projects{$_} = $project{etics_projects}{$_};
-}
-for $_ (keys %{$project{need_externs_aux}}) {
- $need_externs_aux{$_} = $project{need_externs_aux}{$_};
-}
-for my $ext (keys %need_externs_aux) {
- for (@{$need_externs_aux{$ext}}) {
- my ($pkg, $type) =/([^:]*)(?::(.*))?/;
- $type = 'BR' unless ($type);
-
- push @{$need_externs{$ext}},$pkg;
- $need_externs_type{$ext}->{$pkg} = $type;
- }
-}
-if ($project eq 'emi') {
- $extranodmod{lb} = 'lb.emi-lb';
- $extranodmod{px} = 'px.emi-px';
-}
-for $_ (keys %{$project{modules}}) {
- push @{$lbmodules{$_}},@{$project{modules}{$_}};
-}
-
-
-if ($help) { usage(); exit 0; }
-
-if ($listmodules) {
- my $name_prefix = ($listmodules eq 'gridsite' and $project eq 'glite') ? 'org' : $project{etics_name};
- my @m;
-
- if (exists $lbmodules{$listmodules}) {
- @m = map exists $subpackages{$listmodules . '.' . $_} ? "" : "$name_prefix.$listmodules.$_",@{$lbmodules{$listmodules}};
- } else {
- if ($project eq 'emi' and $project_version == 1) {
- # no sub-packages in EMI-1
- } else {
- for my $sub (keys %subpackages) {
- push @m, $sub if ($subpackages{$sub} eq $listmodules);
- }
- }
- }
- print map $_ eq "" ? "" : "$_ ", @m;
- print "\n";
- exit 0;
-}
-
-warn "$0: --branch and --output make sense only in --mode=etics\n"
- if ($output || $branch) && $mode ne 'etics';
-
-my $en;
-for (keys %enable_nodes) { $en = 1 if $enable_nodes{$_}; }
-
-my $dis;
-for (keys %disable_nodes) { $dis = 1 if $disable_nodes{$_}; }
-
-die "--enable-* and --disable-* are mutually exclusive\n"
- if $en && $dis;
-
-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{jp}};
-
-if ($dis) {
- for (@nodes) {
- $enable_nodes{$_} = 1 unless ($disable_nodes{$_} or not $default_nodes{$_});
- }
-}
-
-if (!$en && !$dis) { for (@nodes) { $enable_nodes{$_} = 1 if ($default_nodes{$_}) } };
-
-for (keys %enable_nodes) { delete $enable_nodes{$_} unless $enable_nodes{$_}; }
-
-$stagedir = $root unless $stagedir;
-$stagedir=~s/\/$// if ($stagedir);
-
-if ($mode eq 'build') { for my $ext (keys %externs) {
- if (defined $externs{$ext} and defined $externs{$ext}{withprefix}) { $externs{$ext}{prefix} = $externs{$ext}{withprefix}; }
- elsif (defined $externs{$ext}{pkg}) {
- my ($flag, $env, $cmd, $ret);
- my $pkg = $externs{$ext}{pkg};
- my $flagname = uc $externs{$ext}{pkg};
- $flagname =~ s/-[0-9\.]*$//;
- $flagname =~ y/-\+/_X/;
-
- print "Checking $pkg ... ";
- $env = "PKG_CONFIG_PATH=$pkg_config_env$stagedir$prefix/$libdir/pkgconfig";
- $cmd = "$env pkg-config $pkg --exists >/dev/null";
- `$cmd`; $ret = $?;
- print "('$cmd' => $ret)\n" if ($debug);
- if ($ret == 0) {
- $externs{$ext}{prefix}=`$env pkg-config $pkg --variable=prefix`;
- chomp $externs{$ext}{prefix};
- print "$externs{$ext}{prefix}\n";
-
- $flag=`$env pkg-config $pkg --cflags`;
- $externs{$ext}{flags} .= "${flagname}_CFLAGS=$flag" if ($flag);
- $flag=`$env pkg-config $pkg --libs`;
- $externs{$ext}{flags} .= "${flagname}_LIBS=$flag" if ($flag);
- } else {
- print "(using default $externs{$ext}{prefix})\n";
- }
- print "\n" if ($debug);
- }
- elsif ($ext eq 'jdk') {
- my $jdk_prefix;
-
- print "Looking for some caffein ... ";
- if (defined $ENV{'JDK_HOME'}) {
- $jdk_prefix = $ENV{'JDK_HOME'};
- print "JDK_HOME=$jdk_prefix\n";
- } elsif (defined $ENV{'JAVA_HOME'}) {
- $jdk_prefix = $ENV{'JAVA_HOME'};
- print "JAVA_HOME=$jdk_prefix\n";
- } else {
- foreach my $i (0..$#{$externs{$ext}{locations}}) {
- if (-e $externs{$ext}{locations}[$i]) {
- $jdk_prefix=$externs{$ext}{locations}[$i];
- print "(found directory $jdk_prefix)\n";
- last;
- }
- }
- print "(using default $externs{$ext}{prefix})\n" unless ($jdk_prefix);
- }
- $externs{$ext}{prefix} = $jdk_prefix if ($jdk_prefix);
- }
-} }
-
-if ($mode eq 'build') {
- print "Writing config.status\n";
- open CONF,">config.status" or die "config.status: $!\n";
- for ('JDK_HOME', 'JAVA_HOME', 'PKG_CONFIG_PATH') {
- print CONF "$_=$ENV{$_} " if (defined $ENV{$_});
- }
- print CONF "$0 @keeparg\n";
- close CONF;
-}
-
-
-my @modules;
-my %aux;
-
-if ($module) {
-# push @modules,split(/[,.]+/,$module);
- push @modules,$module;
-}
-else {
- @modules = map(($extranodmod{$_} ? $extranodmod{$_} : 'lb.'.$_),(keys %enable_nodes));
-
- my $n;
-
- do {
- local $"="\n";
- $n = $#modules;
- push @modules,(map @{$deps{$_}},@modules);
-
- undef %aux; @aux{@modules} = (1) x ($#modules+1);
- @modules = keys %aux;
- } while ($#modules > $n);
-}
-
-@aux{@modules} = (1) x ($#modules+1);
-delete $aux{$_} for (split /,/,$staged);
-@modules = keys %aux;
-
-mode_build() if $mode eq 'build';
-mode_checkout() if $mode eq 'checkout';
-mode_etics($module) if $mode eq 'etics';
-
-sub mode_build {
- print "\nBuilding modules: @modules\n";
- print "Mode: "; print $module ? "single module" : "multiple modules"; print "\n";
-
- my @ext = map @{$need_externs{$_}},@modules;
- my @myjars = map @{$need_jars{$_}},@modules;
- undef %aux; @aux{@ext} = 1;
- @ext = keys %aux;
- undef %aux; @aux{@myjars} = (1) x ($#myjars+1);
- @myjars = keys %aux;
-
- print "\nRequired externals:\n";
- print "\t$_: ".($externs{$_}{prefix}?$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;
-
- if ($module) {
- print "Not creating summary Makefile\n" if $debug;
- } else {
- print "Creating Makefile\n";
-
- open MAK,">Makefile" or die "Makefile: $!\n";
-
- print MAK "all: @modules\n\n";
- print MAK "stage: ".(join '-stage ', @modules)."-stage\n\n";
- print MAK "clean check install:\n";
-
- for (@modules) {
- my $full = full($_);
- print MAK "\tcd $full/$buildroot{$_} && \${MAKE} \$@\n"
- }
-
- print MAK "\ndistclean:\n";
-
- for (@modules) {
- my $full = full($_);
- print MAK $buildroot{$_} eq '' ?
- "\tcd $full && \${MAKE} distclean\n" :
- "\trm -rf $full/$buildroot{$_}\n"
- }
-
- print MAK "\n";
-
- for (@modules) {
- my %ldeps; undef %ldeps;
- @ldeps{@{$deps{$_}}} = 1;
- for my $x (split /,/,$staged) { delete $ldeps{$x}; }
- my @dnames = $module ? () : keys %ldeps;
- my $snames = $#dnames == -1 ? '' : join('-stage ', @dnames).'-stage';
-
- my $full = full($_);
- my $build = $buildroot{$_};
-
- print MAK "$_: @dnames\n\tcd $full/$build && \${MAKE} && \${MAKE} install\n\n";
- print MAK "$_-stage: $snames\n\tcd $full/$build && \${MAKE} && \${MAKE} stage\n\n";
- }
-
- close MAK;
- }
-}
-
-sub mode_checkout() {
- for (@modules) {
- my $module = $_;
- my $tag = "";
- if ($lb_tag){
- for (@{$lbmodules{lb}}){
- if ("lb.".$_ eq $module){
- $tag = '-r '.$lb_tag;
- }
- }
- }
- if ($lbjp_tag) {
- for (@{$lbmodules{'lbjp-common'}}){
- if ("lbjp-common.".$_ eq $module){
- $tag = '-r '.$lbjp_tag;
- }
- }
- }
- if ($jp_tag){
- for (@{$lbmodules{'jp'}}){
- if ("jp.".$_ eq $module){
- $tag = '-r '.$jp_tag;
- }
- }
- }
- if ($jobid_tag){
- for (@{$lbmodules{jobid}}){
- if ("jobid.".$_ eq $module){
- $tag = '-r '.$jobid_tag;
- }
- }
- }
- if ($canl_tag) {
- for (@{$lbmodules{'canl'}}){
- if ("canl.".$_ eq $module){
- $tag = '-r '.$canl_tag;
- }
- }
- }
- #if (grep {"lb.".$_ eq $module} @{$lbmodules{lb}}){
- # print "found";
- #}
- $_ = full($_);
- print "\n*** Checking out $_\n";
- system("cvs checkout $tag $_") == 0 or die "cvs checkout $tag $_: $?\n";
- }
-}
-
-BEGIN{
-%etics_externs = (
- default => {
- 'myproxy-devel'=>'myproxy-devel',
- 'myproxy-server'=>'myproxy-server',
- 'myproxy-admin'=>'myproxy-admin',
- cares=>'c-ares',
- utiljava=>'org.glite.security.util-java',
- gpt=>'gpt',
- fetchcrl=>'fetch-crl',
- activemq=>'activemq-cpp-library',
- },
-);
-
-%etics_projects = (
-);
-
-%need_externs_aux = (
- 'lb.client' => [ qw/cppunit:B classads libtool:B globus:B/ ],
- 'lb.common' => [ qw/expat cares:B cppunit:B classads libtool:B globus:B/ ],
- 'lb.doc' => [ qw/tetex-latex:B/ ],
- 'lb.logger' => [ qw/cppunit:B libtool:B globus:B/ ],
- 'lb.logger-msg' => [ qw/cppunit:B activemq libtool:B globus:B/ ],
- 'lb.nagios' => [ qw/globus_proxy_utils:R/ ],
- 'lb.server' => [ qw/globus_essentials:R globus:B expat cares mysql-server:R cppunit:B gsoap:B classads voms:B lcas gridsite:B bison:B libtool:B libxml2 flex:B/ ],
- 'lb.state-machine' => [ qw/classads libtool:B libxslt:B expat:B globus:B/ ],
- 'lb.utils' => [ qw/cppunit:B libtool:B globus:B/ ],
- 'lb.ws-interface' => [ qw/libxslt:B tidy:B/ ],
- 'lb.ws-test' => [ qw/gsoap:B libtool:B globus:B/ ],
- 'lb.types' => [ qw// ],
- 'lb.harvester' => [ qw/docbook-utils:B libtool:B globus:B/ ],
- 'lbjp-common.db' => [ qw/mysql-devel:B postgresql:B cppunit:B log4c:B libtool:B/ ],
- 'lbjp-common.log' => [ qw/log4c libtool:B/ ],
- 'lbjp-common.maildir' => [ qw/libtool:B/ ],
- 'lbjp-common.server-bones' => [ qw/libtool:B/ ],
- 'lbjp-common.trio' => [ qw/cppunit:B libtool:B/ ],
- 'lbjp-common.jp-interface' => [ qw/cppunit:B log4c:B libtool:B/ ],
- 'lbjp-common.gss' => [ qw/globus_essentials:R globus:B cares cppunit:B libtool:B/ ],
- 'lbjp-common.gsoap-plugin' => [ qw/cppunit:B globus_essentials:R globus:B cares:B gsoap gsoapxx libtool:B/ ],
- 'jobid.api-c' => [ qw/cppunit:B libtool:B openssl:B/ ],
- 'jobid.api-cpp' => [ qw/cppunit:B libtool:B/ ],
- 'jobid.api-java' => [ qw/ant:B jdk:B/ ],
- 'jp.client' => [ qw/gsoap libtar globus_essentials:R globus:B/ ],
- 'jp.doc' => [],
- 'jp.index' => [ qw/gsoap globus_essentials:R globus:B mysql-server:R/ ],
- 'jp.primary' => [ qw/classads gsoap libtar globus_essentials:R globus:B mysql-server:R/ ],
- 'jp.server-common' => [],
- 'jp.ws-interface' => [],
- 'gridsite.core' => [ qw/httpd-devel:B gsoap:B globus:B curl:B doxygen:B fuse-devel:B libxml2:B openssl:B doxygen:B/ ],
- 'gridsite.commands' => [ qw/curl:R openssl:R/ ],
- 'gridsite.apache' => [ qw/libxml2:R openssl:R curl:R/ ],
- 'gridsite.libs' => [ qw/libxml2:R openssl:R/ ],
- 'gridsite.devel' => [ qw// ],
- 'gridsite.slashgrid' => [ qw/curl:R fuse:R/],
- 'gridsite.services' => [ qw/curl:R gsoap:R/ ],
- 'gridsite.service-clients' => [ qw/curl:R gsoap:R gsoapxx:R/ ],
- 'gridsite.gsexec' => [ qw// ],
- 'gridsite.1.5-compat' => [ qw/httpd-devel:B gsoap:B globus:B curl:B doxygen:B fuse-devel:B libxml2:B openssl:B doxygen:B/ ],
- 'px.proxyrenewal' => [ qw/globus:B globus_essentials:R myproxy-devel:B voms:B libtool:B/ ],
- 'px.myproxy-config' => [ qw/myproxy-admin:R/ ], # in myproxy-config.spec
- 'canl.c' => [ qw/cares:B openssl:B libtool:B bison:B flex:B krb5-devel:B/ ],
-);
-
-%need_jars = (
- 'jobid.api-java' => [ qw/jakarta-commons-codec/ ],
- 'lb.client-java' => [ qw/jakarta-commons-lang/ ],
-);
-
-for my $jar (keys %need_jars) {
- for (@{$need_jars{$jar}}) {
- $need_externs_type{$jar}->{$_} = 'BR'; # XXX
- }
-}
-
-%deps_aux = (
- 'lb.client' => [ qw/
- lb.types:B lb.common
- lbjp-common.trio
- jobid.api-cpp:B jobid.api-c
- lbjp-common.gss
- / ],
- 'lb.client-java' => [ qw/
- lb.types:B
- lb.ws-interface:B
- jobid.api-java
- / ],
- 'lb.common' => [ qw/
- jobid.api-cpp:B jobid.api-c
- lb.types:B lbjp-common.trio lbjp-common.gss
- / ],
- 'lb.doc' => [ qw/lb.types:B/ ],
- 'lb.logger' => [ qw/
- lbjp-common.trio
- lbjp-common.log
- jobid.api-c
- lb.common
- lbjp-common.gss
- / ],
- 'lb.logger-msg' => [ qw/
- lb.logger:B
- / ],
- 'lb.nagios' => [ qw/
- lb.client:R
- lb.ws-test:R
- lb.utils:R
- / ],
- 'lb.server' => [ qw/
- lb.ws-interface lb.types:B lb.common lb.state-machine lb.utils:R
- lbjp-common.db lbjp-common.server-bones lbjp-common.trio lbjp-common.maildir lbjp-common.log
- jobid.api-c
- lbjp-common.gsoap-plugin lbjp-common.gss
- / ],
- 'lb.state-machine' => [ qw/lb.types:B lb.common lbjp-common.jp-interface lbjp-common.gss/ ],
- 'lb.utils' => [ qw/
- lbjp-common.jp-interface
- jobid.api-c
- lbjp-common.trio lbjp-common.maildir
- lb.client lb.state-machine lb.types:B
- / ],
- 'lb.ws-test' => [ qw/lbjp-common.gsoap-plugin lb.ws-interface/ ],
- 'lb.ws-interface' => [ qw/lb.types:B/ ],
- 'lb.types' => [ qw// ],
- 'lb.harvester' => [ qw/
- jobid.api-c lbjp-common.trio lbjp-common.db lb.common lb.client
- lbjp-common.gss lbjp-common.log
- / ],
- 'lb.yaim' => [ qw// ],
- 'lb.glite-LB' => [ qw/
- lb.logger:R lb.server:R lb.utils:R lb.doc:R
- lb.ws-test:R lb.harvester:R lb.yaim:R lb.client-java:R
- lb.logger-msg:R
- / ],
- 'lb.emi-lb' => [ qw/
- lb.logger:R lb.server:R lb.utils:R lb.doc:R
- lb.ws-test:R lb.harvester:R lb.yaim:R lb.client-java:R
- lb.logger-msg:R
- / ],
- 'lbjp-common.db' => [ qw/lbjp-common.trio lbjp-common.log/ ],
- 'lbjp-common.maildir' => [ qw// ],
- 'lbjp-common.log' => [ qw// ],
- 'lbjp-common.server-bones' => [ qw/lbjp-common.log/ ],
- 'lbjp-common.trio' => [ qw// ],
- 'lbjp-common.gss' => [ qw// ],
- 'lbjp-common.gsoap-plugin' => [ qw/lbjp-common.gss/ ],
- 'jobid.api-c' => [ qw// ],
- 'jobid.api-cpp' => [ qw/jobid.api-c/ ],
- 'jobid.api-java' => [ qw// ],
-
- 'lbjp-common.jp-interface' => [ qw/lbjp-common.trio lbjp-common.db jobid.api-c/ ],
-
- 'jp.client' => [ qw/
- jp.ws-interface
- lbjp-common.jp-interface lbjp-common.maildir
- jobid.api-c
- lbjp-common.gsoap-plugin
- / ],
- 'jp.doc' => [ qw// ],
- 'jp.index' => [ qw/
- jp.server-common jp.ws-interface
- lbjp-common.jp-interface lbjp-common.trio lbjp-common.db lbjp-common.server-bones
- lbjp-common.gsoap-plugin
- / ],
- 'jp.primary' => [ qw/
- jobid.api-c
- jp.server-common jp.ws-interface
- lb.state-machine
- lbjp-common.jp-interface lbjp-common.trio lbjp-common.db lbjp-common.server-bones
- lbjp-common.gsoap-plugin
- / ],
- 'jp.server-common' => [ qw/
- lbjp-common.jp-interface lbjp-common.db
- / ],
- 'jp.ws-interface' => [ qw// ],
-
- 'gridsite.core' => [ qw// ],
- 'gridsite.commands' => [ qw/gridsite.core:B/ ],
- 'gridsite.apache' => [ qw/gridsite.core:B/ ],
- 'gridsite.libs' => [ qw/gridsite.core:B / ],
- 'gridsite.devel' => [ qw/gridsite.core:B/ ],
- 'gridsite.slashgrid' => [ qw/gridsite.core:B/],
- 'gridsite.services' => [ qw/gridsite.core:B/ ],
- 'gridsite.service-clients' => [ qw/gridsite.core:B/ ],
- 'gridsite.gsexec' => [ qw/gridsite.core:B/ ],
-
- 'px.proxyrenewal' => [ qw// ],
- 'px.glite-PX' => [qw/px.myproxy-yaim:R/],
- 'px.emi-px' => [qw/px.myproxy-yaim:R/],
- 'px.myproxy-yaim' => [ qw// ],
- 'px.myproxy-config' => [],
-
- 'canl.c' => [],
-
- # sub-packages (virtual ETICS components depending on the main)
- 'jobid.api-c-devel' => [ qw/jobid.api-c:B/ ],
- 'jobid.api-cpp-devel' => [ qw/jobid.api-cpp:B/ ],
- 'lbjp-common.db-devel' => [ qw/lbjp-common.db:B/ ],
- 'lbjp-common.gsoap-plugin-devel' => [ qw/lbjp-common.gsoap-plugin:B/ ],
- 'lbjp-common.gss-devel' => [ qw/lbjp-common.gss:B/ ],
- 'lbjp-common.jp-interface-devel' => [ qw/lbjp-common.jp-interface:B/ ],
- 'lbjp-common.log-devel' => [ qw/lbjp-common.log:B/ ],
- 'lbjp-common.maildir-devel' => [ qw/lbjp-common.maildir:B/ ],
- 'lbjp-common.server-bones-devel' => [ qw/lbjp-common.server-bones:B/ ],
- 'lbjp-common.trio-devel' => [ qw/lbjp-common.trio:B/ ],
- 'lb.client-progs' => [ qw/lb.client:B/ ],
- 'lb.client-devel' => [ qw/lb.client:B/ ],
- 'lb.common-devel' => [ qw/lb.common:B/ ],
- 'lb.logger-devel' => [ qw/lb.logger:B/ ],
- 'lb.state-machine-devel' => [ qw/lb.state-machine:B/ ],
- 'px.proxyrenewal-devel' => [ qw/px.proxyrenewal:B/ ],
- 'px.proxyrenewal-progs' => [ qw/px.proxyrenewal:B/ ],
- 'canl.c-devel' => [ qw/canl.c:B/ ],
-);
-
-for my $ext (keys %deps_aux) {
- for (@{$deps_aux{$ext}}) {
- /([^:]*)(?::(.*))?/;
- push @{$deps{$ext}},$1;
- my $type = $2 ? $2 : 'BR';
- $deps_type{$ext}->{$1} = $type;
- }
-}
-
-
-%extrafull = (
- gridsite=>'org.gridsite.core',
- 'canl.c' => 'emi.canl.canl-c',
- 'canl.c-devel' => 'emi.canl.canl-c',
- 'jobid.api-c-devel' => 'org.glite.jobid.api-c',
- 'jobid.api-cpp-devel' => 'org.glite.jobid.api-cpp',
- 'lbjp-common.db-devel' => 'org.glite.lbjp-common.db',
- 'lbjp-common.gsoap-plugin-devel' => 'org.glite.lbjp-common.gsoap-plugin',
- 'lbjp-common.gss-devel' => 'org.glite.lbjp-common.gss',
- 'lbjp-common.jp-interface-devel' => 'org.glite.lbjp-common.jp-interface',
- 'lbjp-common.log-devel' => 'org.glite.lbjp-common.log',
- 'lbjp-common.maildir-devel' => 'org.glite.lbjp-common.maildir',
- 'lbjp-common.server-bones-devel' => 'org.glite.lbjp-common.server-bones',
- 'lbjp-common.trio-devel' => 'org.glite.lbjp-common.trio',
- 'lb.client-devel' => 'org.glite.lb.client',
- 'lb.client-progs' => 'org.glite.lb.client',
- 'lb.common-devel' => 'org.glite.lb.common',
- 'lb.logger-devel' => 'org.glite.lb.logger',
- 'lb.state-machine-devel' => 'org.glite.lb.state-machine',
- 'px.proxyrenewal-devel' => 'org.glite.px.proxyrenewal',
- 'px.proxyrenewal-progs' => 'org.glite.px.proxyrenewal',
-);
-
-#( java => 'client-java' );
-%extranodmod = (
- db => 'lbjp-common.db',
- jpprimary => 'jp.primary',
- jpindex => 'jp.index',
- jpclient => 'jp.client',
- lb => 'lb.glite-LB',
- px => 'px.glite-PX',
- proxyrenewal => 'px.proxyrenewal',
- canl => 'canl.c',
-);
-
-%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/ ],
-);
-
-%conflicts = (
-);
-
-%provides = (
- 'lbjp-common.gss' => [ qq/glite-security-gss/ ],
- 'lbjp-common.gsoap-plugin' => [ qq/glite-security-gsoap-plugin/ ],
- 'lb.nagios' => [ qq/glite-lb-nagios-plugins/ ],
-);
-
-%cvs_prefix = (
- 'lb' => 'org.glite',
- 'jp' => 'org.glite',
- 'jobid' => 'org.glite',
- 'lbjp-common' => 'org.glite',
- 'gridsite' => 'org',
- 'px' => 'org.glite',
- 'canl' => 'emi',
-);
-
-%cvs_tag_prefix = (
- 'lb' => 'glite-',
- 'jp' => 'glite-',
- 'jobid' => 'glite-',
- 'lbjp-common' => 'glite-',
- 'gridsite' => '',
- 'px' => 'glite-',
- 'canl' => 'emi-',
-);
-
-# ==== projects specification ====
-# etics_name ........... ETICS project name
-# conf_prefix .......... ETICS configurations name prefix
-# tag_prefix ........... VCS tag prefix
-# local_prefix ......... prefix (relative to stage)
-# etics_externs ........ ETICS modules names of externals
-# (${NAME.location}, ETICS conf. dependencies)
-# etics_projects ....... ETICS project names of externals
-# etics_externs_devel .. ETICS modules names of devel versions of externals
-# etics_locations ...... ETICS locations in ${NAME.location} properties
-# need_externs_aux ..... project-specific external dependencies
-# supported_platforms .. platforms supported by the project
-# modules .............. additional modules in subsystems
-%projects = (
- glite => {
- current_version => 3,
- etics_name => 'org.glite',
- conf_prefix => { %cvs_tag_prefix },
- tag_prefix => { %cvs_tag_prefix },
- flavours => '--thrflavour=${globus.thr.flavor} --nothrflavour=${globus.nothr.flavor}',
- local_prefix => '',
- etics_externs => {
- default => {
- globus_essentials=>'vdt_globus_essentials',
- globus=>'globus',
- globus_proxy_utils=>'vdt_globus_essentials',
- gridsite=>'org.gridsite.libs',
- yaim_core=>'org.glite.yaim.core',
- gip_release=>'glite-info-provider-release',
- gip_service=>'glite-info-provider-service',
- bdii=>'bdii',
- glite_version=>'glite-version',
- glite_info_templates=>'glite-info-templates',
- glue_schema=>'glue-schema',
- trustmanager=>'org.glite.security.trustmanager',
- axis=>'axis',
- lcas=>'org.glite.security.lcas',
- gsoapxx=>'-',
- jdk=>'jdk',
- voms=>'org.glite.security.voms-api-cpp',
- },
- },
- etics_externs_devel => {
- default => {
- gridsite=>'org.gridsite.devel',
- voms=>'org.glite.security.voms-api',
- },
- },
- etics_projects => {
- vdt=>[qw/globus globus_essentials globus_proxy_utils gpt/],
- 'org.glite'=>[qw/voms gridsite lcas gip_release gip_service bdii glite_version glite_info_templates glue_schema yaim_core/],
- },
- etics_locations => {
- '*' => '',
- },
- need_externs_aux => {
- 'lb.client-java' => [ qw/ant:B jdk:B axis:B trustmanager utiljava libtool:B/ ],
- 'lb.glite-LB' => [ qw/fetchcrl:R gpt:R gip_release:R gip_service:R bdii:R glite_version:R glite_info_templates:R glue_schema:R/ ],
- 'lb.yaim' => [ qw/yaim_core:R/ ],
- 'px.glite-PX' => [qw/myproxy-server:R myproxy-admin:R fetchcrl:R gip_service:R bdii:R glite_version:R gpt:R glue_schema:R/],
- 'px.myproxy-yaim' => [ qw/yaim_core:R/ ],
- },
- supported_platforms => {
- sl5_x86_64_gcc412 => 1,
- sl5_ia32_gcc412 => 1,
- deb5_x86_64_gcc432 => 1,
- deb5_ia32_gcc432 => 1,
- slc4_x86_64_gcc346 => 1,
- slc4_ia32_gcc346 => 1,
- },
- modules => {
- 'lb' => [ qw/glite-LB/ ],
- 'px' => [ qw/glite-PX/ ],
- },
- },
-
- emi => {
- current_version => 2,
- etics_name => 'emi',
- conf_prefix => {
- 'lb' => 'emi-',
- 'jp' => 'emi-',
- 'jobid' => 'emi-',
- 'lbjp-common' => 'emi-',
- 'gridsite' => 'emi-',
- 'px' => 'emi-',
- 'canl' => 'emi-',
- },
- tag_prefix => { %cvs_tag_prefix },
- flavours => '--thrflavour= --nothrflavour=',
- local_prefix => '/usr',
- etics_externs => {
- default => {
- globus_essentials=>'globus-gssapi-gsi',
- globus=>'globus-gssapi-gsi-devel',
- globus_proxy_utils=>'globus-proxy-utils',
- gridsite=>'emi.gridsite.libs',
- yaim_core=>'emi.yaim.yaim-core',
- yaim_bdii=>'emi.bdii.yaim-bdii',
- gip_service=>'emi.bdii.glite-info-provider-service',
- bdii=>'emi.bdii.core',
- glite_version=>'emi.emi-version',
- glue_schema=>'emi.bdii.glue-schema',
- trustmanager=>'emi.java-security.trustmanager',
- trustmanager_axis=>'emi.java-security.trustmanager-axis',
- axis=>'axis1.4',
- lcas=>'emi.sac.lcas',
- gsoapxx=>'-',
- jdk=>'java',
- voms => 'emi.voms.voms-api',
- },
- sl5_x86_64_gcc412EPEL => {
- 'myproxy-devel' => 'myproxy-devel.x86_64',
- },
- sl6_x86_64_gcc446EPEL => {
- 'myproxy-devel' => 'myproxy-devel.x86_64',
- },
- deb6_x86_64_gcc445 => {
- axis => 'axis1.4',
- # mappings in ETICS project configuration
- #globus_essentials => 'libglobus-gssapi-gsi4',
- #globus => 'libglobus-gssapi-gsi-dev',
- #axis => 'libaxis-java',
- #cares => 'libc-ares2',
- #cppunit => 'libcppunit',
- #expat => 'libexpat1',
- #log4c => 'liblog4c3',
- #curl => 'libcurl3',
- #'mysql' => 'libmysqlclient16',
- #'mysql-devel' => 'libmysqlclient-dev',
- #libxslt => 'xsltproc',
- #'jakarta-commons-codec' => 'libcommons-codec-java',
- #'jakarta-commons-lang' => 'libcommons-lang-java',
- #'tetex-latex' => 'texlive-latex-extra',
- #'perl-LDAP' => 'libnet-ldap-perl',
- #'fuse-lib' => 'libfuse2',
- #'fuse' => 'fuse-utils',
- },
- },
- etics_externs_devel => {
- default => {
- cares => 'c-ares-devel',
- classads => 'classads-devel',
- cppunit => 'cppunit-devel',
- expat => 'expat-devel',
- gsoap => 'gsoap-devel',
- voms => 'emi.voms.voms-api-devel',
- libtar => 'libtar-devel',
- log4c => 'log4c-devel',
- postgresql => 'postgresql-devel',
- curl => 'curl-devel',
- libxml2 => 'libxml2-devel',
- openssl => 'openssl-devel',
- gridsite=>'emi.gridsite.devel',
- jdk=>'java-devel',
- },
- deb6_x86_64_gcc445 => {
- # mappings in ETICS project configuration
- #cares => 'libc-ares-dev',
- #cppunit => 'libcppunit-dev',
- #expat => 'libexpat1-dev',
- #libtar => 'libtar-dev',
- #log4c => 'liblog4c-dev',
- #postgresql => 'libpq-dev',
- #curl => 'libcurl4-openssl-dev',
- #libxml2 => 'libxml2-dev',
- #openssl => 'libssl-dev',
- #'tetex-latex' => 'texlive-latex-extra',
- #libxslt=>'xsltproc',
- #'httpd-devel' => 'apache2-prefork-dev',
- #'fuse-devel' => 'libfuse-dev',
- #gsoap => 'gsoap',
- #'krb5-devel' => 'libkrb5-dev',
- },
- },
- etics_projects => {
- 'emi'=>[qw/voms voms-devel gridsite lcas gip_service bdii glite_version glue_schema yaim_core yaim_bdii trustmanager trustmanager_axis/],
- },
- etics_locations => {
- axis => 'axis',
- },
- need_externs_aux => {
- 'lb.client-java' => [ qw/ant:B jdk:B axis:B trustmanager trustmanager_axis libtool:B/ ],
- 'lb.emi-lb' => [ qw/fetchcrl:R gip_service:R bdii:R glite_version:R glue_schema:R/ ],
- 'lb.yaim' => [ qw/yaim_core:R yaim_bdii:R/ ],
- 'px.emi-px' => [qw/myproxy-server:R myproxy-admin:R fetchcrl:R gip_service:R bdii:R glite_version:R glue_schema:R/],
- 'px.myproxy-yaim' => [ qw/yaim_core:R yaim_bdii:R/ ],
- },
- supported_platforms => {
- sl5_x86_64_gcc412EPEL => 1,
- sl5_ia32_gcc412EPEL => 1,
- sl6_x86_64_gcc446EPEL => 1,
- deb6_x86_64_gcc445 => 1,
- },
- modules => {
- 'lb' => [ qw/emi-lb/ ],
- 'px' => [ qw/emi-px/ ],
- },
- },
-);
-
-%platform_properties = (
- 'jobid.api-java' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.types' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.doc' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.ws-interface' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.yaim' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'lb.nagios' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'px.yaim' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'px.myproxy-config' => {
- default => { 'package.buildarch' => 'noarch' },
- },
- 'gridsite.devel' => {
- default => { 'packageName' => 'gridsite-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libgridsite-dev' },
- },
- 'canl.c-devel' => {
- default => { 'packageName' => 'canl-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libcanl-dev' },
- },
- 'jobid.api-c-devel' => {
- default => { 'packageName' => 'glite-jobid-api-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-jobid-dev' },
- },
- 'jobid.api-cpp-devel' => {
- default => { 'packageName' => 'glite-jobid-api-cpp-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-jobid-cpp-dev' },
- },
- 'lbjp-common.db-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-db-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-db-dev' },
- },
- 'lbjp-common.gsoap-plugin-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-gsoap-plugin-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-gsoap-plugin-dev' },
- },
- 'lbjp-common.gss-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-gss-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-gss-dev' },
- },
- 'lbjp-common.jp-interface-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-jp-interface-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-jp-interface-dev' },
- },
- 'lbjp-common.log-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-log-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-log-dev' },
- },
- 'lbjp-common.maildir-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-maildir-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-maildir-dev' },
- },
- 'lbjp-common.server-bones-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-server-bones-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-server-bones-dev' },
- },
- 'lbjp-common.trio-devel' => {
- default => { 'packageName' => 'glite-lbjp-common-trio-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lbjp-common-trio-dev' },
- },
- 'lb.client-devel' => {
- default => { 'packageName' => 'glite-lb-client-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-client-dev' },
- },
- 'lb.common-devel' => {
- default => { 'packageName' => 'glite-lb-common-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-common-dev' },
- },
- 'lb.state-machine-devel' => {
- default => { 'packageName' => 'glite-lb-state-machine-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-state-machine-dev' },
- },
- 'lb.logger-devel' => {
- default => { 'packageName' => 'glite-lb-logger-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-lb-logger-dev' },
- },
- 'px.proxyrenewal-devel' => {
- default => { 'packageName' => 'glite-px-proxyrenewal-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libglite-security-proxyrenewal-dev' },
- },
- 'canl.c-devel' => {
- default => { 'packageName' => 'canl-c-devel' },
- deb6_x86_64_gcc445 => { 'packageName' => 'libcanl-c-dev' },
- },
-);
-
-my @k = keys %deps_aux;
-@buildroot{@k} = ('') x ($#k+1);
-
-$buildroot{'gridsite.core'} = 'src';
-}
-
-sub full
-{
- my ($short) = @_;
- my $subsys = $short;
- $subsys =~ s/\..*//;
-
- my $cvs_prefix = exists $cvs_prefix{$subsys} ? $cvs_prefix{$subsys} : 'org.glite';
- return $extrafull{$short} ? $extrafull{$short} : "$cvs_prefix.$short";
-}
-
-sub get_version
-{
- my ($fmod, $top_srcdir) = @_;
-
- my ($subsys,$mod) = split /\./,$fmod,2;
- my ($major,$minor,$rev,$age);
- my $old_;
-
- if ($force_version) {
- $force_version =~ /([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)-(.+)/;
- ($major,$minor,$rev,$age) = ($1,$2,$3,$4);
- }
- else {
- my $path = "$top_srcdir/project";
- if ($subsys eq 'gridsite') {
- $path = "$cvs_prefix{$subsys}.$subsys.core/project";
- }
- open V,"$path/version.properties"
- or die "$path/version.properties: $!\n";
-
- $old_ = $_;
- while (<V>) {
- chomp;
- ($major,$minor,$rev) = ($1,$2,$3) if /module\.version\s*=\s*([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)/;
- $age = $1 if /module\.age\s*=\s*([[:digit:]]+)/;
- }
- close V;
- $_ = $old_;
- }
- $version = "$major.$minor.$rev-$age";
-
- return ($major, $minor, $rev, $age);
-}
-
-sub get_description
-{
- my ($top_srcdir) = @_;
-
- my $cvs_module = $top_srcdir;
- my $package_description = "";
- my $package_summary = "";
-
- if (-e "$cvs_module/project/package.description") {
- open V, "$cvs_module/project/package.description";
- $package_description = join ("", <V>);
- close V;
- chomp $package_description;
- }
- else {
- print STDERR "package.description not found for $subsys.$module!\n"; }
-
- if (-e "$cvs_module/project/package.summary") {
- open V, "$cvs_module/project/package.summary";
- $package_summary = join ("", <V>);
- close V;
- chomp $package_summary;
- $package_summary =~ s/\n/\\n/g;
- }
- else {
- print STDERR "package.summary not found for $subsys.$module!\n"; }
-
- return ($package_summary, $package_description);
-}
-
-sub mkinc
-{
- my %aux;
- undef %aux;
- my @m=qw/
-lb.client lb.doc lb.state-machine lb.ws-interface lb.logger lb.logger-msg lb.nagios lb.types lb.common lb.server lb.utils lb.ws-test lb.client-java lb.harvester lb.yaim lb.glite-LB lb.emi-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
-px.proxyrenewal px.myproxy-yaim px.glite-PX px.myproxy-config px.emi-px
-canl.c
-/;
- @aux{@m} = (1) x ($#m+1);
-
- my ($short) = @_;
- my $full = full $short;
- my ($subsys,$mod) = split /\./,$short,2;
- my $packageName = "$project{tag_prefix}{$subsys}$subsys-${mod}";
-
- unless ($aux{$short}) {
- print "Makefile.inc not needed in $full\n";
- return;
- }
-
- my $top_srcdir = '.';
- my $abs_srcdir = '';
- my $build = '';
-
- if ($module) {
- $top_srcdir = $0;
- $top_srcdir =~ s,/?[^/]*$,,;
- $abs_srcdir = $top_srcdir;
- $top_srcdir =~ s,^$,\.,;
- } else {
- $build = "$full/";
- $abs_srcdir = "$full/";
- unless ($buildroot{$_} eq '') {
- $top_srcdir = '..';
- $build .= "$buildroot{$_}/";
- unless (-d "$build") {
- mkdir "$build" or die "mkdir $build: $!\n";
- }
- }
- }
-
- my ($major, $minor, $rev, $age) = get_version $short, $abs_srcdir;
- my ($package_summary, $package_description) = get_description $abs_srcdir;
- if ($package_description) { $package_description =~ s/(.{1,78}\S|\S+)\s+/$1\n/mg; }
- my $package_description_debian = $package_description;
- $package_description_debian =~ s/^/ /mg;
-
- my ($old_locale, $specdate, $debdate);
-
- # files for ETICS always in root source directory
- mkdir $abs_srcdir."project" unless (-d $abs_srcdir."project");
- open PKGCHL,">".$abs_srcdir."project/changelog"
- or die $abs_srcdir."project/changelog: $!\n";
- $old_locale = setlocale(LC_TIME);
- setlocale(LC_TIME, "C");
- $specdate = strftime("%a %b %d %Y", gmtime());
- $debdate = strftime("%a, %d %b %Y %H:%M:%S %z", gmtime());
- setlocale(LC_TIME, $old_locale);
- print PKGCHL qq{* $specdate CESNET team <emi-lb\@metacentrum.cz>
-- automatically generated package
-};
- close PKGCHL;
-
- unless ($top_srcdir eq '.') {
- unlink $build."Makefile";
- symlink "$top_srcdir/Makefile",$build."Makefile" or die "symlink $top_srcdir/Makefile ".$build."Makefile: $!\n";
- }
-
- open MKINC,">".$build."Makefile.inc"
- or die $build."Makefile.inc: $!\n";
-
- print "Creating ".$build."Makefile.inc\n";
-
- print MKINC qq{project = $project
-PREFIX = $root
-prefix = $prefix
-stagedir = $stagedir
-sysroot = $sysroot
-sysconfdir = $sysconfdir
-localstatedir = $localstatedir
-thrflavour = $thrflavour
-nothrflavour = $nothrflavour
-libdir = $libdir
-top_srcdir = $top_srcdir
-};
-
- for (@{$need_externs{$short}}) {
- next unless defined $externs{$_} and defined $externs{$_}{prefix};
- print MKINC "${_}_prefix = $externs{$_}{prefix}\n";
- print MKINC "$externs{$_}{flags}" if defined $externs{$_}{flags};
- }
-
- for (@{$need_jars{$short}}) {
- print MKINC "${_}_jar = $jar{$_}\n"
- }
-
- my $need_gsoap = 0;
- for (@{$need_externs{$short}}) { $need_gsoap = 1 if $_ eq 'gsoap'; }
-
- print MKINC "gsoap_default_version=".gsoap_version()."\n" if $need_gsoap;
-
- close MKINC;
-
- my $dh;
- my $debian = 0;
-
- opendir $dh, "$abs_srcdir/project" || die "Can't open $abs_srcdir/project: $!";
- for my $dir (readdir $dh) {
- if ($dir=~/^(.*)\.spec$/) {
- if ($1 ne $packageName) {
- printf STDERR "Changed RPM name: $packageName --> $1\n" if ($debug);;
- $packageName=$1;
- }
- last;
- }
- }
- closedir $dh;
-
- for my $file ("$packageName.spec", "debian.rules", "debian.control", "debian.changelog", "debian.copyright") {
- if (-f "$abs_srcdir/project/$file") {
- my $old_ = $_;
- printf STDERR "Creating $build$file\n" if ($debug);;
- open DST, ">$build$file";
- open SRC, "<$abs_srcdir/project/$file";
- while (<SRC>) {
- if (/\@MODULE\@/) { s/\@MODULE\@/$full/g; }
- if (/\@URL\@/) { s/\@URL\@/$package{url}/g; }
- if (/\@SUMMARY\@/) { s/\@SUMMARY\@/$package_summary/g; }
- if (/\@DESCRIPTION\@/) { s/\@DESCRIPTION\@/$package_description/g; }
- if (/\@DEBIAN_DESCRIPTION\@/) { s/\@DEBIAN_DESCRIPTION\@/$package_description_debian/g; }
- if (/\@VERSION\@/) { s/\@VERSION\@/$version/g; }
- if (/\@MAJOR\@/) { s/\@MAJOR\@/$major/g; }
- if (/\@MINOR\@/) { s/\@MINOR\@/$minor/g; }
- if (/\@REVISION\@/) { s/\@REVISION\@/$rev/g; }
- if (/\@AGE\@/) { s/\@AGE\@/$age/g; }
- if (/\@MAINTAINER\@/) { s/\@MAINTAINER\@/$package{maintainer}/g; }
- if (/\@UPLOADERS\@/) { s/\@UPLOADERS\@/$package{uploaders}/g; }
- if (/\@DEBIAN_VCS\@/) { s/\@DEBIAN_VCS\@/$package{debian_vcs}/g; }
- if (/\@DEBIAN_DATE\@/) { s/\@DEBIAN_DATE\@/$debdate/g; }
- if (/\@SPEC_DATE\@/) { s/\@SPEC_DATE\@/$specdate/g; }
- if (/^\s*.+\/configure\s/ and $force_version) {
- print "Version forced to $version\n" if ($debug);;
- s/--version\s+\S+\s?//;
- s/$/ --version $version/;
- }
- printf DST "%s", "$_";
- }
- close SRC;
- close DST;
- $_ = $old_;
- }
- }
-
- print "Creating ${build}debian/\n" if ($debug);;
-
- `rm -rfv ${build}debian`;
- mkdir $build."debian" or die $!;
- `cp $abs_srcdir/project/debian.* ${build}debian/ 2>/dev/null`;
- `mv ${build}debian.* ${build}debian/ 2>/dev/null`;
- `rm -f ${build}debian/*.orig`;
- opendir $dh, "${build}debian" || die "Can't open ${build}debian: $!";
- for $_ (readdir $dh) {
- if (/^debian\.(.*)/) {
- `mv ${build}debian/$_ ${build}debian/$1`;
- $debian = 1;
- }
- }
- closedir $dh;
-
- if ($debian) {
- my ($dir, $file);
-
- chmod 0755, "${build}debian/rules";
- $file="${build}debian/docs"; if (not -f $file) { `touch $file`; }
- $dir="${build}debian/source"; if (not -d $dir) { mkdir $dir; }
- $file="${build}debian/source/format"; if (not -f $file) { `echo "3.0 (quilt)" > $file` }
- $file="${build}debian/compat"; if (not -f $file) { `echo "7" > $file` }
- $file="${build}debian/changelog"; if (not -f $file) {
- open FH, ">$file" or die $!;
- print FH qq{$packageName ($major.$minor.$rev-$age) unstable; urgency=low
-
- * Automatically generated package
-
- -- $package{maintainer} $debdate
-};
- close FH;
- }
-
- } else {
- `rm -rf ${build}debian`;
- }
-}
-
-BEGIN{
-};
-
-sub mode_etics_packaging {
- my ($fmod, $cmd, $rpmprepare, $debprepare) = @_;
- my ($workspaceDir, $srcPackageName, $srcAge, $topDir);
-
- # old-school packaging by ETICS for EMI-1
- if ($project eq 'emi' and $project_version == 1) { return; }
-
- if ($fmod eq 'gridsite.core') {
- $workspaceDir = '..';
- $srcPackageName = 'gridsite';
- $srcAge = '';
- $topDir = '../';
- } else {
- $workspaceDir = '${workspaceDir}';
- $srcPackageName = '${packageName}';
- $srcAge = '-${age}';
- $topDir = '';
- }
-
- $cmd->{clean} = 'make clean
- rm -rfv ${package.tgzLocation} ${package.SRPMSLocation}';
- $cmd->{default}{packaging} = $rpmprepare;
- $cmd->{default}{packaging} .= "dir=\${workspaceDir}/rpm_build_src_\$\$
- mkdir -p \${package.tgzLocation} \${package.SRPMSLocation} \$dir/{BUILD,RPMS,SOURCES,SRPMS} 2>/dev/null || true
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \${package.tgzLocation}/
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \$dir/SOURCES/
- rpmbuild -bs --nodeps --define \"_topdir \$dir\" $srcPackageName.spec
- cp -v \$dir/SRPMS/*.src.rpm \${package.SRPMSLocation}/
- rm -rf \$dir";
-
- for my $p ('deb5_x86_64_gcc432', 'deb5_ia32_gcc432', 'deb6_x86_64_gcc445', 'deb6_ia32_gcc445') {
- for my $c (keys %{$cmd->{default}}) { $cmd->{$p}{$c} = $cmd->{default}{$c}; }
- $cmd->{$p}{clean} = 'make clean
- rm -rfv ${package.tgzLocation} ${package.SDEBSLocation}';
- $cmd->{$p}{packaging} = $debprepare;
- $cmd->{$p}{packaging} .= "dir=\${workspaceDir}/dpkg_build_src_\$\$
- mkdir -p \${package.tgzLocation} \${package.SDEBSLocation} \$dir 2>/dev/null || true
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \${package.tgzLocation}/
- cp -vf $workspaceDir/$srcPackageName-\${version}${srcAge}.src.tar.gz \$dir/${srcPackageName}_\${version}.orig.tar.gz
- tar xzf \$dir/${srcPackageName}_\${version}.orig.tar.gz -C \$dir
- cp -rf ${topDir}debian/ \$dir/$srcPackageName-\${version}/
- cd \$dir/$srcPackageName-\${version}
- dpkg-buildpackage -S -d -nc
- cd -
- cp -v \$dir/*.tar.gz \$dir/*.dsc \${package.SDEBSLocation}/
- rm -rf \$dir";
- }
-}
-
-sub mode_etics {
- $fmod = shift;
-
- die "$0: --module required with --etics\n" unless $fmod;
-
- my ($subsys,$module) = split /\./,$fmod,2;
- my $full = full "$subsys.$module";
-
- my ($major,$minor,$rev,$age) = get_version $fmod, $full;
-
- # XXX: --with ignored for platform-dependend packages
- my @copts = ();
- my %ge;
- @ge{@{$etics_projects{$project{etics_name}}}} = (1) x ($#{$etics_projects{$project{etics_name}}}+1);
-
- for (@{$need_externs{"$subsys.$module"}}) {
- if ($need_externs_type{"$subsys.$module"}->{$_}=~/B/ and (defined $externs{$_} or defined $jar{$_})) {
- my $eext = $etics_externs{default}{$_} ? $etics_externs{default}{$_} : $_;
- next if ($eext eq '-');
- if (defined $project{etics_locations}{'*'} or defined $project{etics_locations}{$_}) {
- $eext = $project{etics_locations}{$_} if ($project{etics_locations}{$_});
- push @copts,$ge{$_} ? "--with-$_=\${stageDir}" : "--with-$_=\${$eext.location}";
- } else {
- if ($ge{$_} and not defined $externs{$_}{pkg}) {
- push @copts, "--with-$_=\${stageDir}";
- }
- }
- }
- }
-
- for (@{$need_jars{"$subsys.$module"}}) {
- my $eext = $etics_externs{default}{$_} ? $etics_externs{default}{$_} : $_;
-
- push @copts,"--with-$_ \${$eext.location}$jar{$_}" if (defined $project{etics_locations}{'*'} or defined $project{etics_locations}{$_});
- }
-
- my $conf;
- my $conftag;
- my ($confprefix, $nameprefix, $packageName);
-
- $dwpath = "path = \${projectName}/\${moduleName}/\${version}/\${platformName}/\${packageName}-\${version}-\${age}.tar.gz\n";
-
- $confprefix = $project{conf_prefix}{$subsys};
- $nameprefix = $confprefix;
- $nameprefix =~ s/-$//;
- $nameprefix =~ s/-/\./g;
- $packageName = "$project{tag_prefix}{$subsys}$subsys-${module}";
-
- if ($branch) {
- $conf = "$confprefix${subsys}-${module}_$branch";
- $conftag = $branch;
- # forced low age number
- $age = $branch eq 'HEAD' ? '0head' : '0dev';
- push @copts, '--version ${version}-${age}';
- }
- else {
- $conf = "$confprefix$subsys-${module}_R_${major}_${minor}_${rev}_${age}";
-# XXX: gridsite hack
- $conftag = $subsys eq 'gridsite' ? "$project{tag_prefix}{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}" :
- "$project{tag_prefix}{$subsys}$subsys-${module}_R_${major}_${minor}_${rev}_${age}";
-
- # lowering age for older packaging
- if ($project eq 'emi' and $project_version == 1) {
- $age = $age - 1;
- }
- }
-
- # emi1 suffix for older packaging
- if ($project eq 'emi' and $project_version == 1) {
- $age = $age.$project.$project_version;
- $conf = $conf.$project.$project_version;
- }
-
- my $file = $output ? $output : "$conf.ini";
- open C,">$file" or die "$file: $!\n";
-
- my $buildroot = $buildroot{"$subsys.$module"} eq '' ? '#no build.root' : "build.root = " . $buildroot{"$subsys.$module"};
-
- my $confdir = $buildroot{"$subsys.$module"} eq '' ? '.' : '..';
-
- my $cvs_module = full "$subsys.$module";
- my ($package_summary, $package_description) = get_description $cvs_module;
- if ($package_description) {
- $package_description =~ s/\n/\\n/g;
- $package_description = "package.description = $package_description\n";
- }
- if ($package_summary) {
- $package_summary = "package.summary = $package_summary\n";
- }
-
- my %cmd;
- $cmd_vcs{checkout} = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_module 2>/dev/null";
- #$cmd_vcs{checkout} = "((test -d jra1mw/.git && (cd jra1mw; git pull)) || (git clone -q http://scientific.zcu.cz/git/jra1mw.git";
- #$cmd_vcs{checkout} .= " && (cd jra1mw; git checkout -b \${tag} --track origin/\${tag})" unless ($conftag eq /HEAD/);
- #$cmd_vcs{checkout} .= ")) && (test -d \${moduleName} || ln -s jra1mw/$cvs_module \${moduleName})";
- $cmd_vcs{checkout} .= "\n\ttest -f \${packageName}-\${version}-\${age}.src.tar.gz || (ln -s \${moduleName} \${packageName}-\${version}; tar -chf - \${packageName}-\${version} --exclude CVS --exclude .git --exclude .etics | gzip --best > \${packageName}-\${version}-\${age}.src.tar.gz; rm \${packageName}-\${version})";
- $cmd_vcs{tag} = "cvs -d \${vcsroot} tag -R \${tag} ${moduleName}";
-
- $cmd{default}{init} = 'None';
- $cmd{default}{configure} = 'None';
- $cmd{default}{compile} = 'None';
- $cmd{default}{test} = 'None';
- $cmd{default}{install} = 'None';
- $cmd{default}{packaging} = 'None';
- $cmd{default}{clean} = 'make clean';
-
- if (exists $subpackages{$fmod}) {
- $cmd{default}{clean} = 'None';
- $cmd{default}{packaging} = "echo building nothing, $subpackages{$fmod} will build this package";
- $cmd_vcs{checkout} = "mkdir -v \${moduleName} 2>/dev/null || true";
- } elsif ($subsys eq 'gridsite') {
- $cmd_vcs{tag} = 'None';
-
- if ($module eq 'core') {
- my $flags;
-
- if ($project ne 'glite') {
- # don't evaluate pkg-config calls to get them into source package
- $flags = 'RELEASE_VERSION=${age}
- GSOAPDIR=\`pkg-config gsoap --variable=prefix\`
- OPENSSL_GLOBUS_FLAGS=\`pkg-config globus-openssl --cflags\`
- OPENSSL_GLOBUS_LIBS=\`pkg-config globus-openssl --libs\`';
- } else {
- $flags = 'RELEASE_VERSION=${age}
- GSOAPDIR=${gsoap.location}
- OPENSSL_GLOBUS_FLAGS=-I${globus.location}/include/${globus.dbg.nothr.flavor}
- OPENSSL_GLOBUS_LIBS=-L${globus.location}/${libdir}
- HTTPD_FLAGS=-I${httpd-devel.location}/include/httpd -I${httpd-devel.location}/include/apache2 -I${httpd-devel.location}/include/apr-1 -I${httpd-devel.location}/include/apr-1.0 -I${httpd-devel.location}/include/apr-0 -I${httpd-devel.location}/include/pcre';
- }
-
- $cmd{default}{configure} = "cat > Makefile.inc <<EOF
- project = $project
- top_srcdir = ..
- $flags
- EOF";
- $cmd{default}{compile} = "make prefix=\${prefix}$project{local_prefix} libdir=\${libdir}";
- $cmd{default}{install} = "make prefix=\${prefix}$project{local_prefix} libdir=\${libdir} install";
- mode_etics_packaging($fmod, \%cmd,
- "make prefix=\${prefix}$project{local_prefix} rpm-prepare
- cp gridsite.spec ../\n\t",
- "chmod +x \${moduleDir}/src/make-debian-files || true
- make prefix=\${prefix}$project{local_prefix} deb-prepare\n\t"
- );
- }
- elsif ($module eq '1.5-compat') {
- $cmd_vcs{checkout} = "cvs -d \${vcsroot} co -d \${moduleName} ".($conftag eq 'HEAD' ? '-A' : '-r ${tag}')." $cvs_prefix{$subsys}.$subsys.core 2>/dev/null";
- $cmd{default}{init} = 'echo "/sbin/ldconfig" > project/.post
- echo "/sbin/ldconfig" > project/.postun';
- $cmd{default}{configure} = "cat > src/Makefile.inc <<EOF
- project = emi
- libdir = \${libdir}
- MAJOR_VERSION=1
- MINOR_VERSION=1.5
- PATCH_VERSION=1.5.0
- VERSION=\\\$(PATCH_VERSION)
- RELEASE_VERSION=\${age}
- GSOAPDIR=\\`pkg-config gsoap --variable=prefix\\`
- OPENSSL_GLOBUS_FLAGS=\\`pkg-config globus-openssl --cflags\\`
- OPENSSL_GLOBUS_LIBS=\\`pkg-config globus-openssl --libs\\`
- EOF";
- $cmd{default}{compile} = "make -C src prefix=\${prefix}$project{local_prefix}
- rm -fv project/debian.changelog";
- $cmd{default}{install} = "make -C src prefix=\${prefix}$project{local_prefix} install-lib
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.so.1
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.so
- rm -fv \${prefix}$project{local_prefix}/\${libdir}/libgridsite*.a";
- $cmd{default}{packaging} = "None";
- }
- else {
- $cmd{default}{clean} = 'None';
- $cmd{default}{packaging} = "echo building nothing, org.gridsite.core make rpm step will create this";
- $cmd_vcs{checkout} = "mkdir -v \${moduleName} 2>/dev/null || true";
- }
- }
- elsif ($subsys eq 'px' and $module eq 'myproxy-config') {
- $cmd{default}{configure} = "/usr/bin/perl $confdir/configure --root=\${prefix} --prefix= --stage=\${stageDir} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts";
- $cmd{default}{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config";
- }
- else {
- $cmd{default}{configure} = "/usr/bin/perl $confdir/configure $project{flavours} --root=\${prefix} --prefix=$project{local_prefix} --stage=\${stageDir} --sysroot=\${package.prefix} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts";
- $cmd{default}{compile} = 'make';
- $cmd{default}{test} = 'make check';
- $cmd{default}{install} = 'make install';
- if ($subsys eq 'lb' and $module eq 'client') {
- $cmd{default}{compile} = "make rpath=$project{local_prefix}/\${libdir}";
- $cmd{default}{install} = "make install post-install rpath=$project{local_prefix}/\${libdir}";
- }
- mode_etics_packaging($fmod, \%cmd);
- }
-
- 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 = $project{etics_name}.$subsys.$module
-displayName = $conf
-description = $cvs_prefix{$subsys}.$subsys.$module
-projectName = $project{etics_name}
-age = $age
-deploymentType = None
-vcsroot = :pserver:anonymous\@glite.cvs.cern.ch:/cvs/glite
-tag = $conftag
-version = $major.$minor.$rev
-$dwpath
-[Platform-default:VcsCommand]
-displayName = None
-description = None
-tag = $cmd_vcs{tag}
-branch = None
-commit = None
-checkout = $cmd_vcs{checkout}
-
-};
-
- for my $p (keys %cmd) {
- next if $p ne 'default' and exists $project{supported_platforms} and not exists $project{supported_platforms}{$p};
-
- print C qq{[Platform-$p:BuildCommand]
-postpublish = None
-packaging = $cmd{$p}{packaging}
-displayName = None
-description = None
-doc = None
-prepublish = None
-publish = None
-compile = $cmd{$p}{compile}
-init = $cmd{$p}{init}
-install = $cmd{$p}{install}
-clean = $cmd{$p}{clean}
-test = $cmd{$p}{test}
-configure = $cmd{$p}{configure}
-checkstyle = None
-
-};
- }
-
- print C qq{[Platform-default:Property]
-$buildroot
-package.preserve.libtool = false
-$package_description$package_summary$defprops};
-
- for (@{$obsoletes{"$subsys.$module"}}) {
- print C "package.obsoletes = $_\n";
- print C "package.replaces = $_\n";
- }
- for (@{$conflicts{"$subsys.$module"}}) {
- print C "package.conflicts = $_\n";
- }
- for (@{$provides{"$subsys.$module"}}) {
- print C "package.provides = $_\n";
- }
- print C "\n";
-
- for my $pp (keys %{$platform_properties{"$subsys.$module"}}) {
- next if $pp eq 'default';
- next if exists $project{supported_platforms} and not exists $project{supported_platforms}{$pp};
-
- print C "[Platform-$pp:Property]\n$buildroot\n";
-
- for my $p (keys %{$platform_properties{"$subsys.$module"}->{$pp}}) {
- print C $p . ' = ' . $platform_properties{"$subsys.$module"}->{$pp}->{$p} . "\n";
- }
- print C "$package_description$package_summary\n";
- }
-
- for my $platform ('default', keys %{$project{supported_platforms}}) {
- my $used = 0;
- my $output = '';
-
- for (@{$need_externs{"$subsys.$module"}},@{$need_jars{"$subsys.$module"}}) {
- my $eext = $etics_externs{$platform}{$_};
- my $edev = $project{etics_externs_devel}{$platform}{$_};
-
- # for the default platform using package of the same
- # name for runtime dependency
- if (not $eext) {
- if ($platform eq 'default') {
-#print "default runtime $_ on default\n";
- $eext = $_; }
- else {
-#print "no runtime $_ on $platform\n";
- $eext = '-'; }
- }
- if ($eext eq '-' and $edev eq '-') {
-#print "skipping $_ on $platform\n";
- next;
- }
-
- my $proj = 'externals';
- for my $p (keys %etics_projects) {
- for $m (@{$etics_projects{$p}}) {
- $proj = $p if $m eq $_;
- }
- }
-
- my $type = $need_externs_type{"$subsys.$module"}->{$_};
-
- if ($edev) {
- if ($type eq 'B') {
- # no runtime - change to devel pkg
- $eext = $edev;
- } elsif ($type eq 'BR' or $type eq 'RB') {
- # additional devel pkg
- if ($edev ne '-') { $output .= "$proj|$edev = B\n"; }
- }
- }
- if ($eext ne '-') { $output .= "$proj|$eext = $type\n"; }
- }
-
- if ($platform eq 'default') {
- for (@{$deps{"$subsys.$module"}}) {
- my $type = $deps_type{"$subsys.$module"}->{$_};
- if (not $used) {
- $used = 1;
- }
- $output .= "$project{etics_name}|$project{etics_name}.$_ = $type\n";
- }
- }
-
- if ($output) {
- print C qq{
-[Platform-$platform:DynamicDependency]
-$output};
- }
- }
-
- close C;
-
- for $file ("$cvs_module/project/debian.rules", "$cvs_module/project/$packageName.spec") {
- my $lib;
- my $main_module;
- @copts = ();
-
- if ($file =~ /debian\.rules$/) { $lib = 'lib'; }
- else { $lib = '%{_lib}'; }
-
- my $main_module = "$subsys.$module";
- if (exists $subpackages{$main_module}) { $main_module = $subpackages{$main_module}; }
-
- # locations hacks
- if ($file =~ /$packageName\.spec$/) {
- if ($fmod eq 'lb.client-java') {
- push @copts, '';
- push @copts, '--with-axis=/usr/local/axis1.4';
- }
- }
-
- if (-f $file) {
- open DST,">$file.new" or die "$file.new: $!\n";
- open SRC,"<$file" or die "$file: $!\n";
- while (<SRC>) {
- if (/^(\s*).+\/configure\s/) {
- printf DST "%s", "$1";
- printf DST "/usr/bin/perl $confdir/configure $project{flavours} --root=/ --prefix=$project{local_prefix} --libdir=$lib --project=$project --module $main_module@copts\n";
- } else {
- printf DST "%s", "$_";
- }
- }
- close SRC;
- close DST;
-
- `diff -b "$file" "$file.new"`;
- if ($? == 0) {
- print STDERR "($file not changed)\n";
- unlink "$file.new";
- } else {
- print STDERR "Writing $file\n";
- rename "$file", "$file.orig" unless -f "$file.orig";
- rename "$file.new", "$file";
- }
- }
- }
-}
-
-sub gsoap_version {
- local $_;
- my $gsoap_version;
- open S,"$externs{gsoap}{prefix}/bin/soapcpp2 -v 2>&1 |" or die "$externs{gsoap}{prefix}/bin/soapcpp2: $!\n";
-
- while ($_ = <S>) {
- 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;
-}
-
-sub getlibdir {
- if ( -e "/etc/debian_version") { # We are on Debian
- $lib64="lib";
- $lib32="lib32"; }
- else { # Another distribution
- $lib64="lib64";
- $lib32="lib"; }
- $libdir=$lib32;
-
- open INP, "uname -s | "; # Check kernel name
- $kname= <INP>;
- chomp($kname);
- close INP;
-
- if ( $kname eq "Linux") {
- $arch = ("x86_64\npowerpc\nppc64\n");
-
- open INP, "uname -p | "; # Check processor type
- $procname= <INP>;
- chomp($procname);
- close INP;
-
- if ($arch =~/^$procname\n/) {
- return ($lib64); }
-
- open INP, "uname -m | "; # Check machine hardware
- $machname= <INP>;
- chomp($machname);
- close INP;
-
- if ($arch =~/^$machname\n/) {
- return ($lib64); }
-
- # special cases (hyperlink lib64, Debian)
- if (-l "/usr/lib64") {
- $libdir=$lib32; }
-
- # if /usr/lib64 doesn't exist at all (AIX)
- unless ( -e "/usr/lib64" ) {
- $libdir=$lib32; }
- }
-
- if ( $kname eq "SunOS") {
- if (-e "/usr/lib/64") {
- $libdir="lib/64"; }
- }
-
- return $libdir;
-}
-
-sub reshuffle_platforms($$) {
- my ($data, $platforms) = @_;
- my ($platform, %blacklist, $value);
-
- return if not $platforms;
-
- for $platform (keys %$data) {
-#print "plat: $platform: $data->{$platform}\n";
- next if $platform eq 'default';
- for $_ (keys %{$data->{$platform}}) {
-#print " blacklist: $_ = $data->{$platform}{$_}\n";
- $blacklist{$_} = 1;
- }
- }
-
- for $_ (keys %blacklist) {
- $value = $data->{default}{$_} ? $data->{default}{$_} : $_;
- for $platform (keys %$platforms) {
- next if $platform eq 'default';
- if (not defined $data->{$platform}{$_}) {
- $data->{$platform}{$_} = $value;
-#print "added $value to $platform\n"
- }
- }
- $data->{default}{$_} = '-';
-#print "deleted $_ from default\n";
- }
-
- # merge dependencies across the supported platforms
- %blacklist = [];
- for $platform (keys %$platforms) {
- next if $platform eq 'default';
- for $_ (keys %{$data->{$platform}}) {
- $blacklist{$_} = 1;
- }
- }
- for $_ (keys %blacklist) {
- $value = undef;
- $same = 1;
- for $platform (keys %$platforms) {
- if (not $value) { $value = $data->{$platform}{$_}; }
- if (not $data->{$platform}{$_} or $value ne $data->{$platform}{$_}) {
- $same = 0;
- last;
- }
- }
- if ($same and $value) {
-#print "merged dependency $_\n";
- $data->{default}{$_} = $value;
- for $platform (keys %$platforms) {
- delete $data->{$platform}{$_};
- }
- }
- }
-}
-
-sub usage {
- my @ext = keys %externs;
- my @myjars = keys %jar;
-
- print STDERR qq{
-Usage: $0 options
-
-General options (defaults in []):
- --prefix=PREFIX destination directory [./stage]
- --stage=DIR staging directory [./stage]
- --root=DIR installation root (custom relocation root -> sysroot) [./stage]
- --sysroot=DIR system root (custom relocation root -> sysroot) []
- --sysconfdir=DIR system configuration directory [PREFIX/etc]
- --staged=module,module,... what is already in PREFIX (specify without org.glite.)
- --thrflavour=flavour
- --nothrflavour=flavour threaded and non-treaded flavours [gcc64dbgpthr,gcc64dbg]
- --listmodules=subsys list modules of a subsystem
- --listmodules=module list subpackages of a module
- --version=maj.min.rev-age version used instead of reading version.properties
- --branch=branch CVS branch/etics name suffix (HEAD, branch_2_1, ...)
- --libdir=libdir typically [lib,lib64] postfix
- --project=PROJECT build or generate etics for a project (glite/emi1/emi) [emi]
- --debug print more details
-
-Mode of operation:
- --mode=\{checkout|build|etics\} what to do [build]
-
-What to build:
- --module=module build this module only
- --enable-NODE build this "node" (set of modules) only
- --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
- --jobid-tag=tag checkout jobid modules with specific tag
- --canl-tag=tag checkout canl modules with specific tag
-
-Dependencies (summary of what will be used is always printed):
- --with-EXTERNAL=PATH where to look for an external [autodetect]
- --with-JAR=JAR where to look for jars
-
-Available nodes:
- @nodes
-
-Default nodes:
- @default_nodes
-
-Externals (not all for all modules) are:
- @ext
-
-External jars are:
- @myjars
-
-};
-
-}
+++ /dev/null
-#ifndef __EDG_WORKLOAD_LOGGING_COMMON_ESCAPE_H__
-#define __EDG_WORKLOAD_LOGGING_COMMON_ESCAPE_H__
-/*!
- * \file escape.h
- */
-
-#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.
-*/
-
-
-
-/*!
- * \fn char *glite_lbu_EscapeULM(const char *str)
- * \param str a string to escape
- * \return new (allocated) escaped string
- * \brief in given string (ULM) escape all ULM_QM, ULM_BS and ULM_LF by ULM_BS
- */
-
-char *glite_lbu_EscapeULM(const char *);
-
-
-/*!
- * \fn char *glite_lbu_UnescapeULM(const char *str)
- * \param str a string to unescape
- * \return new (allocated) unescaped string
- * \brief in given string (ULM) unescape all escaped ULM_QM, ULM_BS and ULM_LF
- */
-
-char *glite_lbu_UnescapeULM(const char *);
-
-
-/*!
- * \fn char *glite_lbu_EscapeXML(const char *str);
- * \param str a string to escape
- * \return new (allocated) escaped string
- * \brief in given string (XML) escape all unwanted characters
- */
-
-char *glite_lbu_EscapeXML(const char *);
-
-
-/*!
- * \fn char *glite_lbu_UnescapeXML(const char *str)
- * \param str a string to unescape
- * \return new (allocated) unescaped string
- * \brief in given string (XML) unescape all escaped characters
- */
-
-char *glite_lbu_UnescapeXML(const char *);
-
-
-/*!
- * \fn char *glite_lbu_EscapeSQL(const char *str)
- * \param str a string to escape
- * \return new (allocated) escaped string
- * \brief in given string (SQL) escape all unwanted characters
- */
-
-char *glite_lbu_EscapeSQL(const char *);
-
-
-/*!
- * \fn char *glite_lbu_EscapeJSON(const char *str)
- * \param str a string to escape
- * \return new (allocated) escaped string
- * \brief in given string (JSON) escape all unwanted characters
- */
-
-char *glite_lbu_EscapeJSON(const char *in);
-
-#endif /* __EDG_WORKLOAD_LOGGING_COMMON_ESCAPE_H__ */
+++ /dev/null
-/*************************************************************************
- *
- * $Id$
- *
- * Copyright (C) 1998 Bjorn Reese and Daniel Stenberg.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
- * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
- *
- ************************************************************************/
-
-#ifndef TRIO_TRIO_H
-#define TRIO_TRIO_H
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdlib.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* make utility and C++ compiler in Windows NT fails to find this symbol */
-#if defined(WIN32) && !defined(isascii) && !defined(HAVE_IASCII)
-# define isascii ((unsigned)(x) < 0x80)
-#endif
-
-/*
- * Error codes.
- *
- * Remember to add a textual description to trio_strerror.
- */
-enum {
- TRIO_EOF = 1,
- TRIO_EINVAL = 2,
- TRIO_ETOOMANY = 3,
- TRIO_EDBLREF = 4,
- TRIO_EGAP = 5,
- TRIO_ENOMEM = 6,
- TRIO_ERANGE = 7
-};
-
-/* Error macros */
-#define TRIO_ERROR_CODE(x) ((-(x)) & 0x00FF)
-#define TRIO_ERROR_POSITION(x) ((-(x)) >> 8)
-#define TRIO_ERROR_NAME(x) trio_strerror(x)
-
-const char *trio_strerror(int);
-
-/*************************************************************************
- * Print Functions
- */
-
-int trio_printf(const char *format, ...);
-int trio_vprintf(const char *format, va_list args);
-int trio_printfv(const char *format, void **args);
-
-int trio_fprintf(FILE *file, const char *format, ...);
-int trio_vfprintf(FILE *file, const char *format, va_list args);
-int trio_fprintfv(FILE *file, const char *format, void **args);
-
-int trio_dprintf(int fd, const char *format, ...);
-int trio_vdprintf(int fd, const char *format, va_list args);
-int trio_dprintfv(int fd, const char *format, void **args);
-
-/* trio_sprintf(target, format, ...)
- * trio_snprintf(target, maxsize, format, ...)
- *
- * Build 'target' according to 'format' and succesive
- * arguments. This is equal to the sprintf() and
- * snprintf() functions.
- */
-int trio_sprintf(char *buffer, const char *format, ...);
-int trio_vsprintf(char *buffer, const char *format, va_list args);
-int trio_sprintfv(char *buffer, const char *format, void **args);
-
-int trio_snprintf(char *buffer, size_t max, const char *format, ...);
-int trio_vsnprintf(char *buffer, size_t bufferSize, const char *format,
- va_list args);
-int trio_snprintfv(char *buffer, size_t bufferSize, const char *format,
- void **args);
-
-int trio_snprintfcat(char *buffer, size_t max, const char *format, ...);
-int trio_vsnprintfcat(char *buffer, size_t bufferSize, const char *format,
- va_list args);
-
-char *trio_aprintf(const char *format, ...);
-char *trio_vaprintf(const char *format, va_list args);
-
-int trio_asprintf(char **ret, const char *format, ...);
-int trio_vasprintf(char **ret, const char *format, va_list args);
-
-/*************************************************************************
- * Scan Functions
- */
-int trio_scanf(const char *format, ...);
-int trio_vscanf(const char *format, va_list args);
-int trio_scanfv(const char *format, void **args);
-
-int trio_fscanf(FILE *file, const char *format, ...);
-int trio_vfscanf(FILE *file, const char *format, va_list args);
-int trio_fscanfv(FILE *file, const char *format, void **args);
-
-int trio_dscanf(int fd, const char *format, ...);
-int trio_vdscanf(int fd, const char *format, va_list args);
-int trio_dscanfv(int fd, const char *format, void **args);
-
-int trio_sscanf(const char *buffer, const char *format, ...);
-int trio_vsscanf(const char *buffer, const char *format, va_list args);
-int trio_sscanfv(const char *buffer, const char *format, void **args);
-
-/*************************************************************************
- * Renaming
- */
-#ifdef TRIO_REPLACE_STDIO
-/* Replace the <stdio.h> functions */
-#ifndef HAVE_PRINTF
-# define printf trio_printf
-#endif
-#ifndef HAVE_VPRINTF
-# define vprintf trio_vprintf
-#endif
-#ifndef HAVE_FPRINTF
-# define fprintf trio_fprintf
-#endif
-#ifndef HAVE_VFPRINTF
-# define vfprintf trio_vfprintf
-#endif
-#ifndef HAVE_SPRINTF
-# define sprintf trio_sprintf
-#endif
-#ifndef HAVE_VSPRINTF
-# define vsprintf trio_vsprintf
-#endif
-#ifndef HAVE_SNPRINTF
-# define snprintf trio_snprintf
-#endif
-#ifndef HAVE_VSNPRINTF
-# define vsnprintf trio_vsnprintf
-#endif
-#ifndef HAVE_SCANF
-# define scanf trio_scanf
-#endif
-#ifndef HAVE_VSCANF
-# define vscanf trio_vscanf
-#endif
-#ifndef HAVE_FSCANF
-# define fscanf trio_fscanf
-#endif
-#ifndef HAVE_VFSCANF
-# define vfscanf trio_vfscanf
-#endif
-#ifndef HAVE_SSCANF
-# define sscanf trio_sscanf
-#endif
-#ifndef HAVE_VSSCANF
-# define vsscanf trio_vsscanf
-#endif
-/* These aren't stdio functions, but we make them look similar */
-#define dprintf trio_dprintf
-#define vdprintf trio_vdprintf
-#define aprintf trio_aprintf
-#define vaprintf trio_vaprintf
-#define asprintf trio_asprintf
-#define vasprintf trio_vasprintf
-#define dscanf trio_dscanf
-#define vdscanf trio_vdscanf
-#endif
-
-/* strio compatible names */
-#define StrScan trio_sscanf
-#define StrFormat trio_sprintf
-#define StrFormatMax trio_snprintf
-#define StrFormatAlloc trio_aprintf
-#define StrFormatAppendMax trio_snprintfcat
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif /* TRIO_TRIO_H */
+++ /dev/null
-/sbin/ldconfig
+++ /dev/null
-/sbin/ldconfig
+++ /dev/null
-1.0.0-2
-- initial version
-
-1.0.0-3
-- depends on cppunit
-
-1.0.0-4
-- configure script update (globus flavors added to configure call)
-
-1.0.0-5
-- configure script update
-
-1.0.0-6
-- install libraries into $libdir
-
-1.0.1-1
-- Fixed build with newer gcc versions
-
-1.0.2-1
-- Fixed syntax error
-
-2.0.0-1
-- Fixed library version numbering
-
-2.0.1-1
-- Fixed target 'clean' in the Makefile
-
-2.0.2-1
-- Fixed format of the package description file
-- Fixed target 'clean' in the Makefile
-
-2.0.2-2
-- Module rebuilt
-
-2.0.3-1
-- Makefile adopts compilation and linking flags from the environment.
-
-2.0.3-2
-- Module rebuilt
-
-2.0.3-3
-- Module rebuilt
-
-2.0.3-4
-- Module rebuilt
-
-2.1.0-1
-- Fixes for parallel release in EMI & gLite
-
-2.1.0-2
-- Module rebuilt
-
-2.1.1-1
-- Root directory option (ETICS performs own files relocation)
-- Prefix option as prefix inside stage
-- Sysconfdir option (for /etc vs /usr)
-- DESTDIR in makefiles
-
-2.1.2-1
-- Relocatable build directory.
-
-2.1.2-2
-- Module rebuilt
-
-2.1.2-3
-- Module rebuilt
-
-2.1.2-4
-- Module rebuilt
-
-2.1.2-5
-- Module rebuilt
-
-2.1.2-6
-- Module rebuilt
-
-2.1.2-7
-- Module rebuilt
-
-2.1.2-8
-- Module rebuilt
-
-2.2.0-1
-- Preparation for a new multiplatform release
-
-2.2.1-1
-- Portability fixes
-- JSON-specific fixes
-
-2.2.2-1
-- Packaging improvements (rpmlint and lintian checks)
-- License string as recognized by rpmlint and packaging guidelines
-
-2.2.2-2
-- Module rebuilt
-
-2.2.2-3
-- Module rebuilt
-
+++ /dev/null
-Source: glite-lbjp-common-trio
-Priority: extra
-Maintainer: @MAINTAINER@
-Uploaders: @UPLOADERS@
-Build-Depends: debhelper (>= 7.0.50~), chrpath, libcppunit-dev, libtool
-Standards-Version: 3.9.1
-Section: libs
-Homepage: @URL@
-DM-Upload-Allowed: yes
-@DEBIAN_VCS@
-
-Package: libglite-lbu-trio2
-Section: libs
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: @SUMMARY@
-@DEBIAN_DESCRIPTION@
-
-Package: libglite-lbjp-common-trio-dev
-Section: libdevel
-Architecture: any
-Provides: glite-lbjp-common-trio
-Depends: libglite-lbu-trio2 (= ${binary:Version}), ${misc:Depends}
-Description: Development files for gLite L&B/JP common trio library
- This package contains development libraries and header files for gLite L&B/JP
- common trio library.
-
-Package: glite-lbjp-common-trio-dbg
-Section: debug
-Architecture: any
-Priority: extra
-Depends: libglite-lbu-trio2 (= ${binary:Version}), ${misc:Depends}
-Description: gLite L&B/JP common trio library debugging symbols
- This package contains debugging symbols for gLite L&B/JP common trio library.
+++ /dev/null
-This work was packaged for Debian by:
-
- @MAINTAINER@ on Thu, 08 Dec 2011 00:46:07 +0100
-
-It was downloaded from:
-
- @URL@
-
-Upstream Author(s):
-
- @MAINTAINER@
-
-Copyright:
-
- <Copyright (C) 2004-2011 Members of the EGEE Collaboration>
-
-License:
-
- 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.
-
-On Debian systems, the complete text of the Apache version 2.0 license
-can be found in "/usr/share/common-licenses/Apache-2.0".
-
-The Debian packaging is:
-
- Copyright (C) 2004-2011 Members of the EGEE Collaboration
-
-and is licensed under the Apache License, Version 2.0.
+++ /dev/null
-usr/include/glite/lbu
-usr/lib
+++ /dev/null
-usr/include/glite/lbu/*.h
-usr/lib/lib*.so
+++ /dev/null
-usr/lib/lib*.so.*
+++ /dev/null
-#!/usr/bin/make -f
-# -*- makefile -*-
-
--include /usr/share/dpkg/buildflags.mk
-
-# Uncomment this to turn on verbose mode.
-export DH_VERBOSE=1
-
-configure: configure-stamp
-configure-stamp:
- dh_testdir
- /usr/bin/perl ./configure --thrflavour= --nothrflavour= --root=/ --prefix=/usr --libdir=lib --project=emi --module lbjp-common.trio
- touch $@
-
-build: build-arch build-indep
-
-build-arch build-indep: build-stamp
-
-build-stamp: configure-stamp
- dh_testdir
- CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE)
- CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) check
- touch $@
-
-clean: configure-stamp
- dh_testdir
- dh_testroot
- rm -f configure-stamp build-stamp
- $(MAKE) clean
- rm -f Makefile.inc config.status
- dh_clean
-
-install: build-stamp
- dh_testdir
- dh_testroot
- dh_prep
- dh_installdirs
- $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
- rm -rvf $(CURDIR)/debian/tmp/usr/share
- rm -vf $(CURDIR)/debian/tmp/usr/lib/*.la
- rm -vf $(CURDIR)/debian/tmp/usr/lib/*.a
- find $(CURDIR)/debian/tmp -name '*' -print | xargs -I {} -i bash -c "chrpath -d {} > /dev/null 2>&1" || echo 'Stripped RPATH'
-
-binary-indep:
-
-binary-arch: install
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_installexamples
- dh_installman
- dh_installlogrotate
- dh_installcron
- dh_install --fail-missing
- dh_link
- dh_strip --dbg-package=glite-lbjp-common-trio-dbg
- dh_compress
- dh_fixperms
- dh_makeshlibs
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-arch binary-indep
+++ /dev/null
-Summary: @SUMMARY@
-Name: glite-lbjp-common-trio
-Version: @MAJOR@.@MINOR@.@REVISION@
-Release: @AGE@%{?dist}
-Url: @URL@
-License: ASL 2.0
-Vendor: EMI
-Group: System Environment/Libraries
-BuildRequires: cppunit-devel
-BuildRequires: chrpath
-BuildRequires: libtool
-BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
-AutoReqProv: yes
-Source: http://eticssoft.web.cern.ch/eticssoft/repository/emi/emi.lbjp-common.trio/%{version}/src/%{name}-@VERSION@.src.tar.gz
-
-
-%description
-@DESCRIPTION@
-
-
-%package devel
-Summary: Development files for gLite L&B/JP common trio library
-Group: Development/Libraries
-Requires: %{name}%{?_isa} = %{version}-%{release}
-
-
-%description devel
-This package contains development libraries and header files for gLite L&B/JP
-common trio library.
-
-
-%prep
-%setup -q
-
-
-%build
-/usr/bin/perl ./configure --thrflavour= --nothrflavour= --root=/ --prefix=/usr --libdir=%{_lib} --project=emi --module lbjp-common.trio
-make
-
-
-%check
-make check
-
-
-%install
-rm -rf $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
-find $RPM_BUILD_ROOT -name '*.la' -exec rm -rf {} \;
-find $RPM_BUILD_ROOT -name '*.a' -exec rm -rf {} \;
-find $RPM_BUILD_ROOT -name '*' -print | xargs -I {} -i bash -c "chrpath -d {} > /dev/null 2>&1" || echo 'Stripped RPATH'
-
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
-%post -p /sbin/ldconfig
-
-
-%postun -p /sbin/ldconfig
-
-
-%files
-%defattr(-,root,root)
-%dir /usr/share/doc/%{name}-%{version}
-%doc /usr/share/doc/%{name}-%{version}/LICENSE
-/usr/%{_lib}/libglite_lbu_trio.so.@MAJOR@.@MINOR@.@REVISION@
-/usr/%{_lib}/libglite_lbu_trio.so.@MAJOR@
-
-
-%files devel
-%defattr(-,root,root)
-%dir /usr/include/glite
-%dir /usr/include/glite/lbu
-/usr/include/glite/lbu/escape.h
-/usr/include/glite/lbu/trio.h
-/usr/%{_lib}/libglite_lbu_trio.so
-
-
-%changelog
-* @SPEC_DATE@ @MAINTAINER@ - @MAJOR@.@MINOR@.@REVISION@-@AGE@%{?dist}
-- automatically generated package
+++ /dev/null
-Standalone extended implementation of printf and scanf. Provides specialized formating options used by LB and JP.
+++ /dev/null
-Standalone extended implementation of printf and scanf
+++ /dev/null
-# : /cvs/jra1mw/org.glite.lbjp-common.trio/project/version.properties,v 1.2 2009/01/21 10:44:34 zsustr Exp $
-module.version=2.2.2
-module.age=3
+++ /dev/null
-#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 <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-
-#include "escape.h"
-
-#define ULM_QM '"'
-#define ULM_BS '\\'
-#define ULM_LF '\n'
-
-/*
- *----------------------------------------------------------------------
- *
- * \fn char *glite_lbu_EscapeULM(const char *str)
- * \param str a string to escape
- * \return new (allocated) escaped string (is is empty "" if str is NULL)
- * \brief in given string escape all ULM_QM, ULM_BS and ULM_LF by ULM_BS
- *
- * Calls: malloc, strlen
- *
- * Algorithm: array lookup
- * - the new string will be allocated
- *
- *----------------------------------------------------------------------
- */
-
-char *glite_lbu_EscapeULM(const char *str)
-{
-unsigned int i,j;
-size_t size;
-char *ret;
-
-if (str == NULL) return strdup("");
-if ((size = strlen(str)) == 0) return strdup("");
-
-ret = (char*) malloc(1+2*size*sizeof(char));
-
-j = 0;
-for (i=0; i<size; i++) {
- if ((str[i] != ULM_BS) && (str[i] != ULM_QM) && (str[i] != ULM_LF)) {
- ret[j] = str[i];
- j++;
- }
- else {
- ret[j] = ULM_BS;
- if (str[i] == ULM_LF) {
- ret[j+1] = 'n';
- }
- else {
- ret[j+1] = str[i];
- }
- j += 2;
- }
-} /* for */
-
-ret[j] = 0;
-
-return ret;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * \fn char *glite_lbu_UnescapeULM(const char *str)
- * \param str a string to unescape
- * \return new (allocated) unescaped string or NULL (if str NULL or empty)
- * \brief in given string unescape all escaped ULM_QM, ULM_BS and ULM_LF
- *
- * Calls: malloc, strlen
- *
- * Algorithm: array lookup
- * - the new string will be allocated
- *
- *----------------------------------------------------------------------
- */
-
-char *glite_lbu_UnescapeULM(const char *str)
-{
-unsigned int i,j;
-size_t size;
-char *ret;
-
-if (str == NULL) return NULL;
-
-size = strlen(str);
-if (size == 0) return NULL;
-
-ret = (char*) malloc(1+size*sizeof(char));
-
-/*
-j = 0;
-for (i=0; i<size; i++) {
- if ( (str[i] != ULM_BS) ||
- ((str[i] == ULM_BS) && ((str[i+1] != ULM_BS) && (str[i+1] != ULM_QM) && (str[i+1] != 'n'))) )
- {
- if (str[i] == ULM_LF) { ret[j] = 'n'; }
- else { ret[j] = str[i]; }
- j++;
- }
-}
-*/
-for (i=j=0; i<size; i++,j++)
- if (str[i] == ULM_BS) switch(str[++i]) {
- case 'n': ret[j] = ULM_LF; break;
- default: ret[j] = str[i]; break;
- } else { ret[j] = str[i]; }
-
-ret[j] = '\0';
-
-return ret;
-}
-
-static const struct {
- const char c,*e;
-} xml_etab[] = {
- { '<',"lt" },
- { '>',"gt" },
- { '&',"amp" },
- { '"',"quot" },
- { '\'',"apos" },
- { 0, NULL }
-};
-
-#define XML_ESCAPE_SET "<>&\"'"
-
-char *glite_lbu_EscapeXML(const char *in)
-{
- const char* tmp_in;
- char *out;
- int cnt,i,j,k;
-
- if (!in) return NULL;
-
- for (cnt = 0, tmp_in = in; *tmp_in != '\0'; ++tmp_in) {
- if (strchr(XML_ESCAPE_SET, *tmp_in) ||
- (*tmp_in & 0x7f) < 0x20 /* control character */ ||
- (*tmp_in == '%')) cnt++;
- }
-
- out = malloc(strlen(in)+1+cnt*5);
-
- for (i=j=0; in[i]; i++) {
- for (k=0; xml_etab[k].c && xml_etab[k].c != in[i]; k++);
- if (xml_etab[k].c) {
- int l;
-
- out[j++] = '&';
- memcpy(out+j,xml_etab[k].e,l=strlen(xml_etab[k].e));
- j += l;
- out[j++] = ';';
- } else if ((in[i] & 0x7f) < 0x20 || in[i] == '%') {
- sprintf(out+j, "%%%02x", (unsigned char)in[i]);
- j+=3;
- } else {
- out[j++] = in[i];
- }
- }
- out[j] = 0;
- return out;
-}
-
-char *glite_lbu_UnescapeXML(const char *in)
-{
- char *out;
- int i,j,k;
- char xtmp[3];
- unsigned char origchar;
-
- if (!in) return NULL;
- out = malloc(strlen(in)+1);
-
- for (i=j=0; in[i]; j++) if (in[i] == '&') {
- char *s = strchr(in+i,';');
- if (s) {
- int l = s-in-i+1;
- for (k=0; xml_etab[k].c && strncasecmp(in+i+1,xml_etab[k].e,l-2); k++);
- if (xml_etab[k].c) {
- out[j] = xml_etab[k].c;
- i += l;
- } else out[j] = in[i++];
- } else out[j] = in[i++];
- } else if (in[i] == '%') {
- if (isxdigit(xtmp[0]=in[i+1]) && isxdigit(xtmp[1]=in[i+2])) {
- xtmp[2] = '\0';
- origchar = (unsigned char) strtol(xtmp, NULL, 16);
- if ((origchar & 0x7f) < 0x20 || origchar == '%') {
- out[j] = origchar;
- i += 3;
- } else out[j] = in[i++];
- } else out[j] = in[i++];
- } else {
- out[j] = in[i++];
- }
- out[j] = 0;
- return out;
-}
-
-char *glite_lbu_EscapeSQL(const char *in)
-{
- const char* tmp_in;
- char *out = NULL;
- int i,j,cnt;
-
- if (!in) return NULL;
-
- for (cnt = 0, tmp_in = in; (tmp_in = strchr(tmp_in,'\'')) != NULL; ++tmp_in) {
- ++cnt;
- }
- for (tmp_in = in; (tmp_in = strchr(tmp_in,'\\')) != NULL; ++tmp_in) {
- ++cnt;
- }
-
- out = malloc(strlen(in)+1+cnt);
-
- for (i=j=0; in[i]; i++) {
- if (in[i] == '\\') out[j++] = '\\';
- if (in[i] == '\'') out[j++] = '\'';
- out[j++] = in[i];
- }
- out[j] = 0;
-
- return out;
-}
-
-char *glite_lbu_EscapeJSON(const char *in) {
- const char * tmp_in;
- char *out = NULL;
- int i,j,cnt;
-
- if (!in) return NULL;
-
- for (cnt = 0, tmp_in = in; *tmp_in; tmp_in++) {
- switch (*tmp_in) {
- case '"':
- case '\\':
- case '/':
- case '\b':
- case '\f':
- case '\n':
- case '\r':
- case '\t':
- cnt++;
- break;
- default:
- if ((unsigned char)*tmp_in < 0x20) cnt += 6;
- break;
- }
- }
-
- out = malloc(strlen(in)+1+cnt);
-
- for (i=j=0; in[i]; i++) {
- switch (in[i]) {
- case '"':
- case '\\':
- case '/':
- out[j++] = '\\';
- out[j++] = in[i];
- break;
- case '\b':
- out[j++] = '\\';
- out[j++] = 'b';
- break;
- case '\f':
- out[j++] = '\\';
- out[j++] = 'f';
- break;
- case '\n':
- out[j++] = '\\';
- out[j++] = 'n';
- break;
- case '\r':
- out[j++] = '\\';
- out[j++] = 'r';
- break;
- case '\t':
- out[j++] = '\\';
- out[j++] = 't';
- break;
- default:
- if ((unsigned char)in[i] < 0x20) {
- snprintf(out + j, 7, "\\u%04x", in[i]);
- j += 6;
- } else
- out[j++] = in[i];
- break;
- }
- }
- out[j] = 0;
-
- return out;
-}
+++ /dev/null
-/*************************************************************************
- *
- * $Id$
- *
- * Copyright (C) 1998 Bjorn Reese and Daniel Stenberg.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
- * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
- *
- ************************************************************************/
-
-/*
- * TODO
- * - StrToLongDouble
- */
-
-static const char rcsid[] = "@(#)$Id$";
-
-#if defined(unix) || defined(__xlC__) || defined(__QNX__)
-# define PLATFORM_UNIX
-#elif defined(WIN32) || defined(_WIN32)
-# define PLATFORM_WIN32
-#elif defined(AMIGA) && defined(__GNUC__)
-# define PLATFORM_UNIX
-#endif
-
-#if defined(__STDC__) && (__STDC_VERSION__ >= 199901L)
-# define TRIO_C99
-#endif
-
-#include "strio.h"
-#include <string.h>
-#include <locale.h>
-#include <ctype.h>
-#include <stdarg.h>
-#include <time.h>
-#include <math.h>
-#ifndef DEBUG
-# define NDEBUG
-#endif
-#include <assert.h>
-
-#ifndef NULL
-# define NULL 0
-#endif
-#define NIL ((char)0)
-#ifndef FALSE
-# define FALSE (1 == 0)
-# define TRUE (! FALSE)
-#endif
-
-#define VALID(x) (NULL != (x))
-#define INVALID(x) (NULL == (x))
-
-#if defined(PLATFORM_UNIX)
-# define USE_STRCASECMP
-# define USE_STRNCASECMP
-# define USE_STRERROR
-# if defined(__QNX__)
-# define strcasecmp(x,y) stricmp(x,y)
-# define strncasecmp(x,y,n) strnicmp(x,y,n)
-# endif
-#elif defined(PLATFORM_WIN32)
-# define USE_STRCASECMP
-# define strcasecmp(x,y) strcmpi(x,y)
-#endif
-
-/*************************************************************************
- * StrAppendMax
- */
-char *StrAppendMax(char *target, size_t max, const char *source)
-{
- assert(VALID(target));
- assert(VALID(source));
- assert(max > 0);
-
- max -= StrLength(target) + 1;
- return (max > 0) ? strncat(target, source, max) : target;
-}
-
-/*************************************************************************
- * StrCopyMax
- */
-char *StrCopyMax(char *target, size_t max, const char *source)
-{
- assert(VALID(target));
- assert(VALID(source));
- assert(max > 0); /* Includes != 0 */
-
- target = strncpy(target, source, max - 1);
- target[max - 1] = (char)0;
- return target;
-}
-
-/*************************************************************************
- * StrDuplicate
- */
-char *StrDuplicate(const char *source)
-{
- char *target;
-
- assert(VALID(source));
-
- target = StrAlloc(StrLength(source) + 1);
- if (target)
- {
- StrCopy(target, source);
- }
- return target;
-}
-
-/*************************************************************************
- * StrDuplicateMax
- */
-char *StrDuplicateMax(const char *source, size_t max)
-{
- char *target;
- size_t len;
-
- assert(VALID(source));
- assert(max > 0);
-
- /* Make room for string plus a terminating zero */
- len = StrLength(source) + 1;
- if (len > max)
- {
- len = max;
- }
- target = StrAlloc(len);
- if (target)
- {
- StrCopyMax(target, len, source);
- }
- return target;
-}
-
-/*************************************************************************
- * StrEqual
- */
-int StrEqual(const char *first, const char *second)
-{
- assert(VALID(first));
- assert(VALID(second));
-
- if (VALID(first) && VALID(second))
- {
-#if defined(USE_STRCASECMP)
- return (0 == strcasecmp(first, second));
-#else
- while ((*first != NIL) && (*second != NIL))
- {
- if (toupper(*first) != toupper(*second))
- {
- break;
- }
- first++;
- second++;
- }
- return ((*first == NIL) && (*second == NIL));
-#endif
- }
- return FALSE;
-}
-
-/*************************************************************************
- * StrEqualCase
- */
-int StrEqualCase(const char *first, const char *second)
-{
- assert(VALID(first));
- assert(VALID(second));
-
- if (VALID(first) && VALID(second))
- {
- return (0 == strcmp(first, second));
- }
- return FALSE;
-}
-
-/*************************************************************************
- * StrEqualCaseMax
- */
-int StrEqualCaseMax(const char *first, size_t max, const char *second)
-{
- assert(VALID(first));
- assert(VALID(second));
-
- if (VALID(first) && VALID(second))
- {
- return (0 == strncmp(first, second, max));
- }
- return FALSE;
-}
-
-/*************************************************************************
- * StrEqualLocale
- */
-int StrEqualLocale(const char *first, const char *second)
-{
- assert(VALID(first));
- assert(VALID(second));
-
-#if defined(LC_COLLATE)
- return (strcoll(first, second) == 0);
-#else
- return StrEqual(first, second);
-#endif
-}
-
-/*************************************************************************
- * StrEqualMax
- */
-int StrEqualMax(const char *first, size_t max, const char *second)
-{
- assert(VALID(first));
- assert(VALID(second));
-
- if (VALID(first) && VALID(second))
- {
-#if defined(USE_STRNCASECMP)
- return (0 == strncasecmp(first, second, max));
-#else
- /* Not adequately tested yet */
- size_t cnt = 0;
- while ((*first != NIL) && (*second != NIL) && (cnt <= max))
- {
- if (toupper(*first) != toupper(*second))
- {
- break;
- }
- first++;
- second++;
- cnt++;
- }
- return ((cnt == max) || ((*first == NIL) && (*second == NIL)));
-#endif
- }
- return FALSE;
-}
-
-/*************************************************************************
- * StrError
- */
-const char *StrError(int errorNumber)
-{
-#if defined(USE_STRERROR)
- return strerror(errorNumber);
-#else
- return "unknown";
-#endif
-}
-
-/*************************************************************************
- * StrFormatDate
- */
-size_t StrFormatDateMax(char *target,
- size_t max,
- const char *format,
- const struct tm *datetime)
-{
- assert(VALID(target));
- assert(VALID(format));
- assert(VALID(datetime));
- assert(max > 0);
-
- return strftime(target, max, format, datetime);
-}
-
-/*************************************************************************
- * StrHash
- */
-unsigned long StrHash(const char *string, int type)
-{
- unsigned long value = 0L;
- char ch;
-
- assert(VALID(string));
-
- switch (type)
- {
- case STRIO_HASH_PLAIN:
- while ( (ch = *string++) != NIL )
- {
- value *= 31;
- value += (unsigned long)ch;
- }
- break;
- default:
- assert(FALSE);
- break;
- }
- return value;
-}
-
-/*************************************************************************
- * StrMatch
- */
-int StrMatch(char *string, char *pattern)
-{
- assert(VALID(string));
- assert(VALID(pattern));
-
- for (; ('*' != *pattern); ++pattern, ++string)
- {
- if (NIL == *string)
- {
- return (NIL == *pattern);
- }
- if ((toupper((int)*string) != toupper((int)*pattern))
- && ('?' != *pattern))
- {
- return FALSE;
- }
- }
- /* two-line patch to prevent *too* much recursiveness: */
- while ('*' == pattern[1])
- pattern++;
-
- do
- {
- if ( StrMatch(string, &pattern[1]) )
- {
- return TRUE;
- }
- }
- while (*string++);
-
- return FALSE;
-}
-
-/*************************************************************************
- * StrMatchCase
- */
-int StrMatchCase(char *string, char *pattern)
-{
- assert(VALID(string));
- assert(VALID(pattern));
-
- for (; ('*' != *pattern); ++pattern, ++string)
- {
- if (NIL == *string)
- {
- return (NIL == *pattern);
- }
- if ((*string != *pattern)
- && ('?' != *pattern))
- {
- return FALSE;
- }
- }
- /* two-line patch to prevent *too* much recursiveness: */
- while ('*' == pattern[1])
- pattern++;
-
- do
- {
- if ( StrMatchCase(string, &pattern[1]) )
- {
- return TRUE;
- }
- }
- while (*string++);
-
- return FALSE;
-}
-
-/*************************************************************************
- * StrSpanFunction
- *
- * Untested
- */
-size_t StrSpanFunction(char *source, int (*Function)(int))
-{
- size_t count = 0;
-
- assert(VALID(source));
- assert(VALID(Function));
-
- while (*source != NIL)
- {
- if (Function(*source))
- break; /* while */
- source++;
- count++;
- }
- return count;
-}
-
-/*************************************************************************
- * StrSubstringMax
- */
-char *StrSubstringMax(const char *string, size_t max, const char *find)
-{
- size_t count;
- size_t size;
- char *result = NULL;
-
- assert(VALID(string));
- assert(VALID(find));
-
- size = StrLength(find);
- if (size <= max)
- {
- for (count = 0; count <= max - size; count++)
- {
- if (StrEqualMax(find, size, &string[count]))
- {
- result = (char *)&string[count];
- break;
- }
- }
- }
- return result;
-}
-
-/*************************************************************************
- * StrToDouble
- *
- * double ::= [ <sign> ]
- * ( <number> |
- * <number> <decimal_point> <number> |
- * <decimal_point> <number> )
- * [ <exponential> [ <sign> ] <number> ]
- * number ::= 1*( <digit> )
- * digit ::= ( '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' )
- * exponential ::= ( 'e' | 'E' )
- * sign ::= ( '-' | '+' )
- * decimal_point ::= '.'
- */
-double StrToDouble(const char *source, const char **endp)
-{
-#if defined(TRIO_C99)
- return strtod(source, endp);
-#else
- /* Preliminary code */
- int isNegative = FALSE;
- int isExponentNegative = FALSE;
- unsigned long integer = 0;
- unsigned long fraction = 0;
- unsigned long fracdiv = 1;
- unsigned long exponent = 0;
- double value = 0.0;
-
- /* First try hex-floats */
- if ((source[0] == '0') && ((source[1] == 'x') || (source[1] == 'X')))
- {
- source += 2;
- while (isxdigit((int)*source))
- {
- integer *= 16;
- integer += (isdigit((int)*source)
- ? (*source - '0')
- : 10 + (toupper((int)*source) - 'A'));
- source++;
- }
- if (*source == '.')
- {
- source++;
- while (isxdigit((int)*source))
- {
- fraction *= 16;
- fraction += (isdigit((int)*source)
- ? (*source - '0')
- : 10 + (toupper((int)*source) - 'A'));
- fracdiv *= 16;
- source++;
- }
- if ((*source == 'p') || (*source == 'P'))
- {
- source++;
- if ((*source == '+') || (*source == '-'))
- {
- isExponentNegative = (*source == '-');
- source++;
- }
- while (isdigit((int)*source))
- {
- exponent *= 10;
- exponent += (*source - '0');
- source++;
- }
- }
- }
- }
- else /* Then try normal decimal floats */
- {
- isNegative = (*source == '-');
- /* Skip sign */
- if ((*source == '+') || (*source == '-'))
- source++;
-
- /* Integer part */
- while (isdigit((int)*source))
- {
- integer *= 10;
- integer += (*source - '0');
- source++;
- }
-
- if (*source == '.')
- {
- source++; /* skip decimal point */
- while (isdigit((int)*source))
- {
- fraction *= 10;
- fraction += (*source - '0');
- fracdiv *= 10;
- source++;
- }
- }
- if ((*source == 'e') || (*source == 'E'))
- {
- source++; /* Skip exponential indicator */
- isExponentNegative = (*source == '-');
- if ((*source == '+') || (*source == '-'))
- source++;
- while (isdigit((int)*source))
- {
- exponent *= 10;
- exponent += (*source - '0');
- source++;
- }
- }
- }
-
- value = (double)integer;
- if (fraction != 0)
- {
- value += (double)fraction / (double)fracdiv;
- }
- if (exponent != 0)
- {
- if (isExponentNegative)
- value /= pow((double)10, (double)exponent);
- else
- value *= pow((double)10, (double)exponent);
- }
- if (isNegative)
- value = -value;
-
- if (endp)
- *endp = source;
- return value;
-#endif
-}
-
-/*************************************************************************
- * StrToFloat
- */
-float StrToFloat(const char *source, const char **endp)
-{
-#if defined(TRIO_C99)
- return strtof(source, endp);
-#else
- return (float)StrToDouble(source, endp);
-#endif
-}
-
-/*************************************************************************
- * StrToUpper
- */
-int StrToUpper(char *target)
-{
- int i = 0;
-
- assert(VALID(target));
-
- while (NIL != *target)
- {
- *target = toupper((int)*target);
- target++;
- i++;
- }
- return i;
-}
+++ /dev/null
-/*************************************************************************
- *
- * $Id$
- *
- * Copyright (C) 1998 Bjorn Reese and Daniel Stenberg.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
- * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
- *
- ************************************************************************/
-
-#ifndef TRIO_STRIO_H
-#define TRIO_STRIO_H
-
-#if !(defined(DEBUG) || defined(NDEBUG))
-# define NDEBUG
-#endif
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-#ifndef STRIO_MALLOC
-# define STRIO_MALLOC(n) malloc(n)
-#endif
-#ifndef STRIO_FREE
-# define STRIO_FREE(x) free(x)
-#endif
-
-/*
- * StrAppend(target, source)
- * StrAppendMax(target, maxsize, source)
- *
- * Append 'source' to 'target'
- *
- * target = StrAlloc(size)
- *
- * Allocate a new string
- *
- * StrContains(target, substring)
- *
- * Find out if the string 'substring' is
- * contained in the string 'target'
- *
- * StrCopy(target, source)
- * StrCopyMax(target, maxsize, source)
- *
- * Copy 'source' to 'target'
- *
- * target = StrDuplicate(source)
- * target = StrDuplicateMax(source, maxsize)
- *
- * Allocate and copy 'source' to 'target'
- *
- * StrEqual(first, second)
- * StrEqualMax(first, maxsize, second)
- *
- * Compare if 'first' is equal to 'second'.
- * Case-independent.
- *
- * StrEqualCase(first, second)
- * StrEqualCaseMax(first, maxsize, second)
- *
- * Compare if 'first' is equal to 'second'
- * Case-dependent. Please note that the use of the
- * word 'case' has the opposite meaning as that of
- * strcasecmp().
- *
- * StrFormat(target, format, ...)
- * StrFormatMax(target, maxsize, format, ...)
- *
- * Build 'target' according to 'format' and succesive
- * arguments. This is equal to the sprintf() and
- * snprintf() functions.
- *
- * StrFormatDate(target, format, ...)
- *
- * StrFree(target)
- *
- * De-allocates a string
- *
- * StrHash(string, type)
- *
- * Calculates the hash value of 'string' based on the
- * 'type'.
- *
- * StrIndex(target, character)
- * StrIndexLast(target, character)
- *
- * Find the first/last occurrence of 'character' in
- * 'target'
- *
- * StrLength(target)
- *
- * Return the length of 'target'
- *
- * StrMatch(string, pattern)
- * StrMatchCase(string, pattern)
- *
- * Find 'pattern' within 'string'. 'pattern' may contain
- * wildcards such as * (asterics) and ? (question mark)
- * which matches zero or more characters and exactly
- * on character respectively
- *
- * StrScan(source, format, ...)
- *
- * Equal to sscanf()
- *
- * StrSubstring(target, substring)
- *
- * Find the first occurrence of the string 'substring'
- * within the string 'target'
- *
- * StrTokenize(target, list)
- *
- * Split 'target' into the first token delimited by
- * one of the characters in 'list'. If 'target' is
- * NULL then next token will be returned.
- *
- * StrToUpper(target)
- *
- * Convert all lower case characters in 'target' into
- * upper case characters.
- */
-
-enum {
- STRIO_HASH_NONE = 0,
- STRIO_HASH_PLAIN,
- STRIO_HASH_TWOSIGNED
-};
-
-#if !defined(DEBUG) || defined(__DECC)
-#define StrAlloc(n) (char *)STRIO_MALLOC(n)
-#define StrAppend(x,y) strcat((x), (y))
-#define StrContains(x,y) (0 != strstr((x), (y)))
-#define StrCopy(x,y) strcpy((x), (y))
-#define StrIndex(x,y) strchr((x), (y))
-#define StrIndexLast(x,y) strrchr((x), (y))
-#define StrFree(x) STRIO_FREE(x)
-#define StrLength(x) strlen((x))
-#define StrSubstring(x,y) strstr((x), (y))
-#define StrTokenize(x,y) strtok((x), (y))
-#define StrToLong(x,y,n) strtol((x), (y), (n))
-#define StrToUnsignedLong(x,y,n) strtoul((x), (y), (n))
-#else /* DEBUG */
- /*
- * To be able to use these macros everywhere, including in
- * if() sentences, the assertions are put first in a comma
- * seperated list.
- *
- * Unfortunately the DECC compiler does not seem to like this
- * so it will use the un-asserted functions above for the
- * debugging case too.
- */
-#define StrAlloc(n) \
- (assert((n) > 0),\
- (char *)STRIO_MALLOC(n))
-#define StrAppend(x,y) \
- (assert((x) != NULL),\
- assert((y) != NULL),\
- strcat((x), (y)))
-#define StrContains(x,y) \
- (assert((x) != NULL),\
- assert((y) != NULL),\
- (0 != strstr((x), (y))))
-#define StrCopy(x,y) \
- (assert((x) != NULL),\
- assert((y) != NULL),\
- strcpy((x), (y)))
-#define StrIndex(x,c) \
- (assert((x) != NULL),\
- strchr((x), (c)))
-#define StrIndexLast(x,c) \
- (assert((x) != NULL),\
- strrchr((x), (c)))
-#define StrFree(x) \
- (assert((x) != NULL),\
- STRIO_FREE(x))
-#define StrLength(x) \
- (assert((x) != NULL),\
- strlen((x)))
-#define StrSubstring(x,y) \
- (assert((x) != NULL),\
- assert((y) != NULL),\
- strstr((x), (y)))
-#define StrTokenize(x,y) \
- (assert((y) != NULL),\
- strtok((x), (y)))
-#define StrToLong(x,y,n) \
- (assert((x) != NULL),\
- assert((y) != NULL),\
- assert((n) >= 2 && (n) <= 36),\
- strtol((x), (y), (n)))
-#define StrToUnsignedLong(x,y,n) \
- (assert((x) != NULL),\
- assert((y) != NULL),\
- assert((n) >= 2 && (n) <= 36),\
- strtoul((x), (y), (n)))
-#endif /* DEBUG */
-
-char *StrAppendMax(char *target, size_t max, const char *source);
-char *StrCopyMax(char *target, size_t max, const char *source);
-char *StrDuplicate(const char *source);
-char *StrDuplicateMax(const char *source, size_t max);
-int StrEqual(const char *first, const char *second);
-int StrEqualCase(const char *first, const char *second);
-int StrEqualCaseMax(const char *first, size_t max, const char *second);
-int StrEqualLocale(const char *first, const char *second);
-int StrEqualMax(const char *first, size_t max, const char *second);
-const char *StrError(int);
-size_t StrFormatDateMax(char *target, size_t max, const char *format, const struct tm *datetime);
-unsigned long StrHash(const char *string, int type);
-int StrMatch(char *string, char *pattern);
-int StrMatchCase(char *string, char *pattern);
-size_t StrSpanFunction(char *source, int (*Function)(int));
-char *StrSubstringMax(const char *string, size_t max, const char *find);
-float StrToFloat(const char *source, const char **target);
-double StrToDouble(const char *source, const char **target);
-int StrToUpper(char *target);
-
-#endif /* TRIO_STRIO_H */
+++ /dev/null
-/*************************************************************************
- *
- * $Id$
- *
- * Copyright (C) 1998 Bjorn Reese and Daniel Stenberg.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
- * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
- *
- *************************************************************************
- *
- * A note to trio contributors:
- *
- * Avoid heap allocation at all costs to ensure that the trio functions
- * are async-safe. The exceptions are the printf/fprintf functions, which
- * uses fputc, and the asprintf functions and the <alloc> modifier, which
- * by design are required to allocate form the heap.
- *
- ************************************************************************/
-
-/*
- * TODO:
- * - Scan is probably too permissive about its modifiers.
- * - C escapes in %#[] ?
- * - C99 support has not been properly tested.
- * - Multibyte characters (done for format parsing, except scan groups)
- * - Complex numbers? (C99 _Complex)
- * - Boolean values? (C99 _Bool)
- * - C99 NaN(n-char-sequence) missing
- * - Should we support the GNU %a alloc modifier? GNU has an ugly hack
- * for %a, because C99 used %a for other purposes. If specified as
- * %as or %a[ it is interpreted as the alloc modifier, otherwise as
- * the C99 hex-float. This means that you cannot scan %as as a hex-float
- * immediately followed by an 's'.
- * - Scanning of collating symbols.
- */
-
-static const char rcsid[] = "@(#)$Id$";
-
-/*************************************************************************
- * Trio include files
- */
-#include "trio.h"
-#include "triop.h"
-#include "strio.h"
-
-#ifdef DATAGRID_EXTENSION
-#include "escape.h"
-#endif
-
-/*
- * Encode the error code and the position. This is decoded
- * with TRIO_ERROR_CODE and TRIO_ERROR_POSITION.
- */
-#if TRIO_ERRORS
-# define TRIO_ERROR_RETURN(x,y) (- ((x) + ((y) << 8)))
-#else
-# define TRIO_ERROR_RETURN(x,y) (-1)
-#endif
-
-
-/*************************************************************************
- * Platform and compiler support detection
- */
-#if defined(unix) || defined(__xlC__) || defined(_AIX) || defined(__QNX__)
-# define PLATFORM_UNIX
-#elif defined(AMIGA) && defined(__GNUC__)
-# define PLATFORM_UNIX
-#elif defined(WIN32) || defined(_WIN32) || defined(_MSC_VER)
-# define PLATFORM_WIN32
-# define TRIO_MSVC_5 1100
-#endif
-
-#if defined(__STDC__) && defined(__STDC_VERSION__)
-# if (__STDC_VERSION__ >= 199409L)
-# define TRIO_COMPILER_SUPPORTS_ISO94
-# endif
-# if (__STDC_VERSION__ >= 199901L)
-# define TRIO_COMPILER_SUPPORTS_C99
-# endif
-#endif
-
-#if defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)
-# define TRIO_COMPILER_SUPPORTS_UNIX98
-#endif
-
-#if defined(__STDC_ISO_10646__) || defined(MB_LEN_MAX) || defined(USE_MULTIBYTE) || TRIO_WIDECHAR
-# define TRIO_COMPILER_SUPPORTS_MULTIBYTE
-# if !defined(MB_LEN_MAX)
-# define MB_LEN_MAX 6
-# endif
-#endif
-
-
-/*************************************************************************
- * Generic definitions
- */
-
-#if !(defined(DEBUG) || defined(NDEBUG))
-# define NDEBUG
-#endif
-#include <assert.h>
-#include <ctype.h>
-#if !defined(TRIO_COMPILER_SUPPORTS_C99) && !defined(isblank)
-# define isblank(x) (((x)==32) || ((x)==9))
-#endif
-#include <math.h>
-#include <limits.h>
-#include <float.h>
-#include <stdarg.h>
-#include <stddef.h>
-#include <errno.h>
-
-#ifndef NULL
-# define NULL 0
-#endif
-#define NIL ((char)0)
-#ifndef FALSE
-# define FALSE (1 == 0)
-# define TRUE (! FALSE)
-#endif
-#define BOOLEAN_T int
-
-/* mincore() can be used for debugging purposes */
-#define VALID(x) (NULL != (x))
-
-/* xlC crashes on log10(0) */
-#define guarded_log10(x) (((x) == 0.0) ? -HUGE_VAL : log10(x))
-#define guarded_log16(x) (guarded_log10(x) / log10(16.0))
-
-
-/*************************************************************************
- * Platform specific definitions
- */
-#if defined(PLATFORM_UNIX)
-# include <unistd.h>
-# include <signal.h>
-# include <locale.h>
-# define USE_LOCALE
-#endif /* PLATFORM_UNIX */
-#if defined(PLATFORM_WIN32)
-# include <io.h>
-# define read _read
-# define write _write
-#endif /* PLATFORM_WIN32 */
-
-#if TRIO_WIDECHAR
-# if defined(TRIO_COMPILER_SUPPORTS_ISO94)
-# include <wchar.h>
-# include <wctype.h>
-# else
-typedef char wchar_t;
-typedef int wint_t;
-# define WEOF EOF
-# define iswalnum(x) isalnum(x)
-# define iswalpha(x) isalpha(x)
-# define iswblank(x) isblank(x)
-# define iswcntrl(x) iscntrl(x)
-# define iswdigit(x) isdigit(x)
-# define iswgraph(x) isgraph(x)
-# define iswlower(x) islower(x)
-# define iswprint(x) isprint(x)
-# define iswpunct(x) ispunct(x)
-# define iswspace(x) isspace(x)
-# define iswupper(x) isupper(x)
-# define iswxdigit(x) isxdigit(x)
-# endif
-#endif
-
-
-/*************************************************************************
- * Compiler dependent definitions
- */
-
-/* Support for long long */
-#ifndef __cplusplus
-# if !defined(USE_LONGLONG)
-# if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-# define USE_LONGLONG
-# elif defined(__SUNPRO_C)
-# define USE_LONGLONG
-# elif defined(_LONG_LONG) || defined(_LONGLONG)
-# define USE_LONGLONG
-# endif
-# endif
-#endif
-
-/* The extra long numbers */
-#if defined(USE_LONGLONG)
-typedef signed long long int trio_longlong_t;
-typedef unsigned long long int trio_ulonglong_t;
-#elif defined(_MSC_VER)
-# if (_MSC_VER >= TRIO_MSVC_5)
-typedef signed __int64 trio_longlong_t;
-typedef unsigned __int64 trio_ulonglong_t;
-# else
-typedef signed long int trio_longlong_t;
-typedef unsigned long int trio_ulonglong_t;
-# endif
-#else
-typedef signed long int trio_longlong_t;
-typedef unsigned long int trio_ulonglong_t;
-#endif
-
-/* Maximal and fixed integer types */
-#if defined(TRIO_COMPILER_SUPPORTS_C99)
-# include <stdint.h>
-typedef intmax_t trio_intmax_t;
-typedef uintmax_t trio_uintmax_t;
-typedef int8_t trio_int8_t;
-typedef int16_t trio_int16_t;
-typedef int32_t trio_int32_t;
-typedef int64_t trio_int64_t;
-#elif defined(TRIO_COMPILER_SUPPORTS_UNIX98)
-# include <inttypes.h>
-typedef intmax_t trio_intmax_t;
-typedef uintmax_t trio_uintmax_t;
-typedef int8_t trio_int8_t;
-typedef int16_t trio_int16_t;
-typedef int32_t trio_int32_t;
-typedef int64_t trio_int64_t;
-#elif defined(_MSC_VER) && (_MSC_VER >= TRIO_MSVC_5)
-typedef trio_longlong_t trio_intmax_t;
-typedef trio_ulonglong_t trio_uintmax_t;
-typedef __int8 trio_int8_t;
-typedef __int16 trio_int16_t;
-typedef __int32 trio_int32_t;
-typedef __int64 trio_int64_t;
-#else
-typedef trio_longlong_t trio_intmax_t;
-typedef trio_ulonglong_t trio_uintmax_t;
-# if defined(TRIO_INT8_T)
-typedef TRIO_INT8_T trio_int8_t;
-# else
-typedef signed char trio_int8_t;
-# endif
-# if defined(TRIO_INT16_T)
-typedef TRIO_INT16_T trio_int16_t;
-# else
-typedef signed short trio_int16_t;
-# endif
-# if defined(TRIO_INT32_T)
-typedef TRIO_INT32_T trio_int32_t;
-# else
-typedef signed int trio_int32_t;
-# endif
-# if defined(TRIO_INT64_T)
-typedef TRIO_INT64_T trio_int64_t;
-# else
-typedef trio_longlong_t trio_int64_t;
-# endif
-#endif
-
-
-/*************************************************************************
- * Internal definitions
- */
-
-/* Long double sizes */
-#ifdef LDBL_DIG
-# define MAX_MANTISSA_DIGITS LDBL_DIG
-# define MAX_EXPONENT_DIGITS 4
-#else
-# define MAX_MANTISSA_DIGITS DBL_DIG
-# define MAX_EXPONENT_DIGITS 3
-#endif
-
-/* The maximal number of digits is for base 2 */
-#define MAX_CHARS_IN(x) (sizeof(x) * CHAR_BIT)
-/* The width of a pointer. The number of bits in a hex digit is 4 */
-#define POINTER_WIDTH ((sizeof("0x") - 1) + sizeof(void *) * CHAR_BIT / 4)
-
-/* Infinite and Not-A-Number for floating-point */
-#define INFINITE_LOWER "inf"
-#define INFINITE_UPPER "INF"
-#define LONG_INFINITE_LOWER "infinite"
-#define LONG_INFINITE_UPPER "INFINITE"
-#define NAN_LOWER "nan"
-#define NAN_UPPER "NAN"
-
-/* Various constants */
-enum {
- TYPE_PRINT = 1,
- TYPE_SCAN = 2,
-
- /* Flags. Use maximum 32 */
- FLAGS_NEW = 0,
- FLAGS_STICKY = 1,
- FLAGS_SPACE = 2 * FLAGS_STICKY,
- FLAGS_SHOWSIGN = 2 * FLAGS_SPACE,
- FLAGS_LEFTADJUST = 2 * FLAGS_SHOWSIGN,
- FLAGS_ALTERNATIVE = 2 * FLAGS_LEFTADJUST,
- FLAGS_SHORT = 2 * FLAGS_ALTERNATIVE,
- FLAGS_SHORTSHORT = 2 * FLAGS_SHORT,
- FLAGS_LONG = 2 * FLAGS_SHORTSHORT,
- FLAGS_QUAD = 2 * FLAGS_LONG,
- FLAGS_LONGDOUBLE = 2 * FLAGS_QUAD,
- FLAGS_SIZE_T = 2 * FLAGS_LONGDOUBLE,
- FLAGS_PTRDIFF_T = 2 * FLAGS_SIZE_T,
- FLAGS_INTMAX_T = 2 * FLAGS_PTRDIFF_T,
- FLAGS_NILPADDING = 2 * FLAGS_INTMAX_T,
- FLAGS_UNSIGNED = 2 * FLAGS_NILPADDING,
- FLAGS_UPPER = 2 * FLAGS_UNSIGNED,
- FLAGS_WIDTH = 2 * FLAGS_UPPER,
- FLAGS_WIDTH_PARAMETER = 2 * FLAGS_WIDTH,
- FLAGS_PRECISION = 2 * FLAGS_WIDTH_PARAMETER,
- FLAGS_PRECISION_PARAMETER = 2 * FLAGS_PRECISION,
- FLAGS_BASE = 2 * FLAGS_PRECISION_PARAMETER,
- FLAGS_BASE_PARAMETER = 2 * FLAGS_BASE,
- FLAGS_FLOAT_E = 2 * FLAGS_BASE_PARAMETER,
- FLAGS_FLOAT_G = 2 * FLAGS_FLOAT_E,
- FLAGS_QUOTE = 2 * FLAGS_FLOAT_G,
- FLAGS_WIDECHAR = 2 * FLAGS_QUOTE,
- FLAGS_ALLOC = 2 * FLAGS_WIDECHAR,
- FLAGS_IGNORE = 2 * FLAGS_ALLOC,
- FLAGS_IGNORE_PARAMETER = 2 * FLAGS_IGNORE,
- FLAGS_VARSIZE_PARAMETER = 2 * FLAGS_IGNORE_PARAMETER,
- FLAGS_FIXED_SIZE = 2 * FLAGS_VARSIZE_PARAMETER,
- /* Reused flags */
- FLAGS_EXCLUDE = FLAGS_SHORT,
- FLAGS_USER_DEFINED = FLAGS_IGNORE,
- /* Compounded flags */
- FLAGS_ALL_VARSIZES = FLAGS_LONG | FLAGS_QUAD | FLAGS_INTMAX_T | FLAGS_PTRDIFF_T | FLAGS_SIZE_T,
- FLAGS_ALL_SIZES = FLAGS_ALL_VARSIZES | FLAGS_SHORTSHORT | FLAGS_SHORT,
-
- NO_POSITION = -1,
- NO_WIDTH = 0,
- NO_PRECISION = -1,
- NO_SIZE = -1,
-
- NO_BASE = -1,
- MIN_BASE = 2,
- MAX_BASE = 36,
- BASE_BINARY = 2,
- BASE_OCTAL = 8,
- BASE_DECIMAL = 10,
- BASE_HEX = 16,
-
- /* Maximal number of allowed parameters */
- MAX_PARAMETERS = 64,
- /* Maximal number of characters in class */
- MAX_CHARACTER_CLASS = UCHAR_MAX,
-
- /* Maximal string lengths for user-defined specifiers */
- MAX_USER_NAME = 64,
- MAX_USER_DATA = 256,
-
- /* Maximal length of locale separator strings */
- MAX_LOCALE_SEPARATOR_LENGTH = MB_LEN_MAX,
- /* Maximal number of integers in grouping */
- MAX_LOCALE_GROUPS = 64
-};
-
-#define NO_GROUPING ((int)CHAR_MAX)
-
-/* Fundamental formatting parameter types */
-#define FORMAT_UNKNOWN 0
-#define FORMAT_INT 1
-#define FORMAT_DOUBLE 2
-#define FORMAT_CHAR 3
-#define FORMAT_STRING 4
-#define FORMAT_POINTER 5
-#define FORMAT_COUNT 6
-#define FORMAT_PARAMETER 7
-#define FORMAT_GROUP 8
-#if TRIO_GNU
-# define FORMAT_ERRNO 9
-#endif
-#if TRIO_EXTENSION
-# define FORMAT_USER_DEFINED 10
-#endif
-
-/* Character constants */
-#define CHAR_IDENTIFIER '%'
-#define CHAR_BACKSLASH '\\'
-#define CHAR_QUOTE '\"'
-#define CHAR_ADJUST ' '
-
-/* Character class expressions */
-#define CLASS_ALNUM ":alnum:"
-#define CLASS_ALPHA ":alpha:"
-#define CLASS_CNTRL ":cntrl:"
-#define CLASS_DIGIT ":digit:"
-#define CLASS_GRAPH ":graph:"
-#define CLASS_LOWER ":lower:"
-#define CLASS_PRINT ":print:"
-#define CLASS_PUNCT ":punct:"
-#define CLASS_SPACE ":space:"
-#define CLASS_UPPER ":upper:"
-#define CLASS_XDIGIT ":xdigit:"
-
-/*
- * SPECIFIERS:
- *
- *
- * a Hex-float
- * A Hex-float
- * c Character
- * C Widechar character (wint_t)
- * d Decimal
- * e Float
- * E Float
- * F Float
- * F Float
- * g Float
- * G Float
- * i Integer
- * m Error message
- * n Count
- * o Octal
- * p Pointer
- * s String
- * S Widechar string (wchar_t *)
- * u Unsigned
- * x Hex
- * X Hex
- * [] Group
- * <> User-defined
- *
- * Reserved:
- *
- * D Binary Coded Decimal %D(length,precision) (OS/390)
- */
-#define SPECIFIER_CHAR 'c'
-#define SPECIFIER_STRING 's'
-#define SPECIFIER_DECIMAL 'd'
-#define SPECIFIER_INTEGER 'i'
-#define SPECIFIER_UNSIGNED 'u'
-#define SPECIFIER_OCTAL 'o'
-#define SPECIFIER_HEX 'x'
-#define SPECIFIER_HEX_UPPER 'X'
-#define SPECIFIER_FLOAT_E 'e'
-#define SPECIFIER_FLOAT_E_UPPER 'E'
-#define SPECIFIER_FLOAT_F 'f'
-#define SPECIFIER_FLOAT_F_UPPER 'F'
-#define SPECIFIER_FLOAT_G 'g'
-#define SPECIFIER_FLOAT_G_UPPER 'G'
-#define SPECIFIER_POINTER 'p'
-#define SPECIFIER_GROUP '['
-#define SPECIFIER_UNGROUP ']'
-#define SPECIFIER_COUNT 'n'
-#if TRIO_UNIX98
-# define SPECIFIER_CHAR_UPPER 'C'
-# define SPECIFIER_STRING_UPPER 'S'
-#endif
-#if TRIO_C99
-# define SPECIFIER_HEXFLOAT 'a'
-# define SPECIFIER_HEXFLOAT_UPPER 'A'
-#endif
-#if TRIO_GNU
-# define SPECIFIER_ERRNO 'm'
-#endif
-#if TRIO_EXTENSION
-# define SPECIFIER_BINARY 'b'
-# define SPECIFIER_BINARY_UPPER 'B'
-# define SPECIFIER_USER_DEFINED_BEGIN '<'
-# define SPECIFIER_USER_DEFINED_END '>'
-# define SPECIFIER_USER_DEFINED_SEPARATOR ':'
-#endif
-
-/*
- * QUALIFIERS:
- *
- *
- * Numbers = d,i,o,u,x,X
- * Float = a,A,e,E,f,F,g,G
- * String = s
- * Char = c
- *
- *
- * 9$ Position
- * Use the 9th parameter. 9 can be any number between 1 and
- * the maximal argument
- *
- * 9 Width
- * Set width to 9. 9 can be any number, but must not be postfixed
- * by '$'
- *
- * h Short
- * Numbers:
- * (unsigned) short int
- *
- * hh Short short
- * Numbers:
- * (unsigned) char
- *
- * l Long
- * Numbers:
- * (unsigned) long int
- * String:
- * as the S specifier
- * Char:
- * as the C specifier
- *
- * ll Long Long
- * Numbers:
- * (unsigned) long long int
- *
- * L Long Double
- * Float
- * long double
- *
- * # Alternative
- * Float:
- * Decimal-point is always present
- * String:
- * non-printable characters are handled as \number
- *
- * Spacing
- *
- * + Sign
- *
- * - Alignment
- *
- * . Precision
- *
- * * Parameter
- * print: use parameter
- * scan: no parameter (ignore)
- *
- * q Quad
- *
- * Z size_t
- *
- * w Widechar
- *
- * ' Thousands/quote
- * Numbers:
- * Integer part grouped in thousands
- * Binary numbers:
- * Number grouped in nibbles (4 bits)
- * String:
- * Quoted string
- *
- * j intmax_t
- * t prtdiff_t
- * z size_t
- *
- * ! Sticky
- * @ Parameter (for both print and scan)
- *
- * I n-bit Integer
- * Numbers:
- * The following options exists
- * I8 = 8-bit integer
- * I16 = 16-bit integer
- * I32 = 32-bit integer
- * I64 = 64-bit integer
- */
-#define QUALIFIER_POSITION '$'
-#define QUALIFIER_SHORT 'h'
-#define QUALIFIER_LONG 'l'
-#define QUALIFIER_LONG_UPPER 'L'
-#define QUALIFIER_ALTERNATIVE '#'
-#define QUALIFIER_SPACE ' '
-#define QUALIFIER_PLUS '+'
-#define QUALIFIER_MINUS '-'
-#define QUALIFIER_DOT '.'
-#define QUALIFIER_STAR '*'
-#define QUALIFIER_CIRCUMFLEX '^'
-#if TRIO_C99
-# define QUALIFIER_SIZE_T 'z'
-# define QUALIFIER_PTRDIFF_T 't'
-# define QUALIFIER_INTMAX_T 'j'
-#endif
-#if TRIO_BSD || TRIO_GNU
-# define QUALIFIER_QUAD 'q'
-#endif
-#if TRIO_GNU
-# define QUALIFIER_SIZE_T_UPPER 'Z'
-#endif
-#if TRIO_MISC
-# define QUALIFIER_WIDECHAR 'w'
-#endif
-#if TRIO_MICROSOFT
-# define QUALIFIER_FIXED_SIZE 'I'
-#endif
-#if TRIO_EXTENSION
-# define QUALIFIER_QUOTE '\''
-# define QUALIFIER_STICKY '!'
-# define QUALIFIER_VARSIZE '&' /* This should remain undocumented */
-# define QUALIFIER_PARAM '@' /* Experimental */
-# define QUALIFIER_COLON ':' /* For scanlists */
-# define QUALIFIER_EQUAL '=' /* For scanlists */
-#endif
-#if DATAGRID_EXTENSION
-# define QUALIFIER_ESCAPE '|'
-#endif
-
-
-/*************************************************************************
- * Internal structures
- */
-
-/* Parameters */
-typedef struct {
- int type;
- unsigned long flags;
- int width;
- int precision;
- int base;
- int varsize;
-#ifdef QUALIFIER_ESCAPE
- enum dg_escape { ESCAPE_NONE, ESCAPE_ULM, ESCAPE_XML, ESCAPE_SQL, ESCAPE_JSON } escape;
-#endif
- int indexAfterSpecifier;
- union {
- char *string;
-#if TRIO_WIDECHAR
- wchar_t *wstring;
-#endif
- void *pointer;
- union {
- trio_uintmax_t as_signed;
- trio_intmax_t as_unsigned;
- } number;
- double doubleNumber;
- double *doublePointer;
- long double longdoubleNumber;
- long double *longdoublePointer;
- int errorNumber;
- } data;
- /* For the user-defined specifier */
- char user_name[MAX_USER_NAME];
- char user_data[MAX_USER_DATA];
-} parameter_T;
-
-/* General trio "class" */
-typedef struct _trio_T {
- void *location;
- void (*OutStream)(struct _trio_T *, int);
- void (*InStream)(struct _trio_T *, int *);
- /*
- * The number of characters that would have been written/read if
- * there had been sufficient space.
- */
- int processed;
- /*
- * The number of characters that are actually written/read.
- * Processed and committed with only differ for the *nprintf
- * and *nscanf functions.
- */
- int committed;
- int max;
- int current;
-} trio_T;
-
-/* References (for user-defined callbacks) */
-typedef struct _reference_T {
- trio_T *data;
- parameter_T *parameter;
-} reference_T;
-
-/* Registered entries (for user-defined callbacks) */
-typedef struct _userdef_T {
- struct _userdef_T *next;
- trio_callback_t callback;
- char *name;
-} userdef_T;
-
-
-/*************************************************************************
- * Internal variables
- */
-
-static const char null[] = "(nil)";
-
-#if defined(USE_LOCALE)
-static struct lconv *internalLocaleValues = NULL;
-#endif
-
-/*
- * UNIX98 says "in a locale where the radix character is not defined,
- * the radix character defaults to a period (.)"
- */
-static char internalDecimalPoint[MAX_LOCALE_SEPARATOR_LENGTH + 1] = ".";
-static char internalThousandSeparator[MAX_LOCALE_SEPARATOR_LENGTH + 1] = ",";
-static char internalGrouping[MAX_LOCALE_GROUPS] = { (char)NO_GROUPING };
-
-static const char internalDigitsLower[] = "0123456789abcdefghijklmnopqrstuvwxyz";
-static const char internalDigitsUpper[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-static BOOLEAN_T internalDigitsUnconverted = TRUE;
-static int internalDigitArray[128];
-#if TRIO_EXTENSION
-static BOOLEAN_T internalCollationUnconverted = TRUE;
-static char internalCollationArray[MAX_CHARACTER_CLASS][MAX_CHARACTER_CLASS];
-#endif
-
-static volatile trio_callback_t internalEnterCriticalRegion = NULL;
-static volatile trio_callback_t internalLeaveCriticalRegion = NULL;
-static userdef_T *internalUserDef = NULL;
-
-
-/*************************************************************************
- * trio_strerror [public]
- */
-const char *trio_strerror(int errorcode)
-{
- /* Textual versions of the error codes */
- switch (TRIO_ERROR_CODE(errorcode))
- {
- case TRIO_EOF:
- return "End of file";
- case TRIO_EINVAL:
- return "Invalid argument";
- case TRIO_ETOOMANY:
- return "Too many arguments";
- case TRIO_EDBLREF:
- return "Double reference";
- case TRIO_EGAP:
- return "Reference gap";
- case TRIO_ENOMEM:
- return "Out of memory";
- case TRIO_ERANGE:
- return "Invalid range";
- default:
- return "Unknown";
- }
-}
-
-/*************************************************************************
- * TrioIsQualifier [private]
- *
- * Description:
- * Remember to add all new qualifiers to this function.
- * QUALIFIER_POSITION must not be added.
- */
-static BOOLEAN_T
-TrioIsQualifier(const char ch)
-{
- /* QUALIFIER_POSITION is not included */
- switch (ch)
- {
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- case QUALIFIER_PLUS:
- case QUALIFIER_MINUS:
- case QUALIFIER_SPACE:
- case QUALIFIER_DOT:
- case QUALIFIER_STAR:
- case QUALIFIER_ALTERNATIVE:
- case QUALIFIER_SHORT:
- case QUALIFIER_LONG:
- case QUALIFIER_LONG_UPPER:
- case QUALIFIER_CIRCUMFLEX:
-#if defined(QUALIFIER_SIZE_T)
- case QUALIFIER_SIZE_T:
-#endif
-#if defined(QUALIFIER_PTRDIFF_T)
- case QUALIFIER_PTRDIFF_T:
-#endif
-#if defined(QUALIFIER_INTMAX_T)
- case QUALIFIER_INTMAX_T:
-#endif
-#if defined(QUALIFIER_QUAD)
- case QUALIFIER_QUAD:
-#endif
-#if defined(QUALIFIER_SIZE_T_UPPER)
- case QUALIFIER_SIZE_T_UPPER:
-#endif
-#if defined(QUALIFIER_WIDECHAR)
- case QUALIFIER_WIDECHAR:
-#endif
-#if defined(QUALIFIER_QUOTE)
- case QUALIFIER_QUOTE:
-#endif
-#if defined(QUALIFIER_STICKY)
- case QUALIFIER_STICKY:
-#endif
-#if defined(QUALIFIER_VARSIZE)
- case QUALIFIER_VARSIZE:
-#endif
-#if defined(QUALIFIER_PARAM)
- case QUALIFIER_PARAM:
-#endif
-#if defined(QUALIFIER_FIXED_SIZE)
- case QUALIFIER_FIXED_SIZE:
-#endif
-#ifdef QUALIFIER_ESCAPE
- case QUALIFIER_ESCAPE:
-#endif
- return TRUE;
- default:
- return FALSE;
- }
-}
-
-/*************************************************************************
- * TrioGenerateNan [private]
- *
- * Calculating NaN portably is difficult. Some compilers will emit
- * warnings about divide by zero, and others will simply fail to
- * generate a NaN.
- */
-static double
-TrioGenerateNaN(void)
-{
-#if defined(TRIO_COMPILER_SUPPORTS_C99)
- return nan(NULL);
-#elif defined(DBL_QNAN)
- return DBL_QNAN;
-#elif defined(PLATFORM_UNIX)
- double value;
- void (*signal_handler)(int);
-
- signal_handler = signal(SIGFPE, SIG_IGN);
- value = 0.0 / 0.0;
- signal(SIGFPE, signal_handler);
- return value;
-#else
- return 0.0 / 0.0;
-#endif
-}
-
-/*************************************************************************
- * TrioIsNan [private]
- */
-static int
-TrioIsNan(double number)
-{
-#ifdef isnan
- /* C99 defines isnan() as a macro */
- return isnan(number);
-#else
- double integral, fraction;
-
- return (/* NaN is the only number which does not compare to itself */
- (number != number) ||
- /* Fallback solution if NaN compares to NaN */
- ((number != 0.0) &&
- (fraction = modf(number, &integral),
- integral == fraction)));
-#endif
-}
-
-/*************************************************************************
- * TrioIsInfinite [private]
- */
-static int
-TrioIsInfinite(double number)
-{
-#ifdef isinf
- /* C99 defines isinf() as a macro */
- return isinf(number);
-#else
- return ((number == HUGE_VAL) ? 1 : ((number == -HUGE_VAL) ? -1 : 0));
-#endif
-}
-
-/*************************************************************************
- * TrioSetLocale [private]
- */
-#if defined(USE_LOCALE)
-static void
-TrioSetLocale(void)
-{
- internalLocaleValues = (struct lconv *)localeconv();
- if (internalLocaleValues)
- {
- if ((internalLocaleValues->decimal_point) &&
- (internalLocaleValues->decimal_point[0] != NIL))
- {
- StrCopyMax(internalDecimalPoint,
- sizeof(internalDecimalPoint),
- internalLocaleValues->decimal_point);
- }
- if ((internalLocaleValues->thousands_sep) &&
- (internalLocaleValues->thousands_sep[0] != NIL))
- {
- StrCopyMax(internalThousandSeparator,
- sizeof(internalThousandSeparator),
- internalLocaleValues->thousands_sep);
- }
- if ((internalLocaleValues->grouping) &&
- (internalLocaleValues->grouping[0] != NIL))
- {
- StrCopyMax(internalGrouping,
- sizeof(internalGrouping),
- internalLocaleValues->grouping);
- }
- }
-}
-#endif /* defined(USE_LOCALE) */
-
-/*************************************************************************
- * TrioGetPosition [private]
- *
- * Get the %n$ position.
- */
-static int
-TrioGetPosition(const char *format,
- int *indexPointer)
-{
- char *tmpformat;
- int number = 0;
- int index = *indexPointer;
-
- number = (int)StrToLong(&format[index], &tmpformat, BASE_DECIMAL);
- index = (int)(tmpformat - format);
- if ((number != 0) && (QUALIFIER_POSITION == format[index++]))
- {
- *indexPointer = index;
- /*
- * number is decreased by 1, because n$ starts from 1, whereas
- * the array it is indexing starts from 0.
- */
- return number - 1;
- }
- return NO_POSITION;
-}
-
-/*************************************************************************
- * TrioFindNamespace [private]
- *
- * Find registered user-defined specifier.
- * The prev argument is used for optimisation only.
- */
-static userdef_T *
-TrioFindNamespace(const char *name, userdef_T **prev)
-{
- userdef_T *def;
-
- if (internalEnterCriticalRegion)
- (void)internalEnterCriticalRegion(NULL);
-
- for (def = internalUserDef; def; def = def->next)
- {
- /* Case-sensitive string comparison */
- if (StrEqualCase(def->name, name))
- break;
-
- if (prev)
- *prev = def;
- }
-
- if (internalLeaveCriticalRegion)
- (void)internalLeaveCriticalRegion(NULL);
-
- return def;
-}
-
-/*************************************************************************
- * TrioPreprocess [private]
- *
- * Description:
- * Parse the format string
- */
-static int
-TrioPreprocess(int type,
- const char *format,
- parameter_T *parameters,
- va_list arglist,
- void **argarray)
-{
-#if TRIO_ERRORS
- /* Count the number of times a parameter is referenced */
- unsigned short usedEntries[MAX_PARAMETERS];
-#endif
- /* Parameter counters */
- int parameterPosition;
- int currentParam;
- int maxParam = -1;
- /* Utility variables */
- unsigned long flags;
- int width;
- int precision;
- int varsize;
-#ifdef QUALIFIER_ESCAPE
- enum dg_escape escape;
-#endif
- int base;
- int index; /* Index into formatting string */
- int dots; /* Count number of dots in modifier part */
- BOOLEAN_T positional; /* Does the specifier have a positional? */
- BOOLEAN_T got_sticky = FALSE; /* Are there any sticky modifiers at all? */
- /*
- * indices specifies the order in which the parameters must be
- * read from the va_args (this is necessary to handle positionals)
- */
- int indices[MAX_PARAMETERS];
- int pos = 0;
- /* Various variables */
- char ch;
-#if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE)
- int charlen;
-#endif
- int i = -1;
- int num;
- char *tmpformat;
-
-
-#if TRIO_ERRORS
- /*
- * The 'parameters' array is not initialized, but we need to
- * know which entries we have used.
- */
- memset(usedEntries, 0, sizeof(usedEntries));
-#endif
-
- index = 0;
- parameterPosition = 0;
-#if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE)
- mblen(NULL, 0);
-#endif
-
- while (format[index])
- {
-#if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE)
- if (! isascii(format[index]))
- {
- /*
- * Multibyte characters cannot be legal specifiers or
- * modifiers, so we skip over them.
- */
- charlen = mblen(&format[index], MB_LEN_MAX);
- index += (charlen > 0) ? charlen : 1;
- continue; /* while */
- }
-#endif /* TRIO_COMPILER_SUPPORTS_MULTIBYTE */
- if (CHAR_IDENTIFIER == format[index++])
- {
- if (CHAR_IDENTIFIER == format[index])
- {
- index++;
- continue; /* while */
- }
-
- flags = FLAGS_NEW;
- dots = 0;
- currentParam = TrioGetPosition(format, &index);
- positional = (NO_POSITION != currentParam);
- if (!positional)
- {
- /* We have no positional, get the next counter */
- currentParam = parameterPosition;
- }
- if(currentParam >= MAX_PARAMETERS)
- {
- /* Bail out completely to make the error more obvious */
- return TRIO_ERROR_RETURN(TRIO_ETOOMANY, index);
- }
-
- if (currentParam > maxParam)
- maxParam = currentParam;
-
- /* Default values */
- width = NO_WIDTH;
- precision = NO_PRECISION;
- base = NO_BASE;
- varsize = NO_SIZE;
-#ifdef QUALIFIER_ESCAPE
- escape = ESCAPE_NONE;
-#endif
-
- while (TrioIsQualifier(format[index]))
- {
- ch = format[index++];
-
- switch (ch)
- {
- case QUALIFIER_SPACE:
- flags |= FLAGS_SPACE;
- break;
-
- case QUALIFIER_PLUS:
- flags |= FLAGS_SHOWSIGN;
- break;
-
- case QUALIFIER_MINUS:
- flags |= FLAGS_LEFTADJUST;
- flags &= ~FLAGS_NILPADDING;
- break;
-
- case QUALIFIER_ALTERNATIVE:
- flags |= FLAGS_ALTERNATIVE;
- break;
-
- case QUALIFIER_DOT:
- if (dots == 0) /* Precision */
- {
- dots++;
-
- /* Skip if no precision */
- if (QUALIFIER_DOT == format[index])
- break;
-
- /* After the first dot we have the precision */
- flags |= FLAGS_PRECISION;
- if ((QUALIFIER_STAR == format[index]) ||
- (QUALIFIER_PARAM == format[index]))
- {
- index++;
- flags |= FLAGS_PRECISION_PARAMETER;
-
- precision = TrioGetPosition(format, &index);
- if (precision == NO_POSITION)
- {
- parameterPosition++;
- if (positional)
- precision = parameterPosition;
- else
- {
- precision = currentParam;
- currentParam = precision + 1;
- }
- }
- else
- {
- if (! positional)
- currentParam = precision + 1;
- if (width > maxParam)
- maxParam = precision;
- }
- if (currentParam > maxParam)
- maxParam = currentParam;
- }
- else
- {
- precision = StrToLong(&format[index], &tmpformat, BASE_DECIMAL);
- index = (int)(tmpformat - format);
- }
- }
- else if (dots == 1) /* Base */
- {
- dots++;
-
- /* After the second dot we have the base */
- flags |= FLAGS_BASE;
- if ((QUALIFIER_STAR == format[index]) ||
- (QUALIFIER_PARAM == format[index]))
- {
- index++;
- flags |= FLAGS_BASE_PARAMETER;
- base = TrioGetPosition(format, &index);
- if (base == NO_POSITION)
- {
- parameterPosition++;
- if (positional)
- base = parameterPosition;
- else
- {
- base = currentParam;
- currentParam = base + 1;
- }
- }
- else
- {
- if (! positional)
- currentParam = base + 1;
- if (base > maxParam)
- maxParam = base;
- }
- if (currentParam > maxParam)
- maxParam = currentParam;
- }
- else
- {
- base = StrToLong(&format[index], &tmpformat, BASE_DECIMAL);
- if (base > MAX_BASE)
- return TRIO_ERROR_RETURN(TRIO_EINVAL, index);
- index = (int)(tmpformat - format);
- }
- }
- else
- {
- return TRIO_ERROR_RETURN(TRIO_EINVAL, index);
- }
- break; /* QUALIFIER_DOT */
-
- case QUALIFIER_PARAM:
- type = TYPE_PRINT;
- /* FALLTHROUGH */
- case QUALIFIER_STAR:
- /* This has different meanings for print and scan */
- if (TYPE_PRINT == type)
- {
- /* Read with from parameter */
- flags |= (FLAGS_WIDTH | FLAGS_WIDTH_PARAMETER);
- width = TrioGetPosition(format, &index);
- if (width == NO_POSITION)
- {
- parameterPosition++;
- if (positional)
- width = parameterPosition;
- else
- {
- width = currentParam;
- currentParam = width + 1;
- }
- }
- else
- {
- if (! positional)
- currentParam = width + 1;
- if (width > maxParam)
- maxParam = width;
- }
- if (currentParam > maxParam)
- maxParam = currentParam;
- }
- else
- {
- /* Scan, but do not store result */
- flags |= FLAGS_IGNORE;
- }
-
- break; /* QUALIFIER_STAR */
-
- case '0':
- if (! (flags & FLAGS_LEFTADJUST))
- flags |= FLAGS_NILPADDING;
- /* FALLTHROUGH */
- case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- flags |= FLAGS_WIDTH;
- /* &format[index - 1] is used to "rewind" the read
- * character from format
- */
- width = StrToLong(&format[index - 1], &tmpformat, BASE_DECIMAL);
- index = (int)(tmpformat - format);
- break;
-
- case QUALIFIER_SHORT:
- if (flags & FLAGS_SHORTSHORT)
- return TRIO_ERROR_RETURN(TRIO_EINVAL, index);
- else if (flags & FLAGS_SHORT)
- flags |= FLAGS_SHORTSHORT;
- else
- flags |= FLAGS_SHORT;
- break;
-
- case QUALIFIER_LONG:
- if (flags & FLAGS_QUAD)
- return TRIO_ERROR_RETURN(TRIO_EINVAL, index);
- else if (flags & FLAGS_LONG)
- flags |= FLAGS_QUAD;
- else
- flags |= FLAGS_LONG;
- break;
-
- case QUALIFIER_LONG_UPPER:
- flags |= FLAGS_LONGDOUBLE;
- break;
-
-#if defined(QUALIFIER_SIZE_T)
- case QUALIFIER_SIZE_T:
- flags |= FLAGS_SIZE_T;
- /* Modify flags for later truncation of number */
- if (sizeof(size_t) == sizeof(trio_ulonglong_t))
- flags |= FLAGS_QUAD;
- else if (sizeof(size_t) == sizeof(long))
- flags |= FLAGS_LONG;
- break;
-#endif
-
-#if defined(QUALIFIER_PTRDIFF_T)
- case QUALIFIER_PTRDIFF_T:
- flags |= FLAGS_PTRDIFF_T;
- if (sizeof(ptrdiff_t) == sizeof(trio_ulonglong_t))
- flags |= FLAGS_QUAD;
- else if (sizeof(ptrdiff_t) == sizeof(long))
- flags |= FLAGS_LONG;
- break;
-#endif
-
-#if defined(QUALIFIER_INTMAX_T)
- case QUALIFIER_INTMAX_T:
- flags |= FLAGS_INTMAX_T;
- if (sizeof(trio_intmax_t) == sizeof(trio_ulonglong_t))
- flags |= FLAGS_QUAD;
- else if (sizeof(trio_intmax_t) == sizeof(long))
- flags |= FLAGS_LONG;
- break;
-#endif
-
-#if defined(QUALIFIER_QUAD)
- case QUALIFIER_QUAD:
- flags |= FLAGS_QUAD;
- break;
-#endif
-
-#if defined(QUALIFIER_FIXED_SIZE)
- case QUALIFIER_FIXED_SIZE:
- if (flags & FLAGS_FIXED_SIZE)
- return TRIO_ERROR_RETURN(TRIO_EINVAL, index);
-
- if (flags & (FLAGS_ALL_SIZES | FLAGS_LONGDOUBLE |
- FLAGS_WIDECHAR | FLAGS_VARSIZE_PARAMETER))
- return TRIO_ERROR_RETURN(TRIO_EINVAL, index);
-
- if ((format[index] == '6') &&
- (format[index + 1] == '4'))
- {
- varsize = sizeof(trio_int64_t);
- index += 2;
- }
- else if ((format[index] == '3') &&
- (format[index + 1] == '2'))
- {
- varsize = sizeof(trio_int32_t);
- index += 2;
- }
- else if ((format[index] == '1') &&
- (format[index + 1] == '6'))
- {
- varsize = sizeof(trio_int16_t);
- index += 2;
- }
- else if (format[index] == '8')
- {
- varsize = sizeof(trio_int8_t);
- index++;
- }
- else
- return TRIO_ERROR_RETURN(TRIO_EINVAL, index);
-
- flags |= FLAGS_FIXED_SIZE;
- break;
-#endif
-
-#ifdef QUALIFIER_ESCAPE
- case QUALIFIER_ESCAPE:
- switch (format[index++]) {
- case 'U': escape = ESCAPE_ULM; break;
- case 'X': escape = ESCAPE_XML; break;
- case 'S': escape = ESCAPE_SQL; break;
- case 'J': escape = ESCAPE_JSON; break;
- default: return TRIO_ERROR_RETURN(TRIO_EINVAL,index);
- }
- break;
-#endif
-
-
-#if defined(QUALIFIER_WIDECHAR)
- case QUALIFIER_WIDECHAR:
- flags |= FLAGS_WIDECHAR;
- break;
-#endif
-
-#if defined(QUALIFIER_SIZE_T_UPPER)
- case QUALIFIER_SIZE_T_UPPER:
- break;
-#endif
-
-#if defined(QUALIFIER_QUOTE)
- case QUALIFIER_QUOTE:
- flags |= FLAGS_QUOTE;
- break;
-#endif
-
-#if defined(QUALIFIER_STICKY)
- case QUALIFIER_STICKY:
- flags |= FLAGS_STICKY;
- got_sticky = TRUE;
- break;
-#endif
-
-#if defined(QUALIFIER_VARSIZE)
- case QUALIFIER_VARSIZE:
- flags |= FLAGS_VARSIZE_PARAMETER;
- parameterPosition++;
- if (positional)
- varsize = parameterPosition;
- else
- {
- varsize = currentParam;
- currentParam = varsize + 1;
- }
- if (currentParam > maxParam)
- maxParam = currentParam;
- break;
-#endif
-
- default:
- /* Bail out completely to make the error more obvious */
- return TRIO_ERROR_RETURN(TRIO_EINVAL, index);
- }
- } /* while qualifier */
-
- /*
- * Parameters only need the type and value. The value is
- * read later.
- */
- if (flags & FLAGS_WIDTH_PARAMETER)
- {
-#if TRIO_ERRORS
- usedEntries[width] += 1;
-#endif
- parameters[pos].type = FORMAT_PARAMETER;
- indices[width] = pos;
- width = pos++;
- }
- if (flags & FLAGS_PRECISION_PARAMETER)
- {
-#if TRIO_ERRORS
- usedEntries[precision] += 1;
-#endif
- parameters[pos].type = FORMAT_PARAMETER;
- indices[precision] = pos;
- precision = pos++;
- }
- if (flags & FLAGS_BASE_PARAMETER)
- {
-#if TRIO_ERRORS
- usedEntries[base] += 1;
-#endif
- parameters[pos].type = FORMAT_PARAMETER;
- indices[base] = pos;
- base = pos++;
- }
- if (flags & FLAGS_VARSIZE_PARAMETER)
- {
-#if TRIO_ERRORS
- usedEntries[varsize] += 1;
-#endif
- parameters[pos].type = FORMAT_PARAMETER;
- indices[varsize] = pos;
- varsize = pos++;
- }
-
- indices[currentParam] = pos;
-
- switch (format[index++])
- {
-#if defined(SPECIFIER_CHAR_UPPER)
- case SPECIFIER_CHAR_UPPER:
- flags |= FLAGS_WIDECHAR;
- /* FALLTHROUGH */
-#endif
- case SPECIFIER_CHAR:
- if (flags & FLAGS_LONG)
- flags |= FLAGS_WIDECHAR;
- else if (flags & FLAGS_SHORT)
- flags &= ~FLAGS_WIDECHAR;
- parameters[pos].type = FORMAT_CHAR;
- break;
-
-#if defined(SPECIFIER_STRING_UPPER)
- case SPECIFIER_STRING_UPPER:
- flags |= FLAGS_WIDECHAR;
- /* FALLTHROUGH */
-#endif
- case SPECIFIER_STRING:
- if (flags & FLAGS_LONG)
- flags |= FLAGS_WIDECHAR;
- else if (flags & FLAGS_SHORT)
- flags &= ~FLAGS_WIDECHAR;
- parameters[pos].type = FORMAT_STRING;
- break;
-
-
- case SPECIFIER_GROUP:
- if (TYPE_SCAN == type)
- {
- int depth = 1;
- parameters[pos].type = FORMAT_GROUP;
- if (format[index] == QUALIFIER_CIRCUMFLEX)
- index++;
- if (format[index] == SPECIFIER_UNGROUP)
- index++;
- if (format[index] == QUALIFIER_MINUS)
- index++;
- /* Skip nested brackets */
- while (format[index] != NIL)
- {
- if (format[index] == SPECIFIER_GROUP)
- {
- depth++;
- }
- else if (format[index] == SPECIFIER_UNGROUP)
- {
- if (--depth <= 0)
- {
- index++;
- break;
- }
- }
- index++;
- }
- }
- break;
-
- case SPECIFIER_INTEGER:
- parameters[pos].type = FORMAT_INT;
- break;
-
- case SPECIFIER_UNSIGNED:
- flags |= FLAGS_UNSIGNED;
- parameters[pos].type = FORMAT_INT;
- break;
-
- case SPECIFIER_DECIMAL:
- /* Disable base modifier */
- flags &= ~FLAGS_BASE_PARAMETER;
- base = BASE_DECIMAL;
- parameters[pos].type = FORMAT_INT;
- break;
-
- case SPECIFIER_OCTAL:
- flags &= ~FLAGS_BASE_PARAMETER;
- base = BASE_OCTAL;
- parameters[pos].type = FORMAT_INT;
- break;
-
-#if defined(SPECIFIER_BINARY)
- case SPECIFIER_BINARY_UPPER:
- flags |= FLAGS_UPPER;
- /* FALLTHROUGH */
- case SPECIFIER_BINARY:
- flags |= FLAGS_NILPADDING;
- flags &= ~FLAGS_BASE_PARAMETER;
- base = BASE_BINARY;
- parameters[pos].type = FORMAT_INT;
- break;
-#endif
-
- case SPECIFIER_HEX_UPPER:
- flags |= FLAGS_UPPER;
- /* FALLTHROUGH */
- case SPECIFIER_HEX:
- flags |= FLAGS_UNSIGNED;
- flags &= ~FLAGS_BASE_PARAMETER;
- base = BASE_HEX;
- parameters[pos].type = FORMAT_INT;
- break;
-
- case SPECIFIER_FLOAT_E_UPPER:
- flags |= FLAGS_UPPER;
- /* FALLTHROUGH */
- case SPECIFIER_FLOAT_E:
- flags |= FLAGS_FLOAT_E;
- parameters[pos].type = FORMAT_DOUBLE;
- break;
-
- case SPECIFIER_FLOAT_G_UPPER:
- flags |= FLAGS_UPPER;
- /* FALLTHROUGH */
- case SPECIFIER_FLOAT_G:
- flags |= FLAGS_FLOAT_G;
- parameters[pos].type = FORMAT_DOUBLE;
- break;
-
- case SPECIFIER_FLOAT_F_UPPER:
- flags |= FLAGS_UPPER;
- /* FALLTHROUGH */
- case SPECIFIER_FLOAT_F:
- parameters[pos].type = FORMAT_DOUBLE;
- break;
-
- case SPECIFIER_POINTER:
- parameters[pos].type = FORMAT_POINTER;
- break;
-
- case SPECIFIER_COUNT:
- parameters[pos].type = FORMAT_COUNT;
- break;
-
-#if defined(SPECIFIER_HEXFLOAT)
-# if defined(SPECIFIER_HEXFLOAT_UPPER)
- case SPECIFIER_HEXFLOAT_UPPER:
- flags |= FLAGS_UPPER;
- /* FALLTHROUGH */
-# endif
- case SPECIFIER_HEXFLOAT:
- base = BASE_HEX;
- parameters[pos].type = FORMAT_DOUBLE;
- break;
-#endif
-
-#if defined(FORMAT_ERRNO)
- case SPECIFIER_ERRNO:
- parameters[pos].type = FORMAT_ERRNO;
- break;
-#endif
-
-#if defined(SPECIFIER_USER_DEFINED_BEGIN)
- case SPECIFIER_USER_DEFINED_BEGIN:
- {
- unsigned int max;
- int without_namespace = TRUE;
-
- parameters[pos].type = FORMAT_USER_DEFINED;
- parameters[pos].user_name[0] = NIL;
- tmpformat = (char *)&format[index];
-
- while ((ch = format[index]))
- {
- index++;
- if (ch == SPECIFIER_USER_DEFINED_END)
- {
- if (without_namespace)
- {
- /* We must get the handle first */
- parameters[pos].type = FORMAT_PARAMETER;
- parameters[pos].indexAfterSpecifier = index;
- parameters[pos].flags = FLAGS_USER_DEFINED;
- /* Adjust parameters for insertion of new one */
- pos++;
-# if TRIO_ERRORS
- usedEntries[currentParam] += 1;
-# endif
- parameters[pos].type = FORMAT_USER_DEFINED;
- currentParam++;
- indices[currentParam] = pos;
- if (currentParam > maxParam)
- maxParam = currentParam;
- }
- /* Copy the user data */
- max = (unsigned int)(&format[index] - tmpformat);
- if (max > MAX_USER_DATA)
- max = MAX_USER_DATA;
- StrCopyMax(parameters[pos].user_data,
- max,
- tmpformat);
- break; /* while */
- }
- if (ch == SPECIFIER_USER_DEFINED_SEPARATOR)
- {
- without_namespace = FALSE;
- /* Copy the namespace for later looking-up */
- max = (int)(&format[index] - tmpformat);
- if (max > MAX_USER_NAME)
- max = MAX_USER_NAME;
- StrCopyMax(parameters[pos].user_name,
- max,
- tmpformat);
- tmpformat = (char *)&format[index];
- }
- }
- if (ch != SPECIFIER_USER_DEFINED_END)
- return TRIO_ERROR_RETURN(TRIO_EINVAL, index);
- }
- break;
-#endif /* defined(SPECIFIER_USER_DEFINED_BEGIN) */
-
- default:
- /* Bail out completely to make the error more obvious */
- return TRIO_ERROR_RETURN(TRIO_EINVAL, index);
- }
-
-#if TRIO_ERRORS
- /* Count the number of times this entry has been used */
- usedEntries[currentParam] += 1;
-#endif
-
- /* Find last sticky parameters */
- if (got_sticky && !(flags & FLAGS_STICKY))
- {
- for (i = pos - 1; i >= 0; i--)
- {
- if (parameters[i].type == FORMAT_PARAMETER)
- continue;
- if ((parameters[i].flags & FLAGS_STICKY) &&
- (parameters[i].type == parameters[pos].type))
- {
- /* Do not overwrite current qualifiers */
- flags |= (parameters[i].flags & (unsigned long)~FLAGS_STICKY);
- if (width == NO_WIDTH)
- width = parameters[i].width;
- if (precision == NO_PRECISION)
- precision = parameters[i].precision;
- if (base == NO_BASE)
- base = parameters[i].base;
- break;
- }
- }
- }
-
- parameters[pos].indexAfterSpecifier = index;
- parameters[pos].flags = flags;
- parameters[pos].width = width;
- parameters[pos].precision = precision;
- parameters[pos].base = (base == NO_BASE) ? BASE_DECIMAL : base;
- parameters[pos].varsize = varsize;
-#ifdef QUALIFIER_ESCAPE
- parameters[pos].escape = escape;
-#endif
- pos++;
-
- if (! positional)
- parameterPosition++;
-
- } /* if identifier */
-
- } /* while format characters left */
-
- for (num = 0; num <= maxParam; num++)
- {
-#if TRIO_ERRORS
- if (usedEntries[num] != 1)
- {
- if (usedEntries[num] == 0) /* gap detected */
- return TRIO_ERROR_RETURN(TRIO_EGAP, num);
- else /* double references detected */
- return TRIO_ERROR_RETURN(TRIO_EDBLREF, num);
- }
-#endif
-
- i = indices[num];
-
- /*
- * FORMAT_PARAMETERS are only present if they must be read,
- * so it makes no sense to check the ignore flag (besides,
- * the flags variable is not set for that particular type)
- */
- if ((parameters[i].type != FORMAT_PARAMETER) &&
- (parameters[i].flags & FLAGS_IGNORE))
- continue; /* for all arguments */
-
- /*
- * The stack arguments are read according to ANSI C89
- * default argument promotions:
- *
- * char = int
- * short = int
- * unsigned char = unsigned int
- * unsigned short = unsigned int
- * float = double
- *
- * In addition to the ANSI C89 these types are read (the
- * default argument promotions of C99 has not been
- * considered yet)
- *
- * long long
- * long double
- * size_t
- * ptrdiff_t
- * intmax_t
- */
- switch (parameters[i].type)
- {
- case FORMAT_GROUP:
- case FORMAT_STRING:
-#if TRIO_WIDECHAR
- if (flags & FLAGS_WIDECHAR)
- {
- parameters[i].data.wstring = (argarray == NULL)
- ? va_arg(arglist, wchar_t *)
- : (wchar_t *)(argarray[num]);
- }
- else
-#endif
- {
- parameters[i].data.string = (argarray == NULL)
- ? va_arg(arglist, char *)
- : (char *)(argarray[num]);
- }
- break;
-
- case FORMAT_POINTER:
- case FORMAT_COUNT:
- case FORMAT_USER_DEFINED:
- case FORMAT_UNKNOWN:
- parameters[i].data.pointer = (argarray == NULL)
- ? va_arg(arglist, void *)
- : argarray[num];
- break;
-
- case FORMAT_CHAR:
- case FORMAT_INT:
- if (TYPE_SCAN == type)
- {
- if (argarray == NULL)
- parameters[i].data.pointer =
- (trio_uintmax_t *)va_arg(arglist, void *);
- else
- {
- if (parameters[i].type == FORMAT_CHAR)
- parameters[i].data.pointer =
- (trio_uintmax_t *)((char *)argarray[num]);
- else if (parameters[i].flags & FLAGS_SHORT)
- parameters[i].data.pointer =
- (trio_uintmax_t *)((short *)argarray[num]);
- else
- parameters[i].data.pointer =
- (trio_uintmax_t *)((int *)argarray[num]);
- }
- }
- else
- {
-#if defined(QUALIFIER_VARSIZE) || defined(QUALIFIER_FIXED_SIZE)
- if ((parameters[i].flags & FLAGS_VARSIZE_PARAMETER) ||
- (parameters[i].flags & FLAGS_FIXED_SIZE))
- {
- if (parameters[i].flags & FLAGS_VARSIZE_PARAMETER)
- {
- /*
- * Variable sizes are mapped onto the fixed sizes, in
- * accordance with integer promotion.
- *
- * Please note that this may not be portable, as we
- * only guess the size, not the layout of the numbers.
- * For example, if int is little-endian, and long is
- * big-endian, then this will fail.
- */
- varsize = (int)parameters[parameters[i].varsize].data.number.as_unsigned;
- }
- else
- {
- /* Used for the I<bits> modifiers */
- varsize = parameters[i].varsize;
- }
- parameters[i].flags &= ~FLAGS_ALL_VARSIZES;
-
- if (varsize <= (int)sizeof(int))
- ;
- else if (varsize <= (int)sizeof(long))
- parameters[i].flags |= FLAGS_LONG;
-#if defined(QUALIFIER_INTMAX_T)
- else if (varsize <= (int)sizeof(trio_longlong_t))
- parameters[i].flags |= FLAGS_QUAD;
- else
- parameters[i].flags |= FLAGS_INTMAX_T;
-#else
- else
- parameters[i].flags |= FLAGS_QUAD;
-#endif
- }
-#endif /* defined(QUALIFIER_VARSIZE) */
-#if defined(QUALIFIER_SIZE_T) || defined(QUALIFIER_SIZE_T_UPPER)
- if (parameters[i].flags & FLAGS_SIZE_T)
- parameters[i].data.number.as_unsigned = (argarray == NULL)
- ? (trio_uintmax_t)va_arg(arglist, size_t)
- : (trio_uintmax_t)(*((size_t *)argarray[num]));
- else
-#endif
-#if defined(QUALIFIER_PTRDIFF_T)
- if (parameters[i].flags & FLAGS_PTRDIFF_T)
- parameters[i].data.number.as_unsigned = (argarray == NULL)
- ? (trio_uintmax_t)va_arg(arglist, ptrdiff_t)
- : (trio_uintmax_t)(*((ptrdiff_t *)argarray[num]));
- else
-#endif
-#if defined(QUALIFIER_INTMAX_T)
- if (parameters[i].flags & FLAGS_INTMAX_T)
- parameters[i].data.number.as_unsigned = (argarray == NULL)
- ? (trio_uintmax_t)va_arg(arglist, trio_intmax_t)
- : (trio_uintmax_t)(*((trio_intmax_t *)argarray[num]));
- else
-#endif
- if (parameters[i].flags & FLAGS_QUAD)
- parameters[i].data.number.as_unsigned = (argarray == NULL)
- ? (trio_uintmax_t)va_arg(arglist, trio_ulonglong_t)
- : (trio_uintmax_t)(*((trio_ulonglong_t *)argarray[num]));
- else if (parameters[i].flags & FLAGS_LONG)
- parameters[i].data.number.as_unsigned = (argarray == NULL)
- ? (trio_uintmax_t)va_arg(arglist, long)
- : (trio_uintmax_t)(*((long *)argarray[num]));
- else
- {
- if (argarray == NULL)
- parameters[i].data.number.as_unsigned = (trio_uintmax_t)va_arg(arglist, int);
- else
- {
- if (parameters[i].type == FORMAT_CHAR)
- parameters[i].data.number.as_unsigned = (trio_uintmax_t)(*((char *)argarray[num]));
- else if (parameters[i].flags & FLAGS_SHORT)
- parameters[i].data.number.as_unsigned = (trio_uintmax_t)(*((short *)argarray[num]));
- else
- parameters[i].data.number.as_unsigned = (trio_uintmax_t)(*((int *)argarray[num]));
- }
- }
- }
- break;
-
- case FORMAT_PARAMETER:
- /*
- * The parameter for the user-defined specifier is a pointer,
- * whereas the rest (width, precision, base) uses an integer.
- */
- if (parameters[i].flags & FLAGS_USER_DEFINED)
- parameters[i].data.pointer = (argarray == NULL)
- ? va_arg(arglist, void *)
- : argarray[num];
- else
- parameters[i].data.number.as_unsigned = (argarray == NULL)
- ? (trio_uintmax_t)va_arg(arglist, int)
- : (trio_uintmax_t)(*((int *)argarray[num]));
- break;
-
- case FORMAT_DOUBLE:
- if (TYPE_SCAN == type)
- {
- if (parameters[i].flags & FLAGS_LONG)
- parameters[i].data.longdoublePointer = (argarray == NULL)
- ? va_arg(arglist, long double *)
- : (long double *)((long double *)argarray[num]);
- else
- {
- if (argarray == NULL)
- parameters[i].data.doublePointer =
- va_arg(arglist, double *);
- else
- {
- if (parameters[i].flags & FLAGS_SHORT)
- parameters[i].data.doublePointer =
- (double *)((float *)argarray[num]);
- else
- parameters[i].data.doublePointer =
- (double *)((double *)argarray[num]);
- }
- }
- }
- else
- {
- if (parameters[i].flags & FLAGS_LONG)
- parameters[i].data.longdoubleNumber = (argarray == NULL)
- ? va_arg(arglist, long double)
- : (long double)(*((long double *)argarray[num]));
- else
- {
- if (argarray == NULL)
- parameters[i].data.longdoubleNumber = (long double)va_arg(arglist, double);
- else
- {
- if (parameters[i].flags & FLAGS_SHORT)
- parameters[i].data.longdoubleNumber = (long double)(*((float *)argarray[num]));
- else
- parameters[i].data.longdoubleNumber = (long double)(long double)(*((double *)argarray[num]));
- }
- }
- }
- break;
-
-#if defined(FORMAT_ERRNO)
- case FORMAT_ERRNO:
- parameters[i].data.errorNumber = errno;
- break;
-#endif
-
- default:
- break;
- }
- } /* for all specifiers */
- return num;
-}
-
-
-/*************************************************************************
- *
- * @FORMATTING
- *
- ************************************************************************/
-
-
-/*************************************************************************
- * TrioWriteNumber [private]
- *
- * Description:
- * Output a number.
- * The complexity of this function is a result of the complexity
- * of the dependencies of the flags.
- */
-static void
-TrioWriteNumber(trio_T *self,
- trio_uintmax_t number,
- unsigned long flags,
- int width,
- int precision,
- int base)
-{
- BOOLEAN_T isNegative;
- char buffer[MAX_CHARS_IN(trio_uintmax_t) * (1 + MAX_LOCALE_SEPARATOR_LENGTH) + 1];
- char *bufferend;
- char *pointer;
- const char *digits;
- int i;
- int length;
- char *p;
- int charsPerThousand;
- int groupingIndex;
- int count;
-
- assert(VALID(self));
- assert(VALID(self->OutStream));
- assert((base >= MIN_BASE && base <= MAX_BASE) || (base == NO_BASE));
-
- digits = (flags & FLAGS_UPPER) ? internalDigitsUpper : internalDigitsLower;
-
- isNegative = (flags & FLAGS_UNSIGNED)
- ? FALSE
- : ((trio_intmax_t)number < 0);
- if (isNegative)
- number = -number;
-
- if (flags & FLAGS_QUAD)
- number &= (trio_ulonglong_t)-1;
- else if (flags & FLAGS_LONG)
- number &= (unsigned long)-1;
- else
- number &= (unsigned int)-1;
-
- /* Build number */
- pointer = bufferend = &buffer[sizeof(buffer) - 1];
- *pointer-- = NIL;
- charsPerThousand = (int)internalGrouping[0];
- groupingIndex = 1;
- for (i = 1; i < (int)sizeof(buffer); i++)
- {
- *pointer-- = digits[number % base];
- number /= base;
- if (number == 0)
- break;
-
- if ((flags & FLAGS_QUOTE)
- && (charsPerThousand != NO_GROUPING)
- && (i % charsPerThousand == 0))
- {
- /*
- * We are building the number from the least significant
- * to the most significant digit, so we have to copy the
- * thousand separator backwards
- */
- length = StrLength(internalThousandSeparator);
- if (((int)(pointer - buffer) - length) > 0)
- {
- p = &internalThousandSeparator[length - 1];
- while (length-- > 0)
- *pointer-- = *p--;
- }
-
- /* Advance to next grouping number */
- switch (internalGrouping[groupingIndex])
- {
- case CHAR_MAX: /* Disable grouping */
- charsPerThousand = NO_GROUPING;
- break;
- case 0: /* Repeat last group */
- break;
- default:
- charsPerThousand = (int)internalGrouping[groupingIndex++];
- break;
- }
- }
- }
-
- /* Adjust width */
- width -= (bufferend - pointer) - 1;
-
- /* Adjust precision */
- if (NO_PRECISION != precision)
- {
- precision -= (bufferend - pointer) - 1;
- if (precision < 0)
- precision = 0;
- flags |= FLAGS_NILPADDING;
- }
-
- /* Adjust width further */
- if (isNegative || (flags & FLAGS_SHOWSIGN) || (flags & FLAGS_SPACE))
- width--;
- if (flags & FLAGS_ALTERNATIVE)
- {
- switch (base)
- {
- case BASE_BINARY:
- case BASE_HEX:
- width -= 2;
- break;
- case BASE_OCTAL:
- width--;
- break;
- default:
- break;
- }
- }
-
- /* Output prefixes spaces if needed */
- if (! ((flags & FLAGS_LEFTADJUST) ||
- ((flags & FLAGS_NILPADDING) && (precision == NO_PRECISION))))
- {
- count = (precision == NO_PRECISION) ? 0 : precision;
- while (width-- > count)
- self->OutStream(self, CHAR_ADJUST);
- }
-
- /* width has been adjusted for signs and alternatives */
- if (isNegative)
- self->OutStream(self, '-');
- else if (flags & FLAGS_SHOWSIGN)
- self->OutStream(self, '+');
- else if (flags & FLAGS_SPACE)
- self->OutStream(self, ' ');
-
- if (flags & FLAGS_ALTERNATIVE)
- {
- switch (base)
- {
- case BASE_BINARY:
- self->OutStream(self, '0');
- self->OutStream(self, (flags & FLAGS_UPPER) ? 'B' : 'b');
- break;
-
- case BASE_OCTAL:
- self->OutStream(self, '0');
- break;
-
- case BASE_HEX:
- self->OutStream(self, '0');
- self->OutStream(self, (flags & FLAGS_UPPER) ? 'X' : 'x');
- break;
-
- default:
- break;
- } /* switch base */
- }
-
- /* Output prefixed zero padding if needed */
- if (flags & FLAGS_NILPADDING)
- {
- if (precision == NO_PRECISION)
- precision = width;
- while (precision-- > 0)
- {
- self->OutStream(self, '0');
- width--;
- }
- }
-
- /* Output the number itself */
- while (*(++pointer))
- {
- self->OutStream(self, *pointer);
- }
-
- /* Output trailing spaces if needed */
- if (flags & FLAGS_LEFTADJUST)
- {
- while (width-- > 0)
- self->OutStream(self, CHAR_ADJUST);
- }
-}
-
-/*************************************************************************
- * TrioWriteStringCharacter [private]
- *
- * Description:
- * Output a single character of a string
- */
-static void
-TrioWriteStringCharacter(trio_T *self,
- int ch,
- unsigned long flags)
-{
- if (flags & FLAGS_ALTERNATIVE)
- {
- if (! (isprint(ch) || isspace(ch)))
- {
- /*
- * Non-printable characters are converted to C escapes or
- * \number, if no C escape exists.
- */
- self->OutStream(self, CHAR_BACKSLASH);
- switch (ch)
- {
- case '\007': self->OutStream(self, 'a'); break;
- case '\b': self->OutStream(self, 'b'); break;
- case '\f': self->OutStream(self, 'f'); break;
- case '\n': self->OutStream(self, 'n'); break;
- case '\r': self->OutStream(self, 'r'); break;
- case '\t': self->OutStream(self, 't'); break;
- case '\v': self->OutStream(self, 'v'); break;
- case '\\': self->OutStream(self, '\\'); break;
- default:
- self->OutStream(self, 'x');
- TrioWriteNumber(self, (trio_intmax_t)ch,
- FLAGS_UNSIGNED | FLAGS_NILPADDING,
- 2, 2, BASE_HEX);
- break;
- }
- }
- else if (ch == CHAR_BACKSLASH)
- {
- self->OutStream(self, CHAR_BACKSLASH);
- self->OutStream(self, CHAR_BACKSLASH);
- }
- else
- {
- self->OutStream(self, ch);
- }
- }
- else
- {
- self->OutStream(self, ch);
- }
-}
-
-/*************************************************************************
- * TrioWriteString [private]
- *
- * Description:
- * Output a string
- */
-static void
-TrioWriteString(trio_T *self,
- const char *string,
- unsigned long flags,
- int width,
- int precision)
-{
- int length;
- int ch;
-
- assert(VALID(self));
- assert(VALID(self->OutStream));
-
- if (string == NULL)
- {
- string = null;
- length = sizeof(null) - 1;
- /* Disable quoting for the null pointer */
- flags &= (~FLAGS_QUOTE);
- width = 0;
- }
- else
- {
- length = StrLength(string);
- }
- if ((NO_PRECISION != precision) &&
- (precision < length))
- {
- length = precision;
- }
- width -= length;
-
- if (flags & FLAGS_QUOTE)
- self->OutStream(self, CHAR_QUOTE);
-
- if (! (flags & FLAGS_LEFTADJUST))
- {
- while (width-- > 0)
- self->OutStream(self, CHAR_ADJUST);
- }
-
- while (length-- > 0)
- {
- /* The ctype parameters must be an unsigned char (or EOF) */
- ch = (int)((unsigned char)(*string++));
- TrioWriteStringCharacter(self, ch, flags);
- }
-
- if (flags & FLAGS_LEFTADJUST)
- {
- while (width-- > 0)
- self->OutStream(self, CHAR_ADJUST);
- }
- if (flags & FLAGS_QUOTE)
- self->OutStream(self, CHAR_QUOTE);
-}
-
-/*************************************************************************
- * TrioWriteWideStringCharacter [private]
- *
- * Description:
- * Output a wide string as a multi-byte sequence
- */
-#if TRIO_WIDECHAR
-static int
-TrioWriteWideStringCharacter(trio_T *self,
- wchar_t wch,
- unsigned long flags,
- int width)
-{
- int size;
- int i;
- int ch;
- char *string;
- char buffer[MB_LEN_MAX + 1];
-
- if (width == NO_WIDTH)
- width = sizeof(buffer);
-
- size = wctomb(buffer, wch);
- if ((size <= 0) || (size > width) || (buffer[0] == NIL))
- return 0;
-
- string = buffer;
- i = size;
- while ((width >= i) && (width-- > 0) && (i-- > 0))
- {
- /* The ctype parameters must be an unsigned char (or EOF) */
- ch = (int)((unsigned char)(*string++));
- TrioWriteStringCharacter(self, ch, flags);
- }
- return size;
-}
-#endif /* TRIO_WIDECHAR */
-
-/*************************************************************************
- * TrioWriteString [private]
- *
- * Description:
- * Output a wide character string as a multi-byte string
- */
-#if TRIO_WIDECHAR
-static void
-TrioWriteWideString(trio_T *self,
- const wchar_t *wstring,
- unsigned long flags,
- int width,
- int precision)
-{
- int length;
- int size;
-
- assert(VALID(self));
- assert(VALID(self->OutStream));
-
-#if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE)
- mblen(NULL, 0);
-#endif
-
- if (wstring == NULL)
- {
- TrioWriteString(self, NULL, flags, width, precision);
- return;
- }
-
- if (NO_PRECISION == precision)
- {
- length = INT_MAX;
- }
- else
- {
- length = precision;
- width -= length;
- }
-
- if (flags & FLAGS_QUOTE)
- self->OutStream(self, CHAR_QUOTE);
-
- if (! (flags & FLAGS_LEFTADJUST))
- {
- while (width-- > 0)
- self->OutStream(self, CHAR_ADJUST);
- }
-
- while (length > 0)
- {
- size = TrioWriteWideStringCharacter(self, *wstring++, flags, length);
- if (size == 0)
- break; /* while */
- length -= size;
- }
-
- if (flags & FLAGS_LEFTADJUST)
- {
- while (width-- > 0)
- self->OutStream(self, CHAR_ADJUST);
- }
- if (flags & FLAGS_QUOTE)
- self->OutStream(self, CHAR_QUOTE);
-}
-#endif /* TRIO_WIDECHAR */
-
-/*************************************************************************
- * TrioWriteDouble [private]
- */
-static void
-TrioWriteDouble(trio_T *self,
- long double longdoubleNumber,
- unsigned long flags,
- int width,
- int precision,
- int base)
-{
- int charsPerThousand;
- int length;
- double number;
- double workNumber;
- int integerDigits;
- int fractionDigits;
- int exponentDigits;
- int expectedWidth;
- int exponent;
- unsigned int uExponent = 0;
- double dblBase;
- BOOLEAN_T isNegative;
- BOOLEAN_T isExponentNegative = FALSE;
- BOOLEAN_T isHex;
- const char *digits;
- char numberBuffer[MAX_MANTISSA_DIGITS
- * (1 + MAX_LOCALE_SEPARATOR_LENGTH) + 1];
- char *numberPointer;
- char exponentBuffer[MAX_EXPONENT_DIGITS + 1];
- char *exponentPointer = NULL;
- int groupingIndex;
- char *work;
- int i;
- BOOLEAN_T onlyzero;
- int zeroes = 0;
-
- assert(VALID(self));
- assert(VALID(self->OutStream));
- assert(base == BASE_DECIMAL || base == BASE_HEX);
-
- number = (double)longdoubleNumber;
-
- /* Look for infinite numbers and non-a-number first */
- switch (TrioIsInfinite(number))
- {
- case 1:
- /* Positive infinity */
- TrioWriteString(self,
- (flags & FLAGS_UPPER)
- ? INFINITE_UPPER
- : INFINITE_LOWER,
- flags, width, precision);
- return;
-
- case -1:
- /* Negative infinity */
- TrioWriteString(self,
- (flags & FLAGS_UPPER)
- ? "-" INFINITE_UPPER
- : "-" INFINITE_LOWER,
- flags, width, precision);
- return;
-
- default:
- /* Finitude */
- break;
- }
- if (TrioIsNan(number))
- {
- TrioWriteString(self,
- (flags & FLAGS_UPPER)
- ? NAN_UPPER
- : NAN_LOWER,
- flags, width, precision);
- return;
- }
-
- /* Normal numbers */
- digits = (flags & FLAGS_UPPER) ? internalDigitsUpper : internalDigitsLower;
- isHex = (base == BASE_HEX);
- dblBase = (double)base;
-
- if (precision == NO_PRECISION)
- precision = FLT_DIG;
-
- isNegative = (number < 0.0);
- if (isNegative)
- number = -number;
-
- if ((flags & FLAGS_FLOAT_G) || isHex)
- {
- if (precision == 0)
- precision = 1;
-
- if ((number < 1.0e-4) || (number > pow(10.0, (double)precision)))
- {
- /* Use scientific notation */
- flags |= FLAGS_FLOAT_E;
- }
- else if (number < 1.0)
- {
- /*
- * Use normal notation. If the integer part of the number is
- * zero, then adjust the precision to include leading fractional
- * zeros.
- */
- workNumber = fabs(guarded_log10(number));
- if (workNumber - floor(workNumber) < 0.001)
- workNumber--;
- zeroes = (int)floor(workNumber);
- }
- }
-
- if (flags & FLAGS_FLOAT_E)
- {
- /* Scale the number */
- workNumber = guarded_log10(number);
- if (workNumber == -HUGE_VAL)
- {
- exponent = 0;
- /* Undo setting */
- if (flags & FLAGS_FLOAT_G)
- flags &= ~FLAGS_FLOAT_E;
- }
- else
- {
- exponent = (int)floor(workNumber);
- number /= pow(10.0, (double)exponent);
- isExponentNegative = (exponent < 0);
- uExponent = (isExponentNegative) ? -exponent : exponent;
- /* No thousand separators */
- flags &= ~FLAGS_QUOTE;
- }
- }
-
- /*
- * Truncated number.
- *
- * precision is number of significant digits for FLOAT_G
- * and number of fractional digits for others
- */
- integerDigits = (floor(number) > DBL_EPSILON)
- ? 1 + (int)guarded_log10(floor(number))
- : 1;
- fractionDigits = ((flags & FLAGS_FLOAT_G) && (zeroes == 0))
- ? precision - integerDigits
- : zeroes + precision;
-
- number = floor(0.5 + number * pow(dblBase, (double)fractionDigits));
- workNumber = (isHex
- ? guarded_log16(0.5 + number)
- : guarded_log10(0.5 + number));
- if ((int)workNumber + 1 > integerDigits + fractionDigits)
- {
- if (flags & FLAGS_FLOAT_E)
- {
- /* Adjust if number was rounded up one digit (ie. 0.99 to 1.00) */
- exponent--;
- uExponent -= (isExponentNegative) ? 1 : -1;
- number /= dblBase;
- }
- else
- {
- /* Adjust if number was rounded up one digit (ie. 99 to 100) */
- integerDigits++;
- }
- }
-
- /* Build the fraction part */
- numberPointer = &numberBuffer[sizeof(numberBuffer) - 1];
- *numberPointer = NIL;
- onlyzero = TRUE;
- for (i = 0; i < fractionDigits; i++)
- {
- *(--numberPointer) = digits[(int)fmod(number, dblBase)];
- number = floor(number / dblBase);
-
- if ((flags & FLAGS_FLOAT_G) && !(flags & FLAGS_ALTERNATIVE))
- {
- /* Prune trailing zeroes */
- if (numberPointer[0] != digits[0])
- onlyzero = FALSE;
- else if (onlyzero && (numberPointer[0] == digits[0]))
- numberPointer++;
- }
- else
- onlyzero = FALSE;
- }
-
- /* Insert decimal point */
- if ((flags & FLAGS_ALTERNATIVE) || ((fractionDigits > 0) && !onlyzero))
- {
- i = StrLength(internalDecimalPoint);
- while (i> 0)
- {
- *(--numberPointer) = internalDecimalPoint[--i];
- }
- }
- /* Insert the integer part and thousand separators */
- charsPerThousand = (int)internalGrouping[0];
- groupingIndex = 1;
- for (i = 1; i < integerDigits + 1; i++)
- {
- *(--numberPointer) = digits[(int)fmod(number, dblBase)];
- number = floor(number / dblBase);
- if (number < DBL_EPSILON)
- break;
-
- if ((i > 0)
- && ((flags & (FLAGS_FLOAT_E | FLAGS_QUOTE)) == FLAGS_QUOTE)
- && (charsPerThousand != NO_GROUPING)
- && (i % charsPerThousand == 0))
- {
- /*
- * We are building the number from the least significant
- * to the most significant digit, so we have to copy the
- * thousand separator backwards
- */
- length = StrLength(internalThousandSeparator);
- integerDigits += length;
- if (((int)(numberPointer - numberBuffer) - length) > 0)
- {
- work = &internalThousandSeparator[length - 1];
- while (length-- > 0)
- *(--numberPointer) = *work--;
- }
-
- /* Advance to next grouping number */
- if (charsPerThousand != NO_GROUPING)
- {
- switch (internalGrouping[groupingIndex])
- {
- case CHAR_MAX: /* Disable grouping */
- charsPerThousand = NO_GROUPING;
- break;
- case 0: /* Repeat last group */
- break;
- default:
- charsPerThousand = (int)internalGrouping[groupingIndex++];
- break;
- }
- }
- }
- }
-
- /* Build the exponent */
- exponentDigits = 0;
- if (flags & FLAGS_FLOAT_E)
- {
- exponentPointer = &exponentBuffer[sizeof(exponentBuffer) - 1];
- *exponentPointer-- = NIL;
- do {
- *exponentPointer-- = digits[uExponent % base];
- uExponent /= base;
- exponentDigits++;
- } while (uExponent);
- }
-
- /*
- * Calculate expected width.
- * sign + integer part + thousands separators + decimal point
- * + fraction + exponent
- */
- expectedWidth = StrLength(numberPointer);
- if (isNegative || (flags & FLAGS_SHOWSIGN))
- expectedWidth += sizeof("-") - 1;
- if (exponentDigits > 0)
- expectedWidth += exponentDigits +
- ((exponentDigits > 1) ? sizeof("E+") : sizeof("E+0")) - 1;
- if (isHex)
- expectedWidth += sizeof("0X") - 1;
-
- /* Output prefixing */
- if (flags & FLAGS_NILPADDING)
- {
- /* Leading zeros must be after sign */
- if (isNegative)
- self->OutStream(self, '-');
- else if (flags & FLAGS_SHOWSIGN)
- self->OutStream(self, '+');
- if (isHex)
- {
- self->OutStream(self, '0');
- self->OutStream(self, (flags & FLAGS_UPPER) ? 'X' : 'x');
- }
- if (!(flags & FLAGS_LEFTADJUST))
- {
- for (i = expectedWidth; i < width; i++)
- {
- self->OutStream(self, '0');
- }
- }
- }
- else
- {
- /* Leading spaces must be before sign */
- if (!(flags & FLAGS_LEFTADJUST))
- {
- for (i = expectedWidth; i < width; i++)
- {
- self->OutStream(self, CHAR_ADJUST);
- }
- }
- if (isNegative)
- self->OutStream(self, '-');
- else if (flags & FLAGS_SHOWSIGN)
- self->OutStream(self, '+');
- if (isHex)
- {
- self->OutStream(self, '0');
- self->OutStream(self, (flags & FLAGS_UPPER) ? 'X' : 'x');
- }
- }
- /* Output number */
- for (i = 0; numberPointer[i]; i++)
- {
- self->OutStream(self, numberPointer[i]);
- }
- /* Output exponent */
- if (exponentDigits > 0)
- {
- self->OutStream(self,
- isHex
- ? ((flags & FLAGS_UPPER) ? 'P' : 'p')
- : ((flags & FLAGS_UPPER) ? 'E' : 'e'));
- self->OutStream(self, (isExponentNegative) ? '-' : '+');
-
- /* The exponent must contain at least two digits */
- if (exponentDigits == 1)
- self->OutStream(self, '0');
-
- for (i = 0; i < exponentDigits; i++)
- {
- self->OutStream(self, exponentPointer[i + 1]);
- }
- }
- /* Output trailing spaces */
- if (flags & FLAGS_LEFTADJUST)
- {
- for (i = expectedWidth; i < width; i++)
- {
- self->OutStream(self, CHAR_ADJUST);
- }
- }
-}
-
-/*************************************************************************
- * TrioFormatProcess [private]
- */
-static int
-TrioFormatProcess(trio_T *data,
- const char *format,
- parameter_T *parameters)
-
-{
-#if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE)
- int charlen;
-#endif
- int i;
- const char *string;
- void *pointer;
- unsigned long flags;
- int width;
- int precision;
- int base;
- int index;
-
- index = 0;
- i = 0;
-#if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE)
- mblen(NULL, 0);
-#endif
-
- while (format[index])
- {
-#if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE)
- if (! isascii(format[index]))
- {
- charlen = mblen(&format[index], MB_LEN_MAX);
- while (charlen-- > 0)
- {
- data->OutStream(data, format[index++]);
- }
- continue; /* while */
- }
-#endif /* TRIO_COMPILER_SUPPORTS_MULTIBYTE */
- if (CHAR_IDENTIFIER == format[index])
- {
- if (CHAR_IDENTIFIER == format[index + 1])
- {
- data->OutStream(data, CHAR_IDENTIFIER);
- index += 2;
- }
- else
- {
- /* Skip the parameter entries */
- while (parameters[i].type == FORMAT_PARAMETER)
- i++;
-
- flags = parameters[i].flags;
-
- /* Find width */
- width = parameters[i].width;
- if (flags & FLAGS_WIDTH_PARAMETER)
- {
- /* Get width from parameter list */
- width = (int)parameters[width].data.number.as_signed;
- }
-
- /* Find precision */
- if (flags & FLAGS_PRECISION)
- {
- precision = parameters[i].precision;
- if (flags & FLAGS_PRECISION_PARAMETER)
- {
- /* Get precision from parameter list */
- precision = (int)parameters[precision].data.number.as_signed;
- }
- }
- else
- {
- precision = NO_PRECISION;
- }
-
- /* Find base */
- base = parameters[i].base;
- if (flags & FLAGS_BASE_PARAMETER)
- {
- /* Get base from parameter list */
- base = (int)parameters[base].data.number.as_signed;
- }
-
- switch (parameters[i].type)
- {
- case FORMAT_CHAR:
- if (flags & FLAGS_QUOTE)
- data->OutStream(data, CHAR_QUOTE);
- if (! (flags & FLAGS_LEFTADJUST))
- {
- while (--width > 0)
- data->OutStream(data, CHAR_ADJUST);
- }
-#if TRIO_WIDECHAR
- if (flags & FLAGS_WIDECHAR)
- {
- TrioWriteWideStringCharacter(data,
- (wchar_t)parameters[i].data.number.as_signed,
- flags,
- NO_WIDTH);
- }
- else
-#endif
- TrioWriteStringCharacter(data,
- (int)parameters[i].data.number.as_signed,
- flags);
-
- if (flags & FLAGS_LEFTADJUST)
- {
- while(--width > 0)
- data->OutStream(data, CHAR_ADJUST);
- }
- if (flags & FLAGS_QUOTE)
- data->OutStream(data, CHAR_QUOTE);
-
- break; /* FORMAT_CHAR */
-
- case FORMAT_INT:
- if (base == NO_BASE)
- base = BASE_DECIMAL;
-
- TrioWriteNumber(data,
- parameters[i].data.number.as_signed,
- flags,
- width,
- precision,
- base);
-
- break; /* FORMAT_INT */
-
- case FORMAT_DOUBLE:
- TrioWriteDouble(data,
- parameters[i].data.longdoubleNumber,
- flags,
- width,
- precision,
- base);
- break; /* FORMAT_DOUBLE */
-
- case FORMAT_STRING:
-#if TRIO_WIDECHAR
- if (flags & FLAGS_WIDECHAR)
- {
- TrioWriteWideString(data,
- parameters[i].data.wstring,
- flags,
- width,
- precision);
- }
- else
-#endif
-#ifdef QUALIFIER_ESCAPE
- {
- char *s = NULL;
- static const char* empty = "(null)";
- switch (parameters[i].escape)
- {
- case ESCAPE_ULM:
- s = glite_lbu_EscapeULM(parameters[i].data.string);
- break;
- case ESCAPE_XML:
- s = glite_lbu_EscapeXML(parameters[i].data.string);
- break;
- case ESCAPE_SQL:
- s = glite_lbu_EscapeSQL(parameters[i].data.string);
- break;
- case ESCAPE_JSON:
- s = glite_lbu_EscapeJSON(parameters[i].data.string);
- break;
- case ESCAPE_NONE:
- s = strdup(parameters[i].data.string ? parameters[i].data.string : empty);
- break;
- }
- TrioWriteString(data,s,flags,width,precision);
- free(s);
- }
-#else
- {
- TrioWriteString(data,
- parameters[i].data.string,
- flags,
- width,
- precision);
- }
-#endif
- break; /* FORMAT_STRING */
-
- case FORMAT_POINTER:
- {
- reference_T reference;
-
- reference.data = data;
- reference.parameter = ¶meters[i];
- trio_print_pointer(&reference, parameters[i].data.pointer);
- }
- break; /* FORMAT_POINTER */
-
- case FORMAT_COUNT:
- pointer = parameters[i].data.pointer;
- if (NULL != pointer)
- {
- /*
- * C99 paragraph 7.19.6.1.8 says "the number of
- * characters written to the output stream so far by
- * this call", which is data->committed
- */
-#if defined(QUALIFIER_SIZE_T) || defined(QUALIFIER_SIZE_T_UPPER)
- if (flags & FLAGS_SIZE_T)
- *(size_t *)pointer = (size_t)data->committed;
- else
-#endif
-#if defined(QUALIFIER_PTRDIFF_T)
- if (flags & FLAGS_PTRDIFF_T)
- *(ptrdiff_t *)pointer = (ptrdiff_t)data->committed;
- else
-#endif
-#if defined(QUALIFIER_INTMAX_T)
- if (flags & FLAGS_INTMAX_T)
- *(trio_intmax_t *)pointer = (trio_intmax_t)data->committed;
- else
-#endif
- if (flags & FLAGS_QUAD)
- {
- *(trio_ulonglong_t *)pointer = (trio_ulonglong_t)data->committed;
- }
- else if (flags & FLAGS_LONG)
- {
- *(long int *)pointer = (long int)data->committed;
- }
- else if (flags & FLAGS_SHORT)
- {
- *(short int *)pointer = (short int)data->committed;
- }
- else
- {
- *(int *)pointer = (int)data->committed;
- }
- }
- break; /* FORMAT_COUNT */
-
- case FORMAT_PARAMETER:
- break; /* FORMAT_PARAMETER */
-
-#if defined(FORMAT_ERRNO)
- case FORMAT_ERRNO:
- string = StrError(parameters[i].data.errorNumber);
- if (string)
- {
- TrioWriteString(data,
- string,
- flags,
- width,
- precision);
- }
- else
- {
- data->OutStream(data, '#');
- TrioWriteNumber(data,
- (trio_intmax_t)parameters[i].data.errorNumber,
- flags,
- width,
- precision,
- BASE_DECIMAL);
- }
- break; /* FORMAT_ERRNO */
-#endif /* defined(FORMAT_ERRNO) */
-
-#if defined(FORMAT_USER_DEFINED)
- case FORMAT_USER_DEFINED:
- {
- reference_T reference;
- userdef_T *def = NULL;
-
- if (parameters[i].user_name[0] == NIL)
- {
- /* Use handle */
- if ((i > 0) ||
- (parameters[i - 1].type == FORMAT_PARAMETER))
- def = (userdef_T *)parameters[i - 1].data.pointer;
- }
- else
- {
- /* Look up namespace */
- def = TrioFindNamespace(parameters[i].user_name, NULL);
- }
- if (def) {
- reference.data = data;
- reference.parameter = ¶meters[i];
- def->callback(&reference);
- }
- }
- break;
-#endif /* defined(FORMAT_USER_DEFINED) */
-
- default:
- break;
- } /* switch parameter type */
-
- /* Prepare for next */
- index = parameters[i].indexAfterSpecifier;
- i++;
- }
- }
- else /* not identifier */
- {
- data->OutStream(data, format[index++]);
- }
- }
- return data->processed;
-}
-
-/*************************************************************************
- * TrioFormatRef [private]
- */
-static int
-TrioFormatRef(reference_T *reference,
- const char *format,
- va_list arglist,
- void **argarray)
-{
- int status;
- parameter_T parameters[MAX_PARAMETERS];
-
- status = TrioPreprocess(TYPE_PRINT, format, parameters, arglist, argarray);
- if (status < 0)
- return status;
-
- return TrioFormatProcess(reference->data, format, parameters);
-}
-
-/*************************************************************************
- * TrioFormat [private]
- *
- * Description:
- * This is the main engine for formatting output
- */
-static int
-TrioFormat(void *destination,
- size_t destinationSize,
- void (*OutStream)(trio_T *, int),
- const char *format,
- va_list arglist,
- void **argarray)
-{
- int status;
- trio_T data;
- parameter_T parameters[MAX_PARAMETERS];
-
- assert(VALID(OutStream));
- assert(VALID(format));
-
- memset(&data, 0, sizeof(data));
- data.OutStream = OutStream;
- data.location = destination;
- data.max = destinationSize;
-
-#if defined(USE_LOCALE)
- if (NULL == internalLocaleValues)
- {
- TrioSetLocale();
- }
-#endif
-
- status = TrioPreprocess(TYPE_PRINT, format, parameters, arglist, argarray);
- if (status < 0)
- return status;
-
- return TrioFormatProcess(&data, format, parameters);
-}
-
-/*************************************************************************
- * TrioOutStreamFile [private]
- */
-static void
-TrioOutStreamFile(trio_T *self,
- int output)
-{
- FILE *file = (FILE *)self->location;
-
- assert(VALID(self));
- assert(VALID(file));
-
- self->processed++;
- self->committed++;
- (void)fputc(output, file);
-}
-
-/*************************************************************************
- * TrioOutStreamFileDescriptor [private]
- */
-static void
-TrioOutStreamFileDescriptor(trio_T *self,
- int output)
-{
- int fd = *((int *)self->location);
- char ch;
-
- assert(VALID(self));
-
- ch = (char)output;
- (void)write(fd, &ch, sizeof(char));
- self->processed++;
- self->committed++;
-}
-
-/*************************************************************************
- * TrioOutStreamString [private]
- */
-static void
-TrioOutStreamString(trio_T *self,
- int output)
-{
- char **buffer = (char **)self->location;
-
- assert(VALID(self));
- assert(VALID(buffer));
-
- **buffer = (char)output;
- (*buffer)++;
- self->processed++;
- self->committed++;
-}
-
-/*************************************************************************
- * TrioOutStreamStringMax [private]
- */
-static void
-TrioOutStreamStringMax(trio_T *self,
- int output)
-{
- char **buffer;
-
- assert(VALID(self));
- buffer = (char **)self->location;
- assert(VALID(buffer));
-
- if (self->processed < self->max)
- {
- **buffer = (char)output;
- (*buffer)++;
- self->committed++;
- }
- self->processed++;
-}
-
-/*************************************************************************
- * TrioOutStreamStringDynamic [private]
- */
-#define DYNAMIC_START_SIZE 32
-struct dynamicBuffer {
- char *buffer;
- size_t length;
- size_t allocated;
-};
-
-static void
-TrioOutStreamStringDynamic(trio_T *self,
- int output)
-{
- struct dynamicBuffer *infop;
-
- assert(VALID(self));
- assert(VALID(self->location));
-
- infop = (struct dynamicBuffer *)self->location;
-
- if (infop->buffer == NULL)
- {
- /* Start with a reasonable size */
- infop->buffer = (char *)TRIO_MALLOC(DYNAMIC_START_SIZE);
- if (infop->buffer == NULL)
- return; /* fail */
-
- infop->allocated = DYNAMIC_START_SIZE;
- self->processed = 0;
- self->committed = 0;
- }
- else if (self->committed + sizeof(NIL) >= infop->allocated)
- {
- char *newptr;
-
- /* Allocate increasing chunks */
- newptr = (char *)TRIO_REALLOC(infop->buffer, infop->allocated * 2);
-
- if (newptr == NULL)
- return;
-
- infop->buffer = newptr;
- infop->allocated *= 2;
- }
-
- infop->buffer[self->committed] = (char)output;
- self->committed++;
- self->processed++;
-
- infop->length = self->committed;
-}
-
-/*************************************************************************
- * printf
- */
-int
-trio_printf(const char *format,
- ...)
-{
- int status;
- va_list args;
-
- assert(VALID(format));
-
- va_start(args, format);
- status = TrioFormat(stdout, 0, TrioOutStreamFile, format, args, NULL);
- va_end(args);
- return status;
-}
-
-int
-trio_vprintf(const char *format,
- va_list args)
-{
- assert(VALID(format));
-
- return TrioFormat(stdout, 0, TrioOutStreamFile, format, args, NULL);
-}
-
-#ifdef __GNUC__
-#define UNUSED_VAR __attribute__((unused))
-#else
-#define UNUSED_VAR
-#endif
-
-static void shutup_unitialized(va_list *dummy UNUSED_VAR) {
-}
-
-int
-trio_printfv(const char *format,
- void ** args)
-{
- va_list dummy;
- shutup_unitialized(&dummy);
-
- assert(VALID(format));
-
- return TrioFormat(stdout, 0, TrioOutStreamFile, format, dummy, args);
-}
-
-/*************************************************************************
- * fprintf
- */
-int
-trio_fprintf(FILE *file,
- const char *format,
- ...)
-{
- int status;
- va_list args;
-
- assert(VALID(file));
- assert(VALID(format));
-
- va_start(args, format);
- status = TrioFormat(file, 0, TrioOutStreamFile, format, args, NULL);
- va_end(args);
- return status;
-}
-
-int
-trio_vfprintf(FILE *file,
- const char *format,
- va_list args)
-{
- assert(VALID(file));
- assert(VALID(format));
-
- return TrioFormat(file, 0, TrioOutStreamFile, format, args, NULL);
-}
-
-int
-trio_fprintfv(FILE *file,
- const char *format,
- void ** args)
-{
- va_list dummy;
- shutup_unitialized(&dummy);
-
- assert(VALID(file));
- assert(VALID(format));
-
- return TrioFormat(file, 0, TrioOutStreamFile, format, dummy, args);
-}
-
-/*************************************************************************
- * dprintf
- */
-int
-trio_dprintf(int fd,
- const char *format,
- ...)
-{
- int status;
- va_list args;
-
- assert(VALID(format));
-
- va_start(args, format);
- status = TrioFormat(&fd, 0, TrioOutStreamFileDescriptor, format, args, NULL);
- va_end(args);
- return status;
-}
-
-int
-trio_vdprintf(int fd,
- const char *format,
- va_list args)
-{
- assert(VALID(format));
-
- return TrioFormat(&fd, 0, TrioOutStreamFileDescriptor, format, args, NULL);
-}
-
-int
-trio_dprintfv(int fd,
- const char *format,
- void **args)
-{
- va_list dummy;
- shutup_unitialized(&dummy);
-
- assert(VALID(format));
-
- return TrioFormat(&fd, 0, TrioOutStreamFileDescriptor, format, dummy, args);
-}
-
-/*************************************************************************
- * sprintf
- */
-int
-trio_sprintf(char *buffer,
- const char *format,
- ...)
-{
- int status;
- va_list args;
-
- assert(VALID(buffer));
- assert(VALID(format));
-
- va_start(args, format);
- status = TrioFormat(&buffer, 0, TrioOutStreamString, format, args, NULL);
- *buffer = NIL; /* Terminate with NIL character */
- va_end(args);
- return status;
-}
-
-int
-trio_vsprintf(char *buffer,
- const char *format,
- va_list args)
-{
- int status;
-
- assert(VALID(buffer));
- assert(VALID(format));
-
- status = TrioFormat(&buffer, 0, TrioOutStreamString, format, args, NULL);
- *buffer = NIL;
- return status;
-}
-
-int
-trio_sprintfv(char *buffer,
- const char *format,
- void **args)
-{
- int status;
- va_list dummy;
- shutup_unitialized(&dummy);
-
- assert(VALID(buffer));
- assert(VALID(format));
-
- status = TrioFormat(&buffer, 0, TrioOutStreamString, format, dummy, args);
- *buffer = NIL;
- return status;
-}
-
-/*************************************************************************
- * snprintf
- */
-int
-trio_snprintf(char *buffer,
- size_t bufferSize,
- const char *format,
- ...)
-{
- int status;
- va_list args;
-
- assert(VALID(buffer));
- assert(VALID(format));
-
- va_start(args, format);
- status = TrioFormat(&buffer, bufferSize > 0 ? bufferSize - 1 : 0,
- TrioOutStreamStringMax, format, args, NULL);
- if (bufferSize > 0)
- *buffer = NIL;
- va_end(args);
- return status;
-}
-
-int
-trio_vsnprintf(char *buffer,
- size_t bufferSize,
- const char *format,
- va_list args)
-{
- int status;
-
- assert(VALID(buffer));
- assert(VALID(format));
-
- status = TrioFormat(&buffer, bufferSize > 0 ? bufferSize - 1 : 0,
- TrioOutStreamStringMax, format, args, NULL);
- if (bufferSize > 0)
- *buffer = NIL;
- return status;
-}
-
-int
-trio_snprintfv(char *buffer,
- size_t bufferSize,
- const char *format,
- void **args)
-{
- int status;
- va_list dummy;
- shutup_unitialized(&dummy);
-
- assert(VALID(buffer));
- assert(VALID(format));
-
- status = TrioFormat(&buffer, bufferSize > 0 ? bufferSize - 1 : 0,
- TrioOutStreamStringMax, format, dummy, args);
- if (bufferSize > 0)
- *buffer = NIL;
- return status;
-}
-
-/*************************************************************************
- * snprintfcat
- * Appends the new string to the buffer string overwriting the '\0'
- * character at the end of buffer.
- */
-int
-trio_snprintfcat(char *buffer,
- size_t bufferSize,
- const char *format,
- ...)
-{
- int status;
- va_list args;
- size_t buf_len;
-
- va_start(args, format);
-
- assert(VALID(buffer));
- assert(VALID(format));
-
- buf_len = strlen(buffer);
- buffer = &buffer[buf_len];
-
- status = TrioFormat(&buffer, bufferSize - 1 - buf_len,
- TrioOutStreamStringMax, format, args, NULL);
- va_end(args);
- *buffer = NIL;
- return status;
-}
-
-int
-trio_vsnprintfcat(char *buffer,
- size_t bufferSize,
- const char *format,
- va_list args)
-{
- int status;
- size_t buf_len;
- assert(VALID(buffer));
- assert(VALID(format));
-
- buf_len = strlen(buffer);
- buffer = &buffer[buf_len];
- status = TrioFormat(&buffer, bufferSize - 1 - buf_len,
- TrioOutStreamStringMax, format, args, NULL);
- *buffer = NIL;
- return status;
-}
-
-/*************************************************************************
- * trio_aprintf
- */
-
-/* Deprecated */
-char *
-trio_aprintf(const char *format,
- ...)
-{
- va_list args;
- struct dynamicBuffer info;
-
- assert(VALID(format));
-
- info.buffer = NULL;
- info.length = 0;
- info.allocated = 0;
-
- va_start(args, format);
- (void)TrioFormat(&info, 0, TrioOutStreamStringDynamic, format, args, NULL);
- va_end(args);
- if (info.length) {
- info.buffer[info.length] = NIL; /* we terminate this with a zero byte */
- return info.buffer;
- }
- else
- return NULL;
-}
-
-/* Deprecated */
-char *
-trio_vaprintf(const char *format,
- va_list args)
-{
- struct dynamicBuffer info;
-
- assert(VALID(format));
-
- info.buffer = NULL;
- info.length = 0;
- info.allocated = 0;
-
- (void)TrioFormat(&info, 0, TrioOutStreamStringDynamic, format, args, NULL);
- if (info.length) {
- info.buffer[info.length] = NIL; /* we terminate this with a zero byte */
- return info.buffer;
- }
- else
- return NULL;
-}
-
-int
-trio_asprintf(char **result,
- const char *format,
- ...)
-{
- va_list args;
- int status;
- struct dynamicBuffer info;
-
- assert(VALID(format));
-
- info.buffer = NULL;
- info.length = 0;
- info.allocated = 0;
-
- va_start(args, format);
- status = TrioFormat(&info, 0, TrioOutStreamStringDynamic, format, args, NULL);
- va_end(args);
- if (status < 0) {
- *result = NULL;
- return status;
- }
- if (info.length == 0) {
- /*
- * If the length is zero, no characters have been written and therefore
- * no memory has been allocated, but we must to allocate and return an
- * empty string.
- */
- info.buffer = (char *)TRIO_MALLOC(sizeof(char));
- if (info.buffer == NULL) {
- *result = NULL;
- return TRIO_ERROR_RETURN(TRIO_ENOMEM, 0);
- }
- }
- info.buffer[info.length] = NIL; /* we terminate this with a zero byte */
- *result = info.buffer;
-
- return status;
-}
-
-int
-trio_vasprintf(char **result,
- const char *format,
- va_list args)
-{
- int status;
- struct dynamicBuffer info;
-
- assert(VALID(format));
-
- info.buffer = NULL;
- info.length = 0;
- info.allocated = 0;
-
- status = TrioFormat(&info, 0, TrioOutStreamStringDynamic, format, args, NULL);
- if (status < 0) {
- *result = NULL;
- return status;
- }
- if (info.length == 0) {
- info.buffer = (char *)TRIO_MALLOC(sizeof(char));
- if (info.buffer == NULL) {
- *result = NULL;
- return TRIO_ERROR_RETURN(TRIO_ENOMEM, 0);
- }
- }
- info.buffer[info.length] = NIL; /* we terminate this with a zero byte */
- *result = info.buffer;
-
- return status;
-}
-
-
-/*************************************************************************
- *
- * @CALLBACK
- *
- ************************************************************************/
-
-
-/*************************************************************************
- * trio_register [public]
- */
-void *
-trio_register(trio_callback_t callback,
- const char *name)
-{
- userdef_T *def;
- userdef_T *prev = NULL;
-
- if (callback == NULL)
- return NULL;
-
- if (name)
- {
- /* Handle built-in namespaces */
- if (name[0] == ':')
- {
- if (StrEqual(name, ":enter"))
- {
- internalEnterCriticalRegion = callback;
- }
- else if (StrEqual(name, ":leave"))
- {
- internalLeaveCriticalRegion = callback;
- }
- return NULL;
- }
-
- /* Bail out if namespace is too long */
- if (StrLength(name) >= MAX_USER_NAME)
- return NULL;
-
- /* Bail out if namespace already is registered */
- def = TrioFindNamespace(name, &prev);
- if (def)
- return NULL;
- }
-
- def = (userdef_T *)TRIO_MALLOC(sizeof(userdef_T));
- if (def)
- {
- if (internalEnterCriticalRegion)
- (void)internalEnterCriticalRegion(NULL);
-
- if (name)
- {
- /* Link into internal list */
- if (prev == NULL)
- internalUserDef = def;
- else
- prev->next = def;
- }
- /* Initialize */
- def->callback = callback;
- def->name = (name == NULL)
- ? NULL
- : StrDuplicate(name);
- def->next = NULL;
-
- if (internalLeaveCriticalRegion)
- (void)internalLeaveCriticalRegion(NULL);
- }
- return def;
-}
-
-/*************************************************************************
- * trio_unregister [public]
- */
-void
-trio_unregister(void *handle)
-{
- userdef_T *self = (userdef_T *)handle;
- userdef_T *def;
- userdef_T *prev = NULL;
-
- assert(VALID(self));
-
- if (self->name)
- {
- def = TrioFindNamespace(self->name, &prev);
- if (def)
- {
- if (internalEnterCriticalRegion)
- (void)internalEnterCriticalRegion(NULL);
-
- if (prev == NULL)
- internalUserDef = NULL;
- else
- prev->next = def->next;
-
- if (internalLeaveCriticalRegion)
- (void)internalLeaveCriticalRegion(NULL);
- }
- StrFree(self->name);
- }
- TRIO_FREE(self);
-}
-
-/*************************************************************************
- * trio_get_format [public]
- */
-const char *
-trio_get_format(void *ref)
-{
- assert(((reference_T *)ref)->parameter->type == FORMAT_USER_DEFINED);
-
- return (((reference_T *)ref)->parameter->user_data);
-}
-
-/*************************************************************************
- * trio_get_argument [public]
- */
-void *
-trio_get_argument(void *ref)
-{
- assert(((reference_T *)ref)->parameter->type == FORMAT_USER_DEFINED);
-
- return ((reference_T *)ref)->parameter->data.pointer;
-}
-
-/*************************************************************************
- * trio_get_width / trio_set_width [public]
- */
-int
-trio_get_width(void *ref)
-{
- return ((reference_T *)ref)->parameter->width;
-}
-
-void
-trio_set_width(void *ref,
- int width)
-{
- ((reference_T *)ref)->parameter->width = width;
-}
-
-/*************************************************************************
- * trio_get_precision / trio_set_precision [public]
- */
-int
-trio_get_precision(void *ref)
-{
- return (((reference_T *)ref)->parameter->precision);
-}
-
-void
-trio_set_precision(void *ref,
- int precision)
-{
- ((reference_T *)ref)->parameter->precision = precision;
-}
-
-/*************************************************************************
- * trio_get_base / trio_set_base [public]
- */
-int
-trio_get_base(void *ref)
-{
- return (((reference_T *)ref)->parameter->base);
-}
-
-void
-trio_set_base(void *ref,
- int base)
-{
- ((reference_T *)ref)->parameter->base = base;
-}
-
-/*************************************************************************
- * trio_get_long / trio_set_long [public]
- */
-int
-trio_get_long(void *ref)
-{
- return (((reference_T *)ref)->parameter->flags & FLAGS_LONG);
-}
-
-void
-trio_set_long(void *ref,
- int is_long)
-{
- if (is_long)
- ((reference_T *)ref)->parameter->flags |= FLAGS_LONG;
- else
- ((reference_T *)ref)->parameter->flags &= ~FLAGS_LONG;
-}
-
-/*************************************************************************
- * trio_get_longlong / trio_set_longlong [public]
- */
-int
-trio_get_longlong(void *ref)
-{
- return (((reference_T *)ref)->parameter->flags & FLAGS_QUAD);
-}
-
-void
-trio_set_longlong(void *ref,
- int is_longlong)
-{
- if (is_longlong)
- ((reference_T *)ref)->parameter->flags |= FLAGS_QUAD;
- else
- ((reference_T *)ref)->parameter->flags &= ~FLAGS_QUAD;
-}
-
-/*************************************************************************
- * trio_get_longdouble / trio_set_longdouble [public]
- */
-int
-trio_get_longdouble(void *ref)
-{
- return (((reference_T *)ref)->parameter->flags & FLAGS_LONGDOUBLE);
-}
-
-void
-trio_set_longdouble(void *ref,
- int is_longdouble)
-{
- if (is_longdouble)
- ((reference_T *)ref)->parameter->flags |= FLAGS_LONGDOUBLE;
- else
- ((reference_T *)ref)->parameter->flags &= ~FLAGS_LONGDOUBLE;
-}
-
-/*************************************************************************
- * trio_get_short / trio_set_short [public]
- */
-int
-trio_get_short(void *ref)
-{
- return (((reference_T *)ref)->parameter->flags & FLAGS_SHORT);
-}
-
-void
-trio_set_short(void *ref,
- int is_short)
-{
- if (is_short)
- ((reference_T *)ref)->parameter->flags |= FLAGS_SHORT;
- else
- ((reference_T *)ref)->parameter->flags &= ~FLAGS_SHORT;
-}
-
-/*************************************************************************
- * trio_get_shortshort / trio_set_shortshort [public]
- */
-int
-trio_get_shortshort(void *ref)
-{
- return (((reference_T *)ref)->parameter->flags & FLAGS_SHORTSHORT);
-}
-
-void
-trio_set_shortshort(void *ref,
- int is_shortshort)
-{
- if (is_shortshort)
- ((reference_T *)ref)->parameter->flags |= FLAGS_SHORTSHORT;
- else
- ((reference_T *)ref)->parameter->flags &= ~FLAGS_SHORTSHORT;
-}
-
-/*************************************************************************
- * trio_get_alternative / trio_set_alternative [public]
- */
-int
-trio_get_alternative(void *ref)
-{
- return (((reference_T *)ref)->parameter->flags & FLAGS_ALTERNATIVE);
-}
-
-void
-trio_set_alternative(void *ref,
- int is_alternative)
-{
- if (is_alternative)
- ((reference_T *)ref)->parameter->flags |= FLAGS_ALTERNATIVE;
- else
- ((reference_T *)ref)->parameter->flags &= ~FLAGS_ALTERNATIVE;
-}
-
-/*************************************************************************
- * trio_get_alignment / trio_set_alignment [public]
- */
-int
-trio_get_alignment(void *ref)
-{
- return (((reference_T *)ref)->parameter->flags & FLAGS_LEFTADJUST);
-}
-
-void
-trio_set_alignment(void *ref,
- int is_leftaligned)
-{
- if (is_leftaligned)
- ((reference_T *)ref)->parameter->flags |= FLAGS_LEFTADJUST;
- else
- ((reference_T *)ref)->parameter->flags &= ~FLAGS_LEFTADJUST;
-}
-
-/*************************************************************************
- * trio_get_spacing /trio_set_spacing [public]
- */
-int
-trio_get_spacing(void *ref)
-{
- return (((reference_T *)ref)->parameter->flags & FLAGS_SPACE);
-}
-
-void
-trio_set_spacing(void *ref,
- int is_space)
-{
- if (is_space)
- ((reference_T *)ref)->parameter->flags |= FLAGS_SPACE;
- else
- ((reference_T *)ref)->parameter->flags &= ~FLAGS_SPACE;
-}
-
-/*************************************************************************
- * trio_get_sign / trio_set_sign [public]
- */
-int
-trio_get_sign(void *ref)
-{
- return (((reference_T *)ref)->parameter->flags & FLAGS_SHOWSIGN);
-}
-
-void
-trio_set_sign(void *ref,
- int is_sign)
-{
- if (is_sign)
- ((reference_T *)ref)->parameter->flags |= FLAGS_SHOWSIGN;
- else
- ((reference_T *)ref)->parameter->flags &= ~FLAGS_SHOWSIGN;
-}
-
-/*************************************************************************
- * trio_get_padding / trio_set_padding [public]
- */
-int
-trio_get_padding(void *ref)
-{
- return (((reference_T *)ref)->parameter->flags & FLAGS_NILPADDING);
-}
-
-void
-trio_set_padding(void *ref,
- int is_padding)
-{
- if (is_padding)
- ((reference_T *)ref)->parameter->flags |= FLAGS_NILPADDING;
- else
- ((reference_T *)ref)->parameter->flags &= ~FLAGS_NILPADDING;
-}
-
-/*************************************************************************
- * trio_get_quote / trio_set_quote [public]
- */
-int
-trio_get_quote(void *ref)
-{
- return (((reference_T *)ref)->parameter->flags & FLAGS_QUOTE);
-}
-
-void
-trio_set_quote(void *ref,
- int is_quote)
-{
- if (is_quote)
- ((reference_T *)ref)->parameter->flags |= FLAGS_QUOTE;
- else
- ((reference_T *)ref)->parameter->flags &= ~FLAGS_QUOTE;
-}
-
-/*************************************************************************
- * trio_get_upper / trio_set_upper [public]
- */
-int
-trio_get_upper(void *ref)
-{
- return (((reference_T *)ref)->parameter->flags & FLAGS_UPPER);
-}
-
-void
-trio_set_upper(void *ref,
- int is_upper)
-{
- if (is_upper)
- ((reference_T *)ref)->parameter->flags |= FLAGS_UPPER;
- else
- ((reference_T *)ref)->parameter->flags &= ~FLAGS_UPPER;
-}
-
-/*************************************************************************
- * trio_get_largest / trio_set_largest [public]
- */
-#if TRIO_C99
-int
-trio_get_largest(void *ref)
-{
- return (((reference_T *)ref)->parameter->flags & FLAGS_INTMAX_T);
-}
-
-void
-trio_set_largest(void *ref,
- int is_largest)
-{
- if (is_largest)
- ((reference_T *)ref)->parameter->flags |= FLAGS_INTMAX_T;
- else
- ((reference_T *)ref)->parameter->flags &= ~FLAGS_INTMAX_T;
-}
-#endif
-
-/*************************************************************************
- * trio_get_ptrdiff / trio_set_ptrdiff [public]
- */
-int
-trio_get_ptrdiff(void *ref)
-{
- return (((reference_T *)ref)->parameter->flags & FLAGS_PTRDIFF_T);
-}
-
-void
-trio_set_ptrdiff(void *ref,
- int is_ptrdiff)
-{
- if (is_ptrdiff)
- ((reference_T *)ref)->parameter->flags |= FLAGS_PTRDIFF_T;
- else
- ((reference_T *)ref)->parameter->flags &= ~FLAGS_PTRDIFF_T;
-}
-
-/*************************************************************************
- * trio_get_size / trio_set_size [public]
- */
-#if TRIO_C99
-int
-trio_get_size(void *ref)
-{
- return (((reference_T *)ref)->parameter->flags & FLAGS_SIZE_T);
-}
-
-void
-trio_set_size(void *ref,
- int is_size)
-{
- if (is_size)
- ((reference_T *)ref)->parameter->flags |= FLAGS_SIZE_T;
- else
- ((reference_T *)ref)->parameter->flags &= ~FLAGS_SIZE_T;
-}
-#endif
-
-/*************************************************************************
- * trio_print_int [public]
- */
-void
-trio_print_int(void *ref,
- int number)
-{
- reference_T *self = (reference_T *)ref;
-
- TrioWriteNumber(self->data,
- (trio_intmax_t)number,
- self->parameter->flags,
- self->parameter->width,
- self->parameter->precision,
- self->parameter->base);
-}
-
-/*************************************************************************
- * trio_print_uint [public]
- */
-void
-trio_print_uint(void *ref,
- unsigned int number)
-{
- reference_T *self = (reference_T *)ref;
-
- TrioWriteNumber(self->data,
- (trio_intmax_t)number,
- self->parameter->flags | FLAGS_UNSIGNED,
- self->parameter->width,
- self->parameter->precision,
- self->parameter->base);
-}
-
-/*************************************************************************
- * trio_print_double [public]
- */
-void
-trio_print_double(void *ref,
- double number)
-{
- reference_T *self = (reference_T *)ref;
-
- TrioWriteDouble(self->data,
- number,
- self->parameter->flags,
- self->parameter->width,
- self->parameter->precision,
- self->parameter->base);
-}
-
-/*************************************************************************
- * trio_print_string [public]
- */
-void
-trio_print_string(void *ref,
- char *string)
-{
- reference_T *self = (reference_T *)ref;
-
- TrioWriteString(self->data,
- string,
- self->parameter->flags,
- self->parameter->width,
- self->parameter->precision);
-}
-
-/*************************************************************************
- * trio_print_pointer [public]
- */
-void
-trio_print_pointer(void *ref,
- void *pointer)
-{
- reference_T *self = (reference_T *)ref;
- unsigned long flags;
- trio_uintmax_t number;
-
- if (NULL == pointer)
- {
- const char *string = null;
- while (*string)
- self->data->OutStream(self->data, *string++);
- }
- else
- {
- /*
- * The subtraction of the null pointer is a workaround
- * to avoid a compiler warning. The performance overhead
- * is negligible (and likely to be removed by an
- * optimising compiler). The (char *) casting is done
- * to please ANSI C++.
- */
- number = (trio_uintmax_t)((char *)pointer - (char *)0);
- /* Shrink to size of pointer */
- number &= (trio_uintmax_t)-1;
- flags = self->parameter->flags;
- flags |= (FLAGS_UNSIGNED | FLAGS_ALTERNATIVE |
- FLAGS_NILPADDING);
- TrioWriteNumber(self->data,
- (trio_intmax_t)number,
- flags,
- POINTER_WIDTH,
- NO_PRECISION,
- BASE_HEX);
- }
-}
-
-/*************************************************************************
- * trio_print_ref [public]
- */
-int
-trio_print_ref(void *ref,
- const char *format,
- ...)
-{
- int status;
- va_list arglist;
-
- assert(VALID(format));
-
- va_start(arglist, format);
- status = TrioFormatRef((reference_T *)ref, format, arglist, NULL);
- va_end(arglist);
- return status;
-}
-
-/*************************************************************************
- * trio_vprint_ref [public]
- */
-int
-trio_vprint_ref(void *ref,
- const char *format,
- va_list arglist)
-{
- assert(VALID(format));
-
- return TrioFormatRef((reference_T *)ref, format, arglist, NULL);
-}
-
-/*************************************************************************
- * trio_printv_ref [public]
- */
-int
-trio_printv_ref(void *ref,
- const char *format,
- void **argarray)
-{
- va_list dummy;
- shutup_unitialized(&dummy);
-
- assert(VALID(format));
-
- return TrioFormatRef((reference_T *)ref, format, dummy, argarray);
-}
-
-
-/*************************************************************************
- *
- * @SCANNING
- *
- ************************************************************************/
-
-
-/*************************************************************************
- * TrioSkipWhitespaces [private]
- */
-static int
-TrioSkipWhitespaces(trio_T *self)
-{
- int ch;
-
- ch = self->current;
- while (isspace(ch))
- {
- self->InStream(self, &ch);
- }
- return ch;
-}
-
-/*************************************************************************
- * TrioGetCollation [private]
- */
-#if TRIO_EXTENSION
-static void
-TrioGetCollation()
-{
- int i;
- int j;
- int k;
- char first[2];
- char second[2];
-
- /* This is computational expensive */
- first[1] = NIL;
- second[1] = NIL;
- for (i = 0; i < MAX_CHARACTER_CLASS; i++)
- {
- k = 0;
- first[0] = (char)i;
- for (j = 0; j < MAX_CHARACTER_CLASS; j++)
- {
- second[0] = (char)j;
- if (StrEqualLocale(first, second))
- internalCollationArray[i][k++] = (char)j;
- }
- internalCollationArray[i][k] = NIL;
- }
-}
-#endif
-
-/*************************************************************************
- * TrioGetCharacterClass [private]
- *
- * FIXME:
- * multibyte
- */
-static int
-TrioGetCharacterClass(const char *format,
- int *indexPointer,
- unsigned long *flagsPointer,
- int *characterclass)
-{
- int index = *indexPointer;
- int i;
- char ch;
- char range_begin;
- char range_end;
-
- *flagsPointer &= ~FLAGS_EXCLUDE;
-
- if (format[index] == QUALIFIER_CIRCUMFLEX)
- {
- *flagsPointer |= FLAGS_EXCLUDE;
- index++;
- }
- /*
- * If the ungroup character is at the beginning of the scanlist,
- * it will be part of the class, and a second ungroup character
- * must follow to end the group.
- */
- if (format[index] == SPECIFIER_UNGROUP)
- {
- characterclass[(int)SPECIFIER_UNGROUP]++;
- index++;
- }
- /*
- * Minus is used to specify ranges. To include minus in the class,
- * it must be at the beginning of the list
- */
- if (format[index] == QUALIFIER_MINUS)
- {
- characterclass[(int)QUALIFIER_MINUS]++;
- index++;
- }
- /* Collect characters */
- for (ch = format[index];
- (ch != SPECIFIER_UNGROUP) && (ch != NIL);
- ch = format[++index])
- {
- switch (ch)
- {
- case QUALIFIER_MINUS: /* Scanlist ranges */
-
- /*
- * Both C99 and UNIX98 describes ranges as implementation-
- * defined.
- *
- * We support the following behaviour (although this may
- * change as we become wiser)
- * - only increasing ranges, ie. [a-b] but not [b-a]
- * - transitive ranges, ie. [a-b-c] == [a-c]
- * - trailing minus, ie. [a-] is interpreted as an 'a'
- * and a '-'
- * - duplicates (although we can easily convert these
- * into errors)
- */
- range_begin = format[index - 1];
- range_end = format[++index];
- if (range_end == SPECIFIER_UNGROUP)
- {
- /* Trailing minus is included */
- characterclass[(int)ch]++;
- ch = range_end;
- break; /* for */
- }
- if (range_end == NIL)
- return TRIO_ERROR_RETURN(TRIO_EINVAL, index);
- if (range_begin > range_end)
- return TRIO_ERROR_RETURN(TRIO_ERANGE, index);
-
- for (i = (int)range_begin; i <= (int)range_end; i++)
- characterclass[i]++;
-
- ch = range_end;
- break;
-
-#if TRIO_EXTENSION
-
- case SPECIFIER_GROUP:
-
- switch (format[index + 1])
- {
- case QUALIFIER_DOT: /* Collating symbol */
- /*
- * FIXME: This will be easier to implement when multibyte
- * characters have been implemented. Until now, we ignore
- * this feature.
- */
- for (i = index + 2; ; i++)
- {
- if (format[i] == NIL)
- /* Error in syntax */
- return -1;
- else if (format[i] == QUALIFIER_DOT)
- break; /* for */
- }
- if (format[++i] != SPECIFIER_UNGROUP)
- return -1;
-
- index = i;
- break;
-
- case QUALIFIER_EQUAL: /* Equivalence class expressions */
- {
- unsigned int j;
- unsigned int k;
-
- if (internalCollationUnconverted)
- {
- /* Lazy evalutation of collation array */
- TrioGetCollation();
- internalCollationUnconverted = FALSE;
- }
- for (i = index + 2; ; i++)
- {
- if (format[i] == NIL)
- /* Error in syntax */
- return -1;
- else if (format[i] == QUALIFIER_EQUAL)
- break; /* for */
- else
- {
- /* Mark any equivalent character */
- k = (unsigned int)format[i];
- for (j = 0; internalCollationArray[k][j] != NIL; j++)
- characterclass[(int)internalCollationArray[k][j]]++;
- }
- }
- if (format[++i] != SPECIFIER_UNGROUP)
- return -1;
-
- index = i;
- }
- break;
-
- case QUALIFIER_COLON: /* Character class expressions */
-
- if (StrEqualMax(CLASS_ALNUM, sizeof(CLASS_ALNUM) - 1,
- &format[index]))
- {
- for (i = 0; i < MAX_CHARACTER_CLASS; i++)
- if (isalnum(i))
- characterclass[i]++;
- index += sizeof(CLASS_ALNUM) - 1;
- }
- else if (StrEqualMax(CLASS_ALPHA, sizeof(CLASS_ALPHA) - 1,
- &format[index]))
- {
- for (i = 0; i < MAX_CHARACTER_CLASS; i++)
- if (isalpha(i))
- characterclass[i]++;
- index += sizeof(CLASS_ALPHA) - 1;
- }
- else if (StrEqualMax(CLASS_CNTRL, sizeof(CLASS_CNTRL) - 1,
- &format[index]))
- {
- for (i = 0; i < MAX_CHARACTER_CLASS; i++)
- if (iscntrl(i))
- characterclass[i]++;
- index += sizeof(CLASS_CNTRL) - 1;
- }
- else if (StrEqualMax(CLASS_DIGIT, sizeof(CLASS_DIGIT) - 1,
- &format[index]))
- {
- for (i = 0; i < MAX_CHARACTER_CLASS; i++)
- if (isdigit(i))
- characterclass[i]++;
- index += sizeof(CLASS_DIGIT) - 1;
- }
- else if (StrEqualMax(CLASS_GRAPH, sizeof(CLASS_GRAPH) - 1,
- &format[index]))
- {
- for (i = 0; i < MAX_CHARACTER_CLASS; i++)
- if (isgraph(i))
- characterclass[i]++;
- index += sizeof(CLASS_GRAPH) - 1;
- }
- else if (StrEqualMax(CLASS_LOWER, sizeof(CLASS_LOWER) - 1,
- &format[index]))
- {
- for (i = 0; i < MAX_CHARACTER_CLASS; i++)
- if (islower(i))
- characterclass[i]++;
- index += sizeof(CLASS_LOWER) - 1;
- }
- else if (StrEqualMax(CLASS_PRINT, sizeof(CLASS_PRINT) - 1,
- &format[index]))
- {
- for (i = 0; i < MAX_CHARACTER_CLASS; i++)
- if (isprint(i))
- characterclass[i]++;
- index += sizeof(CLASS_PRINT) - 1;
- }
- else if (StrEqualMax(CLASS_PUNCT, sizeof(CLASS_PUNCT) - 1,
- &format[index]))
- {
- for (i = 0; i < MAX_CHARACTER_CLASS; i++)
- if (ispunct(i))
- characterclass[i]++;
- index += sizeof(CLASS_PUNCT) - 1;
- }
- else if (StrEqualMax(CLASS_SPACE, sizeof(CLASS_SPACE) - 1,
- &format[index]))
- {
- for (i = 0; i < MAX_CHARACTER_CLASS; i++)
- if (isspace(i))
- characterclass[i]++;
- index += sizeof(CLASS_SPACE) - 1;
- }
- else if (StrEqualMax(CLASS_UPPER, sizeof(CLASS_UPPER) - 1,
- &format[index]))
- {
- for (i = 0; i < MAX_CHARACTER_CLASS; i++)
- if (isupper(i))
- characterclass[i]++;
- index += sizeof(CLASS_UPPER) - 1;
- }
- else if (StrEqualMax(CLASS_XDIGIT, sizeof(CLASS_XDIGIT) - 1,
- &format[index]))
- {
- for (i = 0; i < MAX_CHARACTER_CLASS; i++)
- if (isxdigit(i))
- characterclass[i]++;
- index += sizeof(CLASS_XDIGIT) - 1;
- }
- else
- {
- characterclass[(int)ch]++;
- }
- break;
-
- default:
- characterclass[(int)ch]++;
- break;
- }
- break;
-
-#endif /* TRIO_EXTENSION */
-
- default:
- characterclass[(int)ch]++;
- break;
- }
- }
- return 0;
-}
-
-/*************************************************************************
- * TrioReadNumber [private]
- *
- * We implement our own number conversion in preference of strtol and
- * strtoul, because we must handle 'long long' and thousand separators.
- */
-static BOOLEAN_T
-TrioReadNumber(trio_T *self,
- trio_uintmax_t *target,
- unsigned long flags,
- int width,
- int base)
-{
- trio_uintmax_t number = 0;
- int digit;
- int count;
- BOOLEAN_T isNegative = FALSE;
- int j;
-
- assert(VALID(self));
- assert(VALID(self->InStream));
- assert((base >= MIN_BASE && base <= MAX_BASE) || (base == NO_BASE));
-
- if (internalDigitsUnconverted)
- {
- /* Lazy evaluation of digits array */
- memset(internalDigitArray, -1, sizeof(internalDigitArray));
- for (j = 0; j < (int)sizeof(internalDigitsLower) - 1; j++)
- {
- internalDigitArray[(int)internalDigitsLower[j]] = j;
- internalDigitArray[(int)internalDigitsUpper[j]] = j;
- }
- internalDigitsUnconverted = FALSE;
- }
-
- TrioSkipWhitespaces(self);
-
- if (!(flags & FLAGS_UNSIGNED))
- {
- /* Leading sign */
- if (self->current == '+')
- {
- self->InStream(self, NULL);
- }
- else if (self->current == '-')
- {
- self->InStream(self, NULL);
- isNegative = TRUE;
- }
- }
-
- count = self->processed;
-
- if (flags & FLAGS_ALTERNATIVE)
- {
- switch (base)
- {
- case NO_BASE:
- case BASE_OCTAL:
- case BASE_HEX:
- case BASE_BINARY:
- if (self->current == '0')
- {
- self->InStream(self, NULL);
- if (self->current)
- {
- if ((base == BASE_HEX) &&
- (toupper(self->current) == 'X'))
- {
- self->InStream(self, NULL);
- }
- else if ((base == BASE_BINARY) &&
- (toupper(self->current) == 'B'))
- {
- self->InStream(self, NULL);
- }
- }
- }
- else
- return FALSE;
- break;
- default:
- break;
- }
- }
-
- while (((width == NO_WIDTH) || (self->processed - count < width)) &&
- (! ((self->current == EOF) || isspace(self->current))))
- {
- if (isascii(self->current))
- {
- digit = internalDigitArray[self->current];
- /* Abort if digit is not allowed in the specified base */
- if ((digit == -1) || (digit >= base))
- break;
- }
- else if (flags & FLAGS_QUOTE)
- {
- /* Compare with thousands separator */
- for (j = 0; internalThousandSeparator[j] && self->current; j++)
- {
- if (internalThousandSeparator[j] != self->current)
- break;
-
- self->InStream(self, NULL);
- }
- if (internalThousandSeparator[j])
- break; /* Mismatch */
- else
- continue; /* Match */
- }
- else
- break;
-
- number *= base;
- number += digit;
-
- self->InStream(self, NULL);
- }
-
- /* Was anything read at all? */
- if (self->processed == count)
- return FALSE;
-
- if (target)
- *target = (isNegative) ? -number : number;
- return TRUE;
-}
-
-/*************************************************************************
- * TrioReadChar [private]
- */
-static int
-TrioReadChar(trio_T *self,
- char *target,
- unsigned long flags,
- int width)
-{
- int i;
- char ch;
- trio_uintmax_t number;
-
- assert(VALID(self));
- assert(VALID(self->InStream));
-
- for (i = 0;
- (self->current != EOF) && (i < width);
- i++)
- {
- ch = (char)self->current;
- self->InStream(self, NULL);
- if ((flags & FLAGS_ALTERNATIVE) && (ch == CHAR_BACKSLASH))
- {
- switch (self->current)
- {
- case '\\': ch = '\\'; break;
- case 'a': ch = '\007'; break;
- case 'b': ch = '\b'; break;
- case 'f': ch = '\f'; break;
- case 'n': ch = '\n'; break;
- case 'r': ch = '\r'; break;
- case 't': ch = '\t'; break;
- case 'v': ch = '\v'; break;
- default:
- if (isdigit(self->current))
- {
- /* Read octal number */
- if (!TrioReadNumber(self, &number, 0, 3, BASE_OCTAL))
- return 0;
- ch = (char)number;
- }
- else if (toupper(self->current) == 'X')
- {
- /* Read hexadecimal number */
- self->InStream(self, NULL);
- if (!TrioReadNumber(self, &number, 0, 2, BASE_HEX))
- return 0;
- ch = (char)number;
- }
- else
- {
- ch = (char)self->current;
- }
- break;
- }
- }
-
- if (target)
- target[i] = ch;
- }
- return i + 1;
-}
-
-/*************************************************************************
- * TrioReadString [private]
- */
-static BOOLEAN_T
-TrioReadString(trio_T *self,
- char *target,
- unsigned long flags,
- int width)
-{
- int i;
-
- assert(VALID(self));
- assert(VALID(self->InStream));
-
- TrioSkipWhitespaces(self);
-
- /*
- * Continue until end of string is reached, a whitespace is encountered,
- * or width is exceeded
- */
- for (i = 0;
- ((width == NO_WIDTH) || (i < width)) &&
- (! ((self->current == EOF) || isspace(self->current)));
- i++)
- {
- if (TrioReadChar(self, &target[i], flags, 1) == 0)
- break; /* for */
- }
- if (target)
- target[i] = NIL;
- return TRUE;
-}
-
-/*************************************************************************
- * TrioReadWideChar [private]
- */
-#if TRIO_WIDECHAR
-static int
-TrioReadWideChar(trio_T *self,
- wchar_t *target,
- unsigned long flags,
- int width)
-{
- int i;
- int j;
- int size;
- int amount = 0;
- wchar_t wch;
- char buffer[MB_LEN_MAX + 1];
-
- assert(VALID(self));
- assert(VALID(self->InStream));
-
- for (i = 0;
- (self->current != EOF) && (i < width);
- i++)
- {
- if (isascii(self->current))
- {
- if (TrioReadChar(self, buffer, flags, 1) == 0)
- return 0;
- buffer[1] = NIL;
- }
- else
- {
- /*
- * Collect a multibyte character, by enlarging buffer until
- * it contains a fully legal multibyte character, or the
- * buffer is full.
- */
- j = 0;
- do
- {
- buffer[j++] = (char)self->current;
- buffer[j] = NIL;
- self->InStream(self, NULL);
- }
- while ((j < (int)sizeof(buffer)) && (mblen(buffer, (size_t)j) != j));
- }
- if (target)
- {
- size = mbtowc(&wch, buffer, sizeof(buffer));
- if (size > 0)
- target[i] = wch;
- }
- amount += size;
- self->InStream(self, NULL);
- }
- return amount;
-}
-#endif /* TRIO_WIDECHAR */
-
-/*************************************************************************
- * TrioReadWideString [private]
- */
-#if TRIO_WIDECHAR
-static BOOLEAN_T
-TrioReadWideString(trio_T *self,
- wchar_t *target,
- unsigned long flags,
- int width)
-{
- int i;
- int size;
-
- assert(VALID(self));
- assert(VALID(self->InStream));
-
- TrioSkipWhitespaces(self);
-
-#if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE)
- mblen(NULL, 0);
-#endif
-
- /*
- * Continue until end of string is reached, a whitespace is encountered,
- * or width is exceeded
- */
- for (i = 0;
- ((width == NO_WIDTH) || (i < width)) &&
- (! ((self->current == EOF) || isspace(self->current)));
- )
- {
- size = TrioReadWideChar(self, &target[i], flags, 1);
- if (size == 0)
- break; /* for */
-
- i += size;
- }
- if (target)
- target[i] = L'\0';
- return TRUE;
-}
-#endif /* TRIO_WIDECHAR */
-
-/*************************************************************************
- * TrioReadGroup [private]
- *
- * FIXME: characterclass does not work with multibyte characters
- */
-static BOOLEAN_T
-TrioReadGroup(trio_T *self,
- char *target,
- int *characterclass,
- unsigned long flags,
- int width)
-{
- int ch;
- int i;
-
- assert(VALID(self));
- assert(VALID(self->InStream));
-
- ch = self->current;
- for (i = 0;
- ((width == NO_WIDTH) || (i < width)) &&
- (! ((ch == EOF) ||
- (((flags & FLAGS_EXCLUDE) != 0) ^ (characterclass[ch] == 0))));
- i++)
- {
- if (target)
- target[i] = (char)ch;
- self->InStream(self, &ch);
- }
-
- if (target)
- target[i] = NIL;
- return TRUE;
-}
-
-/*************************************************************************
- * TrioReadDouble [private]
- *
- * FIXME:
- * add long double
- */
-static BOOLEAN_T
-TrioReadDouble(trio_T *self,
- double *target,
- unsigned long flags,
- int width)
-{
- int ch;
- char doubleString[512] = "";
- int index = 0;
- int start;
- int j;
- BOOLEAN_T isHex = FALSE;
-
- if ((width == NO_WIDTH) || (width > (int)sizeof(doubleString) - 1))
- width = sizeof(doubleString) - 1;
-
- TrioSkipWhitespaces(self);
-
- /*
- * Read entire double number from stream. StrToDouble requires a
- * string as input, but InStream can be anything, so we have to
- * collect all characters.
- */
- ch = self->current;
- if ((ch == '+') || (ch == '-'))
- {
- doubleString[index++] = (char)ch;
- self->InStream(self, &ch);
- width--;
- }
-
- start = index;
- switch (ch)
- {
- case 'n':
- case 'N':
- /* Not-a-number */
- if (index != 0)
- break;
- /* FALLTHROUGH */
- case 'i':
- case 'I':
- /* Infinity */
- while (isalpha(ch) && (index - start < width))
- {
- doubleString[index++] = (char)ch;
- self->InStream(self, &ch);
- }
- doubleString[index] = NIL;
-
- /* Case insensitive string comparison */
- if (StrEqual(&doubleString[start], INFINITE_UPPER) ||
- StrEqual(&doubleString[start], LONG_INFINITE_UPPER))
- {
- *target = ((start == 1 && doubleString[0] == '-'))
- ? -HUGE_VAL
- : HUGE_VAL;
- return TRUE;
- }
- if (StrEqual(doubleString, NAN_LOWER))
- {
- /* NaN must not have a preceeding + nor - */
- *target = TrioGenerateNaN();
- return TRUE;
- }
- return FALSE;
-
- default:
- break;
- }
-
- if (ch == '0')
- {
- doubleString[index++] = (char)ch;
- self->InStream(self, &ch);
- if (toupper(ch) == 'X')
- {
- isHex = TRUE;
- doubleString[index++] = (char)ch;
- self->InStream(self, &ch);
- }
- }
- while ((ch != EOF) && (index - start < width))
- {
- /* Integer part */
- if (isHex ? isxdigit(ch) : isdigit(ch))
- {
- doubleString[index++] = (char)ch;
- self->InStream(self, &ch);
- }
- else if (flags & FLAGS_QUOTE)
- {
- /* Compare with thousands separator */
- for (j = 0; internalThousandSeparator[j] && self->current; j++)
- {
- if (internalThousandSeparator[j] != self->current)
- break;
-
- self->InStream(self, &ch);
- }
- if (internalThousandSeparator[j])
- break; /* Mismatch */
- else
- continue; /* Match */
- }
- else
- break; /* while */
- }
- if (ch == '.')
- {
- /* Decimal part */
- doubleString[index++] = (char)ch;
- self->InStream(self, &ch);
- while ((isHex ? isxdigit(ch) : isdigit(ch)) &&
- (index - start < width))
- {
- doubleString[index++] = (char)ch;
- self->InStream(self, &ch);
- }
- if (isHex ? (toupper(ch) == 'P') : (toupper(ch) == 'E'))
- {
- /* Exponent */
- doubleString[index++] = (char)ch;
- self->InStream(self, &ch);
- if ((ch == '+') || (ch == '-'))
- {
- doubleString[index++] = (char)ch;
- self->InStream(self, &ch);
- }
- while ((isHex ? isxdigit(ch) : isdigit(ch)) &&
- (index - start < width))
- {
- doubleString[index++] = (char)ch;
- self->InStream(self, &ch);
- }
- }
- }
-
- if ((index == start) || (*doubleString == NIL))
- return FALSE;
-
- if (flags & FLAGS_LONGDOUBLE)
-/* *longdoublePointer = StrToLongDouble()*/
- return FALSE; /* FIXME: Remove when long double is implemented */
- else
- {
- *target = StrToDouble(doubleString, NULL);
- }
- return TRUE;
-}
-
-/*************************************************************************
- * TrioReadPointer [private]
- */
-static BOOLEAN_T
-TrioReadPointer(trio_T *self,
- void **target,
- unsigned long flags)
-{
- trio_uintmax_t number;
- char buffer[sizeof(null)];
-
- flags |= (FLAGS_UNSIGNED | FLAGS_ALTERNATIVE | FLAGS_NILPADDING);
-
- if (TrioReadNumber(self,
- &number,
- flags,
- POINTER_WIDTH,
- BASE_HEX))
- {
- /*
- * The strange assignment of number is a workaround for a compiler
- * warning
- */
- if (target)
- *target = (char *)0 + number;
- return TRUE;
- }
- else if (TrioReadString(self,
- (flags & FLAGS_IGNORE)
- ? NULL
- : buffer,
- 0,
- sizeof(null) - 1))
- {
- if (StrEqualCase(buffer, null))
- {
- if (target)
- *target = NULL;
- return TRUE;
- }
- }
- return FALSE;
-}
-
-/*************************************************************************
- * TrioScan [private]
- */
-static int
-TrioScan(const void *source,
- size_t sourceSize,
- void (*InStream)(trio_T *, int *),
- const char *format,
- va_list arglist,
- void **argarray)
-{
-#if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE)
- int charlen;
-#endif
- int status;
- int assignment;
- parameter_T parameters[MAX_PARAMETERS];
- trio_T internalData;
- trio_T *data;
- int ch;
-#if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE)
- int cnt;
-#endif
- int index; /* Index of format string */
- int i; /* Index of current parameter */
- unsigned long flags;
- int width;
- int base;
- void *pointer;
-
- assert(VALID(InStream));
- assert(VALID(format));
-
- memset(&internalData, 0, sizeof(internalData));
- data = &internalData;
- data->InStream = InStream;
- data->location = (void *)source;
- data->max = sourceSize;
-
-#if defined(USE_LOCALE)
- if (NULL == internalLocaleValues)
- {
- TrioSetLocale();
- }
-#endif
-
- status = TrioPreprocess(TYPE_SCAN, format, parameters, arglist, argarray);
- if (status < 0)
- return status;
-
- assignment = 0;
- i = 0;
- index = 0;
- data->InStream(data, &ch);
-
-#if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE)
- mblen(NULL, 0);
-#endif
-
- while (format[index])
- {
-#if defined(TRIO_COMPILER_SUPPORTS_MULTIBYTE)
- if (! isascii(format[index]))
- {
- charlen = mblen(&format[index], MB_LEN_MAX);
- /* Compare multibyte characters in format string */
- for (cnt = 0; cnt < charlen - 1; cnt++)
- {
- if (ch != format[index + cnt])
- {
- return TRIO_ERROR_RETURN(TRIO_EINVAL, index);
- }
- data->InStream(data, &ch);
- }
- continue; /* while */
- }
-#endif /* TRIO_COMPILER_SUPPORTS_MULTIBYTE */
- if (EOF == ch)
- return EOF;
-
- if (CHAR_IDENTIFIER == format[index])
- {
- if (CHAR_IDENTIFIER == format[index + 1])
- {
- /* Two % in format matches one % in input stream */
- if (CHAR_IDENTIFIER == ch)
- {
- data->InStream(data, &ch);
- index += 2;
- continue; /* while format chars left */
- }
- else
- return TRIO_ERROR_RETURN(TRIO_EINVAL, index);
- }
-
- /* Skip the parameter entries */
- while (parameters[i].type == FORMAT_PARAMETER)
- i++;
-
- flags = parameters[i].flags;
- /* Find width */
- width = parameters[i].width;
- if (flags & FLAGS_WIDTH_PARAMETER)
- {
- /* Get width from parameter list */
- width = (int)parameters[width].data.number.as_signed;
- }
- /* Find base */
- base = parameters[i].base;
- if (flags & FLAGS_BASE_PARAMETER)
- {
- /* Get base from parameter list */
- base = (int)parameters[base].data.number.as_signed;
- }
-
- switch (parameters[i].type)
- {
- case FORMAT_INT:
- {
- trio_uintmax_t number;
-
- if (0 == base)
- base = BASE_DECIMAL;
-
- if (!TrioReadNumber(data,
- &number,
- flags,
- width,
- base))
- return assignment;
- assignment++;
-
- if (!(flags & FLAGS_IGNORE))
- {
- pointer = parameters[i].data.pointer;
-#if defined(QUALIFIER_SIZE_T) || defined(QUALIFIER_SIZE_T_UPPER)
- if (flags & FLAGS_SIZE_T)
- *(size_t *)pointer = (size_t)number;
- else
-#endif
-#if defined(QUALIFIER_PTRDIFF_T)
- if (flags & FLAGS_PTRDIFF_T)
- *(ptrdiff_t *)pointer = (ptrdiff_t)number;
- else
-#endif
-#if defined(QUALIFIER_INTMAX_T)
- if (flags & FLAGS_INTMAX_T)
- *(trio_intmax_t *)pointer = (trio_intmax_t)number;
- else
-#endif
- if (flags & FLAGS_QUAD)
- *(trio_ulonglong_t *)pointer = (trio_ulonglong_t)number;
- else if (flags & FLAGS_LONG)
- *(long int *)pointer = (long int)number;
- else if (flags & FLAGS_SHORT)
- *(short int *)pointer = (short int)number;
- else
- *(int *)pointer = (int)number;
- }
- }
- break; /* FORMAT_INT */
-
- case FORMAT_STRING:
-#if TRIO_WIDECHAR
- if (flags & FLAGS_WIDECHAR)
- {
- if (!TrioReadWideString(data,
- (flags & FLAGS_IGNORE)
- ? NULL
- : parameters[i].data.wstring,
- flags,
- width))
- return assignment;
- }
- else
-#endif
- {
- if (!TrioReadString(data,
- (flags & FLAGS_IGNORE)
- ? NULL
- : parameters[i].data.string,
- flags,
- width))
- return assignment;
- }
- assignment++;
- break; /* FORMAT_STRING */
-
- case FORMAT_DOUBLE:
- if (!TrioReadDouble(data,
- (flags & FLAGS_IGNORE)
- ? NULL
- : parameters[i].data.doublePointer,
- flags,
- width))
- return assignment;
- assignment++;
- break; /* FORMAT_DOUBLE */
-
- case FORMAT_GROUP:
- {
- int characterclass[MAX_CHARACTER_CLASS + 1];
- int rc;
-
- /* Skip over modifiers */
- while (format[index] != SPECIFIER_GROUP)
- {
- index++;
- }
- /* Skip over group specifier */
- index++;
-
- memset(characterclass, 0, sizeof(characterclass));
- rc = TrioGetCharacterClass(format,
- &index,
- &flags,
- characterclass);
- if (rc < 0)
- return rc;
-
- if (!TrioReadGroup(data,
- (flags & FLAGS_IGNORE)
- ? NULL
- : parameters[i].data.string,
- characterclass,
- flags,
- parameters[i].width))
- return assignment;
- assignment++;
- }
- break; /* FORMAT_GROUP */
-
- case FORMAT_COUNT:
- pointer = parameters[i].data.pointer;
- if (NULL != pointer)
- {
-#if defined(QUALIFIER_SIZE_T) || defined(QUALIFIER_SIZE_T_UPPER)
- if (flags & FLAGS_SIZE_T)
- *(size_t *)pointer = (size_t)data->committed;
- else
-#endif
-#if defined(QUALIFIER_PTRDIFF_T)
- if (flags & FLAGS_PTRDIFF_T)
- *(ptrdiff_t *)pointer = (ptrdiff_t)data->committed;
- else
-#endif
-#if defined(QUALIFIER_INTMAX_T)
- if (flags & FLAGS_INTMAX_T)
- *(trio_intmax_t *)pointer = (trio_intmax_t)data->committed;
- else
-#endif
- if (flags & FLAGS_QUAD)
- {
- *(trio_ulonglong_t *)pointer = (trio_ulonglong_t)data->committed;
- }
- else if (flags & FLAGS_LONG)
- {
- *(long int *)pointer = (long int)data->committed;
- }
- else if (flags & FLAGS_SHORT)
- {
- *(short int *)pointer = (short int)data->committed;
- }
- else
- {
- *(int *)pointer = (int)data->committed;
- }
- }
- break; /* FORMAT_COUNT */
-
- case FORMAT_CHAR:
-#if TRIO_WIDECHAR
- if (flags & FLAGS_WIDECHAR)
- {
- if (TrioReadWideChar(data,
- (flags & FLAGS_IGNORE)
- ? NULL
- : parameters[i].data.wstring,
- flags,
- (width == NO_WIDTH) ? 1 : width) > 0)
- return assignment;
- }
- else
-#endif
- {
- if (TrioReadChar(data,
- (flags & FLAGS_IGNORE)
- ? NULL
- : parameters[i].data.string,
- flags,
- (width == NO_WIDTH) ? 1 : width) > 0)
- return assignment;
- }
- assignment++;
- break; /* FORMAT_CHAR */
-
- case FORMAT_POINTER:
- if (!TrioReadPointer(data,
- (flags & FLAGS_IGNORE)
- ? NULL
- : (void **)parameters[i].data.pointer,
- flags))
- return assignment;
- assignment++;
- break; /* FORMAT_POINTER */
-
- case FORMAT_PARAMETER:
- break; /* FORMAT_PARAMETER */
-
- default:
- return TRIO_ERROR_RETURN(TRIO_EINVAL, index);
- }
- ch = data->current;
- index = parameters[i].indexAfterSpecifier;
- i++;
- }
- else /* Not an % identifier */
- {
- if (isspace((int)format[index]))
- {
- /* Whitespaces may match any amount of whitespaces */
- ch = TrioSkipWhitespaces(data);
- }
- else if (ch == format[index])
- {
- data->InStream(data, &ch);
- }
- else
- return TRIO_ERROR_RETURN(TRIO_EINVAL, index);
-
- index++;
- }
- }
- return assignment;
-}
-
-/*************************************************************************
- * TrioInStreamFile [private]
- */
-static void
-TrioInStreamFile(trio_T *self,
- int *intPointer)
-{
- FILE *file = (FILE *)self->location;
-
- assert(VALID(self));
- assert(VALID(file));
-
- self->current = fgetc(file);
- self->processed++;
- self->committed++;
-
- if (VALID(intPointer))
- {
- *intPointer = self->current;
- }
-}
-
-/*************************************************************************
- * TrioInStreamFileDescriptor [private]
- */
-static void
-TrioInStreamFileDescriptor(trio_T *self,
- int *intPointer)
-{
- int fd = *((int *)self->location);
- int size;
- unsigned char input;
-
- assert(VALID(self));
-
- size = read(fd, &input, sizeof(char));
- self->current = (size == 0) ? EOF : input;
- self->processed++;
- self->committed++;
-
- if (VALID(intPointer))
- {
- *intPointer = self->current;
- }
-}
-
-/*************************************************************************
- * TrioInStreamString [private]
- */
-static void
-TrioInStreamString(trio_T *self,
- int *intPointer)
-{
- unsigned char **buffer;
-
- assert(VALID(self));
- assert(VALID(self->InStream));
- assert(VALID(self->location));
-
- buffer = (unsigned char **)self->location;
- self->current = (*buffer)[0];
- if (self->current == NIL)
- self->current = EOF;
- (*buffer)++;
- self->processed++;
- self->committed++;
-
- if (VALID(intPointer))
- {
- *intPointer = self->current;
- }
-}
-
-/*************************************************************************
- * scanf
- */
-int
-trio_scanf(const char *format,
- ...)
-{
- int status;
- va_list args;
-
- assert(VALID(format));
-
- va_start(args, format);
- status = TrioScan(stdin, 0, TrioInStreamFile, format, args, NULL);
- va_end(args);
- return status;
-}
-
-int
-trio_vscanf(const char *format,
- va_list args)
-{
- assert(VALID(format));
-
- return TrioScan(stdin, 0, TrioInStreamFile, format, args, NULL);
-}
-
-int
-trio_scanfv(const char *format,
- void **args)
-{
- va_list dummy;
- shutup_unitialized(&dummy);
-
- assert(VALID(format));
-
- return TrioScan(stdin, 0, TrioInStreamFile, format, dummy, args);
-}
-
-/*************************************************************************
- * fscanf
- */
-int
-trio_fscanf(FILE *file,
- const char *format,
- ...)
-{
- int status;
- va_list args;
-
- assert(VALID(file));
- assert(VALID(format));
-
- va_start(args, format);
- status = TrioScan(file, 0, TrioInStreamFile, format, args, NULL);
- va_end(args);
- return status;
-}
-
-int
-trio_vfscanf(FILE *file,
- const char *format,
- va_list args)
-{
- assert(VALID(file));
- assert(VALID(format));
-
- return TrioScan(file, 0, TrioInStreamFile, format, args, NULL);
-}
-
-int
-trio_fscanfv(FILE *file,
- const char *format,
- void **args)
-{
- va_list dummy;
- shutup_unitialized(&dummy);
-
- assert(VALID(file));
- assert(VALID(format));
-
- return TrioScan(file, 0, TrioInStreamFile, format, dummy, args);
-}
-
-/*************************************************************************
- * dscanf
- */
-int
-trio_dscanf(int fd,
- const char *format,
- ...)
-{
- int status;
- va_list args;
-
- assert(VALID(format));
-
- va_start(args, format);
- status = TrioScan(&fd, 0, TrioInStreamFileDescriptor, format, args, NULL);
- va_end(args);
- return status;
-}
-
-int
-trio_vdscanf(int fd,
- const char *format,
- va_list args)
-{
- assert(VALID(format));
-
- return TrioScan(&fd, 0, TrioInStreamFileDescriptor, format, args, NULL);
-}
-
-int
-trio_dscanfv(int fd,
- const char *format,
- void **args)
-{
- va_list dummy;
- shutup_unitialized(&dummy);
-
- assert(VALID(format));
-
- return TrioScan(&fd, 0, TrioInStreamFileDescriptor, format, dummy, args);
-}
-
-/*************************************************************************
- * sscanf
- */
-int
-trio_sscanf(const char *buffer,
- const char *format,
- ...)
-{
- int status;
- va_list args;
-
- assert(VALID(buffer));
- assert(VALID(format));
-
- va_start(args, format);
- status = TrioScan(&buffer, 0, TrioInStreamString, format, args, NULL);
- va_end(args);
- return status;
-}
-
-int
-trio_vsscanf(const char *buffer,
- const char *format,
- va_list args)
-{
- assert(VALID(buffer));
- assert(VALID(format));
-
- return TrioScan(&buffer, 0, TrioInStreamString, format, args, NULL);
-}
-
-int
-trio_sscanfv(const char *buffer,
- const char *format,
- void **args)
-{
- va_list dummy;
- shutup_unitialized(&dummy);
-
- assert(VALID(buffer));
- assert(VALID(format));
-
- return TrioScan(&buffer, 0, TrioInStreamString, format, dummy, args);
-}
-
+++ /dev/null
-/*************************************************************************
- *
- * $Id$
- *
- * Copyright (C) 2000 Bjorn Reese and Daniel Stenberg.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
- * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
- *
- ************************************************************************
- *
- * Private functions, types, etc. used for callback functions.
- *
- * The ref pointer is an opaque type and should remain as such.
- * Private data must only be accessible through the getter and
- * setter functions.
- *
- ************************************************************************/
-
-#ifndef TRIO_TRIOP_H
-#define TRIO_TRIOP_H
-
-#include <stdlib.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef TRIO_C99
-# define TRIO_C99 1
-#endif
-#ifndef TRIO_BSD
-# define TRIO_BSD 1
-#endif
-#ifndef TRIO_GNU
-# define TRIO_GNU 1
-#endif
-#ifndef TRIO_MISC
-# define TRIO_MISC 1
-#endif
-#ifndef TRIO_UNIX98
-# define TRIO_UNIX98 1
-#endif
-#ifndef TRIO_MICROSOFT
-# define TRIO_MICROSOFT 1
-#endif
-#ifndef TRIO_EXTENSION
-# define TRIO_EXTENSION 1
-#endif
-#ifndef TRIO_WIDECHAR
-# define TRIO_WIDECHAR 0
-#endif
-#ifndef TRIO_ERRORS
-# define TRIO_ERRORS 1
-#endif
-
-#ifndef TRIO_MALLOC
-# define TRIO_MALLOC(n) malloc(n)
-#endif
-#ifndef TRIO_REALLOC
-# define TRIO_REALLOC(x,n) realloc((x),(n))
-#endif
-#ifndef TRIO_FREE
-# define TRIO_FREE(x) free(x)
-#endif
-
-typedef int (*trio_callback_t)(void *ref);
-
-void *trio_register(trio_callback_t callback, const char *name);
-void trio_unregister(void *handle);
-
-const char *trio_get_format(void *ref);
-void *trio_get_argument(void *ref);
-
-/* Modifiers */
-int trio_get_width(void *ref);
-void trio_set_width(void *ref, int width);
-int trio_get_precision(void *ref);
-void trio_set_precision(void *ref, int precision);
-int trio_get_base(void *ref);
-void trio_set_base(void *ref, int base);
-int trio_get_padding(void *ref);
-void trio_set_padding(void *ref, int is_padding);
-int trio_get_short(void *ref); /* h */
-void trio_set_shortshort(void *ref, int is_shortshort);
-int trio_get_shortshort(void *ref); /* hh */
-void trio_set_short(void *ref, int is_short);
-int trio_get_long(void *ref); /* l */
-void trio_set_long(void *ref, int is_long);
-int trio_get_longlong(void *ref); /* ll */
-void trio_set_longlong(void *ref, int is_longlong);
-int trio_get_longdouble(void *ref); /* L */
-void trio_set_longdouble(void *ref, int is_longdouble);
-int trio_get_alternative(void *ref); /* # */
-void trio_set_alternative(void *ref, int is_alternative);
-int trio_get_alignment(void *ref); /* - */
-void trio_set_alignment(void *ref, int is_leftaligned);
-int trio_get_spacing(void *ref); /* (space) */
-void trio_set_spacing(void *ref, int is_space);
-int trio_get_sign(void *ref); /* + */
-void trio_set_sign(void *ref, int is_showsign);
-int trio_get_quote(void *ref); /* ' */
-void trio_set_quote(void *ref, int is_quote);
-int trio_get_upper(void *ref);
-void trio_set_upper(void *ref, int is_upper);
-#if TRIO_C99
-int trio_get_largest(void *ref); /* j */
-void trio_set_largest(void *ref, int is_largest);
-int trio_get_ptrdiff(void *ref); /* t */
-void trio_set_ptrdiff(void *ref, int is_ptrdiff);
-int trio_get_size(void *ref); /* z / Z */
-void trio_set_size(void *ref, int is_size);
-#endif
-
-/* Printing */
-int trio_print_ref(void *ref, const char *format, ...);
-int trio_vprint_ref(void *ref, const char *format, va_list args);
-int trio_printv_ref(void *ref, const char *format, void **args);
-
-void trio_print_int(void *ref, int number);
-void trio_print_uint(void *ref, unsigned int number);
-/* void trio_print_long(void *ref, long number); */
-/* void trio_print_ulong(void *ref, unsigned long number); */
-void trio_print_double(void *ref, double number);
-void trio_print_string(void *ref, char *string);
-void trio_print_pointer(void *ref, void *pointer);
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif /* TRIO_TRIOP_H */
+++ /dev/null
-/*
-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 <iostream>
-#include <cstring>
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <cppunit/TestFixture.h>
-
-#include "trio.h"
-
-class TrioTest: public CppUnit::TestFixture
-{
- CPPUNIT_TEST_SUITE(TrioTest);
- CPPUNIT_TEST(escapeULM);
- CPPUNIT_TEST(escapeXML);
- CPPUNIT_TEST(escapeSQL);
- CPPUNIT_TEST(escapeJSON);
- CPPUNIT_TEST_SUITE_END();
-
-public:
- void escapeULM();
- void escapeXML();
- void escapeSQL();
- void escapeJSON();
-};
-
-void TrioTest::escapeULM()
-{
- char *e, *r = "START we have =, \\\", and \\n in the string END";
-
- trio_asprintf(&e,"START %|Us END", "we have =, \", and \n in the string"),
- std::cerr << e << std::endl;
-
- CPPUNIT_ASSERT_MESSAGE("escape ULM failed",!strcmp(e,r));
-
- free(e);
-}
-
-void TrioTest::escapeXML()
-{
- char *e, *r = "START there is a <tag> containing &something; </tag> END";
-
- trio_asprintf(&e,"START %|Xs END", "there is a <tag> containing &something; </tag>"),
- std::cerr << e << std::endl;
-
- CPPUNIT_ASSERT_MESSAGE("escape XML failed",!strcmp(e,r));
-
- free(e);
-}
-
-void TrioTest::escapeSQL()
-{
- char *e, *r = "START SQL doesn''t like '' END";
-
- trio_asprintf(&e,"START %|Ss END", "SQL doesn't like '"),
- std::cerr << e << std::endl;
-
- CPPUNIT_ASSERT_MESSAGE("escape SQL failed",!strcmp(e,r));
-
- free(e);
-}
-
-void TrioTest::escapeJSON() {
- char *e, *r = "START Jason doesn't like: \\\\\\n\\r\\b\\r\\t\\f and \\u001b END";
- int ret;
-
- ret = trio_asprintf(&e, "START %|Js END", "Jason doesn't like: \\\n\r\b\r\t\f and \x1B");
- std::cerr << e << std::endl;
-
- CPPUNIT_ASSERT_MESSAGE("escape JSON failed",ret > 0 && strcmp(e,r) == 0);
-
- free(e);
-}
-
-CPPUNIT_TEST_SUITE_REGISTRATION( TrioTest );
-
-#include <assert.h>
-#include <fstream>
-
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/XmlOutputter.h>
-#include <cppunit/TestRunner.h>
-#include <cppunit/TestResult.h>
-#include <cppunit/TestResultCollector.h>
-
-int main (int argc,const char *argv[])
-{
- CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
-
- assert(argc == 2);
- std::ofstream xml(argv[1]);
-
- CppUnit::TestResult controller;
- CppUnit::TestResultCollector result;
- controller.addListener( &result );
-
- CppUnit::TestRunner runner;
- runner.addTest(suite);
- runner.run(controller);
-
- CppUnit::XmlOutputter xout( &result, xml );
- CppUnit::CompilerOutputter tout( &result, std::cout);
- xout.write();
- tout.write();
-
- return result.wasSuccessful() ? 0 : 1 ;
-}
+++ /dev/null
-# : /cvs/glite/org.glite.lbjp-common/project/version.properties,v 1.1 2009/01/21 12:57:26 akrenek Exp $
-module.version=3.1.3
-module.age=2