64 lines
2 KiB
Ruby
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.5/bacula-7.4.5.tar.gz"
|
|
sha256 "0e0972768c6a6d42b5bdedeae714237add8ffd9b9703c9eb7f64d86a47d27cec"
|
|
|
|
bottle do
|
|
sha256 "f3fe5f8a3fa2b9bcfe747342da704172d0e4232e794eaea46186d7a5f2b90e15" => :sierra
|
|
sha256 "6b4bbff8dc4fabf27545b63388f14fc9e65a7e88c20a8fe2d77fb975aa2ce1de" => :el_capitan
|
|
sha256 "6ce4e367081350f958e003eff9b3744643c0bf04eaccafd98ec4bfb02f4db714" => :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
|