homebrew-core/Formula/dnsdist.rb
2017-12-06 03:54:21 -08:00

41 lines
1.5 KiB
Ruby

class Dnsdist < Formula
desc "Highly DNS-, DoS- and abuse-aware loadbalancer"
homepage "https://www.dnsdist.org/"
url "https://downloads.powerdns.com/releases/dnsdist-1.2.0.tar.bz2"
sha256 "9885c9ee8ac7076aede586ea58d4642eb877e7b2d76c902254494e2a5a5faa78"
revision 1
bottle do
sha256 "d23cd225aeb66390e5276bcd9cc3a6bf13384aedcb6c734aa646e76a75df2199" => :high_sierra
sha256 "bef25797c66ad3d829df4b4b7cbfaf3f9c1182b6698fed1bf0394e003f01b5fa" => :sierra
sha256 "f9391933f666eead5287f59fd9fc93c13c917dff27c533a6a28c7ee2b2b07481" => :el_capitan
end
depends_on "boost" => :build
depends_on "pkg-config" => :build
depends_on "lua"
def install
# error: unknown type name 'mach_port_t'
ENV["SDKROOT"] = MacOS.sdk_path if MacOS.version == :sierra
if MacOS.version == :high_sierra
sdk = MacOS::CLT.installed? ? "" : MacOS.sdk_path
ENV["LIBEDIT_CFLAGS"] = "-I#{sdk}/usr/include -I#{sdk}/usr/include/editline"
ENV["LIBEDIT_LIBS"] = "-L/usr/lib -ledit -lcurses"
end
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}",
"--without-net-snmp",
"--sysconfdir=#{etc}/dnsdist"
system "make", "install"
end
test do
(testpath/"dnsdist.conf").write "setLocal('127.0.0.1')"
output = shell_output("#{bin}/dnsdist -C dnsdist.conf --check-config 2>&1")
assert_equal "Configuration 'dnsdist.conf' OK!", output.chomp
end
end