Finally, META.yml customization in MakeMaker

brian_d_foy on 2008-09-06T15:58:00

In a fit of wild yak shaving, I finally adapted Adriano Ferreira's patch to allow customization of the META.yml file in MakeMaker so I can add "resources" to Test::More. Now you can pass in data structures via META_ADD or META_MERGE to, respectively, add/override or merge META.yml values.

For example, MakeMaker itself does this.

    META_MERGE      => {
        no_index => {
            package => ['DynaLoader'],
        },
        resources => {
            license     =>      'http://dev.perl.org/licenses/',
            homepage    =>      'http://makemaker.org',
            bugtracker  =>      'http://rt.cpan.org/NoAuthBugs.html?Dist=ExtUtils-MakeMaker',
            repository  =>      'http://svn.schwern.org/svn/CPAN/ExtUtils-MakeMaker',
            'MailingList' =>    'makemaker@perl.org',
        },
    },

I also brought the default META.yml up to the 1.4 spec, added in a default no_index for t/ and inc/ and a configure_requires on MakeMaker itself filling in long unspoken assumptions.

Here's what MakeMaker's META.yml looks like now:

--- #YAML:1.0
name:               ExtUtils-MakeMaker
version:            6.44
abstract:           Create a module Makefile
author:
    - Michael G Schwern <schwern@pobox.com>
license:            perl
distribution_type:  module
configure_requires:
    ExtUtils::MakeMaker:  0
requires:
    DirHandle:       0
    File::Basename:  0
    File::Spec:      0.8
    Pod::Man:        0
resources:
    bugtracker:   http://rt.cpan.org/NoAuth/Bugs.html?Dist=ExtUtils-MakeMaker
    homepage:     http://makemaker.org
    license:      http://dev.perl.org/licenses/
    MailingList:  makemaker@perl.org
    repository:   http://svn.schwern.org/svn/CPAN/ExtUtils-MakeMaker
no_index:
    directory:
        - t
        - inc
    package:
        - DynaLoader
generated_by:       ExtUtils::MakeMaker version 6.44
meta-spec:
    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
    version:  1.4


Awesome!

dagolden on 2008-09-06T23:42:18

+1

Nothing like a short-hair yak.

-- dagolden

optional_features

merijn on 2008-09-07T08:37:56

Doeas it also support optional_features and other recursive options

requires:
  perl: 5.006
  Exporter: 0
  Carp: 0
  Data::Dumper: 0
recommends:
  File::Temp: 0.14
  IO::Scalar: 0
build_requires:
  perl: 5.006
  Test::Harness: 0
  Test::More: 0
optional_features:
- opt_csv:
    description: Provides parsing of CSV streams
    requires:
      Text::CSV_XS: 0.23
    recommends:
      Text::CSV: 1
      Text::CSV_PP: 1.05
      Text::CSV_XS: 0.54
- opt_excel:
    description: Provides parsing of Microsoft Excel files
    requires:
      Spreadsheet::ParseExcel: 0.26
      Spreadsheet::ParseExcel::FmtDefault: 0
    recommends:
      Spreadsheet::ParseExcel: 0.34