basic conversion of Makefile.PL to vanilla EUMM
[catagits/Catalyst-Plugin-Email.git] / Makefile.PL
CommitLineData
77a3f907 1use strict;
2use warnings;
3
5a5a0df4 4use ExtUtils::MakeMaker;
5
77a3f907 6my $developer = -f '.gitignore';
7ExtUtils::MakeMaker->VERSION('7.00') if $developer;
8
9my %WriteMakefileArgs = (
10 NAME => 'Catalyst::Plugin::Email',
11 VERSION_FROM => 'lib/Catalyst/Plugin/Email.pm',
12 ABSTRACT => 'Send emails with Catalyst',
13 AUTHOR => 'Sebastian Riedel <sri@cpan.org>',
14 LICENSE => 'perl_5',
15 MIN_PERL_VERSION => 5.008, # catalyst minimum
5a5a0df4 16 PREREQ_PM => {
77a3f907 17 'Catalyst' => '2.99',
18 'Email::Send' => '0',
19 'Email::MIME' => '0',
20 'Email::MIME::Creator' => '0',
21 },
22 TEST_REQUIRES => {
5a5a0df4 23 },
5a5a0df4 24);
77a3f907 25
26die 'need to do a merge with CPAN::Meta::Requirements!!'
27 if $developer && exists $WriteMakefileArgs{BUILD_REQUIRES};
28
29if (!eval { ExtUtils::MakeMaker->VERSION('6.6303') }) {
30 $WriteMakefileArgs{BUILD_REQUIRES} = $WriteMakefileArgs{TEST_REQUIRES};
31 delete $WriteMakefileArgs{TEST_REQUIRES};
32}
33
34if (!eval { ExtUtils::MakeMaker->VERSION('6.5501') }) {
35 @{$WriteMakefileArgs{PREREQ_PM}}{ keys %{$WriteMakefileArgs{BUILD_REQUIRES}} } =
36 @{$WriteMakefileArgs{BUILD_REQUIRES}}{ keys %{$WriteMakefileArgs{BUILD_REQUIRES}} };
37
38 delete $WriteMakefileArgs{BUILD_REQUIRES};
39}
40
41my %mm_req = (
42 LICENCE => 6.31,
43 META_MERGE => 6.45,
44 META_ADD => 6.45,
45 MIN_PERL_VERSION => 6.48,
46);
47for (keys %mm_req) {
48 unless (eval { ExtUtils::MakeMaker->VERSION($mm_req{$_}) }) {
49 warn "$_ $@" if $developer;
50 delete $WriteMakefileArgs{$_};
51 }
52}
53
54WriteMakefile(%WriteMakefileArgs);