use ExtUtils::MakeMaker;
(do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
-WriteMakefile(
+my %WriteMakefileArgs = (
NAME => 'Import::Into',
VERSION_FROM => 'lib/Import/Into.pm',
PREREQ_PM => { },
LICENSE => 'perl',
- MIN_PERL_VERSION => '5.006',
META_MERGE => {
'meta-spec' => { version => 2 },
web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Import-Into',
},
},
+ },
+
+ META_ADD => {
prereqs => {
runtime => {
requires => {
'strict' => '0',
'warnings' => '0',
'Module::Runtime' => '0',
+ 'perl' => '5.006',
},
},
test => {
realclean => { FILES => [ 'Distar/', 'MANIFEST*' ] },
);
+
+my $eumm_version = eval $ExtUtils::MakeMaker::VERSION;
+
+for (qw(configure build test runtime)) {
+ my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES';
+ next unless exists $WriteMakefileArgs{META_ADD}{prereqs}{$_}
+ or exists $WriteMakefileArgs{$key};
+ my $r = $WriteMakefileArgs{$key} = {
+ %{$WriteMakefileArgs{META_ADD}{prereqs}{$_}{requires} || {}},
+ %{delete $WriteMakefileArgs{$key} || {}},
+ };
+ defined $r->{$_} or delete $r->{$_} for keys %$r;
+}
+
+# dynamic prereqs get added here.
+
+$WriteMakefileArgs{MIN_PERL_VERSION} = delete $WriteMakefileArgs{PREREQ_PM}{perl} || 0;
+
+$WriteMakefileArgs{BUILD_REQUIRES} = {
+ %{$WriteMakefileArgs{BUILD_REQUIRES} || {}},
+ %{delete $WriteMakefileArgs{TEST_REQUIRES}}
+} if $eumm_version < 6.63_03;
+
+$WriteMakefileArgs{PREREQ_PM} = {
+ %{$WriteMakefileArgs{PREREQ_PM}},
+ %{delete $WriteMakefileArgs{BUILD_REQUIRES}}
+} if $eumm_version < 6.55_01;
+
+delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
+ if $eumm_version < 6.51_03;
+
+WriteMakefile(%WriteMakefileArgs);