class BaculaFd < Formula desc "Network backup solution" homepage "http://www.bacula.org/" url "https://downloads.sourceforge.net/project/bacula/bacula/7.4.6/bacula-7.4.6.tar.gz" sha256 "4e8ea321b64cd49e29aecbdd3cb0dc10615302b18e2f26ffa7e7c82362c1cfed" bottle do sha256 "59a177edb836c122460b8206a0aa1c8e7d7efbf43a7ad3da9e81047843990f0b" => :sierra sha256 "1a25a9a969d1dc5753363cd95ba123c7cf4f21f5cb2db92185a142883fc1bc7b" => :el_capitan sha256 "a28f0a700fe5801cf8410e27ef9d8ba4220253b43a580fa2f370eed618d62e7b" => :yosemite end depends_on "readline" depends_on "openssl" def install # * sets --disable-conio in order to force the use of readline # (conio support not tested) # * working directory in /var/lib/bacula, reasonable place that # matches Debian's location. system "./configure", "--prefix=#{prefix}", "--sbindir=#{bin}", "--with-working-dir=#{var}/lib/bacula", "--with-pid-dir=#{var}/run", "--with-logdir=#{var}/log/bacula", "--enable-client-only", "--disable-conio", "--with-readline=#{Formula["readline"].opt_prefix}" system "make" system "make", "install" (var/"lib/bacula").mkpath end def post_install (var/"run").mkpath end plist_options :startup => true, :manual => "bacula-fd" def plist; <<-EOS.undent Label #{plist_name} RunAtLoad ProgramArguments #{opt_bin}/bacula-fd -f EOS end test do assert_match version.to_s, shell_output("#{bin}/bacula-fd -? 2>&1", 1) end end