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-3.2.0.tar.xz" sha256 "924f1aebad04cacbc4545571239914d2c42e9253784c0df0f391dfad97c59f42" head "https://gitlab.labs.nic.cz/knot/knot-resolver.git" bottle do sha256 "2249a6f9d14d6defb90dd36983f35c8a246517c0730182fe81e683361b268fff" => :mojave sha256 "d6526c90ff00fc06169e4c623ed9760a7e2be318f34148ad7d096a26ada98075" => :high_sierra sha256 "8d976a00be2c6e25e068de57c007a57291f5543a28d1bff3778f83158b1500ec" => :sierra end depends_on "cmocka" => :build depends_on "pkg-config" => :build depends_on "gnutls" depends_on "knot" depends_on "libuv" depends_on "lmdb" depends_on "luajit" depends_on "nettle" 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" (etc/"kresd").install "etc/icann-ca.pem" (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