blog20100901

2013/08/20 - プログラミング言語 Perl にまつわる etc. - Perl monger
参考 : perldoc, perldoc.jp, search.cpan.org, perldoc.perl.org ...
「 初めての Perl 第 6 版 」(オライリー・ジャパン発行 ISBN978-4-87311-567-2) 」
「 続・初めての Perl 改訂版 」(オライリー・ジャパン発行 ISBN4-87311-305-9) 」
「 Effective Perl 第 2 版 」(翔泳社発行 ISBN978-4-7981-3981-4) 」 ... etc,.

Perl Perl_6 翻訳 ディストリビューション

Perl dist [翻訳] CPAN::Meta::Spec (d106)

Perl dist [翻訳] CPAN::Meta::Spec (d106)

目次 - Perl Index


Theme



Perl について、復習を兼ねて断片的な情報を掲載して行く連載その d106 回。

Perl で、独自のディストリビューション ( distribution ) を作成する際に、そのメタデータを記述するための仕様 ( spec ) の定義「 CPAN::Meta::Spec 」を確認する。

今回は、CPAN::Meta::Spec - meta::cpan を自家用に翻訳します。正確な情報はリンク先の原文を参照してください。


NAME ( 名前 )
VERSION ( バージョン )
SYNOPSIS ( 概要 )
DESCRIPTION ( 説明 )
TERMINOLOGY ( 用語 )
DATA TYPES ( データタイプ )
Boolean
String
List
Map
License String
URL
Version
Version Range
STRUCTURE ( 構造 )
REQUIRED FIELDS ( 必須フィールド )
  abstract
  author
  dynamic_config
  generated_by
  license
  meta-spec
  name
  release_status
  version
OPTIONAL FIELDS ( オプショナルフィールド )
  description
  keywords
  no_index
  optional_features
  prereqs
  provides
  resources
DEPRECATED FIELDS ( 廃止予定のフィールド )
  build_requires
  configure_requires
  conflicts
  distribution_type
  license_uri
  private
  recommends
  requires
VERSION NUMBERS ( バージョン番号 )
Version Formats
Version Ranges
PREREQUISITES ( 前提条件 )
Prereq Spec
  Phases
  Relationships
Merging and Resolving Prerequisites ( マージと解決 前提条件の )
SERIALIZATION ( シリアライゼーション )
NOTES FOR IMPLEMENTORS ( 注意 実装者のための )
Extracting Version Numbers from Perl Modules ( 抜き出し バージョン番号の Perl モジュールからの )
Comparing Version Numbers ( 比較 バージョン番号の )
Prerequisites for dynamically configured distributions ( 前提条件 動的に構成されたディストリビューションのための )
Indexing distributions a la PAUSE ( インデクス ディストリビューションの PAUSE での )
SEE ALSO ( 関連項目 )
HISTORY ( ヒストリー )
AUTHOR ( 作者 )
COPYRIGHT AND LICENSE ( コピーライトとライセンス )


NAME ( 名前 )



CPAN::Meta::Spec - specification for CPAN distribution metadata


CPAN::Meta::Spec - 仕様 CPAN ディストリビューションメタデータのための


VERSION ( バージョン )



version 2.150010



SYNOPSIS ( 概要 )




my $distmeta = {
name => 'Module-Build',
abstract => 'Buil and install Perl modules',
description => "Module::Build is a system for "
. "building, testing, and installing Perl modules. "
. "It is meant to ... blah blah blah ...",
version => '0.36',
release_status => 'stable',
author => [
'ken Williams <kwilliams@cpan.org>',
'Module-Build List <module-build@perl.org>, # additional contact
],
license => [ 'perl_5' ],
prereqs => {
runtime => {
requires => {
'perl' => '5.006',
'ExtUtils::Install' => '0',
'File::Basename' => '0',
'File::Compare' => '0',
'IO::File' => '0',
},
recommends => {
'Archive::Tar' => '1.00',
'ExtUtils::Install' => '0.3',
'ExtUtils::ParseXS' => '2.02',
},
},
build => {
requires => {
'Test::More' => '0',
},
}
},
resources => {
license => [ 'http://dev.perl.org/licenses/ ],
},
optional_features => {
domination => {
description => 'Take over the world',
prereqs => {
develop => { requires => { 'Genius::Evil' => '1.234' } },
runtime => { requires => { 'Machine::Weather' => '2.0' } },
}
},
},
dynamic_config => 1,
keywords => [ qw/ toolchain cpan dual-life / ],
'meta-spec' => {
version => '2',
url => 'http://metacpan.org/pod/CPAN::Meta::Spec',
},
generated_by => 'Module::Build version 0.36',
};



DESCRIPTION ( 説明 )



This document describes version 2 of the CPAN distribution metadata specification, also known as the "CPAN Meta Spec".


このドキュメントは記述します CPAN ディストリビューションメタデータの仕様のバージョン 2 を, またの名を "CPAN Meta Spec".

Revisions of this specification for typo corrections and prose clarifications may be issued as CPAN::Meta::Spec 2.x. These revisions will never change semantics or add or remove specified behavior.


改訂版は この仕様の タイポの添削 それと 散文体の明確化のための 発行されるはずです CPAN::Meta::Spec 2.x として. これらの改訂は決しておこないません セマンティクスの変更を または 特定の振る舞いを追加や削除することを.

Distribution metadata describe important properties of Perl distributions. Distribution building tools like Module::Build, Module::Install, ExtUtils::MakeMaker or Dist::Zilla should create a metadata file in accordance with this specification and include it with the distribution for use by automated tools that index, examine, package or install Perl distributions.


ディストリビューションメタデータは記述します 重要な特性を Perl ディストリビューションの. ディストリビューションの構築ツールは Module::Build, Module::Install, ExtUtils::MakeMaker や Dist::Zilla のような 作成するはずです メタデータファイルを したがって この仕様に それと 含めます それを ディストリビューションに 使うために 自動化されたツールで インデクス, 検査, パッケージまたはインストールする Perl ディストリビューションを.


TERMINOLOGY ( 用語 )




distribution



This is the primary object described by the metadata. In the context of this document it usually refers to a collection of modules, scripts, and/or documents that are distributed together for other developers to use. Examples of distributions are Class-Container, libwww-perl, or DBI.


これは主なオブジェクトです 記述された メタデータによって. このドキュメントのコンテキストでは 通常示します コレクションを モジュール, スクリプト, それと / または ドキュメントの それは 配布されます 一緒に 他の開発者が利用するために. ディストリビューションの例は Class-Container, libwww-perl, や DBI です.


module



This refers to a reusable library of code contained in a single file. Modules usually contain one or more packages and are often referred to by the name of a primary package that can be mapped to the file name. For example, one might refer to File::Spec instead of File/Spec.pm


これは示します 再利用できる コードのライブラリを 含まれる 単一のファイルに. モジュールは通常含み 1 つ以上のパッケージを しばしば呼ばれます プライマリパッケージの名前で マップできる ファイル名に. 例えば, 人は参照するはずです File::Spec を 代わりに File/Spec.pm の.


package



This refers to a namespace declared with the Perl package statement. In Perl, packages often have a version number property given by the $VERSION variable in the namespace.


これは示します 名前空間を 宣言された Perl package 構文で. Perl では, パッケージはしばしば持ちます バージョン番号プロパティを 与えられる $VERSION 変数によって 名前空間の.


consumer



This refers to code that reads a metadata file, deserializes it into a data structure in memory, or interprets a data structure of metadata elements.


これは示します コードを 読み込み メタデータファイルを, デシリアライズする それを データ構造に メモリ内の, または 解釈する データ構造を メタデータの要素の.


producer



This refers to code that constructs a metadata data structure, serializes into a bytestream and/or writes it to disk.


これは示します コードを メタデータデータ構造を構築する, バイトストリームへのシリアライズ それと/または それをディスクに書き込む.


must, should, may, etc.



These terms are interpreted as described in IETF RFC 2119.


これらの用語は解釈されます 記述されているように IETF RFC 2119 で.

# IETF RFC 2119 ( 英語, 日本語 )
用語解釈
must「しなければならない」絶対的な要請 ( 同義: required ( 要求されている ), shall ( することになる ) ).
must not「してはならない」絶対的な禁止事項 ( 同義: shall not ( することはない ) ).
should「する必要がある」特定の状況下では無視されうるがその重要性を慎重に判断しなければならない ( 同義: recommended ( 推奨される ).
should not「しないほうがよい」特定の状況下では選択されうるがそれは慎重に判断しなければならない ( 同義: not recommended ( 推奨されない ) ).
may「してもよい」まさに選択的なアイテム. これを選択する実装は選択しない実装と, 選択しない実装は選択する実装との相互運用に備えなければならない ( must ) ( 同義: optional ( 選択できる ) ).



DATA TYPES ( データタイプ )



Fields in the "STRUCTURE" section describe data elements, each of which has an associated data type as described herein. There are four primitive types: Boolean, String, List and Map. Other types are subtypes of primitives and define compound data structures or define constraints on the values of a data element.


フィールドは "STRUCTURE" セクションの 記述します データエレメントを, それぞれは持っています 関連するデータタイプを ここに記述されているように. 4 つのプリミティブタイプがあります: Boolean, String, List それと Map. 他のタイプは プリミティブのサブタイプです それと 定義します 複合のデータ構造を または 定義します 制約を データエレメントの値での.

Boolean



A Boolean is used to provide a true or false value. It must be represented as a defined value that is either "1" or "0" or stringifies to those values.


Boolean は利用されます 提供に true または false 値の. それは表現しなければなりません 定義された値として "1" or "0" のどちらかで または 文字列化して これらの値を.


String



A String is data element containing a non-zero length sequence of Unicode characters, such as an ordinary Perl scalar that is not a reference.


String はデータエレメントです 含む 非ゼロの長さの Unicode 文字列を, 普通の Perl スカラのように リファレンスではない.


List



A List is an ordered collection of zero or more data elements. Elements of a List may be of mixed types.


List は 順序づけられたコレクションです ゼロ以上のデータエレメントの. エレメントは List の ミックスドタイプでもよいです.

Producers must represent List elements using a data structure which unambiguously indicates that multiple values are possible, such as a reference to a Perl array (an "arrayref").


Producer は表現しなければなりません List エレメントを データ構造を使って 曖昧さなく示す 複数の値が可能であることを, Perl 配列へのリファレンスのように ( "arrayref" ).

Consumers expecting a List must consider a String as equivalent to a List of length 1.


Consumer は 期待する List を 考慮しなければなりません String を 等しいものとして 長さ 1 の List に.


Map



A Map is an unordered collection of zero or more data elements ("values"), indexed by associated String elements ("keys"). The Map's value elements may be of mixed types.


Map は 順序づけられていないコレクションです ゼロ以上のデータエレメントの ( "values" ), インデクス化された 関連した String エレメント ( "keys" ) によって. Map の value エレメントはミックスドタイプかもしれません.


License String



A License String is a subtype of String with a restricted set of values. Valid values are described in detail in the description of the "license" field.


License String はサブタイプです String の 制限された値のセットを持つ. 有効な値は 記述されています 詳しく 説明で "license" フィールドの.


URL



URL is a subtype of String containing a Uniform Resource Locator or Identifier. [ This type is called URL and not URI for historical reasons. ]


URL はサブタイプです String の 含んだ Uniform Resource Locator or Identifier を. [ このタイプは呼ばれます URL と URI ではありません 歴史的な理由のために. ]


Version



A Version is a subtype of String containing a value that describes the version number of packages or distributions. Restrictions on format are described in detail in the Version Formats" section.


Version はサブタイプです String の 含んだ 値を 記述する バージョン番号を パッケージまたはディストリビューションの. フォーマットの制限は記述されています 詳細に "Version Formats" セクションで.


Version Range



The Version Range type is a subtype of String. It describes a range of Versions that may be present or installed to fulfill prerequisites. It is specified in detail in the "Version Ranges" section.


Version Range タイプはサブタイプです String の. それは記述しますバージョンの範囲を 存在するまたはインストールされているかもしれない 前提条件を満たすために. それは指定します 詳細で "Version Ranges" セクションの.


STRUCTURE ( 構造 )



The metadata structure is a data element of type Map. This section describes valid keys within the Map.


メタデータの構造は タイプ Map のデータエレメントです. このセクションは記述します 有効な keys を Map で.

Any keys not described in this specification document (whether top-level or within compound data structures described herein) are considered custom keys and must begin with an "x" or "X" and be followed by an underscore; i.e. they must match the pattern: qr{\Ax_}i. If a custom key refers to a compound data structure, subkeys within it do not need an "x_" or "X_" prefix.


すべての keys は 記述されていない この仕様ドキュメントに ( トップレベルまたはここで記述された複合データ構造内にあるかどうかにかかわらず ) みなされます カスタム keys だと それと 始まらなければなりません "x" or "X" と 続くアンダースコアによって; i.e. それらはマッチしなければなりません パターンに: qr{\Ax_}i. もしカスタム key が示す場合 複合データ構造を, その中のサブキーは 必要としません "x_" or "X_" プレフィクスを.

Consumers of metadata may ignore any or all custom keys. All other keys not described herein are invalid and should be ignored by consumers. Producers must not generate or output invalid keys.


Consumer は メタデータの 無視するかもしれません いずれかまたはすべてのカスタム keys を. すべての他の keys は ここに記述されていない 無効で無視されるはずです consumer によって. Producer は 生成や出力してはいけません 無効な key を.

For each key, an example is provided followed by a description. The description begins with the version of spec in which the key was added or in which the definition was modified, whether the key is required or optional and the data type of the corresponding data element. These items are in parentheses, brackets and braces, respectively.


各 key では, 例が提供され 続きます 説明が. 説明は始まります spec のバージョンで key が追加された または 定義が変更された, key が required なのか optional なのかどうか それと データタイプで 対応するデータ要素の. これらのアイテムは丸カッコ, 角カッコ それと 波カッコです, それぞれ.

If a data type is a Map or Map subtype, valid subkeys will be described as well.


もしデータタイプが Map または Map サブタイプなら, 有効なサブキーもまた記述されます.

Some fields are marked Deprecated. These are shown for historical context and must not be produced in or consumed from any metadata structure of version 2 or higher.


いくつかのフィールドはマークされています 非推奨に. これらは示されます 歴史的なコンテキストのために それと 製造 ( produce ) したり消費 ( consume ) してはいけません メタデータ構造からは バージョン 2 以上の.


REQUIRED FIELDS ( 必須フィールド )




abstract



Example:



abstract => 'Build and install Perl modules'



(Spec 1.2) [required] {String}

This is a short description of the purpose of the distribution.


これは短い説明です ディストリビューションの目的の.


author



Example:



author => [ 'Ken Williams <kwilliams@cpan.org>' ]



(Spec 1.2) [required] {List of one or more Strings}

This List indicates the person(s) to contact concerning the distribution. The preferred form of the contact string is:


この List は示します 人 (s) を コンタクトのために ディストリビューションに関する. 好ましい形式は コンタクト文字列の:


contact-name <email-address>



This field provides a general contact list independent of other structured fields provided within the "resources" field, such as bugtracker. The addressee(s) can be contacted for any purpose including but not limited to (security) problems with the distribution, questions about the distribution or bugs in the distribution.


このフィールドは提供します 一般的なコンタクトリストを 独立する 他の構造化フィールドが提供するものから "resources" フィールド内で, bugtracker などの. 受取人 (s) はコンタクトできます いかなる目的でも 含むが制限はされません ( セキュリティ ) 問題 ディストリビューションでの, 質問 ディストリビューションに関する または バグに ディストリビューションの.

A distribution's original author is usually the contact listed within this field. Co-maintainers, successor maintainers or mailing lists devoted to the distribution may also be listed in addition to or instead of the original author.


ディストリビューションの原作者は 通常コンタクトです リストされた このフィールドに. 共同メンテナ, 後継メンテナ または メーリングリストは 専念した ディストリビューションに またリストされるかもしれません 追加で または 代わりに 原作者の.


dynamic_config



Example:



dynamic_config => 1



(Spec 2) [required] {Boolean}

A boolean flag indicating whether a Build.PL or Makefile.PL (or similar) must be executed to determine prerequisites.


boolean フラグです 示す Build.PL または Makefile.PL ( または同様のもの ) を実行すべきかどうかを 決定するために prerequisite ( 前提条件 ) を.

This field should be set to a true value if the distribution performs some dynamic configuration (asking questions, sensing the environment, etc.) as part of its configuration. This field should be set to a false value to indicate that prerequisites included in metadata may be considered final and valid for static analysis.


このフィールドはセットする必要があります true 値に もしディストリビューションが行う場合 いくつかの動的構成 ( 質問をたずねる, 検出 環境の, etc. ) を 一部として その構成の. このフィールドはセットする必要があります false 値に 示すために prerequisite が メタデータに含まれる みなせることを 最終と それと 有効だと 静的解析のために.

Note: when this field is true, post-configuration prerequisites are not guaranteed to bear any relation whatsoever to those stated in the metadata, and relying on them doing so is an error. See also "Prerequisites for dynamically configured distributions" in the implementors' notes.


注: このフィールドが true のとき, 構成後の prerequisite は 保証を担うものではありません すべての関係を 記載されたいかなるものとの メタデータで, それと 頼ることは それらに 誤りです. また参照します "Prerequisites for dynamically configured distributions" を 実装者のノートの.

This field explicitly does not indicate whether installation may be safely performed without using a Makefile or Build file, as there may be special files to install or custom installation targets (e.g. for dual-life modules that exist on CPAN as well as in the Perl core). This field only defines whether or not prerequisites are exactly as given in the metadata.


このフィールドは 明示的に示すものではありません インストールが安全に行えるかどうかを 利用せずに Makefile や Build file を, あるかもしれないので 特別なファイルや インストールのための カスタムインストールターゲットが ( e.g. dual-life モジュールで 存在する CPAN および Perl core に ). このフィールドは定義します prerequisite が 正確に与えられているかどうかのみを メタデータで.

# dual-life モジュール: CPAN と Perl core に存在する別々のソースリポジトリを持った同じモジュール see what is a "dual-life" module ? - stackoverflow


generated_by



Example:



generated_by => 'Module::Build version 0.36'



(Spec 1.0) [required] {String}

This field indicates the tool that was used to create this metadata. There are no defined semantics for this field, but it is traditional to use a string in the form "Generating::Package version 1.23" or the author's name, if the file was generated by hand.


このフィールドは示します ツールを 利用した 作成に このメタデータの. 定義されたセマンティクスはありません このフィールドのために, しかし 伝統的に使います 文字列を 形式 "Generating::Package version 1.23" で または 作者の名前を, もしファイルが生成されているなら 手動で.


license



Example:



license => [ 'perl_5' ]
license => [ 'apache_2_0', 'mozilla_1_0' ]



(Spec) [required] {List of one or more License Strings}

One or more licenses that apply to some or all of the files in the distribution. If multiple licenses are listed, the distribution documentation should be consulted to clarify the interpretation of multiple licenses.


1 つ以上のライセンス 適用する 一部またはすべてに ファイルの ディストリビューションの. もし複数のライセンスがリストされているなら, ディストリビューションのドキュメントは参照しなければなりません 明確にするために 解釈を 複数ライセンスの.

The following list of license strings are valid:


次のライセンスのリストは有効です:


string description
------------- -----------------------------------------------
agp_3 GNU Affero General Public License, Version 3
apache_1_1 Apache Software License, Version 1.1
apache_2_0 Apache License, Version 2.0
artistic_1 Artistic License, (Version 1)
artistic_2 Artistic License, Version 2.0
bsd BSD License (three-clause)
freebsd FreeBSD License (two-clause)
gfdl_1_2 GNU Free Documentation License, Version 1.2
gfdl_1_3 GNU Free Documentation License, Version 1.3
gpl_1 GNU General Public License, Version 1
gpl_2 GNU General Public License, Version 2
gpl_3 GNU General Public License, Version 3
lgpl_2_1 GNU Lesser General Public License, Version 2.1
lgpl_3_0 GNU Lesser General Public License, Version 3.0
mit MIT (aka X11) License
mozilla_1_0 Mozilla Public License, Version 1.0
mozilla_1_1 Mozilla Public License, Version 1.1
openssl OpenSSL License
perl_5 The Perl 5 License (Artistic 1 & GPL 1 or Later)
qpl_1_0 Q Public License, Version 1.0
ssleay Original SSLeay License
sun Sun Internet Standards Source License (SISSL)
zlib zlib License



The following license strings are also valid and indicate other licensing not described above:


次のライセンス文字列は また有効です それと 示します 他のライセンスを 記述されていない 上記に:


string description
------------- -----------------------------------------------
open_source Other Open Source Initiative (OSI) approved license
restricted Requires special permission from copyright holder
unrestricted Not an OSI approved license, but not restricted
unknown License not provided in metadata



All other strings are invalid in the license field.


すべての他の文字列は 無効です ライセンスフィールドで.


meta-spec



Example:



'meta-spec' => {
version => '2',
url => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec',
}



(Spec) [required] {Map}

This field indicates the version of the CPAN Meta Spec that should be used to interpret the metadata. Consumers must check this key as soon as possible and abort further metadata processing if the meta-spec version is not supported by the consumer.


このフィールドは示します バージョンを CPAN Meta Spec の 利用されるべき 解釈に メタデータの. Consumer はチェックしなければなりません この key を できるだけ早く それと 打ち切ります さらなるメタデータの処理を もし meta-spec のバージョンが サポートされていないなら consumer によって.

The following keys are valid, but only version is required.


次の key が有効です, しかし version のみが必要とします.


version



This subkey gives the integer Version of the CPAN Meta Spec against which the document was generated.


このサブキーは 与えます 整数バージョンを CPAN Meta Spec の ドキュメントに対する 生成された.


url



This is a URL of the metadata specification document corresponding to the given version. This is strictly for human-consumption and should not impact the interpretation of the document.


これは URL です メタデータの仕様ドキュメントの 対応する 与えられたバージョンに. これは厳密に 人が消費するものです それと 影響するべきではありません 解釈に ドキュメントの.

For the version 2 spec, either of these are recommended:


バージョン 2 spec では, これらのどちらかが推奨されます:


http://metacpan.org/pod/CPAN::Meta::Spec
http://search.cpan.org/perldoc?CPAN::Meta::Spec




name



Example:



name => 'Module-Build'



(Spec 1.0) [required] {String}

This field is the name of the distribution. This is often created by taking the "main package" in the distribution and changing :: to -, but the name may be completely unrelated to the packages within the distribution. For example, LWP::UserAgent is distributed as part of the distribution name "libwww-perl".


このフィールドは 名前です ディストリビューションの. これはしばしば作成されます 取ることで "main package" を ディストリビューションの それと 変更します :: を - に, しかし 名前は完全に無関係かもしれません package に ディストリビューションの. 例えば, LWP::UserAgent は 配布されています 一部として ディストリビューション名 "libwww-perl" の.


release_status



Example:



release_status => 'stable'



(Spec 2) [required] {String}

This field provides the release status of this distribution. If the version field contains an underscore character, then release_status must not be "stable."


このフィールドは提供します リリースステイタスを このディストリビューションの. もし version フィールドが含むなら アンダースコア文字を, そのとき release_status は "stable" であってはなりません.

The release_status field must have one of the following values:


release_status フィールドは 持っていなければなりません 次の値のひとつを:


stable



This indicates an ordinary, "final" release that should be indexed by PAUSE or other indexers.


これは普通示します, "final" リリースを インデクスされるべき PAUSE または 他のインデクサによって.


testing



This indicates a "beta" release that is substantially complete, but has an elevated risk of bugs and requires additional testing. The distribution should not be installed over a stable release without an explicit request or other confirmation from a user. This release status may also be used for "release candidate" versions of a distribution.


これは示します "beta" リリースを それは大体完了しています, しかし バグのリスクが高く それと 必須です 追加のテストが. ディストリビューションはインストールされるべきではありません stable リリースの上に 明示的な要求または他の確認なしに ユーザからの. このリリースステータスはまた利用されます "release candidate" (* リリース候補 ) バージョンに ディストリビューションの.


unstable



This indicates an "alpha" release that is under active development, but has been released for early feedback or testing and may be missing features or may have serious bugs. The distribution should not be installed over a stable release without an explicit request or other confirmation from a user.


これは示します "alpha" リリースを それはアクティブに開発中です, しかしリリースされます 早期のフィードバックやテスト それと 機能が不足していないかや深刻なバグを持っていないかのために. ディストリビューションはインストールされるべきではありません stable リリースの上に 明示的な要求または他の確認なしに ユーザからの.


Consumers may use this field to determine how to index the distribution for CPAN or other repositories in addition to or in replacement of heuristics based on version number or file name.


Consumer は使ってもよいです このフィールドを 決定に どのようにインデクスするかのための ディストリビューションを CPAN または他のリポジトリに 追加で または 代わりに ヒューリスティックの 基づいた バージョン番号やファイル名に.


version



Example:



version => '0.36'



(Spec) [required] {Version}

This field gives the version of the distribution to which the metadata structure refers.


このフィールドは与えます バージョンを ディストリビューションの メタデータ構造が参照する.


OPTIONAL FIELDS ( オプショナルフィールド )




description



Example:



description => "Module::Build is a system for "
. "building, testing, and installing Perl modules. "
. "It is meant to ... blah blah blah ...",



(Spec 2) [optional] {String}

A longer, more complete description of the purpose or intended use of the distribution than the one provided by the abstract key.


長く, より完全な説明です 目的や意図の ディストリビューションの利用の 提供されるものよりも abstract key で.


keywords



Example:



keywords => [ qw/ toolchain cpan dual-life / ]



(Spec 1.1) [optional] {List of zero or more Strings}

A List of keywords that describe this distribution. Keywords must not include whitespace.


keyword のリストです 説明する このディストリビューションを. keyword は含めてはいけません 空白を.


no_index



Example:



no_index => {
file => [ 'My/Module.pm' ],
directory => [ 'My/Private' ],
package => [ 'My::Module::Secret' ],
namespace => [ 'My::Module::Sample' ],
}



(Spec 1.2) [optional] {Map}

This Map describes any files, directories, packages, and namespaces that are private to the packaging or implementation of the distribution and should be ignored by indexing or search tools. Note that this is a list of exclusions, and the spec does not define what to include - see "Indexing distributions a la PAUSE" in the implementors notes for more information.


この Map は記述します すべてのファイル, ディレクトリ, package, それと 名前空間を それは プライベートです その packaging や 実装に ディストリビューションの それと 無視されるはずです インデクスや検索ツールによって. 注意してください これはリストです 除外の, それと spec は定義していません 何を含めるかを - 参照します "Indexing distributions a la PAUSE" を 実装者のノートの 詳細のために.

Valid subkeys are as follows:


有効なサブキーは次のとおりです:


file



A List of relative paths to files. Paths must be specified with unix conventions.


リストです 相対パスの ファイルへの. パスは指定しなければなりません unix の慣習で.


directory



A List of relative paths to directories. Paths must be specified with unix conventions.


リストです 相対パスの ディレクトリへの. パスは指定しなければなりません unix の慣習で.

[ Note: previous editions of the spec had dir instead of directory ]


[ 注: 以前のエディション は spec の 持っていました dir を directory の代わりに ]


package



A List of package names.


リストです package 名の.


namespace



A List of package namespaces, where anything below the namespace must be ignored, but not the namespace itself.


リストです package 名前空間の, すべては 名前空間の下にある 無視されるはずです, しかし 名前空間それ自身はそうではありません.

In the example above for no_index, My::Module::Sample::Foo would be ignored, but My::Module::Sample would not.


例では 上記の no_index の, My::Module::Sample::Foo は無視されます, しかし My::Module::Sample はそうではありません.


optional_features



Example:



optional_features => {
sqltite => {
description => 'Provides SQLite support',
prereqs => {
runtime => {
requires => {
'DBD::SQLite' => '1.25'
}
}
}
}
}



(Spec 2) [optional] {Map}

This Map describes optional features with incremental prerequisites. Each key of the optional_features Map is a String used to identify the feature and each value is a Map with additional information about the feature. Valid subkeys include:


この Map は 記述します オプションの機能を 増分の prerequisite で. 各 key は optional_features Map の 文字列です 使われる 識別のために feature の それと 各 value は Map です 追加情報の feature についての. 有効なサブキーは含みます:


description



This is a String describing the feature. Every optional feature should provide a description


これは String です 記述する feature を. すべてのオプショナルな feature は提供しなければなりません description を


prereqs



This entry is required and has the same structure as that of the "prereqs" key. It provides a list of package requirements that must be satisfied for the feature to be supported or enabled.


このエントリは 必須です それと 持っています 構造を "preerqs" key と同じ. それは提供します リストを package 要件の 満たされなければならない その feature をサポートまたは有効にするために.

There is one crucial restriction: the prereqs of an optional feature must not include configure phase prereqs.


ひとつ 重要な制限があります: prereqs は optional feature の 含んではなりません configure フェーズの prereqs を.


Consumers must not include optional features as prerequisites without explicit instruction from users (whether via interactive prompting, a function parameter or a configuration value, etc. ).


Consumer は 含んではなりません optional feature を prerequisite として 明示的な指示なしに ユーザからの ( インタラクティブなプロンプトを介する, ファンクションパラメータ または 構成の値, etc かどうかにかかわらず. ).

If an optional feature is used by a consumer to add additional prerequisites, the consumer should merge the optional feature prerequisites into those given by the prereqs key using the same semantics. See "Merging and Resolving Prerequisites" for details on merging prerequisites.


もし optional feature が使われるなら consumer によって 追加するために 追加の prerequisite を, consumer はマージする必要があります optional feature prerequisite を それらが与えるものに prereqs key によって 利用して 同じセマンティクスを. 参照します "Merging and Resolving Prerequisites" を 詳細のために prerequisite のマージについての.

Suggestion for disuse: Because there is currently no way for a distribution to specify a dependency on an optional feature of another dependency, the use of optional_feature is discouraged. Instead, create a separate, installable distribution that ensures the desired feature is available. For example, if Foo::Bar has a Baz feature, release a separate Foo-Bar-Baz distribution that satisfies requirements for the feature.


提案 不使用の: 現在はないので 方法が ディストリビューションが指定するための 依存を optional feature への 他の依存関係の, 利用は optional_feature の お勧めできません. 代わりに, 分けて作成して, インストールできるディストリビューションを 確保します 望みの機能の利用可能であることを. 例えば, もし Foo::Bar が持っているなら Baz 機能を, リリースします 分けて Foo-Bar-Baz ディストリビューションを 満たした 要件を その機能のための.


prereqs



Example:



prereqs => {
runtime => {
requires => {
'perl' => '5.006',
'File::Spec' => '0.86',
'JSON' => '2.16',
},
recommends => {
'JSON::XS' => '2.26',
},
suggests => {
'Archive::Tar' => '0',
},
},
build => {
requires => {
'Alien::SDL' => '1.00',
},
},
test => {
recommends => {
'Test::Deep' => '0.10',
},
}
}



(Spec 2) [optional] {Map}

This is a Map that describes all the prerequisites of the distribution. The keys are phases of activity, such as configure, build, test or runtime. Values are Maps in which the keys name the type of prerequisite relationship such as requires, recommends, or suggests and the value provides a set of prerequisite relations. The set of relations must be specified as a Map of package names to version ranges.


これは Map です 記述する すべての prerequisites ( 前提条件) を ディストリビューションの. この key は フェーズです アクティビティの, configure, build, test や runtime のような. Value は Map で key 名が タイプです prerequisite 関係の requires, recommends, または suggests のような それと value は提供します セットを prerequisite 関係の. 関係のセットは 指定しなければなりません Map として package 名の バージョンレンジへの.

The full definition for this field is given in the "Prereq Spec" section.


完全な定義は このフィールドのための 与えられます "Prereq Spec" セクションで.


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',
varsion => '0.3',
},
}



(Spec 1.2) [optional] {Map}

This describes all packages provided by this distribution. This information is used by distribution and automation mechanisms like PAUSE, CPAN, metacpan.org and search.cpan.org to build indexes saying in which distribution various packages can be found.


これは記述します すべての package を 提供される このディストリビューションによって. この情報は使われます 配布と自動化メカニズムによって PAUSE, CPAN, metacpan.org のような それと search.cpan.org で 構築のために インデクスの 言う どの配布で さまざまな package が見つけられるかを.

The keys of provides are package names that can be found within the distribution. If a package name key is provided, it must have a Map with the following valid subkeys:


provides の key は package 名です 見つかる ディストリビューションで. もし package 名の key が提供されているなら, それは持っていなければなりません Map を 次の有効なサブキーとともに:


file



This field is required. It must contain a Unix-style relative file path from the root of the distribution directory to a file that contains or generates the package. It may be given as META.yml or META.json to claim a package for indexing without needing a *.pm.


このフィールドは必須です. それは含む必要があります Unix-style の相対ファイルパスを ルートからの ディストリビューションディレクトリの ファイルへの 含むまたは生成される package を. それには与えることもできます META.yml や META.json として 要求する package を インデクスするために 必要とすることなく .pm を.


version



If it exists, this field must contains a Version String for the package. If the package does not have a $VERSION, this field must be omitted.


もし存在するなら, このフィールドは含む必要があります Version Striong を package のための. もし package が持っていないなら $VERSION を, このフィールドは省略しなければなりません.


resources



Example:



resources => {
license => [ 'http://dev.perl.org/licenses/' ],
homepage => 'http://sourceforge.net/projects/module-build',
bugtracker => {
web => 'http://rt.cpan.org/Public/Dist/Display.html?Name=CPAN-Meta',
mailto => 'meta-bugs@example.com',
},
repository => {
url => 'git://github.com/dagolden/cpan-meta.git',
web => 'http://github.com/dagolden/cpan-meta',
type => 'git',
},
x_twitter => 'http://twitter.com/cpan_linked/',
}



(Spec 2) [optional] {Map}

This field describes resources related to this distribution.


このフィールドは記述します リソースを 関係する このディストリビューションに.

Valid subkeys include:


有効なサブキーは 含みます:


homepage



The official home of this project on the web.


オフィシャルなホームです このプロジェクトの web にある.


license



A List of URL's that relate to this distribution's license. As with the top-level license field, distribution documentation should be consulted to clarify the interpretation of multiple licenses provided here.


URL のリストです 関係する このディストリビューションのライセンスに. トップレベルの license フィールドと同じく, ディストリビューションのドキュメントは参照しなければなりません 明確にするために 解釈を 複数ライセンスの ここで提供されている.


bugtracker



This entry describes the bug tracking system for this distribution. It is a Map with the following valid keys:


このエントリは記述します バグトラッキングシステムを このディストリビューションのための. それは Map です 次の有効な key の:


web - a URL pointing to a web front-end for the bug tracker
指し示す URL です web フロントエンドを バグトラッカーのための
mailto - an email address to which bugs can be sent
email アドレスです そのバグを送信できる




repository



This entry describes the source control repository for this distribution. It is a Map with the following valid keys:


このエントリは記述します ソースコントロールリポジトリを ディストリビューションのための. それは Map です 次の有効な key の:


url - a URL pointing to the repository itself
指し示す URL です リポジトリそれ自身を
web - a URL pointing to a web front-end for the repository
指し示す URL です web フロントエンドを リポジトリのための
type - a lowercase string indicating the VCS used
小文字の文字列です 示す VCS を 利用している



# VCS : Version Control System

Because a url like http://myrepo.example.com/ is ambiguous as to type, producers should provide a type whenever a url key is given. The type field should be the name of the most common program used to work with the repository, e.g. git, svn, cvs, darcs, bzr or hg.


url は http://myrepo.example.com/ のような 曖昧なので type として, producer は提供しなければなりません type を url key が与えられるたびに. type フィールドは 名前でなければなりません もっとも一般的なプログラムの 使われる リポジトリでの作業に, e.g. git, svn, cvs, darcs, bzr or hg.


DEPRECATED FIELDS ( 廃止予定のフィールド )




build_requires



(Deprecated in Spec 2) [option] {String}

Replaced by prereqs


置き換えられました prereqs で


configure_requires



(Deprecated in Spec 2) [option] {String}

Replaced by prereqs


置き換えられました prereqs で


conflicts



(Deprecated in Spec 2) [option] {String}

Replaced by prereqs


置き換えられました prereqs で


distribution_type



(Deprecated in Spec 2) [option] {String}

This field indicated 'module' or 'script' but was considered meaningless, since many distributions are hybrids of several kinds of things.


このフィールドは示していました 'module' または 'script' を しかしみなされました 意味がないと, 多くのディストリビューションがハイブリッドなので いくつかの種類の.


license_uri



(Deprecated in Spec 1.2) [optional] {URL}

Replaced by license in resources


置き換えられました resources の linense で


private



(Deprecated in Spec 1.2) [optional] {Map}

This field has been renamed to "no_index".


このフィールドはリネームされました "no_index" に.


recommends



(Deprecated in Spec 2) [optional] {String}

Replaced by prereqs


置き換えられました prereqs によって


requires



(Deprecated in Spec 2) [optional] {String}

Replaced by prereqs


置き換えられました prereqs によって


VERSION NUMBERS ( バージョン番号 )




Version Formats



This section defines the Version type, used by several fields in the CPAN Meta Spec.


このセクションは定義します Version タイプを, 使って いくつかのフィールドを CPAN Meta Spec の.

Version numbers must be treated as strings, not numbers. For example, 1.200 must not be serialized as 1.2. Version comparison should be delegated to the Perl version module, version 0.80 or newer.


バージョン番号は扱われなければなりません 文字列として, 数値ではなく. 例えば, 1.200 はシリアル化してはいけません 1.2 として. バージョンの比較は 委譲しなければなりません Perl version モジュールに, バージョン 0.80 以降の.

Unless otherwise specified, version numbers must appear in one of two formats:


特に指定しないかぎり, バージョン番号は現れなければなりません 2 つのフォーマットのひとつで:


Decimal versions



Decimal versions are regular "decimal numbers", with some limitations. They must be non-negative and must begin and end with a digit. A single underscore may be included, but must be between two digits. They must not use exponential notation ("1.23e-2").


Decimal version は通常の "10 進数" です, いくつかの制限がある. それらは非負 ( non-nagative ) でなければなりません それと 始まって終わらなければなりません 数字で. 単一のアンダースコアが含んでもよいです, しかし 間でなければなりません 2 桁の. それは利用してはいけません 指数記法を ( "1.23e-2" ).


version => '1.234' # OK
version => '1.23_04' # OK

version => '1.23_04_05' # Illegal
version => '1.' # Illegal
version => '.1' # Illegal




Dotted-integer versions



Dotted-integer (also known as dotted-decimal) versions consist of positive integers separated by full stop characters (i.e. "dots", "periods" or "decimal points"). This are equivalent in format to Perl "v-strings", with some additional restrictions on form. They must be given in "normal" form, which has a leading "v" character and at least three integer components. To retain a one-to-one mapping with decimal versions, all components after the first should be restricted to the range 0 to 999. The final component may be separated by an underscore character instead of a period.


Dotted-integer ( また知られる dotted-decimal として ) バージョンは 構成されます 正の整数 分けられた フルストップ文字で ( i.e. "ドット", "ピリオド" または "小数点" ). これには 同じフォーマットで Perl "v-strings" と, いくつか追加の制限があります 形式に. これらは与えなければなりません "normal" 形式で, "v" が先導する 少なくとも 3 つの整数の構成要素 ( components ) を. 維持するために 1 対 1 のマッピングを decimal version との, すべての構成要素は 最初の後の (# 2 番目以降の ) する必要がある制限があります 範囲に 0 から 999 の. 最後の構成要素は分割してもよいです アンダースコア文字で 代わりに ピリオドの.


version => 'v1.2.3' # OK
version => 'v1.2_3' # OK
version => 'v1.2.3.4' # OK
version => 'v1.2.3_4' # OK
version => 'v2009.10.31' # OK

version => 'v1.2' # Illegal
version => '1.2.3' # Illegal
version => 'v1.2_3_4' # Illegal
version => 'v1.2009.10.31' # Not recommended




Version Ranges



Some fields (prereq, optional_features) indicate the particular version(s) of some other module that may be required as a prerequisite. This section details the Version Range type used to provide this information.


いくつかのフィールド ( prereq, optional_features ) は示します 特定のバージョン (s) を いくつか他のモジュールの 要求されるかもしれない prerequisite として. このセクションは詳細です Version Pange タイプ の 利用する 提供するために この情報を.

The simplest format for a Version Range is just the version number itself, e.g. 2.4. This means that at least version 2.4 must be present. To indicate that any version of a prerequisite is okay, even if the prerequisite doesn't define a version at all, use the version 0.



もっともシンプルなフォーマットは Version Range のための 単にバージョン番号それ自身です, e.g. 2.4. これは意味します 少なくともバージョン 2.4 が存在しなければならないことを. 示すためには すべてのバージョンが prerequisite ( 前提条件 ) の Okay であることを, たとえ prerequisite が定義していなくても バージョンを まったく, 利用します バージョン 0 を.

Alternatively, a version range may use the operators < (less than), <= (less than or equal), > (greater than), >= (greater than or equal), == (equal), and != (not equal). For example, the specification < 2.0 means that any version of the prerequisite less than 2.0 is suitable.


あるいは, バージョンレンジは使ってもよいです 演算子 < ( より小さい ), <= ( より小さいか等しい ), > ( より大きい ), >= ( より大きいか等しい ), == ( 等しい ), それと != ( 等しくない ) を. 例えば, 指定は < 2.0 の 意味します すべてのバージョンが prerequisite の 2.0 未満の 適切と.

For more complicated situations, version specifications may be AND-ed together using commas. The specification >= 1.2, != 1.5, < 2.0 indicates a version that must be at least 1.2, less than 2.0, and not equal to 1.5.


より複雑な状況では, バージョン指定は AND してもよいです 一緒に使って カンマを. 指定は >= 1.2, != 1.5, < 2.0 は示します バージョンを 少なくとも 1.2, 2.0 未満, それと等しくない 1.5 と.


PREREQUISITES




Prereq Spec



The prereqs key in the top-level metadata and within optional_features define the relationship between a distribution and other packages. The prereq spec structure is a hierarchical data structure which divides prerequisites into Phases of activity in the installation process and Relationships that indicate how prerequisites should be resolved.


prereq の key は トップレベルメタデータと optional_features 内の 定義します 関係を 間の ディストリビューションと他の package の. prereq の仕様の構造は 階層データ構造で 分けます prerequisite を アクティビティのフェーズに インストールプロセスと関係で それは 示します どのように prerequisite を解決すべきかを.

For example, to specify that Data::Dumper is required during the test phase, this entry would appear in the distribution metadata:


例えば, 指定するには Data::Dumper が必須なことを 間で test フェーズの, このエントリが現れます ディストリビューションのメタデータで:


prereqs => {
test => {
requires => {
'Data::Dumper' => '2.00'
}
}
}




Phases



Requirements for regular use must be listed in the runtime phase. Other requirements should be listed in the earliest stage in which they are required and consumers must accumulate and satisfy requirements across phases before executing the activity. For example, build requirements must also be available during the test phase.


Requirements は 常用する リストされなければなりません runtime フェーズで. 他の requirements は リストされるはずです 最も早いステージで それらが必要とされる それと consumer は蓄積し満たさなけばなりません requirements を 横断して フェーズを 実行する前に activity を. 例えば, build requirements はまたしなければなりません 利用可能に test フェーズの間で.


before action requirements that must be met
---------------- --------------------------------
perl Build.PL configure
perl Makefile.PL

make configure, runtime, build
Build

make test configure, runtime, build, test
Build test



Consumers that install the distribution must ensure that runtime requirements are also installed and may install dependencies from other phases.


Consumer は インストールする ディストリビューションを 確認しなければなりません runtime requirements もインストールされているかを それと インストールするかもしれません 依存関係を 他のフェーズからくる.


after action requirements that must be met
---------------- --------------------------------
make install runtime
Build install




configure



The configure phase occurs before any dynamic configuration has been attempted. Libraries required by the configure phase must be available for use before the distribution building tool has been executed.


configure フェーズは起こります 前に すべての動的な configuration が施行される. ライブラリは 要求された configure フェーズで 利用可能でなければなりません 前に ディストリビューションビルドツールが実行される.


build



The build phase is when the distribution's source code is compiled (if necessary) and otherwise made ready for installation.


build フェーズは ディストリビューションのソースコードがコンパイルされた ( もし必要なら ) あるいは 準備ができたときです インストールのための.


test



The test phase is when the distribution's automated test suite is run. Any library that is needed only for testing and not for subsequent use should be listed here.



runtime



The runtime phase refers not only to when the distribution's contents are installed, but also to its continued use. Any library that is a prerequisite for regular use of this distribution should be indicated here.


runtime フェーズは指します ディストリビューションのコンテンツがインストールされるだけでなく, それの継続的な利用もまた. すべてのライブラリは prerequisite の 常用する このディストリビューションが 示されるはずです ここで.


develop



The develop phase's prereqs are libraries needed to work on the distribution's source code as its author does. These tools might be needed to build a release tarball, to run author-only tests, or to perform other tasks related to developing new versions of the distribution.


develop フェーズの prereqs は ライブラリです 必要とする 動作に ディストリビューションのソースコードで 作者が. これらのツールは 必要になるかもしれません リリース tarball の構築のため, 作者のみのテストのため, または 実行するため 他のタスクを 開発に関連する 新しいバージョンの ディストリビューションの.


Relationships




requires



These dependencies must be installed for proper completion of the phase.


これらの依存関係は インストールしなければなりません 適切な完了のために フェーズの.


recommends



Recommended dependencies are strongly encouraged and should be satisfied except in resource constrained environments.


Recommend された依存関係は 強く促します それと 満たされるべきです 除いて リソースが窮屈な環境を.


suggests



These dependencies are optional, but are suggested for enhanced operation of the described distribution.


これらの依存関係は オプショナルです, しかし提案されます 高められた操作のために 記述された ディストリビューションの.


conflicts



These libraries cannot be installed when the phase is in operation. This is a very rare situation, and the conflicts relationship should be used with great caution, or not at all.


これらのライブラリは インストールされません フェーズが オペレーションをしているときには. これはとてもまれなシチュエーションです, それと 競合関係 ( conflicts relationship ) は利用すべきです 十分に気をつけて, またはまったく使いません.


Merging and Resolving Prerequisites ( マージと解決 前提条件の )



Whenever metadata consumers merge prerequisites, either from different phases or from optional_features, they should merged in a way which preserves the intended semantics of the prerequisite structure. Generally, this means concatenating the version specifications using commas, as described in the "Version Ranges" section.


metadata consumer はマージするたびに prerequisites を, いずれかから 異なるフェーズ または optional_features からの, マージしなければなりません 方法で 保つ 意図したセマンティクスを prerequisite の構造の. 一般に, これは意味します 連結することを バージョン指定を カンマを使って, 記述されているように "Version Ranges" セクションで.

Another subtle error that can occur in resolving prerequisites comes from the way that modules in prerequisites are indexed to distribution files on CPAN. When a module is deleted from a distribution, prerequisites calling for that module could indicate an older distribution should be installed, potentially overwriting files from a newer distribution.


他の微妙な ( 捉えにくい ) エラーは 発生する prerequisites の解決で 方法からきます モジュールが prerequisites の インデクスされる 配布ファイルに CPAN で. モジュールが削除されると ディストリビューションから, prerequisites が呼び出す そのモジュールは 示すかもしれません 古いディストリビューションをインストールして, 潜在的に上書きすることを ファイルを 新しいディストリビューションから.

For example, as of Oct 31, 2009, the CPAN index file contained these module-distribution mappings:


例えば, 10 月 31, 2009 現在, CPAN インデクスファイルは含んでいます これらの module-distribution マッピングを:


Class::MOP 0.94 D/DR/DROLSKY/Class-MOP-0.94.tar.gz
Class::MOP::Class 0.94 D/DR/DROLSKY/Class-MOP-0.94.tar.gz
Class::MOP::Class::Immutable 0.04 S/ST/STEVAN/Class-MOP-0.36.tar.gz



Consider the case where "Class::MOP" 0.94 is installed. If a distribution specified "Class::MOP::Class::Immutable" as a prerequisite, it could result in Class-MOP-0.36.tar.gz being installed, overwriting any files from Class-MOP-0.94.tar.gz.


考えます ケースを "Class::MOP" 0.94 がインストールされている. もしディストリビューションが指定した場合 "Class::MOP::Class::Immutable" を prerequisite として, 結果になるかもしれません Class-MOP-0.36.tar.gz がインストールされて, 上書きする すべてのファイルを Class-MOP-0.94.tar.gz から.

Consumers of metadata should test whether prerequisites would result in installed module files being "downgraded" to an older version and may warn users or ignore the prerequisite that would cause such a result.


Consumer は メタデータの テストする必要があります prerequisites を インストールした結果 モジュールファイルが "ダウングレード" されるかどうかを 古いバージョンに それと ユーザへの警告や無視をしてもよいです prerequisite を 生じさせる そのような結果を.


SERIALIZATION ( シリアライゼーション )



Distribution metadata should be serialized (as a hashref) as JSON-encoded data and packaged with distributions as the file META.json.


ディストリビューションのメタデータはシリアライズされるはずです ( ハッシュレフの ) JSON-encode データとして それと パッケージされます ディストリビューションとともに ファイル META.json として.

In the past, the distribution metadata structure had been packed with distributions as META.yml, a file in the YAML Tiny format (for which, see YAML::Tiny). Tools that consume distribution metadata from disk should be capable of loading META.yml, but should prefer META.json if both are found.


過去には, ディストリビューションのメタデータ構造は パックされていました ディストリビューションに META.yml として, ファイルの YAML Tiny 形式の ( そのために, 参照します YAML::Tiny を ). ツールは 消費する ディストリビューションメタデータを ディスクから 読み込むことができなければなりません META.yml を, しかし 優先しなければなりません META.json を もし両方見つかるなら.


NOTES FOR IMPLEMENTORS ( 注意 実装者のための )




Extracting Version Numbers from Perl Modules ( 抜き出し バージョン番号の Perl モジュールからの )



To get the version number from a Perl module, consumers should use the MM->parse_version($file) method provided by ExtUtils::MakeMaker or Module::Metadata. For example, for the module given by $mod, the version may be retrieved in one of the following ways:


バージョン番号を得るには Perl モジュールから, consumer は使うはずです MM->parse_version($file) メソッドを 提供される ExtUtils::MakeMaker または Module::Metadata から. 例えば, モジュールでは 与えられた $mod によって, バージョンは取り出すことができるはずです 次のいずれかの方法で:


# via ExtUtils::MakeMaker
my $file = Module::Metadata->new_from_module($mod);
my $version = $info->version;



The private _installed_file_for_module method may be replaced with other methods for locating a module in @INC.


プライベートの _installed_file_for_module メソッドは 置き換えることもできます 他のメソッドに 配置するために モジュールを @INC に.


# via Module::Metadata
my $info = Module::Metadata->new_from_module($mod);
my $version = $info->version;



If only a filename is available, the following approach may be used:


もしファイル名のみが利用可能なら, 次のアプローチも使えます:


# via Module::Build
my $info = Module::Metadata->new_from_file($file);
my $version = $info->version;




Comparing Version Numbers ( 比較 バージョン番号の )



The version module provides the most reliable way to compare version numbers in all the various ways they might be provided or might exist within modules. Given two strings containing version numbers, $v1 and $v2, they should be converted to version objects before using ordinary comparison operators. For example:


version モジュールは提供します もっとも信頼できる方法を 比較する バージョン番号を すべての様々な方法で それは提供されるかもしれません または 存在するかもしれません モジュール内に. 与えられたら 2 つの文字列が 含む バージョン番号, $v1 と $v2 を, それらは変換する必要があります version オブジェクトに 使う前に 通常の比較演算子を. 例えば:


use version;
if ( version->new($v1) <=> version->new($v2) ) {
print "Version are not equal\n";
}



If the only comparison needed is whether an installed module is of a sufficiently high version, a direct test may be done using the string form of eval and the use function. For example, for module $mod and version prerequisite $prereq:


もし唯一の比較が必要とするのが インストールされたモジュールが十分に高いバージョンであるかどうかなら, 直接テストを行えます 使って 文字列を eval の それと use ファンクションを. 例えば, モジュール $mod と バージョン prerequisite $prereq では:


if ( eval "use $mod $prereq (); 1" ) {
print "Module $mod version is OK.\n";
}



If the values of $mod and $prereq have not been scrubbed, however, this presents security implications.


もし $mod のバージョンと $prereq が洗浄されていないなら, しかし, これは示します セキュリティへの影響を.


Prerequisites for dynamically configured distributions ( 前提条件 動的に構成されたディストリビューションのための )



When dynamic_config is true, it is an error to presume that the prerequisites given in distribution metadata will have any relationship whatsoever to the actual prerequisites of the distribution.


dynamic_config が 真 のとき, エラーになります 推測すると prerequisites を 与えられた ディストリビューションメタデータで 持っていると 何らかの関係を 実際の prerequisites と ディストリビューションの.

In practice, however, one can generally expect such prerequisites to be one of two things:


実際には, しかし, それは通常期待できます そのような prerequisite が 2 つのもののひとつになると:

・The minimum prerequisites for the distribution, to which dynamic configuration will only add items

・Whatever the distribution configured with on the releaser's machine at release time


・最小の prerequisites ディストリビューションのための, 動的 configuration ではただ追加されます アイテムが.

・何でも ディストリビューションが 構成したものは releaser のマシン上で リリース時に.

The second case often turns out to have identical results to the first case, albeit only by accident.


2 番目のケースは よくあります 示すことが 結果を 最初のケースの, ただの偶然にもかかわらず.

As such, consumers may use this data for informational analysis, but presenting it to the user as canonical or relying on it as such is invariably the height of folly.


このように, consumer は使うことができます このデータを 情報分析に, しかし それを提示する ユーザに 標準として または そのようなもを頼るのは 常に最も愚かしいことです.


Indexing distributions a la PAUSE ( インデクス ディストリビューションの PAUSE での )



While no_index tells you what must be ignored when indexing, this spec holds no opinion on how you should get your initial candidate list of things to possibly index. For "normal" distributions you might consider simply indexing the contents of lib/, but there are many fascinating oddities on CPAN and many dists from the days when it was normal to put the main .pm file in the root of the distribution archive - so PAUSE currently indexes all .pm and .PL files that are not either (a) specifically excluded by no_index (b) in inc, xt, or t directories, or common 'mistake' directories such as perl5.


no_index は伝えますが あなたに 何が無視されるべきか インデクス時に, この spec は意見を保持していません どのようにあなたが得るべきかについて あなたの初期候補のリストを インデクスするかもしれないものの. "normal" ディストリビューションでは あなたは考慮するかもしれません 単純にインデクスすることを lib/ のコンテンツを, しかしあります 多くの奇妙で魅力的なものが CPAN には それと 多くの dist が ルートに .pm ファイルを置くのが普通だったときからの ディストリビューションアーカイブの - なので PAUSE は現在インデクスします すべての .pm と .PL ファイルを どちらでもない (a) 明確に除外されている no_index によって (b) inc, xt, や t ディレクトリの中, または 一般的な 'mistake' ディレクトリ perl5 のような.

Or: If you're trying to be PAUSE-like, make sure you skip inc, xt and t as well as anything marked as no_index.


または: もしあなたがトライするなら PAUSE-like に, 必ずあなたはスキップしてください inc, xt それと マークされたものも no_index と.

Also remember: If the META file contains a provides field, you shouldn't be indexing anything in the first place - just use that.


また思い出してください: もし META ファイルが含むなら provides フィールドを, あなたはインデクスするべきではありません 最初の場所の何かを - ただそれを使ってください.


SEE ALSO ( 関連項目 )



・CPAN, http://www.cpan.org/
・JSON, http://json.org/
・YAML, http://www.yaml.org/
CPAN
CPANPLUS
ExtUtils::MakeMaker
Module::Build
Module::Install
CPAN::Meta::History::Meta_1_4


HISTORY ( ヒストリー )



Ken Williams wrote the original CPAN Meta Spec (also known as the "META.yml spec") in 2003 and maintained it through several revisions with input from various members of the community. In 2005, Randy Sims redrafted it from HTML to POD for the version 1.2 release. Ken continued to maintain the spec through version 1.4.


Ken Williams は書きました オリジナルの CPAN META Spec を ( また知られています "META.yml spec" として ) 2003 に それと 維持しました いくつかの改定を通じて インプットによる 様々なメンバーからの コミュニティの. 2005 に, Randy Sims は書き直しました それを HTML から POD に バージョン 1.2 のリリースのために. Ken は維持を続けました spec を バージョン 1.4 にいたるまで.

In late 2009, David Golden organized the version 2 proposal review process. David and Ricardo Signes drafted the final version 2 spec in April 2010 based on the version 1.4 spec and patches contributed during the proposal process.


2009 の後半に, David Golden は組織しました バージョン 2 プロポーサルレビュープロセスを. David と Ricardo Signes は書きました 最終バージョン 2 spec を 4 月 2010 に 基づいて バージョン 1.4 spec と パッチに 寄与された プロポーサルプロセスの間に.


AUTHOR ( 作者 )



・David Golden <dagolden@cpan.org>
・Ricardo Signes <rjbs@cpan.org>
・Adam Kennedy <adamk@cpan.org>




This software is copyright (c) 2010 by David Golden, Ricardo Signes, Adam Kennedy and Contributors.


このソフトウェアは コピーライト (c) 2010 です David Golden, Ricardo Signes, Adam Kenney と コントリビュータたちの.


This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


これはフリーソフトウェアです; あなたはできます 再配布 and/or 改変を 同じ条件下で Perl 5 プログラミング言語システムそれ自身と.


NEXT



次回は、ディストリビューションの変更履歴を記述するファイルのフォーマットの仕様「 CPAN::Changes::Spec 」を確認します。これは公式ではないが広く使われているフォーマットだそうです。

参考情報は書籍「 続・初めての Perl 改訂版 」, 「 Effective Perl 第 2 版 」を中心に perldoc, Wikipedia および各 Web サイト。それと詳しい先輩。

目次 - Perl Index

































同じカテゴリー(Perl)の記事
 Perl mp2 翻訳 Web コンテンツ圧縮の FAQ (d228) (2023-10-11 23:49)
 Perl mp2 翻訳 既知のブラウザのバグの回避策をいくつか (d227) (2023-05-26 15:41)
 Perl mp2 翻訳 Perl と Apache でのキュートなトリック (d226) (2023-05-19 17:05)
 Perl mp2 翻訳 テンプレートシステムの選択 (d225) (2022-08-15 22:23)
 Perl mp2 翻訳 大規模 E コマースサイトの構築 (d224) (2022-06-15 20:43)
 Perl mp2 翻訳 チュートリアル (d223) (2022-06-15 20:42)
上の画像に書かれている文字を入力して下さい
 
<ご注意>
書き込まれた内容は公開され、ブログの持ち主だけが削除できます。

Llama
リャマ
TI-DA
てぃーだブログ
プロフィール
セラ (perlackline)
セラ (perlackline)
QRコード
QRCODE
オーナーへメッセージ

PAGE TOP ▲