Update ExtUtils-MakeMaker to CPAN version 6.86
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Sat, 4 Jan 2014 12:24:00 +0000 (12:24 +0000)
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Sat, 4 Jan 2014 12:24:00 +0000 (12:24 +0000)
  [DELTA]

6.86 Sat Jan  4 12:17:53 GMT 2014

    No changes from 6.85_07

6.85_07 Wed Jan  1 18:55:22 GMT 2014
    Bug fixes:
    * Expanded test coverage for metafiles

    Doc fixes:
    * Documentation expanded to mention JSON metafiles

6.85_06 Mon Dec 30 23:14:37 GMT 2013
    Bug fixes:
    * Explicitly require dynaloader before using mod2fname

6.85_05 Sun Dec 29 11:25:00 GMT 2013
    Bug fixes:
    * Export 'configure' section of prereqs when meta-spec version 2

    Doc fixes:
    * Document BUILD_REQUIRES defaults

6.85_04 Mon Dec 23 15:00:14 GMT 2013

    No changes since v6.85_03 fixing repo tags

6.85_03 Mon Dec 23 14:55:37 GMT 2013
    Bug fixes:
    * RT#91540 PREREQ_FATAL not recognised on command line

6.85_02 Tue Dec 17 10:13:28 GMT 2013
    New features:
    * Added PPM_UNINSTALL_EXEC and PPM_UNINSTALL_SCRIPT options
      to PPD generation

6.85_01 Mon Dec 16 13:15:43 GMT 2013
    Bug Fixes:
    * harden xsubpp locating loop in MM_Unix

30 files changed:
Porting/Maintainers.pl
cpan/ExtUtils-MakeMaker/lib/ExtUtils/Command/MM.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_AIX.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_BeOS.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_DOS.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Darwin.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_MacOS.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_NW5.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_OS2.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_QNX.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_UWIN.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VMS.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VOS.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Win32.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Win95.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MY.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/Config.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/FAQ.pod
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/Tutorial.pod
cpan/ExtUtils-MakeMaker/lib/ExtUtils/Mkbootstrap.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/Mksymlists.pm
cpan/ExtUtils-MakeMaker/lib/ExtUtils/testlib.pm
cpan/ExtUtils-MakeMaker/t/metafile_data.t

index 154aeb4..466d6a8 100755 (executable)
@@ -473,7 +473,7 @@ use File::Glob qw(:case);
     },
 
     'ExtUtils::MakeMaker' => {
-        'DISTRIBUTION' => 'BINGOS/ExtUtils-MakeMaker-6.84.tar.gz',
+        'DISTRIBUTION' => 'BINGOS/ExtUtils-MakeMaker-6.86.tar.gz',
         'FILES'        => q[cpan/ExtUtils-MakeMaker],
         'EXCLUDED'     => [
             qr{^t/lib/Test/},
index 38eb8b8..c50647a 100644 (file)
@@ -10,7 +10,7 @@ our @ISA = qw(Exporter);
 
 our @EXPORT  = qw(test_harness pod2man perllocal_install uninstall
                   warn_if_old_packlist test_s cp_nonempty);
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 my $Is_VMS = $^O eq 'VMS';
 
index 684157a..3ffe3df 100644 (file)
@@ -2,7 +2,7 @@ package ExtUtils::Liblist;
 
 use strict;
 
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 use File::Spec;
 require ExtUtils::Liblist::Kid;
index 154f335..95e3dcc 100644 (file)
@@ -11,7 +11,7 @@ use 5.006;
 
 use strict;
 use warnings;
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 use ExtUtils::MakeMaker::Config;
 use Cwd 'cwd';
index ea7f587..e474c1d 100644 (file)
@@ -3,7 +3,7 @@ package ExtUtils::MM;
 use strict;
 use ExtUtils::MakeMaker::Config;
 
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 require ExtUtils::Liblist;
 require ExtUtils::MakeMaker;
index e3f8e70..9ba5058 100644 (file)
@@ -1,7 +1,7 @@
 package ExtUtils::MM_AIX;
 
 use strict;
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 require ExtUtils::MM_Unix;
 our @ISA = qw(ExtUtils::MM_Unix);
index 9d046d8..a185b42 100644 (file)
@@ -1,7 +1,7 @@
 package ExtUtils::MM_Any;
 
 use strict;
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 use Carp;
 use File::Spec;
@@ -806,9 +806,9 @@ sub _has_cpan_meta {
 
 Generate the metafile target.
 
-Writes the file META.yml YAML encoded meta-data about the module in
-the distdir.  The format follows Module::Build's as closely as
-possible.
+Writes the file META.yml (YAML encoded meta-data) and META.json
+(JSON encoded meta-data) about the module in the distdir.
+The format follows Module::Build's as closely as possible.
 
 =cut
 
@@ -959,7 +959,8 @@ sub _hash_merge {
 
     my @metadata_pairs = $mm->metafile_data(\%meta_add, \%meta_merge);
 
-Returns the data which MakeMaker turns into the META.yml file.
+Returns the data which MakeMaker turns into the META.yml file 
+and the META.json file.
 
 Values of %meta_add will overwrite any existing metadata in those
 keys.  %meta_merge will be merged with them.
@@ -995,17 +996,6 @@ sub metafile_data {
     # The author key is required and it takes a list.
     $meta{author}   = defined $self->{AUTHOR}    ? $self->{AUTHOR} : [];
 
-    # Check the original args so we can tell between the user setting it
-    # to an empty hash and it just being initialized.
-    if( $self->{ARGS}{CONFIGURE_REQUIRES} ) {
-        $meta{configure_requires}
-            = _normalize_prereqs($self->{CONFIGURE_REQUIRES});
-    } else {
-        $meta{configure_requires} = {
-            'ExtUtils::MakeMaker'       => 0,
-        };
-    }
-
     {
       my $vers = _metaspec_version( $meta_add, $meta_merge );
       my $method = $vers =~ m!^2!
@@ -1046,6 +1036,15 @@ sub _add_requirements_to_meta_v1_4 {
 
     # Check the original args so we can tell between the user setting it
     # to an empty hash and it just being initialized.
+    if( $self->{ARGS}{CONFIGURE_REQUIRES} ) {
+        $meta{configure_requires}
+            = _normalize_prereqs($self->{CONFIGURE_REQUIRES});
+    } else {
+        $meta{configure_requires} = {
+            'ExtUtils::MakeMaker'       => 0,
+        };
+    }
+
     if( $self->{ARGS}{BUILD_REQUIRES} ) {
         $meta{build_requires} = _normalize_prereqs($self->{BUILD_REQUIRES});
     } else {
@@ -1074,6 +1073,15 @@ sub _add_requirements_to_meta_v2 {
 
     # Check the original args so we can tell between the user setting it
     # to an empty hash and it just being initialized.
+    if( $self->{ARGS}{CONFIGURE_REQUIRES} ) {
+        $meta{prereqs}{configure}{requires}
+            = _normalize_prereqs($self->{CONFIGURE_REQUIRES});
+    } else {
+        $meta{prereqs}{configure}{requires} = {
+            'ExtUtils::MakeMaker'       => 0,
+        };
+    }
+
     if( $self->{ARGS}{BUILD_REQUIRES} ) {
         $meta{prereqs}{build}{requires} = _normalize_prereqs($self->{BUILD_REQUIRES});
     } else {
@@ -1270,8 +1278,8 @@ sub metafile_file {
 
     my $make_frag = $mm->distmeta_target;
 
-Generates the distmeta target to add META.yml to the MANIFEST in the
-distdir.
+Generates the distmeta target to add META.yml and META.json to the MANIFEST
+in the distdir.
 
 =cut
 
@@ -1307,8 +1315,8 @@ MAKE
 
     my $mymeta = $mm->mymeta;
 
-Generate MYMETA information as a hash either from an existing META.yml
-or from internal data.
+Generate MYMETA information as a hash either from an existing CPAN Meta file
+(META.json or META.yml) or from internal data.
 
 =cut
 
@@ -1376,9 +1384,7 @@ sub _mymeta_from_meta {
 
     $self->write_mymeta( $mymeta );
 
-Write MYMETA information to MYMETA.yml.
-
-This will probably be refactored into a more generic YAML dumping method.
+Write MYMETA information to MYMETA.json and MYMETA.yml.
 
 =cut
 
index 9e5239a..986b956 100644 (file)
@@ -26,7 +26,7 @@ require ExtUtils::MM_Any;
 require ExtUtils::MM_Unix;
 
 our @ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 
 =item os_flavor
index 622189d..9dbb945 100644 (file)
@@ -9,7 +9,7 @@ require ExtUtils::MM_Unix;
 require ExtUtils::MM_Win32;
 our @ISA = qw( ExtUtils::MM_Unix );
 
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 
 =head1 NAME
index 1a63fa2..984d69b 100644 (file)
@@ -2,7 +2,7 @@ package ExtUtils::MM_DOS;
 
 use strict;
 
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 require ExtUtils::MM_Any;
 require ExtUtils::MM_Unix;
index c093e9a..024e038 100644 (file)
@@ -7,7 +7,7 @@ BEGIN {
     our @ISA = qw( ExtUtils::MM_Unix );
 }
 
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 
 =head1 NAME
index 28a0028..39c38af 100644 (file)
@@ -2,7 +2,7 @@ package ExtUtils::MM_MacOS;
 
 use strict;
 
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 sub new {
     die <<'UNSUPPORTED';
index 41ed14b..b90c5c8 100644 (file)
@@ -22,7 +22,7 @@ use strict;
 use ExtUtils::MakeMaker::Config;
 use File::Basename;
 
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 require ExtUtils::MM_Win32;
 our @ISA = qw(ExtUtils::MM_Win32);
index 510e33f..6dce7b0 100644 (file)
@@ -5,7 +5,7 @@ use strict;
 use ExtUtils::MakeMaker qw(neatvalue);
 use File::Spec;
 
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 require ExtUtils::MM_Any;
 require ExtUtils::MM_Unix;
index 6c48d0e..25b6d85 100644 (file)
@@ -1,7 +1,7 @@
 package ExtUtils::MM_QNX;
 
 use strict;
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 require ExtUtils::MM_Unix;
 our @ISA = qw(ExtUtils::MM_Unix);
index 8c39701..b5bce54 100644 (file)
@@ -1,7 +1,7 @@
 package ExtUtils::MM_UWIN;
 
 use strict;
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 require ExtUtils::MM_Unix;
 our @ISA = qw(ExtUtils::MM_Unix);
index a7a5e1b..72d04fb 100644 (file)
@@ -15,7 +15,7 @@ use ExtUtils::MakeMaker qw($Verbose neatvalue);
 
 # If we make $VERSION an our variable parse_version() breaks
 use vars qw($VERSION);
-$VERSION = '6.84';
+$VERSION = '6.86';
 $VERSION = eval $VERSION;  ## no critic [BuiltinFunctions::ProhibitStringyEval]
 
 require ExtUtils::MM_Any;
@@ -1594,6 +1594,8 @@ sub init_main {
     # Some systems have restrictions on files names for DLL's etc.
     # mod2fname returns appropriate file base name (typically truncated)
     # It may also edit @modparts if required.
+    # We require DynaLoader to make sure that mod2fname is loaded
+    eval { require DynaLoader };
     if (defined &DynaLoader::mod2fname) {
         $modfname = &DynaLoader::mod2fname(\@modparts);
     }
@@ -2983,6 +2985,17 @@ PPD_OUT
         }
     }
 
+    if ($self->{PPM_UNINSTALL_SCRIPT}) {
+        if ($self->{PPM_UNINSTALL_EXEC}) {
+            $ppd_xml .= sprintf qq{        <UNINSTALL EXEC="%s">%s</UNINSTALL>\n},
+                  $self->{PPM_UNINSTALL_EXEC}, $self->{PPM_UNINSTALL_SCRIPT};
+        }
+        else {
+            $ppd_xml .= sprintf qq{        <UNINSTALL>%s</UNINSTALL>\n},
+                  $self->{PPM_UNINSTALL_SCRIPT};
+        }
+    }
+
     my ($bin_location) = $self->{BINARY_LOCATION} || '';
     $bin_location =~ s/\\/\\\\/g;
 
@@ -3504,12 +3517,15 @@ sub tool_xsubpp {
     # Make sure we pick up the new xsubpp if we're building perl.
     unshift @xsubpp_dirs, $self->{PERL_LIB} if $self->{PERL_CORE};
 
+    my $foundxsubpp = 0;
     foreach my $dir (@xsubpp_dirs) {
         $xsdir = $self->catdir($dir, 'ExtUtils');
         if( -r $self->catfile($xsdir, "xsubpp") ) {
+            $foundxsubpp = 1;
             last;
         }
     }
+    die "ExtUtils::MM_Unix::tool_xsubpp : Can't find xsubpp" if !$foundxsubpp;
 
     my $tmdir   = File::Spec->catdir($self->{PERL_LIB},"ExtUtils");
     my(@tmdeps) = $self->catfile($tmdir,'typemap');
index aa034a2..f97b198 100644 (file)
@@ -15,7 +15,7 @@ BEGIN {
 
 use File::Basename;
 
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 require ExtUtils::MM_Any;
 require ExtUtils::MM_Unix;
index c80b55c..12e7549 100644 (file)
@@ -1,7 +1,7 @@
 package ExtUtils::MM_VOS;
 
 use strict;
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 require ExtUtils::MM_Unix;
 our @ISA = qw(ExtUtils::MM_Unix);
index adbd8e3..78f8bbc 100644 (file)
@@ -27,7 +27,7 @@ use ExtUtils::MakeMaker qw( neatvalue );
 require ExtUtils::MM_Any;
 require ExtUtils::MM_Unix;
 our @ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 $ENV{EMXSHELL} = 'sh'; # to run `commands`
 
index c9cde9c..dac7021 100644 (file)
@@ -2,7 +2,7 @@ package ExtUtils::MM_Win95;
 
 use strict;
 
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 require ExtUtils::MM_Win32;
 our @ISA = qw(ExtUtils::MM_Win32);
index 4dc472d..62a0a94 100644 (file)
@@ -3,7 +3,7 @@ package ExtUtils::MY;
 use strict;
 require ExtUtils::MM;
 
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 our @ISA = qw(ExtUtils::MM);
 
 {
index eced66d..d1bcfe0 100644 (file)
@@ -18,7 +18,7 @@ our @Overridable;
 my @Prepend_parent;
 my %Recognized_Att_Keys;
 
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 $VERSION = eval $VERSION;  ## no critic [BuiltinFunctions::ProhibitStringyEval]
 
 # Emulate something resembling CVS $Revision$
@@ -280,8 +280,8 @@ sub full_setup {
     NORECURS NO_VC OBJECT OPTIMIZE PERL_MALLOC_OK PERL PERLMAINCC PERLRUN
     PERLRUNINST PERL_CORE
     PERL_SRC PERM_DIR PERM_RW PERM_RWX MAGICXS
-    PL_FILES PM PM_FILTER PMLIBDIRS PMLIBPARENTDIRS POLLUTE PPM_INSTALL_EXEC
-    PPM_INSTALL_SCRIPT PREREQ_FATAL PREREQ_PM PREREQ_PRINT PRINT_PREREQ
+    PL_FILES PM PM_FILTER PMLIBDIRS PMLIBPARENTDIRS POLLUTE PPM_INSTALL_EXEC PPM_UNINSTALL_EXEC
+    PPM_INSTALL_SCRIPT PPM_UNINSTALL_SCRIPT PREREQ_FATAL PREREQ_PM PREREQ_PRINT PRINT_PREREQ
     SIGN SKIP TEST_REQUIRES TYPEMAPS UNINST VERSION VERSION_FROM XS XSOPT XSPROTOARG
     XS_VERSION clean depend dist dynamic_lib linkext macro realclean
     tool_autosplit
@@ -605,6 +605,17 @@ END
         parse_args($self, _shellwords($ENV{PERL_MM_OPT} || ''),@ARGV);
     }
 
+    # RT#91540 PREREQ_FATAL not recognized on command line
+    if (%unsatisfied && $self->{PREREQ_FATAL}){
+        my $failedprereqs = join "\n", map {"    $_ $unsatisfied{$_}"}
+                            sort { $a cmp $b } keys %unsatisfied;
+        die <<"END";
+MakeMaker FATAL: prerequisites not found.
+$failedprereqs
+
+Please install these modules first and rerun 'perl Makefile.PL'.
+END
+    }
 
     $self->{NAME} ||= $self->guess_name;
 
@@ -1675,8 +1686,9 @@ Available in version 6.5503 and above.
 
 A hash of modules that are needed to build your module but not run it.
 
-This will go into the C<build_requires> field of your CPAN Meta file.
-(F<META.yml> or F<META.json>).
+This will go into the C<build_requires> field of your F<META.yml> and the C<build> of the C<prereqs> field of your F<META.json>.
+
+Defaults to C<<< { "ExtUtils::MakeMaker" => 0 } >>> if this attribute is not specified.
 
 The format is the same as PREREQ_PM.
 
@@ -1725,10 +1737,9 @@ Available in version 6.52 and above.
 A hash of modules that are required to run Makefile.PL itself, but not
 to run your distribution.
 
-This will go into the C<configure_requires> field of your CPAN Meta file
-(F<META.yml> or F<META.json>)
+This will go into the C<configure_requires> field of your F<META.yml> and the C<configure> of the C<prereqs> field of your F<META.json>.
 
-Defaults to C<<< { "ExtUtils::MakeMaker" => 0 } >>>
+Defaults to C<<< { "ExtUtils::MakeMaker" => 0 } >>> if this attribute is not specified.
 
 The format is the same as PREREQ_PM.
 
@@ -2481,6 +2492,15 @@ Name of the executable used to run C<PPM_INSTALL_SCRIPT> below. (e.g. perl)
 Name of the script that gets executed by the Perl Package Manager after
 the installation of a package.
 
+=item PPM_UNINSTALL_EXEC
+
+Name of the executable used to run C<PPM_UNINSTALL_SCRIPT> below. (e.g. perl)
+
+=item PPM_UNINSTALL_SCRIPT
+
+Name of the script that gets executed by the Perl Package Manager before
+the removal of a package.
+
 =item PREFIX
 
 This overrides all the default install locations.  Man pages,
@@ -2521,8 +2541,7 @@ A hash of modules that are needed to run your module.  The keys are
 the module names ie. Test::More, and the minimum version is the
 value. If the required version number is 0 any version will do.
 
-This will go into the C<requires> field of your CPAN Meta file
-(F<META.yml> or F<META.json>).
+This will go into the C<requires> field of your F<META.yml> and the C<runtime> of the C<prereqs> field of your F<META.json>.
 
     PREREQ_PM => {
         # Require Test::More at least 0.47
@@ -2594,8 +2613,7 @@ if you really need it.
 A hash of modules that are needed to test your module but not run or
 build it.
 
-This will go into the C<test_requires> field of your CPAN Meta file.
-(F<META.yml> or F<META.json>).
+This will go into the C<build_requires> field of your F<META.yml> and the C<test> of the C<prereqs> field of your F<META.json>.
 
 The format is the same as PREREQ_PM.
 
index 3fbbbf8..6d926c0 100644 (file)
@@ -2,7 +2,7 @@ package ExtUtils::MakeMaker::Config;
 
 use strict;
 
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 use Config ();
 
index aac597a..25798bc 100644 (file)
@@ -1,6 +1,6 @@
 package ExtUtils::MakeMaker::FAQ;
 
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 1;
 __END__
index bbd9b1a..c410fd6 100644 (file)
@@ -1,6 +1,6 @@
 package ExtUtils::MakeMaker::Tutorial;
 
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 
 =head1 NAME
index a8f95d6..96b066a 100644 (file)
@@ -3,7 +3,7 @@ package ExtUtils::Mkbootstrap;
 # There's just too much Dynaloader incest here to turn on strict vars.
 use strict 'refs';
 
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 require Exporter;
 our @ISA = ('Exporter');
index 5b08922..38dd8f6 100644 (file)
@@ -10,7 +10,7 @@ use Config;
 
 our @ISA = qw(Exporter);
 our @EXPORT = qw(&Mksymlists);
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 sub Mksymlists {
     my(%spec) = @_;
index 9208ab7..3d0e15d 100644 (file)
@@ -3,7 +3,7 @@ package ExtUtils::testlib;
 use strict;
 use warnings;
 
-our $VERSION = '6.84';
+our $VERSION = '6.86';
 
 use Cwd;
 use File::Spec;
index 94ce094..668ae52 100644 (file)
@@ -3,7 +3,7 @@ BEGIN {
 }
 
 use strict;
-use Test::More tests => 22;
+use Test::More tests => 29;
 
 use Data::Dumper;
 use File::Temp;
@@ -181,7 +181,7 @@ my $new_mm = sub {
 }
 
 
-# Test MIN_PERL_VERSION
+# Test MIN_PERL_VERSION meta-spec 1.4
 {
     my $mm = $new_mm->(
         DISTNAME        => 'Foo-Bar',
@@ -221,11 +221,68 @@ my $new_mm = sub {
             url         => 'http://module-build.sourceforge.net/META-spec-v1.4.html',
             version     => 1.4
         },
-    };
+    }, 'MIN_PERL_VERSION meta-spec 1.4';
 }
 
+# Test MIN_PERL_VERSION meta-spec 2.0
+{
+    my $mm = $new_mm->(
+        DISTNAME        => 'Foo-Bar',
+        VERSION         => 1.23,
+        PM              => {
+            "Foo::Bar"          => 'lib/Foo/Bar.pm',
+        },
+        MIN_PERL_VERSION => 5.006,
+    );
+
+    is_deeply {
+        $mm->metafile_data(
+                {}, {
+                'meta-spec' => {
+                url     => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec',
+                version => 2
+                } } )
+    }, {
+        name            => 'Foo-Bar',
+        version         => 1.23,
+        abstract        => 'unknown',
+        author          => [],
+        license         => 'unknown',
+        dynamic_config  => 1,
+        distribution_type       => 'module',
+
+        prereqs => {
+            configure       => {
+                requires    => {
+                    'ExtUtils::MakeMaker'   => 0,
+                },
+            },
+            build           => {
+                requires    => {
+                    'ExtUtils::MakeMaker'   => 0,
+                },
+            },
+            runtime         => {
+                requires    => {
+                    'perl'  => '5.006',
+                },
+            },
+        },
+
+        no_index        => {
+            directory           => [qw(t inc)],
+        },
+
+        generated_by => "ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION",
+        'meta-spec'  => {
+
+            url     => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec',
+            version => 2
+        },
+    }, 'MIN_PERL_VERSION meta-spec 2.0';
+}
 
-# Test MIN_PERL_VERSION
+# Test MIN_PERL_VERSION meta-spec 1.4
 {
     my $mm = $new_mm->(
         DISTNAME        => 'Foo-Bar',
@@ -269,10 +326,10 @@ my $new_mm = sub {
             url         => 'http://module-build.sourceforge.net/META-spec-v1.4.html',
             version     => 1.4
         },
-    };
+    }, 'MIN_PERL_VERSION and PREREQ_PM meta-spec 1.4';
 }
 
-# Test CONFIGURE_REQUIRES
+# Test CONFIGURE_REQUIRES meta-spec 1.4
 {
     my $mm = $new_mm->(
         DISTNAME        => 'Foo-Bar',
@@ -295,10 +352,10 @@ my $new_mm = sub {
         distribution_type       => 'module',
 
         configure_requires      => {
-            'Fake::Module1'       => 1.01,
+            'Fake::Module1'     => 1.01,
         },
         build_requires      => {
-            'ExtUtils::MakeMaker'       => 0,
+            'ExtUtils::MakeMaker'   => 0,
         },
 
         no_index        => {
@@ -310,10 +367,65 @@ my $new_mm = sub {
             url         => 'http://module-build.sourceforge.net/META-spec-v1.4.html',
             version     => 1.4
         },
-    },'CONFIGURE_REQUIRES';
+    },'CONFIGURE_REQUIRES meta-spec 1.4';
 }
 
-# Test BUILD_REQUIRES
+# Test CONFIGURE_REQUIRES meta-spec 2.0
+{
+    my $mm = $new_mm->(
+        DISTNAME        => 'Foo-Bar',
+        VERSION         => 1.23,
+        CONFIGURE_REQUIRES => {
+            "Fake::Module1" => 1.01,
+        },
+        PM              => {
+            "Foo::Bar"      => 'lib/Foo/Bar.pm',
+        },
+    );
+
+    is_deeply {
+        $mm->metafile_data(
+                {}, {
+                'meta-spec' => {
+                url     => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec',
+                version => 2
+                } } )
+    }, {
+        name            => 'Foo-Bar',
+        version         => 1.23,
+        abstract        => 'unknown',
+        author          => [],
+        license         => 'unknown',
+        dynamic_config  => 1,
+        distribution_type       => 'module',
+
+        prereqs => {
+            configure       => {
+                requires    => {
+                    'Fake::Module1'         => 1.01,
+                },
+            },
+            build           => {
+                requires    => {
+                    'ExtUtils::MakeMaker'   => 0,
+                },
+            },
+        },
+
+        no_index        => {
+            directory           => [qw(t inc)],
+        },
+
+        generated_by => "ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION",
+        'meta-spec'  => {
+            url         => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec',
+            version     => 2
+        },
+    },'CONFIGURE_REQUIRES meta-spec 2.0';
+}
+
+
+# Test BUILD_REQUIRES meta-spec 1.4
 {
     my $mm = $new_mm->(
         DISTNAME        => 'Foo-Bar',
@@ -336,10 +448,107 @@ my $new_mm = sub {
         distribution_type       => 'module',
 
         configure_requires      => {
+            'ExtUtils::MakeMaker'   => 0,
+        },
+        build_requires      => {
+            'Fake::Module1'         => 1.01,
+        },
+
+        no_index        => {
+            directory           => [qw(t inc)],
+        },
+
+        generated_by => "ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION",
+        'meta-spec'  => {
+            url         => 'http://module-build.sourceforge.net/META-spec-v1.4.html',
+            version     => 1.4
+        },
+    },'BUILD_REQUIRES meta-spec 1.4';
+}
+
+# Test BUILD_REQUIRES meta-spec 2.0
+{
+    my $mm = $new_mm->(
+        DISTNAME        => 'Foo-Bar',
+        VERSION         => 1.23,
+        BUILD_REQUIRES => {
+            "Fake::Module1" => 1.01,
+        },
+        PM              => {
+            "Foo::Bar"          => 'lib/Foo/Bar.pm',
+        },
+        META_MERGE => { "meta-spec" => { version => 2 }},
+    );
+
+    is_deeply {
+        $mm->metafile_data(
+                {}, {
+                'meta-spec' => {
+                url     => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec',
+                version => 2
+                } } )
+    }, {
+        name            => 'Foo-Bar',
+        version         => 1.23,
+        abstract        => 'unknown',
+        author          => [],
+        license         => 'unknown',
+        dynamic_config  => 1,
+        distribution_type       => 'module',
+
+        prereqs => {
+            configure       => {
+                requires    => {
+                    'ExtUtils::MakeMaker'   => 0,
+                },
+            },
+            build           => {
+                requires    => {
+                    'Fake::Module1'         => 1.01,
+                },
+            },
+        },
+
+        no_index        => {
+            directory           => [qw(t inc)],
+        },
+
+        generated_by => "ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION",
+        'meta-spec'  => {
+            url         => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec',
+            version     => 2
+        },
+    },'BUILD_REQUIRES meta-spec 2.0';
+}
+
+# Test TEST_REQUIRES meta-spec 1.4
+{
+    my $mm = $new_mm->(
+        DISTNAME        => 'Foo-Bar',
+        VERSION         => 1.23,
+        TEST_REQUIRES => {
+            "Fake::Module1"     => 1.01,
+        },
+        PM              => {
+            "Foo::Bar"          => 'lib/Foo/Bar.pm',
+        },
+    );
+
+    is_deeply {$mm->metafile_data}, {
+        name            => 'Foo-Bar',
+        version         => 1.23,
+        abstract        => 'unknown',
+        author          => [],
+        license         => 'unknown',
+        dynamic_config  => 1,
+        distribution_type       => 'module',
+
+        configure_requires      => {
             'ExtUtils::MakeMaker'       => 0,
         },
         build_requires      => {
-            'Fake::Module1'       => 1.01,
+            'ExtUtils::MakeMaker'       => 0,
+            'Fake::Module1'             => 1.01,
         },
 
         no_index        => {
@@ -351,9 +560,70 @@ my $new_mm = sub {
             url         => 'http://module-build.sourceforge.net/META-spec-v1.4.html',
             version     => 1.4
         },
-    },'CONFIGURE_REQUIRES';
+    },'TEST_REQUIRES meta-spec 1.4';
 }
 
+# Test TEST_REQUIRES meta-spec 2.0
+{
+    my $mm = $new_mm->(
+        DISTNAME        => 'Foo-Bar',
+        VERSION         => 1.23,
+        TEST_REQUIRES => {
+            "Fake::Module1"     => 1.01,
+        },
+        PM              => {
+            "Foo::Bar"          => 'lib/Foo/Bar.pm',
+        },
+        META_MERGE => { "meta-spec" => { version => 2 }},
+    );
+
+    is_deeply {
+        $mm->metafile_data(
+                {}, {
+                'meta-spec' => {
+                url     => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec',
+                version => 2
+                } } )
+    }, {
+        name            => 'Foo-Bar',
+        version         => 1.23,
+        abstract        => 'unknown',
+        author          => [],
+        license         => 'unknown',
+        dynamic_config  => 1,
+        distribution_type       => 'module',
+
+        prereqs => {
+            configure       => {
+                requires    => {
+                    'ExtUtils::MakeMaker'   => 0,
+                },
+            },
+            build           => {
+                requires    => {
+                    'ExtUtils::MakeMaker'   => 0,
+                },
+            },
+            test            => {
+                requires    => {
+                    "Fake::Module1"         => 1.01,
+                },
+            },
+        },
+
+        no_index        => {
+            directory           => [qw(t inc)],
+        },
+
+        generated_by => "ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION",
+        'meta-spec'  => {
+            url         => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec',
+            version     => 2
+        },
+    },'TEST_REQUIRES meta-spec 2.0';
+}
+
+
 # Test _REQUIRES key priority over META_ADD
 
 {
@@ -363,7 +633,7 @@ my $new_mm = sub {
         BUILD_REQUIRES => {
             "Fake::Module1" => 1.01,
         },
-        META_ADD => (my $meta_add = { build_requires => {} }),
+        META_ADD => (my $meta_add = { build_requires => {}, configure_requires => {} }),
         PM              => {
             "Foo::Bar"          => 'lib/Foo/Bar.pm',
         },
@@ -378,10 +648,8 @@ my $new_mm = sub {
         dynamic_config  => 1,
         distribution_type       => 'module',
 
-        configure_requires      => {
-            'ExtUtils::MakeMaker'       => 0,
-        },
-        build_requires      => { },
+        configure_requires      => { },
+        build_requires          => { },
 
         no_index        => {
             directory           => [qw(t inc)],
@@ -405,7 +673,7 @@ my $new_mm = sub {
         license         => ['perl_5'],
         dynamic_config  => 0,
 
-        prereqs         => {
+        prereqs => {
             runtime => {
                 requires => {
                     "DirHandle"         => 0,
@@ -417,6 +685,7 @@ my $new_mm = sub {
             },
             configure => {
                 requires => {
+                    'ExtUtils::MakeMaker'   => 0,
                 },
             },
             build    => {
@@ -458,15 +727,23 @@ my $new_mm = sub {
 
 {
     my $mm = $new_mm->(
-        DISTNAME       => 'Foo-Bar',
-        VERSION        => 1.23,
-        BUILD_REQUIRES => { "Fake::Module1" => 1.01 },
-        TEST_REQUIRES  => { "Fake::Module2" => 1.23 },
+        DISTNAME            => 'Foo-Bar',
+        VERSION             => 1.23,
+        CONFIGURE_REQUIRES  => { "Fake::Module0" => 0.99 },
+        BUILD_REQUIRES      => { "Fake::Module1" => 1.01 },
+        TEST_REQUIRES       => { "Fake::Module2" => 1.23 },
     );
 
     my $meta = $mm->mymeta('t/META_for_testing.json');
+    is($meta->{configure_requires}, undef, "no configure_requires in v2 META");
     is($meta->{build_requires}, undef, "no build_requires in v2 META");
     is_deeply(
+        $meta->{prereqs}{configure}{requires},
+        { "Fake::Module0" => 0.99 },
+        "configure requires are one thing in META v2...",
+    );
+
+    is_deeply(
         $meta->{prereqs}{build}{requires},
         { "Fake::Module1" => 1.01 },
         "build requires are one thing in META v2...",