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.3/bind-9.18.3.tar.xz"
sha256 "0ad8da773bd93cba0ef66cc81999698ebdf9c3e51faed5e5c8c1eb75cad2ae6f"
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: "693e2bea94cb532394fd04c46b2972815fce2288e29ddc164edbe8223b8d47fb"
sha256 arm64_big_sur: "10708f2c7831f9447fadc0478b363029e855e41b516488700430d19365f17a28"
sha256 monterey: "6924a6b337f9042980437bd5c2bddc509d1a74f04609ad4cd7e8515beec5254b"
sha256 big_sur: "8c90b17f6273109feb783584090f7041e85d0670c43aff7248dd46b561b06794"
sha256 catalina: "dc4b9cb4640d95ad76bc3df7fe7c89e419c0682b7e9101ce5db658d35cc9e88f"
sha256 x86_64_linux: "3584a6ca270332f32c655de158b4c6f25034decfb2f36e1da5e6b36996bf447b"
end
depends_on "pkg-config" => :build
depends_on "json-c"
depends_on "libidn2"
depends_on "libnghttp2"
depends_on "libuv"
depends_on "openssl@1.1"
def install
args = [
"--prefix=#{prefix}",
"--sysconfdir=#{pkgetc}",
"--localstatedir=#{var}",
"--with-json-c",
"--with-libidn2=#{Formula["libidn2"].opt_prefix}",
"--with-openssl=#{Formula["openssl@1.1"].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