class Pdns < Formula desc "Authoritative nameserver" homepage "https://www.powerdns.com" url "https://downloads.powerdns.com/releases/pdns-4.1.11.tar.bz2" sha256 "754e4f0ce31118fef5dc470dc039e1f4e7b3ca6248074c9678a659508693b712" revision 1 bottle do sha256 "e9b851c9ce8248562bfa591aaa8313768643e7c3535744e491040d5939e1078e" => :mojave sha256 "1f195fcf89c603691184c77841f8df250cb6ef205841feede230a41337203d77" => :high_sierra sha256 "a0e77bc4f1d21eedef8f74cd1a669d700fddfbe35c950e207ceaf1868898e25b" => :sierra end head do url "https://github.com/powerdns/pdns.git" depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build depends_on "ragel" end depends_on "pkg-config" => :build depends_on "boost" depends_on "lua" depends_on "openssl@1.1" depends_on "sqlite" def install # Fix "configure: error: cannot find boost/program_options.hpp" ENV["SDKROOT"] = MacOS.sdk_path if MacOS.version == :sierra args = %W[ --prefix=#{prefix} --sysconfdir=#{etc}/powerdns --with-lua --with-openssl=#{Formula["openssl@1.1"].opt_prefix} --with-sqlite3 --with-modules=gsqlite3 ] system "./bootstrap" if build.head? system "./configure", *args system "make", "install" end plist_options :manual => "pdns_server start" def plist; <<~EOS KeepAlive Label #{plist_name} ProgramArguments #{opt_bin}/pdns_server EnvironmentVariables KeepAlive SHAuthorizationRight system.preferences EOS end test do output = shell_output("#{sbin}/pdns_server --version 2>&1", 99) assert_match "PowerDNS Authoritative Server #{version}", output end end