homebrew-core/Formula/pdns.rb
2017-01-13 04:05:48 -08:00

87 lines
2.4 KiB
Ruby

class Pdns < Formula
desc "Authoritative nameserver"
homepage "https://www.powerdns.com"
url "https://downloads.powerdns.com/releases/pdns-4.0.2.tar.bz2"
sha256 "d051e53b63f586c924f00ce8a81662f7bd285b461d125d4991538f92cf7e629d"
bottle do
sha256 "69dba7691ad395dcfc1a5d41505b88a5b3fdec3b19e10fd89fe1ad52a7da128e" => :sierra
sha256 "62083c5d449fc0f1f537171bebec8cfc252ca3a0cc8fa3aefa557651df4494c4" => :el_capitan
sha256 "e3323131ac6c78dd5da8725d420759f5af55e65ec4d3b00189f43efea617b060" => :yosemite
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"
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
args = %W[
--prefix=#{prefix}
--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"
else
# SQLite3 backend only is the default
args << "--with-modules=gsqlite3"
end
system "./bootstrap" if build.head?
system "./configure", *args
# Compilation fails at polarssl if we skip straight to make install
system "make"
system "make", "install"
end
plist_options :manual => "pdns_server start"
def plist; <<-EOS.undent
<?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