class Pdns < Formula desc "Authoritative nameserver" homepage "https://www.powerdns.com" url "https://downloads.powerdns.com/releases/pdns-4.1.2.tar.bz2" sha256 "86d8be0171d1ba85c2c6496d62ebf9198a5d522135aa0df3714c0d487a725695" bottle do sha256 "fa683a8e83c6e5deeadebb94071eeed97578292d28f40ec29341c5efaea356b8" => :high_sierra sha256 "d9592add50f6ea15a56e39f24f142c7b6631497a4881dba2805730768c2a5ff8" => :sierra sha256 "4c3577023da4c055bb566c25ad5629b3c27c7a4fdc146038b156e8f4d21a0d63" => :el_capitan end head do url "https://github.com/powerdns/pdns.git" depends_on "automake" => :build depends_on "autoconf" => :build depends_on "libtool" => :build depends_on "ragel" end option "with-postgresql", "Enable the PostgreSQL backend" option "with-remote", "enable the Remote backend" deprecated_option "pgsql" => "with-postgresql" deprecated_option "with-pgsql" => "with-postgresql" depends_on "pkg-config" => :build depends_on "boost" depends_on "lua" depends_on "openssl" depends_on "sqlite" depends_on "postgresql" => :optional 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"].opt_prefix} --with-sqlite3 ] # Include the PostgreSQL backend if requested if build.with? "postgresql" args << "--with-modules=gsqlite3 gpgsql" elsif build.with? "remote" args << "--with-modules=gsqlite3 remote" else # SQLite3 backend only is the default args << "--with-modules=gsqlite3" end 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