diff options
| author | Ondřej Surý | 2014-02-18 17:01:36 +0100 |
|---|---|---|
| committer | Adam Vandenberg | 2014-05-13 11:21:52 -0700 |
| commit | f23beef526891c6311c1a9c2f6ee25fe0d37d084 (patch) | |
| tree | 59295db8057ac46a2992f6f8abfc4162413f1b47 /Library/Formula | |
| parent | 833dbc01b4aac9d39c407853bdb3850712539f60 (diff) | |
| download | homebrew-f23beef526891c6311c1a9c2f6ee25fe0d37d084.tar.bz2 | |
Knot DNS 1.4.3
Signed-off-by: Ondřej Surý <ondrej@sury.org>
Closes #26812.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/knot.rb | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/Library/Formula/knot.rb b/Library/Formula/knot.rb new file mode 100644 index 000000000..b9209cd5f --- /dev/null +++ b/Library/Formula/knot.rb @@ -0,0 +1,101 @@ +require "formula" + +class Knot < Formula + homepage "https://www.knot-dns.cz/" + url "https://secure.nic.cz/files/knot-dns/knot-1.4.3.tar.gz" + sha1 "c9b5598688cbd0b97efabe595244c3bf79273e3a" + + depends_on "userspace-rcu" + depends_on "openssl" + depends_on "libidn" + + def install + system "./configure", "--disable-debug", + "--disable-dependency-tracking", + "--disable-silent-rules", + "--with-configdir=#{etc}", + "--with-storage=#{var}/knot", + "--with-rundir=#{var}/knot", + "--prefix=#{prefix}" + + inreplace 'samples/Makefile', 'install-data-local:', 'disable-install-data-local:' + + system "make" + system "make", "install" + + (buildpath + 'knot.conf').write(knot_conf) + etc.install 'knot.conf' + + (var + 'knot').mkpath + end + + def knot_conf; <<-EOS.undent + system { + identity on; + version on; + rundir "#{var}/knot"; + } + interfaces { + all_ipv4 { + address 0.0.0.0; + port 53; + } + all_ipv6 { + address [::]; + port 53; + } + } + control { + listen-on "knot.sock"; + } + zones { + storage "#{var}/knot"; + # example.com { + # file "#{var}/knot/example.com.zone"; + # } + } + log { + syslog { + any error; + zone warning, notice; + server info; + } + stderr { + any error, warning; + } + } + 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> + <string>#{opt_prefix}/sbin/knotd</string> + <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 |
