Commit | Line | Data |
77a3f907 |
1 | use strict; |
2 | use warnings; |
3 | |
5a5a0df4 |
4 | use ExtUtils::MakeMaker; |
5 | |
77a3f907 |
6 | my $developer = -f '.gitignore'; |
7 | ExtUtils::MakeMaker->VERSION('7.00') if $developer; |
8 | |
9 | my %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 | |
26 | die 'need to do a merge with CPAN::Meta::Requirements!!' |
27 | if $developer && exists $WriteMakefileArgs{BUILD_REQUIRES}; |
28 | |
29 | if (!eval { ExtUtils::MakeMaker->VERSION('6.6303') }) { |
30 | $WriteMakefileArgs{BUILD_REQUIRES} = $WriteMakefileArgs{TEST_REQUIRES}; |
31 | delete $WriteMakefileArgs{TEST_REQUIRES}; |
32 | } |
33 | |
34 | if (!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 | |
41 | my %mm_req = ( |
42 | LICENCE => 6.31, |
43 | META_MERGE => 6.45, |
44 | META_ADD => 6.45, |
45 | MIN_PERL_VERSION => 6.48, |
46 | ); |
47 | for (keys %mm_req) { |
48 | unless (eval { ExtUtils::MakeMaker->VERSION($mm_req{$_}) }) { |
49 | warn "$_ $@" if $developer; |
50 | delete $WriteMakefileArgs{$_}; |
51 | } |
52 | } |
53 | |
54 | WriteMakefile(%WriteMakefileArgs); |