100 lines
2.8 KiB
Ruby
100 lines
2.8 KiB
Ruby
class Knot < Formula
|
|
desc "High-performance authoritative-only DNS server"
|
|
homepage "https://www.knot-dns.cz/"
|
|
url "https://secure.nic.cz/files/knot-dns/knot-3.1.8.tar.xz"
|
|
sha256 "767e458a56277a1270b359294c3be6c63fd734884d62a045e01756a46507aa94"
|
|
license all_of: ["GPL-3.0-or-later", "0BSD", "BSD-3-Clause", "LGPL-2.0-or-later", "MIT"]
|
|
|
|
livecheck do
|
|
url "https://secure.nic.cz/files/knot-dns/"
|
|
regex(/href=.*?knot[._-]v?(\d+(?:\.\d+)+)\.t/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 arm64_monterey: "2843f3ea9f5aafc680598a79bf786b64f455a4d6d57947cbb6b20b221506d5ab"
|
|
sha256 arm64_big_sur: "bf7ab03d621deb91fa988611d46c8c90bbbfad7a901cf9ca291ad66feae779b0"
|
|
sha256 monterey: "c875486df40331a4a4d7767b4a35d7a9278fadca5b0f6450c150dc864390d21c"
|
|
sha256 big_sur: "7939327484b0a39f12fa9bb166794c18529db1a1e066b74bfe3dc718043ed971"
|
|
sha256 catalina: "9d636fe56cfd264ead4e02588516d6eb3a9f7a361541c7ce8949b62b2963d88d"
|
|
sha256 x86_64_linux: "eaa94c2574125bbf737e8a84ec6c1724070a59d8324ca1513ac171de56ad8023"
|
|
end
|
|
|
|
head do
|
|
url "https://gitlab.labs.nic.cz/knot/knot-dns.git"
|
|
|
|
depends_on "autoconf" => :build
|
|
depends_on "automake" => :build
|
|
depends_on "libtool" => :build
|
|
end
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "sphinx-doc" => :build
|
|
depends_on "fstrm"
|
|
depends_on "gnutls"
|
|
depends_on "libidn2"
|
|
depends_on "libnghttp2"
|
|
depends_on "lmdb"
|
|
depends_on "protobuf-c"
|
|
depends_on "userspace-rcu"
|
|
|
|
uses_from_macos "libedit"
|
|
|
|
def install
|
|
system "autoreconf", "-fvi" if build.head?
|
|
system "./configure", "--disable-dependency-tracking",
|
|
"--disable-silent-rules",
|
|
"--with-configdir=#{etc}",
|
|
"--with-storage=#{var}/knot",
|
|
"--with-rundir=#{var}/run/knot",
|
|
"--prefix=#{prefix}",
|
|
"--with-module-dnstap",
|
|
"--enable-dnstap"
|
|
|
|
inreplace "samples/Makefile", "install-data-local:", "disable-install-data-local:"
|
|
|
|
system "make"
|
|
system "make", "install"
|
|
system "make", "install-singlehtml"
|
|
|
|
(buildpath/"knot.conf").write(knot_conf)
|
|
etc.install "knot.conf"
|
|
end
|
|
|
|
def post_install
|
|
(var/"knot").mkpath
|
|
end
|
|
|
|
def knot_conf
|
|
<<~EOS
|
|
server:
|
|
rundir: "#{var}/knot"
|
|
listen: [ "0.0.0.0@53", "::@53" ]
|
|
|
|
log:
|
|
- target: "stderr"
|
|
any: "info"
|
|
|
|
control:
|
|
listen: "knot.sock"
|
|
|
|
template:
|
|
- id: "default"
|
|
storage: "#{var}/knot"
|
|
EOS
|
|
end
|
|
|
|
plist_options startup: true
|
|
service do
|
|
run opt_sbin/"knotd"
|
|
input_path "/dev/null"
|
|
log_path "/dev/null"
|
|
error_log_path var/"log/knot.log"
|
|
end
|
|
|
|
test do
|
|
system bin/"kdig", "www.knot-dns.cz"
|
|
system bin/"khost", "brew.sh"
|
|
system sbin/"knotc", "conf-check"
|
|
end
|
|
end
|