Module-CPANfile-1.0001 >
1.0002
との差分
cpanfile 1.0002 と 1.0001 の差分
1 | 1 | =encoding utf8 |
2 | 2 | |
3 | 3 | =head1 NAME |
4 | 4 | |
5 | 5 | =begin original |
6 | 6 | |
7 | 7 | cpanfile - A format for describing CPAN dependencies for Perl applications |
8 | 8 | |
9 | 9 | =end original |
10 | 10 | |
11 | 11 | cpanfile - PerlアプリケーションのためにCPANの依存性を記述するためのフォーマット |
12 | 12 | |
13 | 13 | =head1 SYNOPSIS |
14 | 14 | |
15 | 15 | requires 'Catalyst', '5.8000'; # 5.8000 or newer |
16 | 16 | requires 'Catalyst::View::JSON', '>= 0.30, < 0.40'; |
17 | 17 | |
18 | 18 | recommends 'JSON::XS', '2.0'; |
19 | 19 | conflicts 'JSON', '< 1.0'; |
20 | 20 | |
21 | 21 | on 'test' => sub { |
22 | 22 | requires 'Test::More', '>= 0.96, < 2.0'; |
23 | 23 | recommends 'Test::TCP', '1.12'; |
24 | 24 | }; |
25 | 25 | |
26 | 26 | on 'develop' => sub { |
27 | 27 | recommends 'Devel::NYTProf'; |
28 | 28 | }; |
29 | 29 | |
30 | 30 | feature 'sqlite', 'SQLite support' => sub { |
31 | 31 | recommends 'DBD::SQLite'; |
32 | 32 | }; |
33 | 33 | |
34 | 34 | =head1 VERSION |
35 | 35 | |
36 | 36 | =begin original |
37 | 37 | |
38 | 38 | This doucment describes cpanfile format version 1.0. |
39 | 39 | |
40 | 40 | =end original |
41 | 41 | |
42 | 42 | このドキュメントは cpanfile フォーマット バージョン 1.0 について書いています。 |
43 | 43 | |
44 | 44 | =head1 DESCRIPTION |
45 | 45 | |
46 | 46 | =begin original |
47 | 47 | |
48 | 48 | C<cpanfile> describes CPAN dependencies required to execute associated |
49 | 49 | Perl code. |
50 | 50 | |
51 | 51 | =end original |
52 | 52 | |
53 | 53 | C<cpanfile> は、関連する Perl のコードを実行するために必要とされている CPAN の依存について記述します。 |
54 | 54 | |
55 | 55 | =head1 シンタックス |
56 | 56 | |
57 | 57 | =over 4 |
58 | 58 | |
59 | 59 | =item requires, recommends, suggests, conflicts |
60 | 60 | |
61 | 61 | requires $module, $version_requirement; |
62 | 62 | |
63 | 63 | =begin original |
64 | 64 | |
65 | 65 | Describes the requirement for a module. See L<CPAN::Meta::Spec> for |
66 | 66 | the meanings of each requirement type. |
67 | 67 | |
68 | 68 | =end original |
69 | 69 | |
70 | 70 | モジュールの要求を記述します。それぞれの要求のタイプの意味については、L<CPAN::Meta::Spec> |
71 | 71 | を見てください。 |
72 | 72 | |
73 | 73 | =begin original |
74 | 74 | |
75 | 75 | When version requirement is omitted, it is assumed that C<0> is |
76 | 76 | passed, meaning any version of the module would satisfy the |
77 | 77 | requirement. |
78 | 78 | |
79 | 79 | =end original |
80 | 80 | |
81 | 81 | バージョンの要求が省略された場合、C<0>が渡されたと想定します。 |
82 | 82 | どのバージョンでも要求を満たすことを意味します。 |
83 | 83 | |
84 | 84 | =begin original |
85 | 85 | |
86 | 86 | Version requirement can either be a version number or a string that |
87 | 87 | satisfies L<CPAN::Meta::Spec/Version Ranges>, such as C<< >= 1.0, != |
88 | 88 | 1.1 >>. |
89 | 89 | |
90 | 90 | =end original |
91 | 91 | |
92 | 92 | バージョンの要求はバージョン番号か、L<CPAN::Meta::Spec/Version Ranges>を満たす |
93 | 93 | C<< >=1.0, !=1.1 >>のような文字列のいずれも可能です。 |
94 | 94 | |
95 | =begin original | |
96 | ||
97 | Note that, per L<CPAN::Meta::Spec>, when a plain version number is | |
98 | given, it means the version I<or newer> is required. If you want a | |
99 | specific version for a module, use the specific range syntax, i.e. | |
100 | C< == 2.1 >. | |
101 | ||
102 | =end original | |
103 | ||
104 | 次のことに注意してください。L<CPAN::Meta::Spec>によって、単純なバージョン番号 | |
105 | が与えらた場合、そのバージョンかI<より新しいもの>が必要であることを意味します。 | |
106 | もしモジュールの特定のバージョンが欲しければ、特定の範囲シンタックスを使ってください。 | |
107 | i.e. C< == 2.1 >。 | |
108 | ||
109 | 95 | =item on |
110 | 96 | |
111 | 97 | on $phase => sub { ... }; |
112 | 98 | |
113 | 99 | =begin original |
114 | 100 | |
115 | 101 | Describe requirements for a specific phase. Available phases are |
116 | 102 | C<configure>, C<build>, C<test>, C<runtime> and C<develop>. |
117 | 103 | |
118 | 104 | =end original |
119 | 105 | |
120 | 106 | 特定のフェーズ用の要求を記述できます。利用可能なフェーズは、 |
121 | 107 | |
122 | 108 | C<configure>、C<build>、C<test>、C<runtime> と C<develop> です。 |
123 | 109 | |
124 | 110 | =item feature |
125 | 111 | |
126 | 112 | feature $identifier, $description => sub { ... }; |
127 | 113 | |
128 | 114 | =begin original |
129 | 115 | |
130 | 116 | Group requirements with features. Description can be omitted, when it |
131 | 117 | is assumed to be the same as identifier. See |
132 | 118 | L<CPAN::Meta::Spec/optional_features> for more details. |
133 | 119 | |
134 | 120 | =end original |
135 | 121 | |
136 | 122 | 機能に対する要求をグループ化します。識別子と同じと想定できるときは |
137 | 123 | 説明は省くことができます。詳細は |
138 | 124 | L<CPAN::Meta::Spec/optional_features> を見てください。 |
139 | 125 | |
140 | 126 | =item configure_requires, build_requires, test_requires, author_requires |
141 | 127 | |
142 | 128 | configure_requires $module, $version; |
143 | 129 | # on 'configure' => sub { requires $module, $version } |
144 | 130 | |
145 | 131 | build_requires $module, $version; |
146 | 132 | # on 'build' => sub { requires $module, $version }; |
147 | 133 | |
148 | 134 | test_requires $module, $version; |
149 | 135 | # on 'test' => sub { requires $module, $version }; |
150 | 136 | |
151 | 137 | author_requires $module, $version; |
152 | 138 | # on 'develop' => sub { requires $module, $version }; |
153 | 139 | |
154 | 140 | =begin original |
155 | 141 | |
156 | 142 | Shortcut for C<requires> in specific phase. This is mainly provided |
157 | 143 | for compatibilities with L<Module::Install> DSL. |
158 | 144 | |
159 | 145 | =end original |
160 | 146 | |
161 | 147 | 特定のフェーズのC<requires>のショートカットです。主に、L<Module::Install>のDSL |
162 | 148 | と互換性をもたせるために提供されています。 |
163 | 149 | |
164 | 150 | =back |
165 | 151 | |
166 | 152 | =head1 USAGE |
167 | 153 | |
168 | 154 | =begin original |
169 | 155 | |
170 | 156 | C<cpanfile> is a format to describe dependencies. How to use this file |
171 | 157 | is dependent on the tools reading/writing it. |
172 | 158 | |
173 | 159 | =end original |
174 | 160 | |
175 | 161 | C<cpanfile> は、依存を記述するためのフォーマットです。このファイルの使い方は |
176 | 162 | それを読む/書くツールに依存します。 |
177 | 163 | |
178 | 164 | =begin original |
179 | 165 | |
180 | 166 | Usually, you're expected to place the C<cpanfile> in the root of the |
181 | 167 | directory containing the associated code. |
182 | 168 | |
183 | 169 | =end original |
184 | 170 | |
185 | 171 | 普通、C<cpanfile>を関連するコードが含まれているルートディレクトリに置くと |
186 | 172 | 予期します。 |
187 | 173 | |
188 | 174 | =begin original |
189 | 175 | |
190 | 176 | Tools supporting C<cpanfile> format (e.g. L<cpanm> and L<carton>) will |
191 | 177 | automatically detect the file and install dependencies for the code to |
192 | 178 | run. |
193 | 179 | |
194 | 180 | =end original |
195 | 181 | |
196 | 182 | C<cpanfile>フォーマットをサポートするツール(例: L<cpanm>やL<carton>)は、 |
197 | 183 | ファイルを自動的に見つけ、実行するコードのために依存をインストールします。 |
198 | 184 | |
199 | 185 | =begin original |
200 | 186 | |
201 | 187 | There are also tools to support converting cpanfile to CPAN toolchain |
202 | 188 | compatible formats, such as L<Module::CPANfile>, |
203 | 189 | L<Dist::Zilla::Plugin::Prereqs::FromCPANfile>, |
204 | 190 | L<Module::Install::CPANfile>, so that C<cpanfile> can be used to |
205 | 191 | describe dependencies for a CPAN distribution as well. |
206 | 192 | |
207 | 193 | =end original |
208 | 194 | |
209 | 195 | cpanfileをCPANツールチェインと互換性のあるフォーマットに変換するツールも |
210 | 196 | あります。L<Module::CPANfile>、 |
211 | 197 | L<Dist::Zilla::Plugin::Prereqs::FromCPANfile>、 |
212 | 198 | L<Module::Install::CPANfile>などです。 そのため、C<cpanfile>は、 |
213 | 199 | CPANディストリビューションの依存性を記述するためにも使えます。 |
214 | 200 | |
215 | 201 | =head1 AUTHOR |
216 | 202 | |
217 | 203 | Tatsuhiko Miyagawa |
218 | 204 | |
219 | 205 | =head1 ACKNOWLEDGEMENTS |
220 | 206 | |
221 | 207 | =begin original |
222 | 208 | |
223 | 209 | The format (DSL syntax) is inspired by L<Module::Install> and |
224 | 210 | L<Module::Build::Functions>. |
225 | 211 | |
226 | 212 | =end original |
227 | 213 | |
228 | 214 | このフォーマット(DSLシンタックス)は、L<Module::Install> と |
229 | 215 | L<Module::Build::Functions>にインスパイアされています。 |
230 | 216 | |
231 | 217 | =begin original |
232 | 218 | |
233 | 219 | C<cpanfile> specification (this document) is based on Ruby's |
234 | 220 | L<Gemfile|http://bundler.io/v1.3/man/gemfile.5.html> specification. |
235 | 221 | |
236 | 222 | =end original |
237 | 223 | |
238 | 224 | C<cpanfile> の仕様(このドキュメント) は Ruby の |
239 | 225 | L<Gemfile|http://bundler.io/v1.3/man/gemfile.5.html> の仕様に基づいています。 |
240 | 226 | |
241 | 227 | =head1 SEE ALSO |
242 | 228 | |
243 | 229 | L<CPAN::Meta::Spec> L<Module::Install> L<Carton> |
244 | 230 | |
245 | 231 | |
246 | 232 | =cut |