Created
March 31, 2018 14:19
-
-
Save Habbie/9403f6bd280caf2ec414f9a42b61ff3b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Unbound < Formula | |
desc "Validating, recursive, caching DNS resolver" | |
homepage "https://www.unbound.net" | |
url "https://www.unbound.net/downloads/unbound-1.7.0.tar.gz" | |
sha256 "94dd9071fb13d8ccd122a3ac67c4524a3324d0e771fc7a8a7c49af8abfb926a2" | |
bottle do | |
sha256 "14bb3f5ce9567f835522a4cf278e843602def948c9c139c0dbe660dad666b6e9" => :high_sierra | |
sha256 "aa344f2853ef983890eed1eecd53c06e0c41e491253f8480bc944c62edc7ccc4" => :sierra | |
sha256 "8854838cff0d79d0b855b95c588588dc95b5eb1bda3a1db019717d832eebf35b" => :el_capitan | |
end | |
deprecated_option "with-python" => "with-python@2" | |
depends_on "openssl" | |
depends_on "libevent" | |
depends_on "python@2" => :optional | |
depends_on "swig" if build.with? "python@2" | |
patch :DATA | |
def install | |
args = %W[ | |
--prefix=#{prefix} | |
--sysconfdir=#{etc} | |
--with-libevent=#{Formula["libevent"].opt_prefix} | |
--with-ssl=#{Formula["openssl"].opt_prefix} | |
] | |
if build.with? "python@2" | |
ENV.prepend "LDFLAGS", `python-config --ldflags`.chomp | |
ENV.prepend "PYTHON_VERSION", "2.7" | |
args << "--with-pyunbound" | |
args << "--with-pythonmodule" | |
args << "PYTHON_SITE_PKG=#{lib}/python2.7/site-packages" | |
end | |
args << "--with-libexpat=#{MacOS.sdk_path}/usr" unless MacOS::CLT.installed? | |
system "./configure", *args | |
inreplace "doc/example.conf", 'username: "unbound"', 'username: "@@HOMEBREW-UNBOUND-USER@@"' | |
system "make" | |
system "make", "test" | |
system "make", "install" | |
end | |
def post_install | |
conf = etc/"unbound/unbound.conf" | |
return unless conf.exist? | |
return unless conf.read.include?('username: "@@HOMEBREW-UNBOUND-USER@@"') | |
inreplace conf, 'username: "@@HOMEBREW-UNBOUND-USER@@"', | |
"username: \"#{ENV["USER"]}\"" | |
end | |
plist_options :startup => true | |
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>Label</key> | |
<string>#{plist_name}</string> | |
<key>KeepAlive</key> | |
<true/> | |
<key>RunAtLoad</key> | |
<true/> | |
<key>ProgramArguments</key> | |
<array> | |
<string>#{opt_sbin}/unbound</string> | |
<string>-d</string> | |
<string>-c</string> | |
<string>#{etc}/unbound/unbound.conf</string> | |
</array> | |
<key>UserName</key> | |
<string>root</string> | |
<key>StandardErrorPath</key> | |
<string>/dev/null</string> | |
<key>StandardOutPath</key> | |
<string>/dev/null</string> | |
</dict> | |
</plist> | |
EOS | |
end | |
test do | |
system sbin/"unbound-control-setup", "-d", testpath | |
end | |
end | |
__END__ | |
diff --git a/testdata/auth_xfr_ixfr.rpl b/testdata/auth_xfr_ixfr.rpl | |
index 91cc8b30..2ccd8997 100644 | |
--- a/testdata/auth_xfr_ixfr.rpl | |
+++ b/testdata/auth_xfr_ixfr.rpl | |
@@ -263,7 +263,7 @@ mail.example.com. 3600 IN A 1.2.3.4 | |
mail.example.com. 3600 IN A 1.2.3.5 | |
mail.example.com. 3600 IN A 1.2.3.7 | |
mail.example.com. 3600 IN A 1.2.3.8 | |
-mail.example.com. 3600 IN AAAA ::5 | |
+mail.example.com. 3600 IN AAAA ::0.0.0.5 | |
r1.example.com. 3600 IN RRSIG A 8 3 10200 20170612005010 20170515005010 42393 nlnetlabs.nl. NhEDrHkuIgHkjWhDRVsGOIJWZpSs+QdduilWFe5d+/ZhOheLJbaTYD5w6+ZZ3yPh1tNud+jlg+GyiOSVapLEO31swDCIarL1UfRjRSpxxDCHGag5Zu+S4hF+KURxO3cJk8jLBELMQyRuMRHoKrw/wsiLGVu1YpAyAPPMcjFBNbk= | |
r2.example.com. 3600 IN RRSIG AAAA 8 3 10200 20170612005010 20170515005010 42393 nlnetlabs.nl. NhEDrHkuIgHkjWhDRVsGOIJWZpSs+QdduilWFe5d+/ZhOheLJbaTYD5w6+ZZ3yPh1tNud+jlg+GyiOSVapLEO31swDCIarL1UfRjRSpxxDCHGag5Zu+S4hF+KURxO3cJk8jLBELMQyRuMRHoKrw/wsiLGVu1YpAyAPPMcjFBNbk= | |
r2.example.com. 3600 IN RRSIG A 8 3 10200 20170612005010 20170515005010 42393 nlnetlabs.nl. NhEDrHkuIgHkjWhDRVsGOIJWZpSs+QdduilWFe5d+/ZhOheLJbaTYD5w6+ZZ3yPh1tNud+jlg+GyiOSVapLEO31swDCIarL1UfRjRSpxxDCHGag5Zu+S4hF+KURxO3cJk8jLBELMQyRuMRHoKrw/wsiLGVu1YpAyAPPMcjFBNbk= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment