homebrew-core/Formula/dnsdist.rb

54 lines
1.8 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.5.1.tar.bz2"
sha256 "cae759729a87703f4d09b0ed4227cb224aaaa252fa92f2432fd7116f560afbf1"
revision 1
livecheck do
url "https://downloads.powerdns.com/releases/"
regex(/href=.*?dnsdist[._-]v?(\d+(?:\.\d+)*)\.t/i)
end
bottle do
sha256 big_sur: "85f26051fea25986ed2510c18ab9dcc29178c7a6acc4cdd01aa2fc3bf086c88a"
sha256 catalina: "61ec7c2d3aa37965c54474ba50f739658679d2dac84e46854e0ca6fbdf9b0058"
sha256 mojave: "821cb52f93b00d1f596e40a9d905f2d7a01fbd26e44bbf48299b5123ed5bc7d6"
end
depends_on "boost" => :build
depends_on "pkg-config" => :build
depends_on "cdb"
depends_on "fstrm"
depends_on "h2o"
depends_on "libsodium"
depends_on "luajit"
depends_on "openssl@1.1"
depends_on "protobuf"
depends_on "re2"
uses_from_macos "libedit"
def install
# error: unknown type name 'mach_port_t'
ENV["SDKROOT"] = MacOS.sdk_path if MacOS.version == :sierra
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}",
"--without-net-snmp",
"--enable-dns-over-tls",
"--enable-dns-over-https",
"--enable-dnscrypt",
"--with-re2",
"--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