class BaculaFd < Formula desc "Network backup solution" homepage "http://www.bacula.org/" url "https://downloads.sourceforge.net/project/bacula/bacula/7.4.4/bacula-7.4.4.tar.gz" sha256 "01a53d4501b17aeea0c25f0b63e49b4586ac221107834a6c471c43bc602c4c47" bottle do sha256 "23688a72a054d90ebc3a25923200c4afc86a9458b4d6c559462ca33cf73ba357" => :sierra sha256 "90ecd2801b306481a1ceed6fa96a4747e7b24e334de8b6511cab7d560f8485a9" => :el_capitan sha256 "bedb60a0e919c89b9ed83dd0a89f3dda785cbc61e9a785d59c7238cc0b324142" => :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