=encoding euc-jp =head1 名前 pp - Perl パッケージャ (Perl Packager) =head1 概要 B S<[ B<-BILMSVXdeghilmoprsv> ]> S<[ I | I ]>... =head1 オプション % pp hello # 'hello'を実行可能形式の'a.out'にパックする % pp -o hello hello.pl # 'hello.pl'を実行可能形式'hello'にパックする % pp -o foo foo.pl bar.pl # 'foo.pl'と'bar.pl'を'foo'にパックする % ./foo # 'foo'の中の'foo.pl'を実行 % mv foo bar; ./bar # 'foo'の中の'bar.pl'を実行 % mv bar baz; ./baz # エラー:perlスクリプト"baz"を開けない % pp -p file # PARファイル'file.par'を作成 % pp -o hello file.par # 'file.par'を実行可能形式'hello'にパック % pp -S -o hello file # 上の2ステップを結合 % pp -p -o out.par file # 'file'から'out.par'を作成 % pp -B -p -o out.par file # 同上、だがコアモジュールをバンドルする # (-B は実行ファイル作成を想定している) % pp -e 'print q//' # one-linerを'a.out'にパック % pp -p -e 'print q//' # PARファイル'a.out.par'を作成 % pp -I /foo hello # パスの追加 (-Iの後にスペースを入れる) % pp -M Foo::Bar hello # モジュールの追加 (-Mの後にスペースを入れる) % pp -M abbrev.pl hello # @INC下のファイルを追加 % pp -X Foo::Bar hello # モジュールを排除 (-Xの後ろにスペースを入れる) % pp -r hello # 'hello'を'a.out'にパックし、'a.out'を実行 % pp -r hello a b c # 'hello'を'a.out'にパックし、 # 引数'a b c'をつけて'a.out'を実行 % pp hello --log=c # 'hello'を'a.out'にパックし、ログメッセージを # 'c'に残す # 'hello'をアイコン付きでコンソールを使用しない'out.exe'にパック(Win32のみ) % pp --gui --icon hello.ico -o out.exe hello =head1 説明 F creates standalone executables from Perl programs, using the compressed packager provided by L, and dependency detection heuristics offered by L. Source files are compressed verbatim without compilation. Fは、Perlのプログラムからスタンドアローンな実行可能ファイルを作成する。 これはLによって提供される圧縮されたパッケージャーと、 Lによって提供される依存関係発見方法を利用している。 ソースファイルはコンパイル無しに逐語的に圧縮される。 You may think of F as "F that works without hassle". :-) あなたはFのことを"混乱せずに動くF"と思うかもしれないが(笑) It does not provide the compilation-step acceleration provided by F (although a ByteLoader variant of F is entirely possible), but makes up for it with better reliability, smaller executable size, and full retrieval of original source code. Fが持っているコンパイルステップアクセラレーションは提供していない (FのByteLoader変種は完全に可能だとしても)。しかし、より信頼性が 高く、小さな実行可能サイズ、そして元のソースファイルを完全に復元する という点でこのことは補われている。 If a single input program is specified, the resulting executable will behave identically as that program. However, when multiple programs are packaged, the produced executable will run the one that has the same basename as C<$0> (i.e. the filename used to invoke it). If nothing matches, it dies with the error C. 入力プログラムが一つ指定されると、生成される実行ファイルは、そのプログラム として振舞う。しかし、複数のプログラムをパッケージした場合、生成される 実行ファイルは、C<$0>と同じベースネームを持つファイルとして実行される (つまり、それを呼び出すために使用されるファイル名ということ)。もし マッチするものが無いと、Cというエラーになる。 On Microsoft Windows platforms, F is used instead of F as the default executable name. MicrosoftのWindowsプラットフォームでは、Fの代わりにFが デフォルトの実行ファイル名として使われる。 =head1 オプション Options are available in a I form and a I form. For example, the three lines below are all equivalent: オプションはI形式とI形式とが利用できる。例えば、 下の三行は全て等価である: % pp -o output.exe input.pl % pp --output output.exe input.pl % pp --output=output.exe input.pl =over 4 =item B<-M>, B<--add>=I|I Adds the specified module into the package, along with its dependencies. Also accepts filenames relative to the C<@INC> path; i.e. C<-M Module::ScanDeps> means the same thing as C<-M Module/ScanDeps.pm>. 指定したモジュールを、依存物と一緒にパッケージに追加する。 また、C<@INC>に関連するファイル名も受け入れる;つまり、C<-M Module::ScanDeps>はC<-M Module/ScanDeps.pm>と同じ事を意味する。 If I does not have a C<.pm>/C<.ix>/C<.al> extension, it will not be scanned for dependencies, and will be placed under C instead of C inside the PAR file. Iが拡張子C<.pm>/C<.ix>/C<.al>を持たない場合、依存関係は 走査されない。そしてPARファイル内のCの代わりに、C下に置かれる。 =item B<-B>, B<--bundle> Bundles core modules in the resulting package. This option is enabled by default, except when C<-p> is specified and C<-o> is unspecified. 生成されるパッケージにコアモジュールをバンドルする。このオプションは デフォルトで発揮される。C<-p>が指定され、C<-o>が指定されていないときは除く。 =item B<-d>, B<--dependent> Reduce the executable size by not including a copy of perl interpreter. Executables built this way will need a separate F or F to function correctly. This option is only available if perl is built as a shared library. perlインタプリタのコピーを含めないことで実行ファイルのサイズを削減する。 この方法でつくられた実行ファイルが正しく機能するためには、別途Fか Fを必要とする。このオプションはperlが共有ライブラリとして構築 されているときにのみ利用できる。 =item B<-e>, B<--eval>=I Package a one-liner, much the same as C Cとほぼ同じワンライナーをパッケージ。 =item B<-X>, B<--exclude>=I Excludes the given module from the dependency search patch and from the package. 与えられたモジュールを依存関連の走査パッチとパッケージから取り除く。 =item B<-g>, B<--gui> Build an executable that does not have a console window. This option is ignored on non-MSWin32 platforms or when C<-p> is specified. コンソールウィンドウを持たない実行ファイルを構築する。このオプションは 非MSWIN32プラットフォーム上、あるいはC<-p>を指定したときには無視される。 =item B<-h>, B<--help> Shows basic usage information. 基本的な使用方法を表示 =item B<-i>, B<--icon>=I Specify an icon file for the executable. This option is ignored on non-MSWin32 platforms or when C<-p> is specified. 実行ファイル用のアイコンを指定。このオプションは非MSWIN32 プラットフォーム上、あるいはC<-p>を指定したときには無視される。 =item B<-I>, B<--lib>=I Adds the given directory to the perl library file search path. 与えられたディレクトリをperlのライブラリファイルファイル検索パスに追加する。 =item B<-l>, B<--link>=I|I Adds the given shared library (a.k.a. shared object or DLL) into the packed file. Also accepts names under library paths; i.e. C<-l ncurses> means the same thing as C<-l libncurses.so> or C<-l /usr/local/lib/libncurses.so> in most Unixes. 与えられた共有ライブラリ(つまり共有オブジェクトやDLL)をパックされた ファイルに加える。ライブラリパス下の名前も受け付ける;すなわち、 C<-l ncurses>は、ほとんどのUNIXシステムにおけるC<-l libncurses.so>や C<-l /usr/local/lib/libncurses.so>と同じことを意味する。 =item B<-L>, B<--log>=I Log the output of packaging to a file rather than to stdout. パッケージングの出力を、標準出力ではなくファイルに記録する。 =item B<-m>, B<--multiarch> Build a multi-architecture PAR file. Implies B<-p>. マルチアーキテクチャなPARファイルを構築する。B<-p>を含む。 =item B<-o>, B<--output>=I Specifies the file name for the final packaged executable. 最終的にパックされる実行可能ファイルのファイル名を指定。 =item B<-p>, B<--par> Create PAR archives only; do not package to a standalone binary. PARアーカイブだけを生成;スタンドアローンなバイナリファイルにはしない。 =item B<-r>, B<--run> Run the resulting packaged script after packaging it. 最終的にパッケージされたスクリプトを、パッケージ後に実行する。 =item B<-S>, B<--save> Do not delete generated PAR file after packaging. 生成されたPARファイルをパッケージ後に削除しない。 =item B<-s>, B<--sign> Cryptographically sign the generated PAR or binary file using L. Lを使って、生成されたPARファイルやバイナリファイルに 暗号形式のサインをつける。 =item B<-v>, B<--verbose>[=I] Increase verbosity of output; I is an integer from C<0> to C<5>, C<5> being the most verbose. Defaults to C<1> if specified without an argument. 冗長な出力を増す;IはC<0>からC<5>までの整数で、C<5>が最も饒舌。 引数を指定しない場合は、デフォルトでC<1>になる。 =item B<-V>, B<--version> Display the version number and copyrights of this program. このプログラムのバージョン番号と著作権を表示。 =back =head1 環境 =over 4 =item PP_OPTS Command-line options (switches). Switches in this variable are taken as if they were on every F command line. コマンドラインオプション(スイッチ)。この変数におけるスイッチは 毎回、Fのコマンドラインであるかのように扱われる。 =back =head1 注意 Here are some recipes showing how to utilize F to bundle F with all its dependencies, on target machines with different expected settings: これは、Fを使ってFをその依存物と一緒にバンドルする 方法を示したレシピである。様々に想定された環境のマシンを対象としている: =over 4 =item Stand-alone setup スタンドアローンファイルのセットアップ % pp -o packed.exe source.pl # packed.exeを生成 # これで目標のマシンに'packed.exe'が展開される… $ packed.exe # 実行 =item Perl interpreter only, without core modules: Perlインタープリタのみでコアモジュールは無し: % pp -B -p source.pl # source.parを作成 % par.pl -B -Opacked.pl source.par # packed.plを作成 # これで目標のマシンに'packed.pl'が展開される… $ perl packed.pl # 実行 =item Perl with core module installed: インストールされているコアモジュール付きのPerl: % pp -p source.pl # source.parを作成 % par.pl -b -Opacked.pl source.par # packed.plを作成 # これで目標のマシンに'packed.pl'が展開される… $ perl packed.pl # run it =item Perl with PAR.pm and its dependencies installed: PAR.pmとインストールされいている依存物を伴ったPerl % pp -p source.pl # source.parの作成 % echo "use PAR 'source.par';" > packed.pl; % cat source.pl >> packed.pl; # packed.plの作成 # これで目標のマシンに'source.par'と'packed.pl'が展開される… $ perl packed.pl # 実行 =back Note that even if your perl was built with a shared library, the 'Stand-alone setup' above will I need a separate F or F to function correctly. Use C<--dependent> if you are willing to ship the shared library with the application, which can significantly reduce the executable size. 注意して欲しいのだが、もしあなたのperlが共有ライブラリと一緒に構築されている場合、 上の'スタンドアローンセットアップ'が正しく動作するために別途Fや Fを必要とはしない。そのアプリケーションと一緒に共有ライブラリを 送りたい場合は、C<--dependent>を使うこと。これにより実行ファイルのサイズを 小さくするという重要なことが可能になる。 =head1 参考 L, L, L, L, L =head1 謝辞 Simon Cozens, Tom Christiansen and Edward Peschko for writing F; this program try to mimic its interface as close as possible, and copied liberally from their code. FはSimon Cozens、Tom ChristiansenそしてEdward Peschko によって書かれた;このプログラムはそのインターフェースを可能な 限りそっくりに真似ており、寛大にもそのコードからコピーをさせて もらっている。 Jan Dubois for writing the F utility, which has been partially adapted into the C<-g> flag. FユーティリティはJan Duboisによって書かれた。これは 一部C<-g>フラグに適合するようにしてある。 Mattia Barbon for providing the C binary loader code. CバイナリローダーのコードはMattia Barbonによって提供された。 Jeff Goff for suggesting the name C. Cという名前はJeff Goffが提案してくれた。 =head1 作者 Autrijus Tang Eautrijus@autrijus.orgE L is the official PAR website. You can write to the mailing list at Epar@perl.orgE, or send an empty mail to Epar-subscribe@perl.orgE to participate in the discussion. Please submit bug reports to Ebug-par@rt.cpan.orgE. =head1 著作権 Copyright 2002, 2003 by Autrijus Tang Eautrijus@autrijus.orgE. Neither this program nor the associated L program impose any licensing restrictions on files generated by their execution, in accordance with the 8th article of the Artistic License: このプログラム及びLプログラムに関連するものはどちらも、これら によって生成されたファイルに対し、いかなるライセンス制限も課さない。 これはArtistic Licenseの第八条に従う: "Aggregation of this Package with a commercial distribution is always permitted provided that the use of this Package is embedded; that is, when no overt attempt is made to make this Package's interfaces visible to the end user of the commercial distribution. Such use shall not be construed as a distribution of this Package." このパッケージを商用配布と組みあわせるのはつねに許されています、 もしこの「パッケージ」の利用方法が埋めこみであれば、すなわち、この 「パッケージ」のインターフェイスがその商用配布のエンドユーザーに 見えるようにしようとするのでなければ。このような利用方法はこの パッケージの配布と解釈されません。 [ 翻訳は 大原氏によるものから転載 Copyright (C) 2001 大原雄馬 ] Therefore, you are absolutely free to place any license on the resulting executable, as long as the packed 3rd-party libraries are also available under the Artistic License. それゆえ、最終的に生成される実行ファイルに対し、いかなるライセンスを 置く絶対的自由があなたにはある。ただし、パックされたサードパーティの ライブラリもArtistic Licenseの下に利用可能である限りは。 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See L