class KnotResolver < Formula desc "Minimalistic, caching, DNSSEC-validating DNS resolver" homepage "https://www.knot-resolver.cz" url "https://secure.nic.cz/files/knot-resolver/knot-resolver-1.2.6.tar.xz" sha256 "31e1b8899c5592433e5265a8e9685126fc5aeff3bd6b10884154b2e34b786f3c" head "https://gitlab.labs.nic.cz/knot/resolver.git" bottle do sha256 "10d923255b12a2daf2f82d97805a20f7466ca3f8a6b0ae2b7f591fae7169abc8" => :sierra sha256 "5cec83d986e1d76b26ac7e5d011120ab137a2d46cbc7f0e0c453a5279e11ff04" => :el_capitan sha256 "f13f913bb92ea2bf04809f58d8fd3e86df310ac71ff25c6b53d117d68541a49a" => :yosemite end option "without-nettle", "Compile without DNS cookies support" option "with-hiredis", "Compile with Redis cache storage support" option "with-libmemcached", "Compile with memcached cache storage support" depends_on "cmocka" => :build depends_on "pkg-config" => :build depends_on "gnutls" depends_on "knot" depends_on "luajit" depends_on "libuv" depends_on "lmdb" depends_on "nettle" => :recommended depends_on "hiredis" => :optional depends_on "libmemcached" => :optional def install %w[all check lib-install daemon-install modules-install].each do |target| system "make", target, "PREFIX=#{prefix}" end cp "etc/config.personal", "config" inreplace "config", /^\s*user\(/, "-- user(" (etc/"kresd").install "config" (buildpath/"root.keys").write(root_keys) (var/"kresd").install "root.keys" end # DNSSEC root anchor published by IANA (https://www.iana.org/dnssec/files) def root_keys; <<-EOS.undent . IN DS 19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5 . IN DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d EOS end plist_options :startup => true def plist; <<-EOS.undent Label #{plist_name} WorkingDirectory #{var}/kresd RunAtLoad ProgramArguments #{sbin}/kresd -c #{etc}/kresd/config StandardInPath /dev/null StandardOutPath /dev/null StandardErrorPath #{var}/log/kresd.log EOS end test do system sbin/"kresd", "--version" end end