From 4173400e99ca4d88cef5a3d71a669c499fa46cca Mon Sep 17 00:00:00 2001 From: Ben Hughes Date: Tue, 7 Jul 2015 12:09:11 +0100 Subject: [PATCH] Suricata: optional libjansson support. For eve-log JSON output, pulls in jansson/libjansson. Closes Homebrew/homebrew#41448. Signed-off-by: Mike McQuaid --- Formula/suricata.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Formula/suricata.rb b/Formula/suricata.rb index 8a7a102efb..1fbde5f1e8 100644 --- a/Formula/suricata.rb +++ b/Formula/suricata.rb @@ -25,6 +25,7 @@ class Suricata < Formula depends_on "geoip" => :optional depends_on "lua" => :optional depends_on "luajit" => :optional + depends_on "jansson" => :optional resource "argparse" do url "https://pypi.python.org/packages/source/a/argparse/argparse-1.3.0.tar.gz" @@ -73,6 +74,12 @@ class Suricata < Formula args << "--with-libgeoip-libs=#{geoip.opt_lib}" end + if build.with? "jansson" + jansson = Formula['jansson'] + args << "--with-libjansson-includes=#{jansson.opt_include}" + args << "--with-libjansson-libraries=#{jansson.opt_lib}" + end + system "./configure", *args system "make", "install-full" @@ -83,6 +90,6 @@ class Suricata < Formula end test do - assert_match /#{version}/, shell_output("#{bin}/suricata --build-info") + assert_match(/#{version}/, shell_output("#{bin}/suricata --build-info")) end end