2014-09-10 15:40:52 +00:00
|
|
|
require "formula"
|
2013-06-07 09:58:57 +00:00
|
|
|
|
|
|
|
class Pdnsrec < Formula
|
2014-09-10 15:40:52 +00:00
|
|
|
homepage "http://wiki.powerdns.com"
|
2014-10-30 15:17:56 +00:00
|
|
|
url "http://downloads.powerdns.com/releases/pdns-recursor-3.6.2.tar.bz2"
|
|
|
|
sha1 "69e461eb1da816f82c344137612d056f281217a1"
|
2014-09-15 14:38:39 +00:00
|
|
|
revision 1
|
2013-06-07 09:58:57 +00:00
|
|
|
|
2014-09-10 15:16:40 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2014-10-30 15:28:40 +00:00
|
|
|
sha1 "b4e3d1a4132ff1c41972d3a8e0a70c945c6ad1ef" => :yosemite
|
|
|
|
sha1 "19d5f92b26119931a0ea3b354b54870f3e3b10ae" => :mavericks
|
|
|
|
sha1 "f391330c5b3211349ad4272d1823772b8f5a2300" => :mountain_lion
|
2014-09-10 15:16:40 +00:00
|
|
|
end
|
|
|
|
|
2013-06-07 09:58:57 +00:00
|
|
|
depends_on :macos => :lion
|
2014-09-10 15:40:52 +00:00
|
|
|
depends_on "boost"
|
|
|
|
depends_on "lua" => :optional
|
2013-06-07 09:58:57 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
# Set overrides using environment variables
|
2014-09-10 15:40:52 +00:00
|
|
|
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"
|
2014-09-10 15:40:52 +00:00
|
|
|
ENV["LUA"] = "1"
|
|
|
|
ENV["LUA_CPPFLAGS_CONFIG"] = "-I#{Formula["lua"].opt_include}"
|
|
|
|
ENV["LUA_LIBS_CONFIG"] = "-llua"
|
2013-06-07 09:58:57 +00:00
|
|
|
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
|
2014-09-10 15:40:52 +00:00
|
|
|
system "make", "basic_checks"
|
2013-06-07 09:58:57 +00:00
|
|
|
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
|
2014-09-10 15:40:52 +00:00
|
|
|
(prefix/"etc/powerdns").mkpath
|
2013-06-07 09:58:57 +00:00
|
|
|
system "#{sbin}/pdns_recursor --config > #{prefix}/etc/powerdns/recursor.conf"
|
|
|
|
end
|
|
|
|
end
|