Skip to content
This repository
tree: 77c10562e5
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 133 lines (84 sloc) 3.655 kb

The META.info File

Every project willing to be a part of the Perl 6 module ecosystem should provide some sort of metadata that can be easily identified and handled properly. This is what the META.info file is for.

The META.info file must exist in the project's root directory. If it doesn't, the module will not be identified as a Perl 6 project and is likely to be ignored by the package managers. The META.info file must contain valid JSON.

The JSON content of the file must be a hash object with the following fields:

Mandatory fields

name

The fully-qualified module name. For example:

    ufo
    JSON::Tiny
    HTTP::Server::Simple

The name should not contain any elements indicating that the module is for Perl 6 (i.e. no perl6::Foo::Bar or Baz::pm6).

version

The module version. If the version is not significant, then this field should be set to *.

description

A short description of the module.

depends

An array that specifies the other modules (if any) that the module depends on. Any modules whose name field is equal to the one mentioned in the depends field will be installed before the one depending on them. If a module has no dependencies, the depends field should be an empty array.

source-url

A URL that represents where the module's source code can be obtained.

The URL protocol (or "scheme") determines the type of resource: ftp:// and http:// are assumed to point to archives containing the full module while git:// points to a Git source code repository.

NOTE: At the time of writing, git:// is the only protocol that is known to be supported by an installer.

Optional Fields

source-type

The type of source the module should be installed from. If this field is missing, the value in the source-url field will be used instead.

NOTE: At the time of writing, git is the only type that is known to be supported by an installer.

author

The author of the module.

The module author can also add any number of other fields he or she wants.

Example

This is an example META.info file for a module called Fast::Food written by Ronald McDonald.

    {
        "name"        : "Fast::Food",
        "version"     : "1.2.3",
        "author"      : "Ronald McDonald",
        "description" : "Orders virtual fast food that no one can eat",
        "depends"     : [],
        "source-type" : "git",
        "source-url"  : "git://github.com/ronald-mcdonald/fast-food.git"
    }

The Directory Structure

The project directory can contain any of the following subdirectories:

bin

The executables should be placed here. They will be installed with the necessary permissions needed for to run them.

lib

All .pm (or .pm6) files should be placed here. They may also be compiled to some intermediate form (e.g. PIR). All files will be installed to a path from which they can be used in Perl 6 code (usually ~/.perl6/lib).

doc

Any sort of documentation to be installed with a module. The files will be installed without modification. For example, all the contents of a doc/ directory of a module Foo::Bar will end up in /perl6/modules/path/doc/Foo/Bar.

t

The tests should be placed here. They will be run after building the module and before installation.

Makefile

If the root directory contains a Makefile, it will be used to build (make), test (make test) and install (make install) the module.

Something went wrong with that request. Please try again.