2011-12-03 03:25:25 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Bind < Formula
|
|
|
|
homepage 'http://www.isc.org/software/bind/'
|
2013-09-22 00:26:19 +00:00
|
|
|
url 'http://ftp.isc.org/isc/bind9/9.9.4/bind-9.9.4.tar.gz'
|
|
|
|
sha1 'd7be390e6c2546f37a7280e1975e1cd134565f62'
|
2011-12-03 03:25:25 +00:00
|
|
|
|
2013-09-21 23:26:14 +00:00
|
|
|
option 'with-brewed-openssl', 'Build with Homebrew OpenSSL instead of the system version'
|
|
|
|
|
|
|
|
depends_on "openssl" if MacOS.version <= :leopard or build.with?('brewed-openssl')
|
2011-12-03 03:25:25 +00:00
|
|
|
|
|
|
|
def install
|
2012-06-12 23:06:43 +00:00
|
|
|
ENV.libxml2
|
|
|
|
# libxml2 appends one inc dir to CPPFLAGS but bind ignores CPPFLAGS
|
2013-06-24 03:50:03 +00:00
|
|
|
ENV.append 'CFLAGS', ENV.cppflags
|
2012-06-12 23:06:43 +00:00
|
|
|
|
|
|
|
ENV['STD_CDEFINES'] = '-DDIG_SIGCHASE=1'
|
|
|
|
|
|
|
|
args = [
|
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--enable-threads",
|
|
|
|
"--enable-ipv6",
|
|
|
|
]
|
|
|
|
|
2013-09-21 23:26:14 +00:00
|
|
|
if build.with? 'brewed-openssl'
|
|
|
|
args << "--with-ssl-dir=#{Formula.factory('openssl').opt_prefix}"
|
|
|
|
elsif MacOS.version > :leopard
|
|
|
|
# For Xcode-only systems we help a bit to find openssl.
|
|
|
|
# If CLT.installed?, it evaluates to "/usr", which works.
|
|
|
|
args << "--with-openssl=#{MacOS.sdk_path}/usr"
|
|
|
|
end
|
2012-06-12 23:06:43 +00:00
|
|
|
|
|
|
|
system "./configure", *args
|
|
|
|
|
|
|
|
# From the bind9 README: "Do not use a parallel 'make'."
|
|
|
|
ENV.deparallelize
|
|
|
|
system "make"
|
|
|
|
system "make install"
|
2011-12-03 03:25:25 +00:00
|
|
|
end
|
|
|
|
end
|