Net::Pcapのビルドでハマる
Xubuntu 12.04でNet::PcapモジュールをCPANからインストールしようとしたら、makeに失敗。
こんなエラーが出ていた。
looking for -lpcap... no - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - You appear to lack the pcap(3) library. If it is installed in a non-standard location, please try setting the LIBS and INC values on the command line. Or get the sources and install the pcap library from http://www.tcpdump.org/ If you install the pcap library using a system package, make sure to also install the corresponding -devel package, which contains the C headers needed to compile this module. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
libpcapの開発用ファイルがないからだと思って、libpcap0.8-devパッケージをインストールしてみたが、それでも失敗。
http://stackoverflow.com/questions/7489966/cpan-installing-netpcap-and-packet-module-failed-due-to-lpcap を参考にMakefile.PLを叩いたがそれでも失敗。
ラチがあかないのでUbuntuレポジトリのビルド済みパッケージlibnet-pcap-perlの中身を見ると、
0001-Append-CCFLAGS-to-Config-ccflags-instead-of-overridi.patchというパッチでMakefile.PLが修正されていた。
どうやらExtUtils::MakeMakerのバグ? https://rt.cpan.org/Public/Bug/Display.html?id=68613 が関係しているらしい。
ビルド済みパッケージはこういう時ほんとありがたい。