2014-08-21 19:58:11 +00:00
|
|
|
class Libtins < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "C++ network packet sniffing and crafting library"
|
2014-08-21 19:58:11 +00:00
|
|
|
homepage "https://libtins.github.io/"
|
2014-08-31 05:30:53 +00:00
|
|
|
url "https://github.com/mfontanini/libtins/archive/v3.1.tar.gz"
|
2015-08-03 12:55:31 +00:00
|
|
|
sha256 "20662ed75699358078aacaf36f38cbd25a9b2bd9ae2c77b7193733c917aab651"
|
2014-08-21 19:58:11 +00:00
|
|
|
head "https://github.com/mfontanini/libtins.git"
|
|
|
|
|
2014-08-21 19:58:11 +00:00
|
|
|
bottle do
|
2014-10-20 13:32:55 +00:00
|
|
|
revision 1
|
|
|
|
sha1 "3f7a5a404ce751fe953100f8a282490dec1eed2a" => :yosemite
|
|
|
|
sha1 "316b0d0b1255f9aa25b257a29f1900c49ec09046" => :mavericks
|
|
|
|
sha1 "85fb8ad451c673cb5cc918294e563525a95824ae" => :mountain_lion
|
2014-08-21 19:58:11 +00:00
|
|
|
end
|
|
|
|
|
2014-08-21 19:58:11 +00:00
|
|
|
option :cxx11
|
|
|
|
|
2014-08-31 05:30:53 +00:00
|
|
|
depends_on "cmake" => :build
|
|
|
|
|
2014-08-21 19:58:11 +00:00
|
|
|
def install
|
|
|
|
ENV.cxx11 if build.cxx11?
|
2014-08-31 05:30:53 +00:00
|
|
|
args = std_cmake_args
|
|
|
|
args << "-DLIBTINS_ENABLE_CXX11=1" if build.cxx11?
|
2014-08-21 19:58:11 +00:00
|
|
|
|
2014-08-31 05:30:53 +00:00
|
|
|
system "cmake", ".", *args
|
2014-08-21 19:58:11 +00:00
|
|
|
system "make", "install"
|
|
|
|
doc.install "examples"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.cpp").write <<-EOS.undent
|
|
|
|
#include <tins/tins.h>
|
|
|
|
int main() {
|
|
|
|
Tins::Sniffer sniffer("en0");
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
system ENV.cxx, "test.cpp", "-ltins", "-o", "test"
|
|
|
|
end
|
|
|
|
end
|