class BaculaFd < Formula desc "Network backup solution" homepage "https://www.bacula.org/" url "https://downloads.sourceforge.net/project/bacula/bacula/9.0.1/bacula-9.0.1.tar.gz" sha256 "fdffca283cb90926caa88098587a41189e9601813f56ef2f020b60f62fd7416b" bottle do sha256 "411d002c1ef603c4ab452d379f31d740977cce512589db456d109a14e9715e55" => :sierra sha256 "cdeb541938314fb0a37975bede92faa38f74cdd4b00d661feb46a378b4ef19c4" => :el_capitan sha256 "4e7b604a2178719595a5c857006474995bcf3e63f1d4bd029acb0647a3eb5cd7" => :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