homebrew-core/Formula/bacula-fd.rb
2017-08-08 14:06:00 -07:00

64 lines
2 KiB
Ruby

class BaculaFd < Formula
desc "Network backup solution"
homepage "https://www.bacula.org/"
url "https://downloads.sourceforge.net/project/bacula/bacula/9.0.3/bacula-9.0.3.tar.gz"
sha256 "ae8501960d43399bea13113274993637b6395d73d7d2c47f9b7a07cb4aa72251"
bottle do
sha256 "a558d0384f4e2f1607d84104fe52fbad9c0fdaa3f335e101203b545a74d01264" => :sierra
sha256 "0b55c3e0b949d5e29d0bb4b0530e8b27734f4c43233a5afea354a97b09678ce9" => :el_capitan
sha256 "2c72c95ac1e6d53458c0e8d5105011176c0ef901c9c4ea5f63950fac86d4042a" => :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