sudo cpan CPAN::Mini
minicpan -r http://ftp.funet.fi/pub/languages/perl/CPAN/ -l ~/minicpan
minicpanを優先
$ sudo cpan cpan> o conf urllist unshift file:///home/dann/minicpan cpan> o conf cpan> o conf commit cpan> q
rpmbuild で Requires の処理してる部分はコメントアウト。use, requireしているファイルを自動でrpmbuildがrequiresに加えてしまうため。
以下のファイルの224, 225行目をコメントアウト
#$require{$module}=$version;
#$line{$module}=$_;
sudo bin/cpan-packager --module Mouse --builder RPM --conf conf/config.yaml
http://angelos.g.hatena.ne.jp/dann/20090401/1238558055
以下のスクリプトでrpmを作成し、 createrepo実行でレポジトリ更新
#!/bin/sh sudo cp /tmp/cpanpackager/rpm/*.rpm /share/CentOS/5/local/i386/RPMS sudo createrepo -v /share/CentOS/5/local/i386/RPMS
sudo yum -y install perl-Mouse
しかし、これらのものは、perlのRPMに含まれているため、Scalar::List::Utils, PathToolsは、dependsから削除しなければならない。
Scalar::Utilの依存はspecファイルにもないにも関わらず、Scalar::Utilの依存が設定されてしまい、HTTP::EngineのRPMをインストールしようとすると以下のエラーとなる。
Transaction Check Error: file /usr/share/man/man3/List::Util.3pm.gz from install of perl-Scalar-List-Utils-1.19-1.cpanpackager conflicts with file from package perl-5.8.8-15.el5_2.1 file /usr/share/man/man3/Scalar::Util.3pm.gz from install of perl-Scalar-List-Utils-1.19-1.cpanpackager conflicts with file from package perl-5.8.8-15.el5_2.1
rpmbuildでperl.reqをみている。__perl_requiresをfilterすることで回避ができた。
rpmbuildは、依存モジュールがインストールされてないと、以下のようにFailed build dependenciesというエラーがでてしまう模様。依存モジュールが存在しなくても、rpm作れるようなオプションない?
それがあれば、一通りモジュールつくるってのができるけれど。なければ、ビルド順番コントロールして、依存関係を解決して、末端のモジュールからビルドとインストールする実装にかえる必要あり。
[info] build package with cpanflute
Argument "5.6.0" isn't numeric in numeric ne (!=) at /usr/lib/perl5/site_perl/5.8.8/RPM/Specfile.pm line 143.
error: Failed build dependencies:
perl(Test::Exception) is needed by perl-Mouse-0.19-1.cpanpackager.noarch
これについては、--nodepsで依存を無視できることがわかった。
パッケージ名とCPANにあがっているモジュール名のミスマッチがあるモジュールにおいて、RequiresにCPANのモジュール名でない名前がはいり、ビルドできない。
以下のようなケース。
RequiresにHTTP::Requestがはいってしまい、ビルドできず。
skip_resolve_module_name系のモジュールだったら、perl(xxx)を、resolved_module名に置換するような実装をいれればいいかも?
Error: Missing Dependency: perl(Module::Build) >= 0.2804 is needed by package perl-Module-Install Error: Missing Dependency: perl(IO::Scalar) is needed by package perl-Getopt-Long-Descriptive Error: Missing Dependency: perl(Template) >= 2.2 is needed by package perl-Module-Setup Error: Missing Dependency: perl(IO::Socket::INET) >= 1.31 is needed by package perl-Test-TCP Error: Missing Dependency: perl(Template) >= 2 is needed by package perl-Template-Plugin-TimeDate Error: Missing Dependency: perl(ExtUtils::Install) >= 1.52 is needed by package perl-Module-Install Error: Missing Dependency: perl(Template) is needed by package perl-Template-Toolkit-Simple Error: Missing Dependency: perl(Archive::Tar) >= 1.44 is needed by package perl-Module-Install Error: Missing Dependency: perl(Date::Parse) is needed by package perl-Template-Plugin-TimeDate Error: Missing Dependency: perl(IO::Scalar) is needed by package perl-Log-Dispatch-Config