X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Makefile.PL;h=8f296f1e287786b5e2cf94b3ba60564df21aff8b;hb=c5df1f5ef10022d95587606b1cbc4a31b18cedac;hp=44635824eba619e4d5d07564f40b402be8583433;hpb=406a97c2aab476c7a52f7c623a95f275eeb376f3;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/Makefile.PL b/Makefile.PL index 4463582..8f296f1 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -2,19 +2,20 @@ use warnings; use strict; use 5.008001; +use lib '.'; use inc::Module::Install 1.00; use Getopt::Long(); my $getopt = Getopt::Long::Parser->new( - config => [qw/gnu_getopt bundling_override no_ignore_case pass_through/] + config => [qw/gnu_getopt bundling_override no_ignore_case pass_through/] ); my $args = { - skip_author_deps => undef, + skip_author_deps => undef, }; $getopt->getoptions($args, 'skip_author_deps'); if (@ARGV) { - warn "\nIgnoring unrecognized option(s): @ARGV\n\n"; + warn "\nIgnoring unrecognized option(s): @ARGV\n\n"; } use FindBin; @@ -84,8 +85,16 @@ See also the "Changes" file for the last few revisions. EOF if ($Module::Install::AUTHOR && ! $args->{skip_author_deps}) { - eval { require Module::Install::ReadmeFromPod } - or die "\nYou need Module::Install::ReadmeFromPod installed to run this Makefile.PL in author mode:\n\n$@\n"; + my @missing_plugins; + for my $plugin (qw(ReadmeFromPod AuthorTests)) { + eval "require Module::Install::$plugin" and next; + push @missing_plugins, "Module::Install::$plugin"; + chomp(my $err = $@); + $missing_plugins[-1] .= " ($err)" + unless $err =~ m{^Can't locate Module/Install/$plugin.pm in \@INC}; + } + die "\nYou need to install the following modules to run this Makefile.PL in author mode:\n\n", join("\n", @missing_plugins), "\n\n" + if @missing_plugins; warn "\n*** AUTHOR MODE: some optional dependencies converted to hard requires.\n\n"; @@ -101,8 +110,17 @@ if ($Module::Install::AUTHOR && ! $args->{skip_author_deps}) { DBIx::Class::Schema::Loader::Optional::Dependencies->_gen_pod(undef, 'lib'); + author_tests( 'xt' ); readme_from( 'lib/DBIx/Class/Schema/Loader.pm' ); realclean_files( qw[README MANIFEST lib/DBIx/Class/Schema/Loader/Optional/Dependencies.pod] ); + postamble <