homebrew-core/Formula/dnsdist.rb

56 lines
1.9 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.6.0.tar.bz2"
sha256 "a7783a04d8d4ad2b0168ffaaf85ef95d5f557057b0462280684dd799d0cdd292"
license "GPL-2.0-only"
revision 1
livecheck do
url "https://downloads.powerdns.com/releases/"
regex(/href=.*?dnsdist[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 arm64_big_sur: "81b870ee49e98a796ac239d1e2f3676ce38a7c5f02945102ca2a4a382d6411f3"
sha256 big_sur: "48492b51a983e3b1c097d2debb98e4888fdf458543c3b19d6cdd5b62bdd0a2ff"
sha256 catalina: "17065d7729a4cda1d599acf95b36ca657d27728ecbc202ea9594888487ba1190"
sha256 mojave: "cd8f596aa6e4bb0b11d0a2bea8e1129ddda3ff47d8ee8e4a0dc699e318dd3d9b"
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-openresty"
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