X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Makefile.PL;fp=Makefile.PL;h=e7acf2f61fc6710c4569008df1c86e9efcdf2c08;hb=77a3f9071afa64f24658d0b7328433c4c08f20b3;hp=2272adcaec24f9824c5c744985f4aaccb1c06557;hpb=c172b4684132a2cb747252d6a6ab59f7b0144a28;p=catagits%2FCatalyst-Plugin-Email.git diff --git a/Makefile.PL b/Makefile.PL index 2272adc..e7acf2f 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,13 +1,54 @@ +use strict; +use warnings; + use ExtUtils::MakeMaker; -WriteMakefile( - NAME => 'Catalyst::Plugin::Email', - AUTHOR => 'Sebastian Riedel (sri@oook.de)', +my $developer = -f '.gitignore'; +ExtUtils::MakeMaker->VERSION('7.00') if $developer; + +my %WriteMakefileArgs = ( + NAME => 'Catalyst::Plugin::Email', + VERSION_FROM => 'lib/Catalyst/Plugin/Email.pm', + ABSTRACT => 'Send emails with Catalyst', + AUTHOR => 'Sebastian Riedel ', + LICENSE => 'perl_5', + MIN_PERL_VERSION => 5.008, # catalyst minimum PREREQ_PM => { - Catalyst => '2.99', - Email::Send => 0, - Email::MIME => 0, - Email::MIME::Creator => 0 + 'Catalyst' => '2.99', + 'Email::Send' => '0', + 'Email::MIME' => '0', + 'Email::MIME::Creator' => '0', + }, + TEST_REQUIRES => { }, - VERSION_FROM => 'Email.pm' ); + +die 'need to do a merge with CPAN::Meta::Requirements!!' + if $developer && exists $WriteMakefileArgs{BUILD_REQUIRES}; + +if (!eval { ExtUtils::MakeMaker->VERSION('6.6303') }) { + $WriteMakefileArgs{BUILD_REQUIRES} = $WriteMakefileArgs{TEST_REQUIRES}; + delete $WriteMakefileArgs{TEST_REQUIRES}; +} + +if (!eval { ExtUtils::MakeMaker->VERSION('6.5501') }) { + @{$WriteMakefileArgs{PREREQ_PM}}{ keys %{$WriteMakefileArgs{BUILD_REQUIRES}} } = + @{$WriteMakefileArgs{BUILD_REQUIRES}}{ keys %{$WriteMakefileArgs{BUILD_REQUIRES}} }; + + delete $WriteMakefileArgs{BUILD_REQUIRES}; +} + +my %mm_req = ( + LICENCE => 6.31, + META_MERGE => 6.45, + META_ADD => 6.45, + MIN_PERL_VERSION => 6.48, +); +for (keys %mm_req) { + unless (eval { ExtUtils::MakeMaker->VERSION($mm_req{$_}) }) { + warn "$_ $@" if $developer; + delete $WriteMakefileArgs{$_}; + } +} + +WriteMakefile(%WriteMakefileArgs);