diff -ur globus_common-10.2.orig/library/globus_common_paths.c globus_common-10.2/library/globus_common_paths.c --- globus_common-10.2.orig/library/globus_common_paths.c 2006-01-19 06:54:14.000000000 +0100 +++ globus_common-10.2/library/globus_common_paths.c 2009-08-04 16:43:07.208220052 +0200 @@ -111,8 +111,7 @@ p = globus_libc_getenv(name); if (!p || strlen(p)==0) { - globus_libc_sprintf(errmsg,_GCSL("Environment variable %s is not set"), name); - return GLOBUS_COMMON_PATH_ERROR_INSTANCE(errmsg); + return GLOBUS_SUCCESS; } *bufp = globus_libc_strdup(p); @@ -199,17 +198,17 @@ if (!deploy && (result=globus_location(&deploy))) return result; - filename = globus_malloc(strlen(deploy) + + filename = globus_malloc( ( deploy ? strlen(deploy) : 0 ) + strlen(file_location) + 1 + 1 ); if (!filename) return GLOBUS_COMMON_PATH_ERROR_INSTANCE(_GCSL("malloc error")); globus_libc_sprintf(filename, "%s/%s", - deploy, + deploy ? deploy : "", file_location); - if (!deploy_path) + if (!deploy_path && deploy) globus_free(deploy); fp = fopen(filename,"r"); diff -ur globus_common-10.2.orig/library/globus_extension.c globus_common-10.2/library/globus_extension.c --- globus_common-10.2.orig/library/globus_extension.c 2008-03-12 20:01:05.000000000 +0100 +++ globus_common-10.2/library/globus_extension.c 2009-08-03 19:57:22.077217655 +0200 @@ -195,14 +195,17 @@ if(globus_location(&tmp) == GLOBUS_SUCCESS) { + if(tmp) + { #if defined(TARGET_ARCH_WIN32) - globus_l_globus_location = - globus_common_create_string("%s\\lib", tmp); + globus_l_globus_location = + globus_common_create_string("%s\\lib", tmp); #else - globus_l_globus_location = - globus_common_create_string("%s/lib", tmp); + globus_l_globus_location = + globus_common_create_string("%s/lib", tmp); #endif - globus_free(tmp); + globus_free(tmp); + } } initialized = GLOBUS_TRUE; diff -ur globus_common-10.2.orig/Makefile.am globus_common-10.2/Makefile.am --- globus_common-10.2.orig/Makefile.am 2004-10-11 14:53:32.000000000 +0200 +++ globus_common-10.2/Makefile.am 2009-08-03 12:31:55.267481653 +0200 @@ -9,7 +9,7 @@ config \ doxygen -sbin_SCRIPTS= \ +libexec_SCRIPTS= \ config.guess EXTRA_DIST = \ diff -ur globus_common-10.2.orig/programs/globus-sh-exec.in globus_common-10.2/programs/globus-sh-exec.in --- globus_common-10.2.orig/programs/globus-sh-exec.in 2006-01-19 06:54:19.000000000 +0100 +++ globus_common-10.2/programs/globus-sh-exec.in 2009-08-03 12:31:55.268482825 +0200 @@ -17,7 +17,11 @@ # -. ${GLOBUS_LOCATION}/libexec/globus-script-initializer +if test -f ${GLOBUS_LOCATION:-/usr}/share/globus/globus-script-initializer ; then +. ${GLOBUS_LOCATION:-/usr}/share/globus/globus-script-initializer +else +. ${GLOBUS_LOCATION:-/usr}/libexec/globus-script-initializer +fi globus_source ${libexecdir}/globus-sh-tools.sh # This was done by the script initializer before V2.0 diff -ur globus_common-10.2.orig/programs/globus-version.in globus_common-10.2/programs/globus-version.in --- globus_common-10.2.orig/programs/globus-version.in 2008-09-29 23:20:05.000000000 +0200 +++ globus_common-10.2/programs/globus-version.in 2009-08-03 12:31:55.269484149 +0200 @@ -43,7 +43,11 @@ usage() { - . ${GLOBUS_LOCATION}/libexec/globus-script-initializer + if test -f ${GLOBUS_LOCATION:-/usr}/share/globus/globus-script-initializer ; then + . ${GLOBUS_LOCATION:-/usr}/share/globus/globus-script-initializer + else + . ${GLOBUS_LOCATION:-/usr}/libexec/globus-script-initializer + fi globus_source ${libexecdir}/globus-sh-tools.sh ${GLOBUS_SH_CAT-cat} 1>&2 <&2 - exit 1 +if test -f ${GLOBUS_LOCATION:-/usr}/share/globus/globus-script-initializer ; then +. ${GLOBUS_LOCATION:-/usr}/share/globus/globus-script-initializer +else +. ${GLOBUS_LOCATION:-/usr}/libexec/globus-script-initializer fi -. ${GLOBUS_LOCATION}/libexec/globus-script-initializer - PROGRAM_NAME=`echo $0 | ${GLOBUS_SH_SED-sed} -e 's|.*/||g'` PROGRAM_VERSION=`echo '$Revision: 1.3 $' | ${GLOBUS_SH_CUT-cut} -d' ' -f2` @@ -67,7 +66,7 @@ EOF } -. ${GLOBUS_LOCATION}/libexec/globus-args-parser-header +. ${libexecdir}/globus-args-parser-header if [ -n "$1" ]; then globus_args_unrecognized_option "$1" @@ -79,8 +78,8 @@ if [ -z "${GLOBUS_HOSTNAME}" ] ; then # Set the _fullname based upon Globus's hostname command - if [ -x "${libexecdir}/globus-libc-hostname" ]; then - _fullname="`${libexecdir}/globus-libc-hostname`" + if [ -x "${sbindir}/globus-libc-hostname" ]; then + _fullname="`${sbindir}/globus-libc-hostname`" fi # if failed to set, use the system's hostname command diff -ur globus_common-10.2.orig/scripts/globus-makefile-header globus_common-10.2/scripts/globus-makefile-header --- globus_common-10.2.orig/scripts/globus-makefile-header 2008-02-20 17:03:35.000000000 +0100 +++ globus_common-10.2/scripts/globus-makefile-header 2009-08-03 12:31:55.271483490 +0200 @@ -25,29 +25,15 @@ my $gpt_path = $ENV{GPT_LOCATION}; my $globus_path = $ENV{GLOBUS_LOCATION}; -my $gpath; -if ( !defined($gpt_path) && !defined($globus_path) ) +if ( !defined($gpt_path) ) { - die("ERROR: GPT_LOCATION or GLOBUS_LOCATION needs to be set before running this script"); + $gpt_path = "/usr"; } -if ( defined($gpt_path) ) +if ( !defined($globus_path) ) { - $gpath = $gpt_path; - if ( ! -d $gpath ) - { - die("ERROR: $gpath doesn't exist!\n"); - } -} - -if ( !defined($gpath) && defined($globus_path) ) -{ - $gpath = $globus_path; - if ( ! -d $gpath ) - { - die("ERROR: $gpath doesn't exist!\n"); - } + $globus_path = "/usr"; } @@ -60,7 +46,7 @@ # my($environment); -@INC = ("$gpath/lib/perl", "$gpath/lib/perl/$Config{'archname'}", @INC); +@INC = ("$gpt_path/lib/perl", "$gpt_path/lib/perl/$Config{'archname'}", @INC); if ( defined eval "require Grid::GPT::V1::Package" ) { @@ -240,7 +226,9 @@ # point our installation object at our globus location # - $installation = new Grid::GPT::Installation(pkgdir => "$globus_path/etc/globus_packages"); + $installation = -d "$globus_path/share/globus/packages" ? + new Grid::GPT::Installation(pkgdir => "$globus_path/share/globus/packages") : + new Grid::GPT::Installation(pkgdir => "$globus_path/etc/globus_packages"); $installation->set_depenv('Build'); # @@ -313,10 +301,17 @@ # push all of our entries onto our header array # + @INC = ("$globus_path/lib/perl", @INC); + + require Globus::Core::Paths; + my $includedir = $Globus::Core::Paths::includedir; + my $flavorincludedir = $Globus::Core::Paths::flavorincludedir; + my $libdir = $Globus::Core::Paths::libdir; + push(@$header, "GLOBUS_CFLAGS=\"$cflagslist\""); - push(@$header, "GLOBUS_INCLUDES=\"-I${globus_path}/include/$flavor $includeslist\""); + push(@$header, "GLOBUS_INCLUDES=\"-I${includedir} -I${flavorincludedir} $includeslist\""); push(@$header, "GLOBUS_LIBS=\"$libslist\""); - push(@$header, "GLOBUS_LDFLAGS=\"-L${globus_path}/lib\""); + push(@$header, "GLOBUS_LDFLAGS=\"-L${libdir}\""); push(@$header, "GLOBUS_PKG_LIBS=\"$pkglibslist $extlibslist\""); push(@$header, "GLOBUS_LIBTOOL=\"$globus_path/sbin/libtool-$flavor\""); } @@ -332,7 +327,9 @@ my($header) = @_; my($copy); - open(IN, "$globus_path/libexec/globus-build-env-$flavor.sh") || die "ERROR: Cannot open $globus_path/libexec/globus-build-env-$flavor.sh!\n$common_error\n"; + open(IN, "$globus_path/share/globus/globus-build-env-$flavor.sh") || + open(IN, "$globus_path/libexec/globus-build-env-$flavor.sh") || + die "ERROR: Cannot open globus-build-env-$flavor.sh!\n$common_error\n"; while () { @@ -370,7 +367,9 @@ my($header) = @_; my($copy); - open(IN, "$globus_path/libexec/globus-sh-tools-vars.sh") || die "ERROR: Cannot open $globus_path/libexec/globus-sh-tools-vars.sh!\n$common_error\n"; + open(IN, "$globus_path/share/globus/globus-sh-tools-vars.sh") || + open(IN, "$globus_path/libexec/globus-sh-tools-vars.sh") || + die "ERROR: Cannot open globus-sh-tools-vars.sh!\n$common_error\n"; while () { diff -ur globus_common-10.2.orig/scripts/globus-makefile-header.gpt1 globus_common-10.2/scripts/globus-makefile-header.gpt1 --- globus_common-10.2.orig/scripts/globus-makefile-header.gpt1 2003-02-05 03:48:31.000000000 +0100 +++ globus_common-10.2/scripts/globus-makefile-header.gpt1 2009-08-03 12:31:55.272482892 +0200 @@ -15,18 +15,13 @@ my $flavor; my $link="static"; -my $gpt=$ENV{GPT_LOCATION}; + my $gpath = $ENV{GPT_LOCATION}; if (!defined($gpath)) { - $gpath = $ENV{GLOBUS_LOCATION}; - - } - if (!defined($gpath)) - { - die "ERROR: GPT_LOCATION or GLOBUS_LOCATION needs to be set before running this script" - } - + $gpath = "/usr"; +} + @INC = (@INC, "$gpath/lib/perl"); require Grid::GPT::Dependencies; @@ -40,20 +35,10 @@ my $pgm_linkslist; my $lib_linkslist; -if(!defined($gpt)) -{ - $gpt=$ENV{GLOBUS_LOCATION}; -} -if(!defined($gpt)) -{ - die "ERROR: GPT_LOCATION or GLOBUS_LOCATION needs to be set before running this script\n"; -} - my $globus=$ENV{GLOBUS_LOCATION}; - if(!defined($globus)) { - die "ERROR: GLOBUS_LOCATION needs to be set before running this script\n"; + $globus = "/usr"; } my %hash; @@ -102,14 +87,23 @@ assemble_link_lines($fakepkg, $flavor, $link); +@INC = ("$globus/lib/perl", @INC); + +require Globus::Core::Paths; +my $includedir = $Globus::Core::Paths::includedir; +my $flavorincludedir = $Globus::Core::Paths::flavorincludedir; +my $libdir = $Globus::Core::Paths::libdir; + push @temp_header, "GLOBUS_CFLAGS=\"$cflagslist\"\n"; -push @temp_header, "GLOBUS_INCLUDES=\" -I$ENV{GLOBUS_LOCATION}/include/$flavor $includeslist\"\n"; +push @temp_header, "GLOBUS_INCLUDES=\"-I$includedir -I$flavorincludedir $includeslist\"\n"; push @temp_header, "GLOBUS_LIBS=\"$libslist\"\n"; -push @temp_header, "GLOBUS_LDFLAGS=\" -L$ENV{GLOBUS_LOCATION}/lib\n"; +push @temp_header, "GLOBUS_LDFLAGS=\"-L$libdir\"\n"; push @temp_header, "GLOBUS_PKG_LIBS=\"$pkglibslist\"\n"; push @temp_header, "GLOBUS_LIBTOOL=$globus/sbin/libtool-$flavor\n"; -open(IN, "$globus/libexec/globus-build-env-$flavor.sh") || die "ERROR: Cannot open GLOBUS_LOCATION/libexec/globus-build-env-$flavor.sh\n"; +open(IN, "$globus/share/globus/globus-build-env-$flavor.sh") || + open(IN, "$globus/libexec/globus-build-env-$flavor.sh") || + die "ERROR: Cannot open globus-build-env-$flavor.sh\n"; while() { @@ -130,7 +124,9 @@ #END of Section one: prepending GLOBUS_ close (IN); -open(IN, "$globus/libexec/globus-sh-tools-vars.sh") || die "ERROR: Cannot open GLOBUS_LOCATION/libexec/globus-sh-tools-vars.sh\n"; +open(IN, "$globus/share/globus/globus-sh-tools-vars.sh") || + open(IN, "$globus/libexec/globus-sh-tools-vars.sh") || + die "ERROR: Cannot open globus-sh-tools-vars.sh\n"; while() { if(m!\S!) diff -ur globus_common-10.2.orig/scripts/globus-sh-tools.sh globus_common-10.2/scripts/globus-sh-tools.sh --- globus_common-10.2.orig/scripts/globus-sh-tools.sh 2006-01-19 06:54:22.000000000 +0100 +++ globus_common-10.2/scripts/globus-sh-tools.sh 2009-08-03 12:31:55.273482271 +0200 @@ -18,7 +18,11 @@ if test -z "$GLOBUS_SH_VARIABLES_SET" ; then - . ${GLOBUS_LOCATION}/libexec/globus-sh-tools-vars.sh + if test -f ${GLOBUS_LOCATION:-/usr}/share/globus/globus-sh-tools-vars.sh ; then + . ${GLOBUS_LOCATION:-/usr}/share/globus/globus-sh-tools-vars.sh + else + . ${GLOBUS_LOCATION:-/usr}/libexec/globus-sh-tools-vars.sh + fi # export all commands: