From: t0m Date: Wed, 19 Aug 2009 19:51:34 +0000 (+0100) Subject: Remove crap from Makefile.PL by using MI::AuthorRequires X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Engine-STOMP.git;a=commitdiff_plain;h=86eaf9262df0d45dd0658eabce1e889730056dba Remove crap from Makefile.PL by using MI::AuthorRequires --- diff --git a/Makefile.PL b/Makefile.PL index 456dbc0..c6ae2a2 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,6 +1,14 @@ use inc::Module::Install 0.91; +use strict; +use warnings; use 5.008006; +BEGIN { + if ($Module::Install::AUTHOR) { + require Module::Install::AuthorRequires; + } +} + license 'perl'; name 'Catalyst-Engine-Stomp'; @@ -19,38 +27,23 @@ requires 'namespace::autoclean' => '0.05'; test_requires 'Alien::ActiveMQ' => '0.00003'; test_requires 'Catalyst::Plugin::ConfigLoader' => undef; -my @force_build_requires_if_author = qw( - Test::NoTabs - Test::Pod - Test::Pod::Coverage - Pod::Coverage -); +author_requires 'Test::NoTabs'; +author_requires 'Test::Pod'; +author_requires 'Test::Pod::Coverage'; +author_requires 'Pod::Coverage'; if ($Module::Install::AUTHOR) { - foreach my $module (@force_build_requires_if_author) { - build_requires $module; - } darwin_check_no_resource_forks(); } +resources + 'repository' => 'git://github.com/chrisa/catalyst-engine-stomp.git', + 'license' => 'http://dev.perl.org/licenses/'; + install_script glob('script/*.pl'); auto_install; WriteAll; -if ($Module::Install::AUTHOR) { - - # Strip out the author only build_requires from META.yml - # Need to do this _after_ WriteAll else it looses track of them - strip_author_only_build_requires(@force_build_requires_if_author); - - Meta->{values}{resources} = [ - [ 'license', => 'http://dev.perl.org/licenses/' ], - [ 'repository', => 'git://github.com/chrisa/catalyst-engine-stomp.git' ], - ]; - - Meta->write; -} - sub darwin_check_no_resource_forks { if ($^O eq 'darwin') { my $osx_ver = `/usr/bin/sw_vers -productVersion`; @@ -66,17 +59,3 @@ sub darwin_check_no_resource_forks { } } -sub strip_author_only_build_requires { - my @build_requires_to_strip = @_; - Meta->{values}{build_requires} = [ grep { - my $ok = 1; - foreach my $module (@build_requires_to_strip) { - if ($_->[0] =~ /$module/) { - $ok = 0; - last; - } - } - $ok; - } @{Meta->{values}{build_requires}} ]; -} -