homebrew-core/Formula/knot.rb

100 lines
2.7 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.2.tar.xz"
sha256 "580087695df350898b2da8a5c2bdf1dc5eb262ed5ff2cb1538cee480a50fa094"
license all_of: ["GPL-3.0-or-later", "0BSD", "BSD-3-Clause", "LGPL-2.0-or-later", "MIT"]
revision 1
livecheck do
url "https://secure.nic.cz/files/knot-dns/"
regex(/href=.*?knot[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 arm64_big_sur: "d3820628ec5c1283db19ee41ccd369ad7d2d042906c85309e6f7924d505fbccf"
sha256 big_sur: "e94eb7b85f05bc88e9cce98c21357cfc0de3514ac8da3ffe376bcb5d358c806b"
sha256 catalina: "7f4565cedf25f3acf6db707499515a77a6fd4abcab9661a820c4cc9c4fa22fbc"
sha256 mojave: "f0e283d4a273f95c50dcded42bc55ade3ad47330074b00d3416a8a825c37ef98"
sha256 x86_64_linux: "1b4d60da3ee25433fdb57ec434bed5cac38725fbec056bcfd8dcd81828411857"
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