=encoding utf8 =head1 NAME cpanfile-faq - cpanfile FAQ =head1 QUESTIONS (質問) =begin original =head2 Does cpanfile replace Makefile.PL/Build.PL or META.yml/json? =end original =head2 cpanfile は Makefile.PL/Build.PL や META.yml/json を置き換えますか? =begin original No, it doesn't. C is a simpler way to declare CPAN dependencies, mainly for I rather than CPAN distributions. =end original いいえ、Cは、単純にCPANの依存を宣言する方法です。 CPANディストリビューションよりもむしろ、主にI<あなたのアプリケーション> のためのものです。 =begin original However, while CPAN distributions do not need to B to C, you can certainly I the dependencies in C, then export them into C files when shipping to CPAN, using tools such as L or L =end original しかしながら、CPANディストリビューションCにB<切り替える>必要が ないとはいえ、確かに、Cで依存をI<管理>できます。それから、CPANに シッピングするときに、LやLのような ツールを使って、その依存をCファイルにエクスポートできます。 =begin original =head2 Why do we need yet another format? =end original =head2 なぜ、別のフォーマットが必要なのでしょう? =begin original Here are some of the reasons that motivates the new L format. =end original 新しくLフォーマットを作る動機となる理由がいくつかあります。 =over 4 =item Not everything is a CPAN distribution (すべてがCPANディストリビューションではない) =begin original First of all, it is annoying to write (a dummy) C when what you develop is not a CPAN distribution, just so that installation like C would work. =end original まず最初に、CPANディストリビューションでないものを開発をするときに、 単に、C のようにが動かしたいがために、 (ダミーの)Cを書くのは面倒です。 =begin original It gets more painful when you develop a web application that you want to deploy on a different environment using version control system (such as PaaS/cloud infrastructure), because it requires you to often commit the META file or C directory (or even worse, both) to a repository. =end original (PaaS/クラウドのようなインフラで)、バージョンコントロールシステムを使って 違った環境でデプロイしたいWebアプリケーションを開発するときに、 より苦痛です。なぜなら、METAファイルかCディレクトリ(悪い時には、両方)を リポジトリに頻繁にコミットしなければならないからです。 =begin original Many web application frameworks generate a boiler-plate C for dependency declaration and to let you install dependencies with C<< cpanm --installdeps . >>, but that doesn't always mean they are meant to be installed. Things can be often much simpler if you run the application from the checkout directory. =end original 多くのWebアプリケーションフレームワークは、依存性の宣言のために、 サンプルのCを生成し、C<< cpanm --installdeps . >>で、 依存をインストールさせます。ですが、常にインストールするつもりであるとは 限りません。チェックアウトしたディレクトリからアプリケーションを 走らせるなら、多くの場合、より簡単にできます。 =begin original With L, dependencies can be installed either globally or locally using supported tools such as L or L. Because C lists all the dependencies of your entire application and will be updated over time, it makes perfect sense to commit the file to a version control system, and push the file for a deployment. =end original Lを使えば、LやLのようなLをサポートしたツール を使って、依存をグローバルにもローカルにもインストールできます。 Cはアプリケーション全体のすべての依存をリストしており、 時間が経てば更新されるでしょう。バージョンコントロールシステムにこのファイルをコミットする 完全な意義があります。そして、デプロイメントのためにファイルを置きます。 =item Familiar DSL syntax (なじみやすいDSLシンタックス) =begin original This is a new file type, but the format and syntax isn't entirely new. The metadata it can declare is exactly a subset of "Prereqs" in L. =end original これは新しいファイルタイプですが、フォーマットとシンタックスは完全に 新しいものではありません。宣言できるメタデータは、Lの "Prereqs"のサブセットです。 =begin original The syntax borrows a lot from L. Module::Install is a great way to easily declare module metadata such as name, author and dependencies. L format is simply to extract the dependencies into a separate file, which means most of the developers are familiar with the syntax. =end original シンタックスの多くはLから借りています。Module::Installは 名前や著者や依存といったモジュールのメタデータを簡単に宣言する素晴らしい方法 です。Lフォーマットは単純に依存性を別のファイルに取り出したもの なので、開発者の多くはそのシンタックスに馴染みがあるということになります。 =item Complete CPAN Meta Spec v2 support (CPAN メタスペック v2 の完全なサポート) =begin original C basically allows you to declare L prerequisite specification using an easy Perl DSL syntax. This makes it easy to declare per-phase dependencies and newer version 2 features such as conflicts and version ranges. =end original Cは、基本的に、簡単なPerlのDSLシンタックスを使って、 Lの必要条件を宣言できます。これにより、 フェーズごとの依存、コンフリクト、バージョンの範囲のような、 新しいバージョン2の機能を簡単に宣言できます。 =back =begin original =head2 How can I start using C? =end original =head2 どのようにCを使い始めますか? =begin original First of all, most distributions on CPAN are not required to update to this format. =end original まず最初に、CPANにある多くのディストリビューションはこのフォーマットに アップデートする必要はありません。 =begin original If your application currently uses C etc. for dependency declaration because of the current toolchain implementation (e.g. C<< cpanm --installdeps . >>), you can upgrade to C while keeping the build file based installation working for the backward compatibility. =end original 現在、あなたのアプリケーションが、現在のツールチェインの実装 (e.g. C<>)のために、Cなどを、 依存の宣言に使っているなら、後方互換性のために動くインストレーションに基づいた ビルドファイルを持ち続けることで、Cにアップグレードできます。 =begin original If you are an author of CPAN module and want to manage CPAN module prerequisites using C you can use one of the following tools: =end original CPANモジュールの作者で、CPANモジュールの必要条件をCを使って 管理したければ、以下のツールの一つを使うことができます。 =over 4 =item Dist::Milla =begin original L is a profile for L that has a C support to declare dependencies for your module. =end original L は、L のプロファイルです。 モジュールの依存の宣言のために、Cをサポートしています。 =item Dist::Zilla =begin original L provides a way to merge dependencies declared in C into META files as well as build files. You can combine them using other prerequisite scanners like C. =end original Lは、Cに宣言された 依存をMETAファイルに加えけてビルドファイルにも、マージする方法を提供します。 Cのような他の必要条件スキャナーを使って、それらを一体化できます。 =item Minilla =begin original L is a yet another authoring tool that supports C as a way to describe dependencies for your CPAN module. =end original Lは、また別のオーサリングツールであり、 CPANモジュールの依存を宣言するための方法としてCをサポートします。 =item Module::Install =begin original L provides a C DSL that reads C to merge prerequisites when dumping C files upon installation. =end original Lは、CDSLを読み、 インストール時にCファイルをダンプするときに、 C を必要条件にマージします。 =item Module::Build =begin original L merges C dependencies from C when dumping out MYMETA information. =end original L は Cから、MYMETAの情報を ダンプするときに、C の依存をマージします。 =item ExtUtils::MakeMaker =begin original L has no direct support for cpanfile yet, but you could use L's C method to update C files with the contents in C, or convert the structure to appropriate options with L and C for C. =end original L は、cpanfileを直接にはサポートしません。ですが、 L の C を使って、 C ファイルを、Cの内容で更新するか、 CにLとCのオプションを使って、 構造を変換できます。 =back