2017-12-01 19:14:55 +00:00
|
|
|
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"
|
|
|
|
|
2017-12-03 18:04:04 +00:00
|
|
|
bottle do
|
|
|
|
sha256 "07ea5e4fa31f31987799ce7bbeaaab54cd729fb3f8dc60ad23e586f2b1787167" => :high_sierra
|
|
|
|
sha256 "0bcff265d128f4fc44022c81a240e64b477d7643bd60133263bab51e2b9eb1f7" => :sierra
|
|
|
|
sha256 "c45b7641f88e05eb96deb8d67341482e88862a3c6f069c37e112736b920df45c" => :el_capitan
|
|
|
|
end
|
|
|
|
|
2017-12-01 19:14:55 +00:00
|
|
|
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
|