97 lines
2.9 KiB
Ruby
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.5/bind-9.18.5.tar.xz"
|
|
sha256 "0cee078d74f0bdc4ec374435026b25de7892f26540a18b22a02ef728a11dcae7"
|
|
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: "d165eb76abb57579d31d961b6d9d76051f91f9c9c6c16d12c7d881e17c7b5b82"
|
|
sha256 arm64_big_sur: "8f8f9e5226175b4fb654b2d10bf632aad11c7ef28aa289547a0b1d8269e7c20f"
|
|
sha256 monterey: "2588513dd61f5689b71207eb029bda2db547da9b133edef253b5bd01be419ea9"
|
|
sha256 big_sur: "0116fc960ffbe3f0e62abe8c4dcb940abd6094457d3e149e7ea4ed9b0056b28e"
|
|
sha256 catalina: "827455fd194be4c5308e38c802bae04b30ae6ad5666b5260b0ab9187e3890707"
|
|
sha256 x86_64_linux: "de2cc9fc567375ba9ec9358c6266fc778d8cf6ecd6c43b21221b293fc4a2c39e"
|
|
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
|