Debian (sid) で Plagger を使う ― 2007年02月17日
Plaggerを使ってみようと、PlaggerQuickStartにある Debian 用の apt line を試してみる。
% sudo apt-get -s install libplagger-perl 以下のパッケージには満たせない依存関係があります: libplagger-perl: 依存: libkinosearch-perl しかし、インストールされようとしていません 依存: libtext-language-guess-perl しかし、インストールされようとしていません 依存: libxango-perl (>= 1.04) しかし、インストールすることができません E: 壊れたパッケージ
しょうがないので自分でパッケージ化することにする。dh-make-perl コマンドを使うと、 CPAN からモジュールのソースコードを取得して、それから Debian のパッケージ化に 必要な情報の抽出、ファイルの作成を自動的にやってくれる。
% dh-make-perl --cpan Plagger (いろいろ省略) Found: Plagger 0.7.17 (libplagger-perl arch=all) ====================================================================== Could not find the dependencies for the requested module Module::Depends::Intrusive reports: syntax error at /home/mickn/work/perl/plagger/Plagger-0.7.17/Makefile.PL line 101, near "tests 't/*.t t/*/*.t t/*/*/*.t'" Bareword "use_test_base" not allowed while "strict subs" in use at /home/mickn/work/perl/plagger/Plagger-0.7.17/Makefile.PL line 103. Bareword "auto_include" not allowed while "strict subs" in use at /home/mickn/work/perl/plagger/Plagger-0.7.17/Makefile.PL line 105. Bareword "auto_install" not allowed while "strict subs" in use at /home/mickn/work/perl/plagger/Plagger-0.7.17/Makefile.PL line 106. Bareword "WriteAll" not allowed while "strict subs" in use at /home/mickn/work/perl/plagger/Plagger-0.7.17/Makefile.PL line 110. Compilation failed in require at /usr/share/perl5/Module/Depends/Intrusive.pm line 76. Generated error: Error: syntax error at /home/mickn/work/perl/plagger/Plagger-0.7.17/Makefile.PL line 101, near "tests 't/*.t t/*/*.t t/*/*/*.t'" Bareword "use_test_base" not allowed while "strict subs" in use at /home/mickn/work/perl/plagger/Plagger-0.7.17/Makefile.PL line 103. Bareword "auto_include" not allowed while "strict subs" in use at /home/mickn/work/perl/plagger/Plagger-0.7.17/Makefile.PL line 105. Bareword "auto_install" not allowed while "strict subs" in use at /home/mickn/work/perl/plagger/Plagger-0.7.17/Makefile.PL line 106. Bareword "WriteAll" not allowed while "strict subs" in use at /home/mickn/work/perl/plagger/Plagger-0.7.17/Makefile.PL line 110. Compilation failed in require at /usr/share/perl5/Module/Depends/Intrusive.pm line 76. Please check if your module depends on Module::Install for its build process - Automatically finding its dependencies is unsupported, please specify them manually using the 'depends' option. ======================================================================
うへ。依存情報の抽出に失敗しているっぽい。エラーメッセージを良く見ると、use_test_base などの「キーワード」の認識に失敗しているらしい。
dh-make-perl は perl で書かれたスクリプトなので、/usr/bin/dh-make-perl を表示して眺めてみると、Module::Depends::Intrusive というモジュールを使って依存情報を抽出しているようだ。
次に、perldoc Module::Depends::Intrusive でマニュアルを読んだり、perldoc -m Module::Depends::Intrusive でモジュールのソースコードを読んでみると、このモジュールは、ExtUtils::MakeMaker や Module::Build、Module::Install (inc::Module::Install) といった Makefile.PL や Build.PL で使われるモジュールのメソッドを自前の物に差しかえ、依存情報の宣言を行うメソッドの処理を横取りし、必要な情報を集めている。
Plagger は Makefile.PL で inc::Module::Install を使っているので、Debian sid にある 0.10 では該当するところを読んでみると、requires と build_requires しか横取りしていない。
CPAN にある Module::Depends の最新版である 0.11 では all_from、auto_install などなどのメソッドも横取りしている。ただ、Plagger でエラーの出た use_test_base などのメソッドについては横取り宣言をしていない。そこで、use_test_base、auto_include、tests の3つを横取りするように、Module::Depends を書きかえてみる。
% dh-make-perl --cpan Module::Depends (略) % cd Module-Depends-0.11 % vi debian/changelog (Debian official の deb が更新された場合を考え、0.11-1 を 0.11-0 に書きかえる) % debuild -rfakeroot -us -uc (略) dh_clean -k # Add commands to install the package into debian/ACKAGE_NAME here /usr/bin/perl Build test t/depends.... # Failed test 'Template::Extract Module::Install requires' # in t/depends.t at line 73. # Structures begin differing at: # $got->{Test::More} = '0' # $expected->{Test::More} = Does not exist # Looks like you failed 1 test of 17. dubious Test returned status 1 (wstat 256, 0x100) DIED. FAILED test 17 Failed 1/17 tests, 94.12% okay Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/depends.t 1 256 17 1 5.88% 17 Failed 1/1 test scripts, 0.00% okay. 1/17 subtests failed, 94.12% okay. make: *** [install-stamp] エラー 1
先は長い。
コメント
トラックバック
※トラックバックの受付件数を超えているため、この記事にトラックバックを投稿することができません。
コメントをどうぞ
※メールアドレスとURLの入力は必須ではありません。 入力されたメールアドレスは記事に反映されず、ブログの管理者のみが参照できます。
※なお、送られたコメントはブログの管理者が確認するまで公開されません。
※投稿には管理者が設定した質問に答える必要があります。