2014-02-18 16:01:36 +00:00
|
|
|
class Knot < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "High-performance authoritative-only DNS server"
|
2014-02-18 16:01:36 +00:00
|
|
|
homepage "https://www.knot-dns.cz/"
|
2015-12-21 11:34:51 +00:00
|
|
|
url "https://secure.nic.cz/files/knot-dns/knot-2.0.2.tar.xz"
|
|
|
|
sha256 "0418a22f9e801503993b3c872f2403bf73eab5ef7266128789b0531b41ea0c7e"
|
2015-12-16 16:26:45 +00:00
|
|
|
revision 1
|
2015-12-21 11:34:51 +00:00
|
|
|
|
|
|
|
head "https://gitlab.labs.nic.cz/labs/knot.git"
|
2014-09-08 16:58:05 +00:00
|
|
|
|
2014-06-19 14:04:38 +00:00
|
|
|
bottle do
|
2015-04-29 00:50:34 +00:00
|
|
|
cellar :any
|
2016-01-15 12:34:43 +00:00
|
|
|
sha256 "d50cdf56ab983378103904777db2561f26735b5dd54cec6a8e42b0aca4fd0c40" => :el_capitan
|
|
|
|
sha256 "f33daf162fb1f7d48eed000c855312a0c5890a13b83bfd91ae4e7b3272e64a5f" => :yosemite
|
|
|
|
sha256 "f0ad7de6798ae89ce64618345265ea345c404868c869fbaccb9d6060c4329465" => :mavericks
|
2014-06-19 14:04:38 +00:00
|
|
|
end
|
|
|
|
|
2015-12-21 11:34:51 +00:00
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "libtool" => :build
|
|
|
|
depends_on "pkg-config" => :build
|
2015-04-29 00:34:48 +00:00
|
|
|
depends_on "gnutls"
|
|
|
|
depends_on "jansson"
|
2014-02-18 16:01:36 +00:00
|
|
|
depends_on "libidn"
|
2015-04-29 00:34:48 +00:00
|
|
|
depends_on "nettle"
|
|
|
|
depends_on "openssl"
|
|
|
|
depends_on "userspace-rcu"
|
2014-02-18 16:01:36 +00:00
|
|
|
|
|
|
|
def install
|
2015-04-29 00:34:48 +00:00
|
|
|
system "autoreconf", "-i", "-f" if build.head?
|
2014-02-18 16:01:36 +00:00
|
|
|
system "./configure", "--disable-debug",
|
|
|
|
"--disable-dependency-tracking",
|
|
|
|
"--disable-silent-rules",
|
|
|
|
"--with-configdir=#{etc}",
|
|
|
|
"--with-storage=#{var}/knot",
|
|
|
|
"--with-rundir=#{var}/knot",
|
|
|
|
"--prefix=#{prefix}"
|
|
|
|
|
2015-04-29 00:34:48 +00:00
|
|
|
inreplace "samples/Makefile", "install-data-local:", "disable-install-data-local:"
|
2014-02-18 16:01:36 +00:00
|
|
|
|
|
|
|
system "make"
|
|
|
|
system "make", "install"
|
|
|
|
|
2015-04-29 00:34:48 +00:00
|
|
|
(buildpath/"knot.conf").write(knot_conf)
|
|
|
|
etc.install "knot.conf"
|
2014-02-18 16:01:36 +00:00
|
|
|
|
2015-04-29 00:34:48 +00:00
|
|
|
(var/"knot").mkpath
|
2014-02-18 16:01:36 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def knot_conf; <<-EOS.undent
|
2015-12-21 11:34:51 +00:00
|
|
|
server:
|
|
|
|
rundir: "#{var}/knot"
|
|
|
|
listen: [ "0.0.0.0@53", "::@53" ]
|
|
|
|
|
|
|
|
log:
|
|
|
|
- target: "stderr"
|
|
|
|
any: "error"
|
|
|
|
|
|
|
|
- target: "syslog"
|
|
|
|
server: "info"
|
|
|
|
zone: "warning"
|
|
|
|
any: "error"
|
|
|
|
|
|
|
|
control:
|
|
|
|
listen: "knot.sock"
|
|
|
|
|
|
|
|
template:
|
|
|
|
- id: "default"
|
|
|
|
storage: "#{var}/knot"
|
2014-02-18 16:01:36 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
plist_options :startup => true
|
|
|
|
|
|
|
|
def plist; <<-EOS.undent
|
|
|
|
<?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>
|
2014-10-27 03:30:28 +00:00
|
|
|
<string>#{opt_sbin}/knotd</string>
|
2014-02-18 16:01:36 +00:00
|
|
|
<string>-c</string>
|
|
|
|
<string>#{etc}/knot.conf</string>
|
|
|
|
</array>
|
|
|
|
<key>ServiceIPC</key>
|
|
|
|
<false/>
|
|
|
|
</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", "checkconf"
|
|
|
|
end
|
|
|
|
end
|