75 lines
2.1 KiB
Ruby
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.2.0.tar.bz2"
|
|
sha256 "222007f25e25aad71ac7d8b7f1797a4bcb30781e456d74ed00396e53828a903a"
|
|
|
|
bottle do
|
|
sha256 "1edfbaee477bd68d8c9be6478e5f9132141af90b28e5610ab695c271c212ba4f" => :catalina
|
|
sha256 "b6bf70bf824e52624c0eebbbeee5e595bf0ad493ad534dcd2329ba3c94cad4e6" => :mojave
|
|
sha256 "6ff18510dcb112904b00cc6c2b70a93a5929d1b1eb836e5d1d3975d8eee41686" => :high_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-libcrypto=#{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
|
|
<?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
|