homebrew-core/Formula/bind.rb

97 lines
2.9 KiB
Ruby

class Bind < Formula
desc "Implementation of the DNS protocols"
homepage "https://www.isc.org/bind/"
# BIND releases with even minor version numbers (9.14.x, 9.16.x, etc) are
# stable. Odd-numbered minor versions are for testing, and can be unstable
# or buggy. They are not suitable for general deployment. We have to use
# "version_scheme" because someone upgraded to 9.15.0, and required a
# downgrade.
url "https://downloads.isc.org/isc/bind9/9.18.6/bind-9.18.6.tar.xz"
sha256 "d43a0fed03c774d1685d203598218c0b7774a88fcc390a0170710d5feb7fbff1"
license "MPL-2.0"
version_scheme 1
head "https://gitlab.isc.org/isc-projects/bind9.git", branch: "main"
# BIND indicates stable releases with an even-numbered minor (e.g., x.2.x)
# and the regex below only matches these versions.
livecheck do
url "https://www.isc.org/download/"
regex(/href=.*?bind[._-]v?(\d+\.\d*[02468](?:\.\d+)*)\.t/i)
end
bottle do
sha256 arm64_monterey: "8ebab1b2fc3e456fe000416da99aa0678ffc570f631dfb174fe62304afc52b8f"
sha256 arm64_big_sur: "4dc8d029aa49aecd791d8c22eb8d5ff5a80375c83a11ab30a397aa57290d6a18"
sha256 monterey: "1f1704a04ac90c13cdfcb05f22af508b81fede25f3dbd9be96d5950655e2a080"
sha256 big_sur: "7519fe25cccbc9f24fce30433b533baebf5728165d929ecc639450d8fc262136"
sha256 catalina: "1c52d724d5927a4334043abd9f5bb5276163577b7983726cd479a4fa260cdd56"
sha256 x86_64_linux: "395605cf0d9653d42c5bbb0e67cfa94720a73ea6476092cef74f38693d5a5817"
end
depends_on "pkg-config" => :build
depends_on "json-c"
depends_on "libidn2"
depends_on "libnghttp2"
depends_on "libuv"
depends_on "openssl@3"
def install
args = [
"--prefix=#{prefix}",
"--sysconfdir=#{pkgetc}",
"--localstatedir=#{var}",
"--with-json-c",
"--with-libidn2=#{Formula["libidn2"].opt_prefix}",
"--with-openssl=#{Formula["openssl@3"].opt_prefix}",
"--without-lmdb",
]
args << "--disable-linux-caps" if OS.linux?
system "./configure", *args
system "make"
system "make", "install"
(buildpath/"named.conf").write named_conf
system "#{sbin}/rndc-confgen", "-a", "-c", "#{buildpath}/rndc.key"
pkgetc.install "named.conf", "rndc.key"
end
def post_install
(var/"log/named").mkpath
(var/"named").mkpath
end
def named_conf
<<~EOS
logging {
category default {
_default_log;
};
channel _default_log {
file "#{var}/log/named/named.log" versions 10 size 1m;
severity info;
print-time yes;
};
};
options {
directory "#{var}/named";
};
EOS
end
plist_options startup: true
service do
run [opt_sbin/"named", "-f", "-L", var/"log/named/named.log"]
end
test do
system bin/"dig", "-v"
system bin/"dig", "brew.sh"
system bin/"dig", "ü.cl"
end
end