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.7/bind-9.18.7.tar.xz"
|
|
sha256 "9e2acf1698f49d70ad12ffbad39ec6716a7da524e9ebd98429c7c70ba1262981"
|
|
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: "0366cdbdf6540a197af0d0907af9fa426862edb1cd6375d2882ccfd26c410cea"
|
|
sha256 arm64_big_sur: "7cf199119084b826b58faecea0165cdbbd1dbe01e71c7930e0d1ec1e51d07b60"
|
|
sha256 monterey: "a765405462d2f6159b26b968e6c4dfc9417af11be2bef86fb4c9d0c55c5ab6c4"
|
|
sha256 big_sur: "c5e213af87bd0fb236c57396a3a6eb4ec0e3aaf9b3d06c80c73a6e51054e4553"
|
|
sha256 catalina: "ab10660ddcdcd26dc9f7d41d9870f1eaaa1e00c783a86c6ae79490305b003357"
|
|
sha256 x86_64_linux: "01d731819144a0349e7a758866172b3f2bc76b3087596f819a430a4166a5dcaf"
|
|
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
|