109 lines
3 KiB
Ruby
109 lines
3 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-2.7.5.tar.xz"
|
|
sha256 "7d70d6d8f708285517d1d7c4ff2e5ddfd119cd2962c7a8d3f50a4c695209a086"
|
|
|
|
bottle do
|
|
sha256 "76131c932aef5e03d54f725fbda012f61b51e8401604e5c0819d942e174a3c80" => :mojave
|
|
sha256 "00228062e04b23590ea26a28bbfc01742971e773b9b8b0bfe7199a1663bff7b4" => :high_sierra
|
|
sha256 "1ac28e8dd3b0840493b93348949a45da87c61bc4934ff951400d0af33fe42966" => :sierra
|
|
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 "libidn"
|
|
depends_on :macos => :yosemite # due to AT_REMOVEDIR
|
|
depends_on "protobuf-c"
|
|
depends_on "userspace-rcu"
|
|
|
|
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", "check"
|
|
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
|
|
|
|
def plist; <<~EOS
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
<plist version="1.0">
|
|
<dict>
|
|
<key>EnableTransactions</key>
|
|
<true/>
|
|
<key>Label</key>
|
|
<string>#{plist_name}</string>
|
|
<key>RunAtLoad</key>
|
|
<true/>
|
|
<key>ProgramArguments</key>
|
|
<array>
|
|
<string>#{opt_sbin}/knotd</string>
|
|
<string>-c</string>
|
|
<string>#{etc}/knot.conf</string>
|
|
</array>
|
|
<key>StandardInPath</key>
|
|
<string>/dev/null</string>
|
|
<key>StandardOutPath</key>
|
|
<string>/dev/null</string>
|
|
<key>StandardErrorPath</key>
|
|
<string>#{var}/log/knot.log</string>
|
|
</dict>
|
|
</plist>
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
system bin/"kdig", "www.knot-dns.cz"
|
|
system bin/"khost", "brew.sh"
|
|
system sbin/"knotc", "-c", etc/"knot.conf", "conf-check"
|
|
end
|
|
end
|