homebrew-core/Formula/bacula-fd.rb

65 lines
2 KiB
Ruby
Raw Normal View History

class BaculaFd < Formula
desc "Network backup solution"
homepage "http://www.bacula.org/"
url "https://downloads.sourceforge.net/project/bacula/bacula/7.4.2/bacula-7.4.2.tar.gz"
sha256 "0c5f7fe1d35fc2aa4ffba73e977b710b955b1fe3e45ab90c67b47b279152ad67"
2014-12-01 17:26:55 +00:00
bottle do
2016-07-10 09:55:14 +00:00
sha256 "c496a445dadc46ae620b7dd74503b888ae83052511c3b1dfcd7b7e2e70552819" => :el_capitan
sha256 "86a4cdcb8f7c3bb3b93a6377e4020ada2dc3cb495f9924910c396f45db5b6808" => :yosemite
sha256 "2865d98fd39ac5d69917fffc9afca14eccdc76b4d74f0ec85339594776df3c6c" => :mavericks
2014-12-01 17:26:55 +00:00
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