class BaculaFd < Formula desc "Network backup solution" homepage "https://www.bacula.org/" url "https://downloads.sourceforge.net/project/bacula/bacula/9.0.4/bacula-9.0.4.tar.gz" sha256 "cafa2d9a9e89a77d3b79984972487e72fb90d949269c77a74a68e97a9d28996f" bottle do sha256 "725d7cfea18a08afae8bb22fbe4da5cc0496b712ff212e351b63bd58b91c1fd0" => :sierra sha256 "c48c7d7e31183ff2a035c8f0558cb373a1a89b4c41ae7a1a4188c4adcf75c2c8" => :el_capitan sha256 "1b7a60b6813c519491d693e4fa44a8f6f26ad06683a314dd0748c0d5197fc57c" => :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