homebrew-core/Formula/bacula-fd.rb
2017-03-11 06:02:08 -08:00

64 lines
2 KiB
Ruby

class BaculaFd < Formula
desc "Network backup solution"
homepage "http://www.bacula.org/"
url "https://downloads.sourceforge.net/project/bacula/bacula/7.4.6/bacula-7.4.6.tar.gz"
sha256 "4e8ea321b64cd49e29aecbdd3cb0dc10615302b18e2f26ffa7e7c82362c1cfed"
bottle do
sha256 "59a177edb836c122460b8206a0aa1c8e7d7efbf43a7ad3da9e81047843990f0b" => :sierra
sha256 "1a25a9a969d1dc5753363cd95ba123c7cf4f21f5cb2db92185a142883fc1bc7b" => :el_capitan
sha256 "a28f0a700fe5801cf8410e27ef9d8ba4220253b43a580fa2f370eed618d62e7b" => :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
<?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