X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Makefile.PL;h=9de5dd2cc9bf327346d8d83de1887d7a6dc4c331;hb=321a86a0f8b3b0065c62f2146a693542d26a032c;hp=ab808e496ff7ad1c54fbe26990aec6155e5411eb;hpb=f7facd7b73c20ba048f0f6c0baea399ba8db10ed;p=gitmo%2FClass-C3.git diff --git a/Makefile.PL b/Makefile.PL index ab808e4..9de5dd2 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,12 +1,48 @@ -use ExtUtils::MakeMaker; -WriteMakefile( - 'NAME' => 'Class::C3', - 'VERSION_FROM' => 'lib/Class/C3.pm', # finds $VERSION - 'PREREQ_PM' => { - 'Test::More' => 0.47, - 'Test::Exception' => 0.15, - 'Scalar::Util' => 1.10, - 'Sub::Name' => 0, - 'NEXT' => 0, - } -); +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'; + +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'; + +# XS not interesting after mro is cored +requires 'Class::C3::XS' => '0.13' + if $] < 5.009_005 and can_xs(); + +test_requires 'Devel::Hide' => 0 + if is_smoker(); + +if($Module::Install::AUTHOR) { + # compiler detection, goes into META + configure_requires 'ExtUtils::MakeMaker' => '6.52'; + configure_requires 'ExtUtils::CBuilder' => '0.27'; + + # Rebuild README for maintainers + system("pod2text lib/Class/C3.pm >README"); +} + +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} ) +}