homebrew-core/Formula/snort.rb
2016-06-07 02:28:43 +01:00

71 lines
1.9 KiB
Ruby

class Snort < Formula
desc "Flexible Network Intrusion Detection System"
homepage "https://www.snort.org"
url "https://www.snort.org/downloads/snort/snort-2.9.8.2.tar.gz"
sha256 "4075012d350dfa47a0200b7a920323f15cb7c370790f2a47367c03aba4009333"
bottle do
cellar :any
sha256 "770bb1f0ac42fb324dfc685aee480fd331a263444c3d3962c0b0603b4205849f" => :el_capitan
sha256 "2efee0c269ee5e986405041f18b448b61358a6aebff64fadce2ee27dc1abe6d6" => :yosemite
sha256 "d8f494f568eb79c84f2466c0bc63ad7ac49c7aed4ab6f38a88e41a4055e63d87" => :mavericks
end
option "with-debug", "Compile Snort with debug options enabled"
deprecated_option "enable-debug" => "with-debug"
depends_on "pkg-config" => :build
depends_on "luajit"
depends_on "daq"
depends_on "libdnet"
depends_on "pcre"
depends_on "openssl"
def install
openssl = Formula["openssl"]
args = %W[
--prefix=#{prefix}
--sysconfdir=#{etc}/snort
--disable-dependency-tracking
--disable-silent-rules
--enable-gre
--enable-mpls
--enable-targetbased
--enable-sourcefire
--with-openssl-includes=#{openssl.opt_include}
--with-openssl-libraries=#{openssl.opt_lib}
--enable-active-response
--enable-normalizer
--enable-reload
--enable-react
--enable-flexresp3
]
if build.with? "debug"
args << "--enable-debug"
args << "--enable-debug-msgs"
else
args << "--disable-debug"
end
system "./configure", *args
system "make", "install"
rm Dir[buildpath/"etc/Makefile*"]
(etc/"snort").install Dir[buildpath/"etc/*"]
end
def caveats; <<-EOS.undent
For snort to be functional, you need to update the permissions for /dev/bpf*
so that they can be read by non-root users. This can be done manually using:
sudo chmod 644 /dev/bpf*
or you could create a startup item to do this for you.
EOS
end
test do
system bin/"snort", "-V"
end
end