2013-06-07 09:58:57 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Pdnsrec < Formula
|
|
|
|
homepage 'http://wiki.powerdns.com'
|
2014-06-20 22:25:27 +00:00
|
|
|
url 'http://downloads.powerdns.com/releases/pdns-recursor-3.6.0.tar.bz2'
|
|
|
|
sha256 '345651705f04eb63ef6ea4573587907bc213879834e37f4b7e4c2e70bc952372'
|
2013-06-07 09:58:57 +00:00
|
|
|
|
|
|
|
depends_on :macos => :lion
|
|
|
|
depends_on 'boost'
|
|
|
|
depends_on 'lua' => :optional
|
|
|
|
|
|
|
|
def install
|
|
|
|
# Set overrides using environment variables
|
|
|
|
ENV['DESTDIR'] = "#{prefix}"
|
|
|
|
ENV['OPTFLAGS'] = "-O0"
|
2013-11-12 18:00:18 +00:00
|
|
|
ENV.O0
|
2013-06-07 09:58:57 +00:00
|
|
|
|
|
|
|
# Include Lua if requested
|
2014-03-06 20:40:26 +00:00
|
|
|
if build.with? "lua"
|
2013-06-07 09:58:57 +00:00
|
|
|
ENV['LUA'] = "1"
|
2014-03-06 05:28:31 +00:00
|
|
|
ENV['LUA_CPPFLAGS_CONFIG'] = "-I#{Formula["lua"].opt_include}"
|
2013-06-07 09:58:57 +00:00
|
|
|
ENV['LUA_LIBS_CONFIG'] = "-llua"
|
|
|
|
end
|
|
|
|
|
2014-06-20 22:25:27 +00:00
|
|
|
# Adjust hard coded paths in Makefile
|
|
|
|
inreplace "Makefile", "/usr/sbin/", "#{sbin}/"
|
|
|
|
inreplace "Makefile", "/usr/bin/", "#{bin}/"
|
|
|
|
inreplace "Makefile", "/etc/powerdns/", "#{etc}/powerdns/"
|
|
|
|
inreplace "Makefile", "/var/run/", "#{var}/run/"
|
2013-06-07 09:58:57 +00:00
|
|
|
|
|
|
|
# Compile
|
|
|
|
system "make basic_checks"
|
|
|
|
system "make"
|
|
|
|
|
|
|
|
# Do the install manually
|
|
|
|
bin.install "rec_control"
|
|
|
|
sbin.install "pdns_recursor"
|
|
|
|
man1.install "pdns_recursor.1", "rec_control.1"
|
|
|
|
|
|
|
|
# Generate a default configuration file
|
|
|
|
(prefix/'etc/powerdns').mkpath
|
|
|
|
system "#{sbin}/pdns_recursor --config > #{prefix}/etc/powerdns/recursor.conf"
|
|
|
|
end
|
|
|
|
end
|