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.5.0.tar.xz" sha256 "c032e63a6b922294746e1ab4002860346e7a6d92b8502965a13ba599088fcb42" head "https://gitlab.labs.nic.cz/knot/knot-resolver.git" bottle do sha256 "624b67c2820bf9b8cf30bbea754f4a0d55c928a48a0fad4e03c3270938a7232b" => :high_sierra sha256 "644859b3c96adcace5c58db615b374c34cf239ce7eda77525da459015b66f8b1" => :sierra sha256 "7190c74a290987e5eaf0b8c0d3a8fcb88c81ad39df6db431f07b095087de3f67" => :el_capitan 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 # Since we don't run `make install` or `make etc-install`, we need to # install root.hints manually before running `make check`. cp "etc/root.hints", buildpath (etc/"kresd").install "root.hints" %w[all lib-install daemon-install client-install modules-install check].each do |target| system "make", target, "PREFIX=#{prefix}", "ETCDIR=#{etc}/kresd" end cp "etc/config.personal", "config" inreplace "config", /^\s*user\(/, "-- user(" (etc/"kresd").install "config" (etc/"kresd").install "etc/root.hints" (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 . IN DS 19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5 . IN DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d EOS end plist_options :startup => true def plist; <<~EOS 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