aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/nsd.rb
blob: b33657916d5e437518a42fc4c8122073757bcd62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
class Nsd < Formula
  homepage "http://www.nlnetlabs.nl/projects/nsd/"
  url "http://www.nlnetlabs.nl/downloads/nsd/nsd-4.1.2.tar.gz"
  sha256 "8514b75bb8884526a637e1666911f429e0f52c5a3b0186104bb111371993644d"

  bottle do
    sha1 "e0b29e8c010ea0e20949e3a7bdf2206136d68e2a" => :yosemite
    sha1 "2648d981e7a399b76a06fa93d7d75d865ca8d816" => :mavericks
    sha1 "a0ec3d813f678d8f83f11011693fcdbed0ebe4f5" => :mountain_lion
  end

  option "with-root-server", "Allow NSD to run as a root name server"
  option "with-bind8-stats", "Enable BIND8-like NSTATS & XSTATS"
  option "with-ratelimit", "Enable rate limiting"
  option "with-zone-stats", "Enable per-zone statistics"

  depends_on "libevent"

  def install
    args = %W[
      --prefix=#{prefix}
      --with-libevent=#{Formula["libevent"].opt_prefix}
    ]

    args << "--enable-root-server" if build.with? "root-server"
    args << "--enable-bind8-stats" if build.with? "bind8-stats"
    args << "--enable-ratelimit" if build.with? "ratelimit"
    args << "--enable-zone-stats" if build.with? "zone-stats"

    system "./configure", *args
    system "make", "install"
  end

  test do
    system "#{sbin}/nsd", "-v"
  end
end