87 lines
2.4 KiB
Ruby
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.1.tar.bz2"
|
|
sha256 "d191eed4a6664430e85969f49835c59e810ecbb7b3eb506e64c6b2734091edd7"
|
|
|
|
bottle do
|
|
rebuild 1
|
|
sha256 "3ad6cd394a15d6aef7d68648103e934d1cd172733346ed2a72a1f0ddffd0a8df" => :el_capitan
|
|
sha256 "3f7651090d99aa1b1fe2d7dd317b936f7c8c357ff0e6c0a5587b98715b7b4658" => :yosemite
|
|
sha256 "e11c02d5f242205cd1190bcdd32a1cc96649e2ee7f0ec72039422c6993452179" => :mavericks
|
|
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-pgsql", "Enable the PostgreSQL backend"
|
|
|
|
deprecated_option "pgsql" => "with-pgsql"
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "boost"
|
|
depends_on "lua"
|
|
depends_on "openssl"
|
|
depends_on "sqlite"
|
|
depends_on :postgresql if build.with? "pgsql"
|
|
|
|
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? "pgsql"
|
|
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
|