Re: problems with Makefile.PL for libapreq 1.33

2007-05-10 Thread Michael Peters
Michael Peters wrote:

> The attached patch should fix this problem in Makefile.PL by doing the test 
> for
> mod_perl version before the test for Apache::Test.

Weird. This seems to have been a problem that was noticed in 2005 and Stas
recommended almost the exact same patch.

http://mail-archives.apache.org/mod_mbox/perl-modperl/200505.mbox/[EMAIL 
PROTECTED]

Any reason this wasn't applied then?

-- 
Michael Peters
Developer
Plus Three, LP



problems with Makefile.PL for libapreq 1.33

2007-05-10 Thread Michael Peters
This is kind of convoluted, but bare with me:

I have Apache2/mod_perl2 and Apache::Test installed on my system (FC6) in the
standard locations. I now want to install Apache1/mod_perl1 and libapreq 1.33 in
a separate location that doesn't have Apache::Test. Now running Makefile.PL in
for libapreq (after Apache1/mod_perl1 have already been built in my local
install of course) always fails with this message:

mod_perl 1.x ( < 1.99) is required at Makefile.PL line 58

And it doesn't matter what I put into PERL5LIB, LIB, APXS or APACHE environment
vars. The reason is because libapreq's Makefile.PL first tries to locate
Apache::Test, which on my system is configured to work with Apache2/mod_perl2.
Apache::Test loads Apache::TestConfig which then loads mod_perl2.pm. And that's
how it's supposed to work. But Apache::TestConfig sets $INC{'mod_perl.pm'} to
/dev/null so when libapreq's Makefile.PL tries to require mod_perl it instead
thinks it's mod_perl2 (not because mod_perl2 comes before mod_perl in @INC, but
because Apache::Test specifically loads mod_perl2).

The attached patch should fix this problem in Makefile.PL by doing the test for
mod_perl version before the test for Apache::Test.

-- 
Michael Peters
Developer
Plus Three, LP

--- Makefile.PL	2004-12-06 10:31:08.0 -0500
+++ Makefile.PL.new	2007-05-10 11:19:46.0 -0400
@@ -6,6 +6,18 @@
 use File::Path qw(mkpath);
 use lib qw(Apache-Test/lib);
 
+BEGIN {
+unless (eval {require mod_perl}) {
+die "Please install mod_perl: 1.25 < version < 1.99\n($@)";
+}
+if ($mod_perl::VERSION < 1.2402) {
+die "Please upgrade mod_perl to 1.24_02 or greater";
+}
+elsif ($mod_perl::VERSION > 1.98) {
+die "mod_perl 1.x ( < 1.99) is required";
+}
+}
+
 use constant MIN_A_T_VERSION => 1.13;
 
 use constant HAS_APACHE_TEST => eval {
@@ -23,17 +35,6 @@
 require Apache::TestMM;
 Apache::TestMM->import(qw(test clean));
 }
-BEGIN {
-unless (eval {require mod_perl}) {
-die "Please install mod_perl: 1.25 < version < 1.99\n($@)";
-}
-if ($mod_perl::VERSION < 1.2402) {
-die "Please upgrade mod_perl to 1.24_02 or greater";
-}
-elsif ($mod_perl::VERSION > 1.98) {
-die "mod_perl 1.x ( < 1.99) is required";
-}
-}
 
 my $conf_data = join '', ;
 $conf_data =~ s|(blib/arch)|$FindBin::Bin/$1|;


Re: Apache::Cookie - what is the mod_perl 2.0 equivalent?

2006-10-25 Thread Michael Peters


Patrick Galbraith wrote:

> I have been looking high and low for the answer - what is the equivalent
> of Apache::Cookie in mod_perl 2.0? I tried to use Apache2::compat to get

Apache::Cookie wasn't part of mod_perl 1 either. It's part of libapreq. So for
apache 2 you need libapreq2 which provides Apache2::Cookie.

-- 
Michael Peters
Developer
Plus Three, LP