CPAN::META::HISTORY::META_1_2(3pm)

πŸŽ€ NAME πŸŽ€

CPAN::Meta::History::Meta_1_2(3pm) β€” Version 1.2 metadata specification for META.yml πŸ’–


🌸 PREFACE 🌸

Okay so this is a historical copy of the version 1.2 spec for META.yml files, copyright by Ken Williams and licensed under the same terms as Perl itself ✨

Modifications from the original:

  • Various spelling corrections 🩹
  • Include list of valid licenses from Module::Build 0.2611 rather than linking to the module, with minor updates to text and links to reflect versions at the time of publication πŸ“š
  • Fixed some dead links to point to active resources πŸ”—

πŸ¦‹ SYNOPSIS πŸ¦‹

--- #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

πŸ’… DESCRIPTION πŸ’…

This doc describes version 1.2 of the META.yml specification 🫢

The META.yml file describes important properties of contributed Perl distributions β€” like the ones found on CPAN. It’s 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 ⭐

🌈 FORMAT 🌈

META.yml files are written in the YAML format (see http://www.yaml.org/) 🧚

See the following links to learn why we chose YAML instead of, say, XML or Data::Dumper:


πŸ“ TERMINOLOGY πŸ“

  • distribution β€” This is the primary object described by the META.yml specification. In the context of this document it usually refers to a collection of modules, scripts, and/or documents that are distributed for other developers to use πŸ’–
  • module β€” This refers to a reusable library of code typically contained in a single file. Currently, we primarily talk of perl modules, but this specification should be open enough to apply to other languages as well (ex. python, ruby) πŸπŸ’Ž

⭐ VERSION SPECIFICATIONS ⭐

Some fields require a version specification (ex. requires, recommends, build_requires, etc.). This section details the version specifications that are currently supported πŸ’…

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 🌸


The first line of a META.yml file should be a valid YAML document header like --- #YAML:1.0 ✨

✨ FIELDS ✨

okay so the rest of the META.yml file is literally just one big YAML mapping, and its keys are all described right here. buckle up bestie, there's a lot πŸ’…


🌸 meta-spec

Example:

 meta-spec:
   version: 1.2
   url: http://module-build.sourceforge.net/META-spec-v1.2.html

(Spec 1.1) [required] {URL} This field tells you where the version of the META.yml specification that's being used actually lives. iconic.

🌸 name

Example:

  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 swapping :: for -. BUT. Sometimes it's completely different, no cap, like with the libwww-perl distribution (see http://search.cpan.org/author/GAAS/libwww-perl/).

🌸 version

Example:

  version: 0.20

(Spec 1.0) [required] {version} The version of the distribution that this META.yml file is referring to.

🌸 abstract

Example:

  abstract: Build and install Perl modules.

(Spec 1.1) [required] {string} A short lil description of what this distribution is even for.

🌸 author

Example:

  author:
    - Ken Williams <kwilliams@cpan.org>

(Spec 1.1) [required] {list of strings} A YAML sequence listing the author(s) of the distribution. The preferred form is author-name <email-address>. periodt.

🌸 license

Example:

  license: perl

(Spec 1.0) [required] {string} The license under which this distribution may be used and redistributed.

It MUST be one of the following licenses:

πŸ’– perl

The distribution may be copied and redistributed under the same terms as perl itself (this is by far the most common licensing option for modules on CPAN). It's a dual license, meaning the user gets to pick between the GPL version 1 or the Artistic version 1 license. slay.

πŸ’– gpl

The distribution is distributed under the terms of the GNU General Public License version 2 (http://opensource.org/licenses/GPL-2.0).

πŸ’– lgpl

The distribution is distributed under the terms of the GNU Lesser General Public License version 2 (http://opensource.org/licenses/LGPL-2.1).

πŸ’– artistic

The distribution is licensed under the Artistic License version 1, as specified by the Artistic file in the standard perl distribution (http://opensource.org/licenses/Artistic-Perl-1.0).

πŸ’– bsd

The distribution is licensed under the BSD 3-Clause License (http://opensource.org/licenses/BSD-3-Clause).

πŸ’– open_source

The distribution is licensed under some other Open Source Initiative-approved license listed over at http://www.opensource.org/licenses/.

πŸ’– unrestricted

The distribution is licensed under a license that is not approved by www.opensource.org http://www.opensource.org/ but that still allows distribution without restrictions. ok flexible queen.

πŸ’– restrictive

The distribution may NOT be redistributed without special permission from the author and/or copyright holder. 🚨


🌸 distribution_type

Example:

  distribution_type: module

(Spec 1.0) [optional] {string} What kind of stuff is actually inside this distribution. Most things on CPAN are modules (which can also mean a whole collection of modules), but some things are scripts.

ngl this field is basically meaningless 😭 β€” because so many distributions are hybrids of several kinds of things, or some brand-new thing, or just subjectively different in focus depending on who's using them. Tools like Module::Build and MakeMaker will likely stop generating this field. so yeah, it's giving deprecated-adjacent.

🌸 requires

Example:

  requires:
    Data::Dumper: 0
    File::Find: 1.03

(Spec 1.0) [optional] {map} A YAML mapping listing the Perl modules this distribution needs in order to work properly. The keys are the module names, and the values are version specifications as described in Module::Build for the requires parameter.

🌸 recommends

Example:

  recommends:
    Data::Dumper: 0
    File::Find: 1.03

(Spec 1.0) [optional] {map} A YAML mapping listing the Perl modules this distribution recommends for enhanced operation. the nice-to-haves, the little luxuries πŸ’…

ALTERNATIVE: Sometimes it's better to show 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 that become available when their requirements are met. For each feature there's a description, plus any of requires, build_requires, conflicts, requires_packages, requires_os, and excludes_os β€” all of which mean the same thing in this subcontext as they do everywhere else in this document.

🌸 build_requires

Example:

  build_requires:
    Data::Dumper: 0
    File::Find: 1.03

(Spec 1.0) [optional] {map} A YAML mapping listing the Perl modules required for building and/or testing this distribution. These dependencies are not needed once the module is installed. bye bye build deps πŸ¦‹

🌸 conflicts

Example:

  conflicts:
    Data::Dumper: 0
    File::Find: 1.03

(Spec 1.0) [optional] {map} A YAML mapping listing the Perl modules that cannot be installed while this distribution is installed. fr fr this is a pretty uncommon situation.

🌸 dynamic_config

Example:

  dynamic_config: 0

(Spec 1.0) [optional] {boolean} A boolean flag saying 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 purely from consulting its metadata file. The main reason to set this to a true value is that your module does 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). don't forget bestie!!

🌸 private

(Deprecated) (Spec 1.0) [optional] {map} This field has been renamed to no_index. See below. ⬇️

🌸 provides

Example:

  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 the packages provided by this distribution. This info can be (and, in some cases, is) used by distribution and automation mechanisms like PAUSE, CPAN, and search.cpan.org to build indexes saying which distribution you can find various packages in.

When you use tools like Module::Build that can generate the provides mapping for your distribution automatically, make sure you actually look at what it generates and check it makes sense β€” indexers will usually trust the provides field if it's there, rather than scanning through the distribution files themselves to figure out packages and versions. And that's a good thing, because it means you can use provides to tell the indexers precisely what you want indexed about your distribution, instead of relying on them to essentially guess what you want indexed. main character energy tbh.

🌸 no_index

Example:

  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) and therefore not of interest to searching and indexing tools. This is useful when there's no provides field 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.) πŸ’€ honest king

πŸŽ€ 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) itself.

🌸 keywords

Example:

  keywords:
    - make
    - build
    - install

(Spec 1.1) [optional] {list} A sequence of keywords/phrases that describe this distribution. tags for your distro πŸ’…

🌸 resources

Example:

  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 β€” like homepage, license, and bugtracker β€” are reserved by this specification, since they have "official" meanings defined right here in this spec. If you want to add your own "special" entries (like the MailingList entry up there), use at least one upper-case letter. iykyk.

The current set of official keys is:

  • homepage β€” the official home of this project on the web.
  • license β€” an URL for an official statement of this distribution's license.
  • bugtracker β€” an URL for a bug tracker (e.g. Bugzilla or RT queue) for this project.

🌸 generated_by

Example:

  generated_by: Module::Build version 0.20

(Spec 1.0) [required] {string} Indicates the tool that was used to create this META.yml file. Good form is to include both the name of the tool and its version, but this field is essentially opaque, at least for the moment. If the META.yml was generated by hand, it's suggested that you put the author in here instead.

[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 the version of that tool. RWS] 🫢

🌈 SEE ALSO 🌈

🌸 HISTORY 🌸

Okay bestie, this is the lore drop πŸ’… β€” the whole glow-up timeline of this spec, from baby's first draft to the polished icon you're reading rn. Every date, every change, no skips. Let's go πŸŽ€


  • March 14, 2003 (Pi day) πŸ₯§
    • Created version 1.0 of this document. Yes, on Pi day. Main character energy from day one, fr fr.
  • May 8, 2003
    • Added the dynamic_config field, which was straight-up missing from the initial version. Not me forgetting a whole field πŸ™ˆ β€” we fixed it.
  • November 13, 2003
    • Added more YAML rationale articles. Reading material, bestie πŸ“š
    • Fixed the existing link to the YAML discussion thread so it points to the new <http://nntp.x.perl.org/group/> site.
    • Added and deprecated the private field. It got like five minutes of fame, poor thing 😭
    • Added the abstract, configure, requires_packages, requires_os, excludes_os, and no_index fields.
    • Bumped version. Slay.
  • November 16, 2003
    • Added the generation and authored_by fields.
    • Added an alternative proposal to the recommends field.
    • Added a proposal for a requires_build_tools field.
  • December 9, 2003
    • Added a link to the latest version of this specification on CPAN.
    • Added the section "VERSION SPECIFICATIONS" β€” you know, the one from earlier πŸ‘€
    • Changed the name from Module::Build::META-spec to CPAN::META::Specification. Rebrand era ✨
    • Added a proposal for the auto_regenerate field.
  • December 15, 2003
    • Added the index field as a compliment to no_index. They're a matching set, your honor 🫢
    • Added the keywords field as a means to aid searching distributions. SEO era, lowkey iconic.
    • Added the "TERMINOLOGY" section to explain certain terms that may be ambiguous. (You already scrolled past it, no cap.)
  • July 26, 2005 🧹
    • Removed a whole bunch of items that have never actually been supported and were more like records of brainstorming: generation, requires_build_tools, requires_packages, configure, requires_os, excludes_os, auto_regenerate. The vault got cleaned out πŸ’€
    • Changed authored_by to author, since that's always been what it's actually called in actual META.yml files. We were lying to ourselves, ngl.
    • Added the == operator to the list of supported version-checking operators.
    • Noted that the distribution_type field is basically meaningless and shouldn't really be used. It's giving decorative. It's giving purely ornamental. Don't use it 😀
    • Clarified dynamic_config a bit. Growth. Maturity. Character development πŸ’–
  • August 23, 2005
    • Removed the name CPAN::META::Specification, since that implies a module that doesn't actually exist. We were out here citing a whole phantom module πŸ˜­πŸ’€ Not anymore, bestie.

Just a lil reminder for the vibe check: the removals above are real removals β€” those fields were never actually supported, so don't go writing them into your META.yml and expecting magic, mkay? 🧚

And that's the whole history, periodt. πŸ’… This page came to you courtesy of perl v5.42.3, dated 2026-11-03 β€” so like, go be gorgeous with your metadata, bestie, you've got this πŸ“πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from