CentOS7でunboundのrpmを作る

いま借りてるCent7でunboundをyum installすると、1.4系が入ってくる。 これは脆弱性がある古いバージョンらしいので、1.5系が欲しい。 CentOS6ならば以下のFedoraのepelに1.5系のrpmがあったんだけど、CentOS7はなさそう。

http://dl.fedoraproject.org/pub/epel/6/x86_64/unbound-1.5.1-1.el6.x86_64.rpm

unboundの最新版が欲しくて、以下のサイトを参考にrpmを作ってみることにした。

heartbeats.jp

上記のURLとは対応バージョンが異なるので、バージョンの記載だけ変更する。

rpmbuildをすると以下のエラーが。

checking for libevent... configure: error: Cannot find the libevent library in /usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr
You can restart ./configure --with-libevent=no to use a builtin alternative.
Please note that this alternative is not as capable as libevent when using
large outgoing port ranges.
エラー: /var/tmp/rpm-tmp.ud07R2 の不正な終了ステータス (%prep)

libeventは/usr/lib64にあったんだけど、そこをみてくれていないみたい。 rpmbuildの変数とかは大丈夫そうなんだけど。。。

[foxtrot@test src]$ rpmbuild --showrc | grep 64
〜
-14: _libdir    %{_prefix}/lib64
〜

configureをみてみると以下の記載が。。

  --with-libevent=pathname
                          use libevent (will check /usr/local /opt/local
                          /usr/lib /usr/pkg /usr/sfw /usr or you can specify
                          an explicit path). Slower, but allows use of large
                          outgoing port ranges.

pathnameをspecファイルに追加してあげればよいのかと、以下のように変更した

--with-libevent=/usr/lib64

けれどもいっこうにエラーは解消せず、同じメッセージばかり。pathの書き方をいろいろ変えてみたけど、同じだった。 仕方なく力技で/usr/lib配下にシンボリックリンクを作ってあげたら、通るようになった。

sudo ln -s /usr/lib64/libevent-2.0.so.5 /usr/lib/libevent

rpmファイルはできたけど、果たしてこれで動くのやら。

[root@test unbound-1.5.7]# ls /root/rpmbuild/RPMS/x86_64/unbound*
/root/rpmbuild/RPMS/x86_64/unbound-1.5.7-1.el7.centos.x86_64.rpm  /root/rpmbuild/RPMS/x86_64/unbound-debuginfo-1.5.7-1.el7.centos.x86_64.rpm

明日以降頑張ってみる。