Geoff, if this Apache::Bootstrap module proves successful in making this
makefile easy to write, do you know of any licensing issues that it
might run into? It uses ASF licensed code, so I don't know if it would
have to be an official mod_perl project.
I'm going to push out 0.03 tomorrow, maybe it is worthwhile, maybe not,
but it has make this makefile business a lot easier to deal with :)
phr...@us... wrote:
> Revision: 67
> http://apache-dispatch.svn.sourceforge.net/apache-dispatch/?rev=67&view=rev
> Author: phred_moyer
> Date: 2008-06-22 01:13:40 -0700 (Sun, 22 Jun 2008)
>
> Log Message:
> -----------
> Simply again with next version of Apache::Bootstrap. This rats nets is
> getting simpler but I only managed to lose 10 lines on this latest
> revision :)
>
> None the less, this stuff is a lot easier to setup now.
>
> Modified Paths:
> --------------
> trunk/Makefile.PL
>
> Modified: trunk/Makefile.PL
> ===================================================================
> --- trunk/Makefile.PL 2008-06-21 09:15:40 UTC (rev 66)
> +++ trunk/Makefile.PL 2008-06-22 08:13:40 UTC (rev 67)
> @@ -5,39 +5,45 @@
>
> use Config;
>
> -BEGIN {
> - my $AB_VER = 0.02;
> - my $fail_msg = "Warning: prerequisite Apache::Bootstrap $AB_VER not found.";
> -
> - eval { require Apache::Bootstrap };
> - die $fail_msg . "\n" if $@;
> +# minimum version of A::B required
> +use Apache::Bootstrap 0.03;
>
> - die $fail_msg . " We have $Apache::Bootstrap::VERSION.\n"
> - if $Apache::Bootstrap::VERSION < $AB_VER;
> +my $bootstrap;
> +
> +BEGIN {
> + # make sure we have at least one minimum version required
> + $bootstrap = Apache::Bootstrap->new({ mod_perl2 => '1.99022', mod_perl => 0, });
> }
>
> -my %prereqs = ( );
> -my %mp2 = ( mod_perl2 => 1.99022 );
> -my %mp1 = ( mod_perl => 0 );
> -
> +# allow builds with mod_perl one when MOD_PERL_1_BUILD ENV is set
> my $mp_gen;
> -if ( $ENV{MOD_PERL_2_BUILD} ) {
> - push @ARGV, "-apxs $ENV{MP_APXS}";
> - my $mp_gen = Apache::Bootstrap->satisfy_mp_generation(2);
> +if ( $ENV{MOD_PERL_1_BUILD} ) {
> +
> + $mp_gen = $bootstrap->satisfy_mp_generation(1);
> +} else {
> +
> + # else we build for mp2
> + push @ARGV, "-apxs $ENV{MP_APXS}" if exists $ENV{MP_APXS};
> + $mp_gen = $bootstrap->satisfy_mp_generation(2);
> }
> -else {
> - $mp_gen = Apache::Bootstrap->satisfy_mp_generation();
> -}
>
> -%prereqs = ( $mp_gen == 1 ? %mp1 : %mp2 );
> +# check for Apache::Test, $HAS_APACHE_TEST contains version or is undefined
> +my $HAS_APACHE_TEST = $bootstrap->check_for_apache_test();
>
> -my $HAS_APACHE_TEST = Apache::Bootstrap->check_for_apache_test();
> +# calculate common makefile version vars
> +my $apache = $bootstrap->apache_major_version;
> +my $base_lib = "lib/$apache/Dispatch.pm";
>
> -my %common_opts = (
> - PREREQ_PM => \%prereqs,
> - clean => { FILES => 't/TEST, *.xs*' },
> +# common makefile build options
> +my %maker_opts = (
> + PREREQ_PM => $bootstrap->mp_prereqs,
> + clean => { FILES => 't/TEST, *.xs*' },
> + NAME => "$apache\::Dispatch",
> + VERSION_FROM => $base_lib,
> + ABSTRACT_FROM => $base_lib,
> );
>
> +
> if ( $mp_gen == 1 ) {
>
> # Build directives using xs or PerlSetVar
> @@ -46,7 +52,7 @@
> eval {
>
require Apache::ExtUtils;
> require Apache::src;
> - };
> + };
>
> if ( $@ || $ENV{DISPATCH_PUREPERL} ) {
> print
> @@ -72,30 +78,14 @@
> $makefile_params{'INC'} = $inc;
> }
>
> - require ExtUtils::MakeMaker;
> - ExtUtils::MakeMaker::WriteMakefile(
> - %common_opts,
> - %makefile_params,
> - VERSION_FROM => "lib/Apache/Dispatch.pm",
> - NAME => "Apache::Dispatch",
> - ABSTRACT_FROM => 'lib/Apache/Dispatch.pm',
> - );
> + %maker_opts = ( %maker_opts, %makefile_params );
>
> }
> -else {
> - require ModPerl::MM;
> - ModPerl::MM::WriteMakefile(
> - %common_opts,
> - VERSION_FROM => "lib/Apache2/Dispatch.pm",
> - NAME => "Apache2::Dispatch",
> - ABSTRACT_FROM => 'lib/Apache2/Dispatch.pm',
> - );
> -}
>
> -if ( $ENV{MOD_PERL_2_BUILD} ) {
> - pop @ARGV;
> -}
> +$bootstrap->WriteMakefile( %maker_opts );
>
> +pop @ARGV unless $ENV{MOD_PERL_1_BUILD};
> +
> package MY;
>
> sub postamble {
>
>
> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Apache-dispatch-devel mailing list
> Apa...@li...
> https://lists.sourceforge.net/lists/listinfo/apache-dispatch-devel
|