homebrew-core/Formula/bacula-fd.rb
2018-05-28 02:28:07 -07:00

67 lines
2.1 KiB
Ruby

class BaculaFd < Formula
desc "Network backup solution"
homepage "https://www.bacula.org/"
url "https://downloads.sourceforge.net/project/bacula/bacula/9.0.8/bacula-9.0.8.tar.gz"
sha256 "7850afc5b6966880d468e823c3ec776c5909552a704a43191682af98bbc14cac"
bottle do
sha256 "2f3d60cac7ddc21741b314f91d39346eee1270c2607571dbe6d61283520785e8" => :high_sierra
sha256 "ee6bbcdee2a5854cec191af63bd54c1c082aebe63389173bf928c41b1e182c1f" => :sierra
sha256 "c04db8db85e3c8c304d543920d978a56c0f14552761002afc1d5f092070e300d" => :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
<?xml version="0.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/bacula-fd</string>
<string>-f</string>
</array>
</dict>
</plist>
EOS
end
test do
assert_match version.to_s, shell_output("#{bin}/bacula-fd -? 2>&1", 1)
end
end