X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Makefile.PL;h=0fcdc76abd14701fce6794767fd46c40787f0a89;hb=38a897e9c77a71c63e750d85a25934e7c5937cae;hp=d4c4e9a6a08bd99580262488a1c1e5da07a03be0;hpb=d304984927c1cac62247a93d2cfeb9d1215c9713;p=gitmo%2FClass-C3.git diff --git a/Makefile.PL b/Makefile.PL index d4c4e9a..0fcdc76 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,11 +1,47 @@ -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, - 'Algorithm::C3' => 0.01, - } -); +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'; + +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(); +} + +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} ) +}