homebrew-core/Formula/pdns.rb
2019-05-25 11:11:51 +02:00

75 lines
2.1 KiB
Ruby

class Pdns < Formula
desc "Authoritative nameserver"
homepage "https://www.powerdns.com"
url "https://downloads.powerdns.com/releases/pdns-4.1.8.tar.bz2"
sha256 "94561132f46c08f646399511b680ce8cda150fd2b8e3d38c0b90b4187163e617"
bottle do
sha256 "44cef8a6fdbb901422ff37309f5080bbeda9eeafc7297cfe241c5b7e6daea09b" => :mojave
sha256 "3f1dc45321b7c14074baec9a9a53d7fb3cd5ca069ccca589f70fa15ff83e446d" => :high_sierra
sha256 "4196afa3c93a17356a69d96458e2792c5636c9005363892add5a9a9311c0f8f3" => :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"
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"].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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/pdns_server</string>
</array>
<key>EnvironmentVariables</key>
<key>KeepAlive</key>
<true/>
<key>SHAuthorizationRight</key>
<string>system.preferences</string>
</dict>
</plist>
EOS
end
test do
output = shell_output("#{sbin}/pdns_server --version 2>&1", 99)
assert_match "PowerDNS Authoritative Server #{version}", output
end
end