これは何?
tagomorisさんのfluent-agent-liteをRHEL/CentOSにインストールする際には、
https://github.com/tagomoris/fluent-agent-lite
README.mdにあるINSTALL -> RHEL/CentOSに従ってrpmをビルドすることになります。
が、僕のやり方がまずかったのか、ビルド手順の下記で2回ほどつまづきました。
- run 'rpmbuild -ba SPECS/fluent-agent-lite.spec'
修正箇所はPull requestしたので取り込まれる間までのメモ
(内容間違ってたら取り込まれないかもしれないけど)
READMEより引用したrpmのビルド手順はこちら。
via. https://github.com/tagomoris/fluent-agent-lite
RHEL/CentOS
To build your rpm package, do 5 steps below.
- Download (newest version) tarball, and place it on SOURCES/ .
- Download package/fluent-agent-lite.conf, and place it on SOURCES/ .
- Fix SOURCES/package/fluent-agent-lite.conf as you want (ex: server name or servers list), and add servers list for your own.
- Download SPECS/fluent-agent-lite.spec, and place it on SPECS/ .
- run 'rpmbuild -ba SPECS/fluent-agent-lite.spec'
To install each RHEL/CentOS host, use yum server, or copy and rpm -i on each host.
NOTE: yum install perl-devel and QA_RPATHS=$[0x001] rpmbuild -ba may help you if rpmbuild fails on your build environment.
fluent-agent-liteをRHEL/CentOSインストール時に詰まるとこ2箇所
[PRがmergeされたので再発しません] 1. cpamnを取ってくるところ
エラー内容
# rpmbuild -ba SPECS/fluent-agent-lite.spec
(snip)
Can't locate object method "Internal" via package "Server" (perhaps you forgot to load "Server"?) at /root/rpmbuild/BUILDROOT/fluent-agent-lite-1.0-original.x86_64/usr/local/fluent-agent-lite/bin/cpanm line 1.
error: Bad exit status from /var/tmp/rpm-tmp.BbU1TC (%install)
原因
cpanmの中身が
Internal Server Error
となっている。
cpanmは下記install.shで、配布元からcurlで取得している。
curl -s -L http://xrl.us/cpanm > $INSTALLDIR/bin/cpanm
http://xrl.us/cpanm
にアクセスすると500 Internal Server Errorが返ってきていた。
(2015/08/18時点に確認、19日には復旧していた)
そして、配布元を確認すると、
via. https://github.com/miyagawa/cpanminus の"Downloading the standalone executable"
から取得するのがいいみたい。
(8/18時点でもこちらからはcpanmが取得出来ていました)
README.mdのHistoryを確認すると、下記で書き換わっていた。
https://github.com/miyagawa/cpanminus/commit/fa971c02a9d3f857c5c0576aa43365f66d495f18#diff-04c6e90faac2675aa89e2176d2eec7d8
対応
Pull requestが受け入れられるまでの暫定対応
install.sh内のcpanmのURLを置き換える
-curl -s -L http://xrl.us/cpanm > $INSTALLDIR/bin/cpanm
+curl -s -L http://cpanmin.us > $INSTALLDIR/bin/cpanm
via. https://github.com/tagomoris/fluent-agent-lite/pull/26/files
8/19時点でhttp://xrl.us/cpanmも復旧しているので、
受け入れられなかった場合は都度対応でもいいかもね。
2. %install 後の check-buildroot でコケる
メモを無くしてしまったので詳細書けず。。
https://gist.github.com/sonots/9225542
こちらを参考に
export QA_SKIP_BUILD_ROOT=1
してからrpmbuildすることで解決出来ました。