You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-commits@perl.apache.org by ph...@apache.org on 2010/10/17 20:38:33 UTC
svn commit: r1023548 - in /perl/Apache-Test/trunk: Changes MANIFEST
Makefile.PL install-pl lib/Apache/TestConfig.pm lib/Apache/TestConfigPerl.pm
Author: phred
Date: Sun Oct 17 18:38:32 2010
New Revision: 1023548
URL: http://svn.apache.org/viewvc?rev=1023548&view=rev
Log:
Fix build edge case where rpm based mp sources missing Apache2::Build cause
require failure in Apache-TestConfig. Reported by Ryan Gies.
[Fred Moyer]
When an explicit shared mod_perl lib is not defined, default to the first
shared module found by find_apache_module().
[Fred Moyer]
Fix logic error in TOP_LEVEL constant calculation. Remove Apache::test
compatibility from mod_perl 1.27.
Removed:
perl/Apache-Test/trunk/install-pl
Modified:
perl/Apache-Test/trunk/Changes
perl/Apache-Test/trunk/MANIFEST
perl/Apache-Test/trunk/Makefile.PL
perl/Apache-Test/trunk/lib/Apache/TestConfig.pm
perl/Apache-Test/trunk/lib/Apache/TestConfigPerl.pm
Modified: perl/Apache-Test/trunk/Changes
URL: http://svn.apache.org/viewvc/perl/Apache-Test/trunk/Changes?rev=1023548&r1=1023547&r2=1023548&view=diff
==============================================================================
--- perl/Apache-Test/trunk/Changes (original)
+++ perl/Apache-Test/trunk/Changes Sun Oct 17 18:38:32 2010
@@ -8,6 +8,18 @@ Changes - Apache::Test change logfile
=item 1.34-dev
+Fix build edge case where rpm based mp sources missing Apache2::Build cause
+require failure in Apache-TestConfig. Reported by Ryan Gies.
+[Fred Moyer]
+
+When an explicit shared mod_perl lib is not defined, default to the first
+shared module found by find_apache_module().
+[Fred Moyer]
+
+Fix logic error in TOP_LEVEL constant calculation. Remove Apache::test
+compatibility from mod_perl 1.27.
+[Fred Moyer]
+
Remove the custom config feature, and instead use inline directives,
ENV vars, and look for apxs et al in PATH.
[Fred Moyer]
Modified: perl/Apache-Test/trunk/MANIFEST
URL: http://svn.apache.org/viewvc/perl/Apache-Test/trunk/MANIFEST?rev=1023548&r1=1023547&r2=1023548&view=diff
==============================================================================
--- perl/Apache-Test/trunk/MANIFEST (original)
+++ perl/Apache-Test/trunk/MANIFEST Sun Oct 17 18:38:32 2010
@@ -8,7 +8,6 @@ README
INSTALL
SUPPORT
ToDo
-install-pl
lib/Apache/Test.pm
lib/Apache/Test5005compat.pm
lib/Apache/TestBuild.pm
Modified: perl/Apache-Test/trunk/Makefile.PL
URL: http://svn.apache.org/viewvc/perl/Apache-Test/trunk/Makefile.PL?rev=1023548&r1=1023547&r2=1023548&view=diff
==============================================================================
--- perl/Apache-Test/trunk/Makefile.PL (original)
+++ perl/Apache-Test/trunk/Makefile.PL Sun Oct 17 18:38:32 2010
@@ -8,7 +8,19 @@ use warnings;
# was this file invoked directly via perl, or via the top-level
# (mp2) Makefile.PL? if top-level, this env var will be set
-use constant TOP_LEVEL => !exists $ENV{MOD_PERL_2_BUILD};
+use constant TOP_LEVEL => $ENV{MOD_PERL_2_BUILD};
+
+if (!TOP_LEVEL) {
+ # see if we are building from within mp root, add src lib if we are
+ eval { require File::Spec };
+ unless ($@) {
+ if ( -e File::Spec->catdir('..', 'lib') ) {
+
+ # building A-T from mp subdirectory, use the mp lib
+ unshift @INC, File::Spec->catdir('..', 'lib');
+ }
+ }
+}
use ExtUtils::MakeMaker;
use Symbol;
@@ -24,8 +36,6 @@ use Apache::TestRunPerl;
my $VERSION;
set_version();
-sanity_check();
-
Apache::TestMM::filter_args();
my @scripts = qw(t/TEST);
@@ -52,13 +62,6 @@ for (@scripts) {
}
Apache::TestReport->generate_script;
-# if built with mod_perl 2.0, its top-level Makefile.PL already
-# installs the uninstall code
-if (TOP_LEVEL) {
- require "./install-pl";
- add_Apache__test_target();
-}
-
my @clean_files =
qw(.mypacklist
t/TEST
@@ -143,37 +146,6 @@ sub set_version {
close $fh;
}
-sub sanity_check {
- # don't allow running an explicit 'perl Makefile.PL', when
- # Apache-Test is checked out into the modperl-2.0 tree, since
- # it then decides that it's a part of the modperl-2.0 build and
- # will try to use modperl httpd/apxs arguments which could be
- # unset or wrong
- if (TOP_LEVEL && -e "../lib/mod_perl2.pm") {
- error "Do not run 'perl Makefile.PL' when Apache-Test is a " .
- "subdirectory of modperl-2.0. Copy it elsewhere and run " .
- "from there.";
- Apache::TestRun::exit_perl(0);
- }
-}
-
-if (TOP_LEVEL && $ExtUtils::MakeMaker::VERSION < 6.06) {
- # now that we're using subversion, make sure that
- # .svn directories are skipped during the build process
- # for old versions of MakeMaker
- *MY::libscan = sub {
- my $self = shift;
-
- my $path = shift;
-
- return '' if $path =~ /\B\.svn\b/;
-
- return $path;
- };
- # avoid warning: used only once: possible typo at ...
- *MY::libscan = *MY::libscan;
-}
-
sub MY::postamble {
my $self = shift;
@@ -188,52 +160,11 @@ EOF
return $string;
}
-sub MY::constants {
- my $self = shift;
-
- my $string = $self->MM::constants;
-
- # mp2 installs A-T into INSTALLSITEARCH, so in order to avoid
- # problems when users forget 'make install UNINST=1', trick MM into
- # installing pure perl modules to the sitearch location, when A-T is
- # not installed as a part of mp2 build
- if (TOP_LEVEL) {
- $string .= <<'EOI';
-
-# install into the same location as mod_perl 2.0
-INSTALLSITELIB = $(INSTALLSITEARCH)
-DESTINSTALLSITELIB = $(DESTINSTALLSITEARCH)
-EOI
- }
-
- $string;
-}
-
sub add_dep {
my($string, $targ, $add) = @_;
$$string =~ s/($targ\s+::)/$1 $add/;
}
-sub add_Apache__test_target {
- use subs qw(MY::install MY::top_targets);
- *MY::install = sub {
- my $self = shift;
-
- my $string = $self->MM::install(@_);
- add_dep(\$string, pure_install => 'nuke_Apache__test');
- $string;
- };
-
- *MY::top_targets = sub {
- my $self = shift;
- my $string = $self->MM::top_targets;
-
- $string .= Apache::Test::install::nuke_Apache__test_target();
-
- $string;
- };
-}
-
sub MY::test {
my $self = shift;
@@ -254,3 +185,23 @@ test::
EOF
}
+sub MY::constants {
+ my $self = shift;
+
+ my $string = $self->MM::constants;
+
+ # mp2 installs this into INSTALLSITEARCH, so in order to avoid
+ # problems when users forget 'make install UNINST=1', trick MM into
+ # installing pure perl modules to the sitearch location, when this is
+ # not installed as a part of mp2 build
+ if (!$ENV{MOD_PERL_2_BUILD}) {
+ $string .= <<'EOI';
+
+# install into the same location as mod_perl 2.0
+INSTALLSITELIB = $(INSTALLSITEARCH)
+DESTINSTALLSITELIB = $(DESTINSTALLSITEARCH)
+EOI
+ }
+
+ $string;
+}
Modified: perl/Apache-Test/trunk/lib/Apache/TestConfig.pm
URL: http://svn.apache.org/viewvc/perl/Apache-Test/trunk/lib/Apache/TestConfig.pm?rev=1023548&r1=1023547&r2=1023548&view=diff
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/TestConfig.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/TestConfig.pm Sun Oct 17 18:38:32 2010
@@ -32,7 +32,7 @@ use constant IS_MOD_PERL_2 =>
eval { require mod_perl2 } || 0;
use constant IS_MOD_PERL_2_BUILD => IS_MOD_PERL_2 &&
- require Apache2::Build && Apache2::Build::IS_MOD_PERL_BUILD();
+ eval { require Apache2::Build && Apache2::Build::IS_MOD_PERL_BUILD() };
use constant IS_APACHE_TEST_BUILD =>
grep { -e "$_/lib/Apache/TestConfig.pm" }
Modified: perl/Apache-Test/trunk/lib/Apache/TestConfigPerl.pm
URL: http://svn.apache.org/viewvc/perl/Apache-Test/trunk/lib/Apache/TestConfigPerl.pm?rev=1023548&r1=1023547&r2=1023548&view=diff
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/TestConfigPerl.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/TestConfigPerl.pm Sun Oct 17 18:38:32 2010
@@ -45,16 +45,21 @@ sub configure_libmodperl {
# $server->{rev} could be set to 2 as a fallback, even when
# the wanted version is 1. So check that we use mod_perl 2
elsif ($server->{rev} >= 2 && IS_MOD_PERL_2) {
+
if (my $build_config = $self->modperl_build_config()) {
if ($build_config->{MODPERL_LIB_SHARED}) {
$libname = $build_config->{MODPERL_LIB_SHARED};
$vars->{libmodperl} ||= $self->find_apache_module($libname);
+ } else {
+ $vars->{libmodperl} ||= $self->find_apache_module('mod_perl.so');
}
# XXX: we have a problem with several perl trees pointing
# to the same httpd tree. So it's possible that we
# configure the test suite to run with mod_perl.so built
# against perl which it wasn't built with. Should we use
# something like ldd to check the match?
+ #
+ # For now, we'll default to the first mod_perl.so found.
}
else {
# XXX: can we test whether mod_perl was linked statically