class BaculaFd < Formula desc "Network backup solution" homepage "https://www.bacula.org/" url "https://downloads.sourceforge.net/project/bacula/bacula/9.0.7/bacula-9.0.7.tar.gz" sha256 "84e87fcfedb2e6df624c4f1a6281948f7061b22e2a2747cc2aa46d34bf190948" bottle do sha256 "159792205dcef2493c4ae2fb7b2359c8ed4ae0b0d985a4535328206bbb21c1a5" => :high_sierra sha256 "788cde919b28276990d1d5802791207080fe24b5a33ccc095b87c208be1dc254" => :sierra sha256 "bcc61675b4c4d3c2801a19357fd426b681a0d598169ce1102a580df5c91cbcd5" => :el_capitan end depends_on "readline" depends_on "openssl" conflicts_with "bareos-client", :because => "Both install a `bconsole` executable." 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 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