class Pdnsd < Formula desc "Proxy DNS server with permanent caching" homepage "http://members.home.nl/p.a.rombouts/pdnsd/" url "http://members.home.nl/p.a.rombouts/pdnsd/releases/pdnsd-1.2.9a-par.tar.gz" version "1.2.9a-par" sha256 "bb5835d0caa8c4b31679d6fd6a1a090b71bdf70950db3b1d0cea9cf9cb7e2a7b" bottle do rebuild 2 sha256 "be218973e8fe1d807e7d9ec2762cab2a9968ce302fb46fb89974a686c1afcc43" => :high_sierra sha256 "81c4852b1093820909afc140f052f732cbd94e428d9aff261b90d74cb4935b09" => :sierra sha256 "1fa2f1f6ba9fc4fe710c1dc1d5bfb2b9663c557f5cdddf3a2fff8394f138a08f" => :el_capitan end def install system "./configure", "--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}", "--localstatedir=#{var}", "--sysconfdir=#{etc}", "--mandir=#{man}", "--with-cachedir=#{var}/cache/pdnsd" system "make", "install" end def caveats; <<-EOS.undent This install of "pdnsd" expects config files to be in #{etc} All state files (status and cache) are stored in #{var}/cache/pdnsd. pdnsd needs to run as root since it listens on privileged ports. Sample config file can be found at #{etc}/pdnsd.conf.sample. Note that you must create the config file before starting the service, and change ownership to "root" or pdnsd will refuse to run: sudo chown root #{etc}/pdnsd.conf For other related utilities, e.g. pdnsd-ctl, to run, change the ownership to the user (default: nobody) running the service: sudo chown -R nobody #{var}/log/pdnsd.log #{var}/cache/pdnsd EOS end plist_options :startup => true, :manual => "sudo pdnsd" def plist; <<-EOS.undent Label #{plist_name} RunAtLoad KeepAlive Program #{opt_sbin}/pdnsd StandardErrorPath #{var}/log/pdnsd.log StandardOutputPath #{var}/log/pdnsd.log Disabled EOS end test do assert_match "version #{version}", shell_output("#{sbin}/pdnsd --version", 1) end end