From: Fuji, Goro Date: Wed, 10 Nov 2010 04:06:35 +0000 (+0900) Subject: Make Makefile.PL more smart X-Git-Tag: 0.84~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9c96124c0befe46e15618b4e61b7a2baef6ae581;p=gitmo%2FMouse.git Make Makefile.PL more smart --- diff --git a/Makefile.PL b/Makefile.PL index 7a4ea86..28e54da 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -9,22 +9,36 @@ BEGIN{ use strict; use warnings; -use inc::Module::Install 1.00; - -# for co-developpers -use Module::Install::XSUtil 0.30; -use Module::Install::AuthorTests; +BEGIN { + # author requires, or bundled modules + my @devmods = qw( + inc::Module::Install 1.00 + Module::Install::TestTarget 0.13 + Module::Install::AuthorTests 0.002 + Module::Install::XSUtil 0.36 + Test::Exception::LessClever 0.005 + Test::Requires 0.06 + ); + my @not_available; + while(my($mod, $ver) = splice @devmods, 0, 2) { + eval qq{use $mod $ver (); 1} or push @not_available, $mod; + } + if(@not_available) { + print qq{# The following modules are not available.\n}; + print qq{# `perl $0 | cpanm` will install them:\n}; + print $_, "\n" for @not_available; + exit 1; + } +} +use inc::Module::Install; -name 'Mouse'; all_from 'lib/Mouse.pm'; # Scalar::Util < 1.14 has a bug. # > Fixed looks_like_number(undef) to return false for perl >= 5.009002 requires 'Scalar::Util' => 1.14; -test_requires 'Test::More' => 0.88; -test_requires 'Test::Requires' => 0.06; # works on 5.6.0 -test_requires 'Test::Exception::LessClever' => 0.005; +test_requires 'Test::More' => 0.88; # to keep zero-dependencies include 'Test::Exception::LessClever';