X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Makefile.PL;h=0fcdc76abd14701fce6794767fd46c40787f0a89;hb=38a897e9c77a71c63e750d85a25934e7c5937cae;hp=405aea399bd00fddcc470985d48c02d1e36cacbe;hpb=ebcf1485fff06d827e09d10a40f49c53177df2cf;p=gitmo%2FClass-C3.git diff --git a/Makefile.PL b/Makefile.PL index 405aea3..0fcdc76 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,18 +1,47 @@ -use inc::Module::Install; +use warnings; +use strict; +use 5.006002; +use inc::Module::Install 1.06; + +perl_version '5.006002'; name 'Class-C3'; all_from 'lib/Class/C3.pm'; -# Class::C3 under 5.9.5+ has no deps -if($] < 5.009_005) { - build_requires 'Test::More' => '0.47'; +test_requires 'Test::More' => '0.47'; + +# needed by the PP version only, have them installed +# regardless of XS availability or perl version +# (for fatpacking and whatnot) +requires 'Algorithm::C3' => '0.07'; +requires 'Scalar::Util' => '0'; + +if ($] < 5.009_005) { + # XS not interesting after mro is cored + requires 'Class::C3::XS' => '0.13' if can_xs(); + test_requires 'Devel::Hide' => 0 if is_smoker(); +} - feature 'XS Speedups', 'Class::C3::XS' => '0.04'; +if($Module::Install::AUTHOR) { + # compiler detection, goes into META + configure_requires 'ExtUtils::MakeMaker' => '6.52'; + configure_requires 'ExtUtils::CBuilder' => '0.27'; - # Would like to disable these if they answer yes above too ... - requires 'Algorithm::C3' => '0.06'; - requires 'Scalar::Util' => '1.10'; + # Rebuild README for maintainers + system("pod2text lib/Class/C3.pm >README"); } -auto_install; WriteAll; + +if ($Module::Install::AUTHOR) { + @{Meta->{values}{requires}} = grep + { $_->[0] !~ /^ (?: Class::C3::XS | Devel::Hide ) $/x } + @{Meta->{values}{requires}} + ; + print "Regenerating META with XS/test requires excluded\n"; + Meta->write; +} + +sub is_smoker { + return ( $ENV{AUTOMATED_TESTING} && ! $ENV{PERL5_CPANM_IS_RUNNING} && ! $ENV{RELEASE_TESTING} ) +}