Modifications from the original:
--- #YAML:1.0 name: Module-Build abstract: Build and install Perl modules version: 0.20 author: - Ken Williams <kwilliams@cpan.org> license: perl distribution_type: module requires: Config: 0 Cwd: 0 Data::Dumper: 0 ExtUtils::Install: 0 File::Basename: 0 File::Compare: 0 File::Copy: 0 File::Find: 0 File::Path: 0 File::Spec: 0 IO::File: 0 perl: 5.005_03 recommends: Archive::Tar: 1.00 ExtUtils::Install: 0.3 ExtUtils::ParseXS: 2.02 Pod::Text: 0 YAML: 0.35 build_requires: Test: 0 urls: license: http://dev.perl.org/licenses/ meta-spec: version: 1.2 url: http://module-build.sourceforge.net/META-spec-v1.2.html generated_by: Module::Build version 0.20
The META.yml file describes important properties of contributed Perl distributions such as the ones found on CPAN. It is typically created by tools like Module::Build, Module::Install, and ExtUtils::MakeMaker.
The fields in the META.yml file are meant to be helpful for people maintaining module collections (like CPAN), for people writing installation tools (like CPAN.pm or CPANPLUS), or just for people who want to know some stuff about a distribution before downloading it and starting to install it.
Note: The latest stable version of this specification can always be found at <http://module-build.sourceforge.net/META-spec-current.html>, and the latest development version (which may include things that won't make it into the stable version can always be found at <http://module-build.sourceforge.net/META-spec-blead.html>.
See the following links to learn why we chose YAML instead of, say, XML or Data::Dumper:
If a single version is listed, then that version is considered to be the minimum version supported.
If 0 is given as the version number, then any version is supported.
Additionally, for more complicated requirements, the specification supports a list of versions, each of which may be optionally preceded by a relational operator.
Supported operators include < (less than), <= (less than or equal), > (greater than), >= (greater than or equal), == (equal), and != (not equal).
If a list is given then it is evaluated from left to right so that any specifications in the list that conflict with a previous specification are overridden by the later.
Examples:
>= 1.2, != 1.5, < 2.0
Any version from version 1.2 onward, except version 1.5, that also precedes version 2.0.
meta-spec: version: 1.2 url: http://module-build.sourceforge.net/META-spec-v1.2.html
(Spec 1.1) [required] {URL} This field indicates the location of the version of the META.yml specification used.
name: Module-Build
(Spec 1.0) [required] {string} The name of the distribution which is often created by taking the ``main module'' in the distribution and changing ``::'' to ``-''. Sometimes it's completely different, however, as in the case of the libwww-perl distribution (see <http://search.cpan.org/author/GAAS/libwww-perl/>).
version: 0.20
(Spec 1.0) [required] {version} The version of the distribution to which the META.yml file refers.
abstract: Build and install Perl modules.
(Spec 1.1) [required] {string} A short description of the purpose of the distribution.
author: - Ken Williams <kwilliams@cpan.org>
(Spec 1.1) [required] {list of strings} A YAML sequence indicating the author(s) of the distribution. The preferred form is author-name <email-address>.
license: perl
(Spec 1.0) [required] {string} The license under which this distribution may be used and redistributed.
Must be one of the following licenses:
distribution_type: module
(Spec 1.0) [optional] {string} What kind of stuff is contained in this distribution. Most things on CPAN are "module"s (which can also mean a collection of modules), but some things are "script"s.
Unfortunately this field is basically meaningless, since many distributions are hybrids of several kinds of things, or some new thing, or subjectively different in focus depending on who's using them. Tools like Module::Build and MakeMaker will likely stop generating this field.
requires: Data::Dumper: 0 File::Find: 1.03
(Spec 1.0) [optional] {map} A YAML mapping indicating the Perl modules this distribution requires for proper operation. The keys are the module names, and the values are version specifications as described in Module::Build for the ``requires'' parameter.
recommends: Data::Dumper: 0 File::Find: 1.03
(Spec 1.0) [optional] {map} A YAML mapping indicating the Perl modules this distribution recommends for enhanced operation.
ALTERNATIVE: It may be desirable to present to the user which features depend on which modules so they can make an informed decision about which recommended modules to install.
Example:
optional_features: - foo: description: Provides the ability to blah. requires: Data::Dumper: 0 File::Find: 1.03 - bar: description: This feature is not available on this platform. excludes_os: MSWin32
(Spec 1.1) [optional] {map} A YAML sequence of names for optional features which are made available when its requirements are met. For each feature a description is provided along with any of ``requires'', ``build_requires'', ``conflicts'', "requires_packages", "requires_os", and "excludes_os" which have the same meaning in this subcontext as described elsewhere in this document.
build_requires: Data::Dumper: 0 File::Find: 1.03
(Spec 1.0) [optional] {map} A YAML mapping indicating the Perl modules required for building and/or testing of this distribution. These dependencies are not required after the module is installed.
conflicts: Data::Dumper: 0 File::Find: 1.03
(Spec 1.0) [optional] {map} A YAML mapping indicating the Perl modules that cannot be installed while this distribution is installed. This is a pretty uncommon situation.
dynamic_config: 0
(Spec 1.0) [optional] {boolean} A boolean flag indicating whether a Build.PL or Makefile.PL (or similar) must be executed when building this distribution, or whether it can be built, tested and installed solely from consulting its metadata file. The main reason to set this to a true value if that your module performs some dynamic configuration (asking questions, sensing the environment, etc.) as part of its build/install process.
Currently Module::Build doesn't actually do anything with this flag - it's probably going to be up to higher-level tools like CPAN to do something useful with it. It can potentially bring lots of security, packaging, and convenience improvements.
If this field is omitted, it defaults to 1 (true).
provides: Foo::Bar: file: lib/Foo/Bar.pm version: 0.27_02 Foo::Bar::Blah: file: lib/Foo/Bar/Blah.pm Foo::Bar::Baz: file: lib/Foo/Bar/Baz.pm version: 0.3
(Spec 1.1) [optional] {map} A YAML mapping that describes all packages provided by this distribution. This information can be (and, in some cases, is) used by distribution and automation mechanisms like PAUSE, CPAN, and search.cpan.org to build indexes saying in which distribution various packages can be found.
When using tools like Module::Build that can generate the "provides" mapping for your distribution automatically, make sure you examine what it generates to make sure it makes sense - indexers will usually trust the "provides" field if it's present, rather than scanning through the distribution files themselves to figure out packages and versions. This is a good thing, because it means you can use the "provides" field to tell the indexers precisely what you want indexed about your distribution, rather than relying on them to essentially guess what you want indexed.
no_index: file: - My/Module.pm dir: - My/Private package: - My::Module::Stuff namespace: - My::Module::Stuff
(Spec 1.1) [optional] {map} A YAML mapping that describes any files, directories, packages, and namespaces that are private (i.e. implementation artifacts) that are not of interest to searching and indexing tools. This is useful when no "provides" field is present.
(Note: I'm not actually sure who looks at this field, or exactly what they do with it. This spec could be off in some way from actual usage.)
file
(Spec 1.1) [optional] Exclude any listed file(s).
dir
(Spec 1.1) [optional] Exclude anything below the listed directory(ies).
package
(Spec 1.1) [optional] Exclude the listed package(s).
namespace
(Spec 1.1) [optional] Excludes anything below the listed namespace(s), but not the listed namespace(s) its self.
keywords: - make - build - install
(Spec 1.1) [optional] {list} A sequence of keywords/phrases that describe this distribution.
resources: license: http://dev.perl.org/licenses/ homepage: http://sourceforge.net/projects/module-build bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Module-Build MailingList: http://lists.sourceforge.net/lists/listinfo/module-build-general
(Spec 1.1) [optional] {map} A mapping of any URL resources related to this distribution. All-lower-case keys, such as "homepage", "license", and "bugtracker", are reserved by this specification, as they have ``official'' meanings defined here in this specification. If you'd like to add your own ``special'' entries (like the ``MailingList'' entry above), use at least one upper-case letter.
The current set of official keys is:
generated_by: Module::Build version 0.20
(Spec 1.0) [required] {string} Indicates the tool that was used to create this META.yml file. It's good form to include both the name of the tool and its version, but this field is essentially opaque, at least for the moment. If META.yml was generated by hand, it is suggested that the author be specified here.
[Note: My meta_stats.pl script which I use to gather statistics regarding META.yml usage prefers the form listed above, i.e. it splits on /\s+version\s+/ taking the first field as the name of the tool that generated the file and the second field as version of that tool. RWS]
CPAN.pm
CPANPLUS
Data::Dumper
ExtUtils::MakeMaker
Module::Build
Module::Install
XML <http://www.w3.org/XML/>
YAML <http://www.yaml.org/>