Skip to content

Commit

Permalink
bareos-client 21.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
cho-m committed Jun 16, 2022
1 parent 9d023d6 commit e6ec5f7
Showing 1 changed file with 50 additions and 21 deletions.
71 changes: 50 additions & 21 deletions Formula/bareos-client.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
class BareosClient < Formula
desc "Client for Bareos (Backup Archiving REcovery Open Sourced)"
homepage "https://www.bareos.org/"
url "https://github.com/bareos/bareos/archive/Release/19.2.9.tar.gz"
sha256 "ea203d4bdacc8dcc86164a74f628888ce31cc90858398498137bd25900b8f723"
url "https://github.com/bareos/bareos/archive/Release/21.1.3.tar.gz"
sha256 "3fc1241981f095c5e3db4e7476cdb273633b630820b1e1eff792b2c4d99b3d11"
license "AGPL-3.0-only"

livecheck do
url "https://github.com/bareos/bareos.git"
url :stable
regex(%r{^Release/(\d+(?:\.\d+)+)$}i)
end

Expand All @@ -17,33 +17,62 @@ class BareosClient < Formula
end

depends_on "cmake" => :build
depends_on "gettext"
depends_on "jansson"
depends_on "lzo"
depends_on "openssl@1.1"
depends_on "readline"

conflicts_with "bacula-fd",
because: "both install a `bconsole` executable"
uses_from_macos "zlib"

on_macos do
depends_on "gettext"
end

on_linux do
depends_on "acl"
end

conflicts_with "bacula-fd", because: "both install a `bconsole` executable"

def install
mkdir "build" do
system "cmake", "..", *std_cmake_args,
"-Dworkingdir=#{var}/lib/bareos",
"-Darchivedir=#{var}/bareos",
"-Dconfdir=#{etc}/bareos",
"-Dconfigtemplatedir=#{lib}/bareos/defaultconfigs",
"-Dscriptdir=#{lib}/bareos/scripts",
"-Dplugindir=#{lib}/bareos/plugins",
"-Dfd-password=XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX",
"-Dmon-fd-password=XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX",
"-Dbasename=XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX",
"-Dhostname=XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX",
"-Dclient-only=ON"
system "make"
system "make", "install"
# Work around hardcoded paths to /usr/local Homebrew installation,
# forced static linkage on macOS, and openssl formula alias usage.
inreplace "core/CMakeLists.txt" do |s|
s.gsub! "/usr/local/opt/gettext/lib/libintl.a", Formula["gettext"].opt_lib/shared_library("libintl")
s.gsub! "/usr/local/opt/openssl", Formula["openssl@1.1"].opt_prefix
s.gsub! "/usr/local/", "#{HOMEBREW_PREFIX}/"
end
inreplace "core/src/plugins/CMakeLists.txt" do |s|
s.gsub! "/usr/local/opt/gettext/include", Formula["gettext"].opt_include
s.gsub! "/usr/local/opt/openssl/include", Formula["openssl@1.1"].opt_include
end
inreplace "core/cmake/BareosFindAllLibraries.cmake" do |s|
s.gsub! "/usr/local/opt/lzo/lib/liblzo2.a", Formula["lzo"].opt_lib/shared_library("liblzo2")
s.gsub! "set(OPENSSL_USE_STATIC_LIBS 1)", ""
end
inreplace "core/cmake/FindReadline.cmake",
"/usr/local/opt/readline/lib/libreadline.a",
Formula["readline"].opt_lib/shared_library("libreadline")

system "cmake", "-S", ".", "-B", "build", *std_cmake_args,
"-DENABLE_PYTHON=OFF",
"-Dworkingdir=#{var}/lib/bareos",
"-Darchivedir=#{var}/bareos",
"-Dconfdir=#{etc}/bareos",
"-Dconfigtemplatedir=#{lib}/bareos/defaultconfigs",
"-Dscriptdir=#{lib}/bareos/scripts",
"-Dplugindir=#{lib}/bareos/plugins",
"-Dfd-password=XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX",
"-Dmon-fd-password=XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX",
"-Dbasename=XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX",
"-Dhostname=XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX",
"-Dclient-only=ON"
system "cmake", "--build", "build"
system "cmake", "--install", "build"
end

def post_install
(var/"lib/bareos").mkpath
# If no configuration files are present,
# deploy them (copy them and replace variables).
unless (etc/"bareos/bareos-fd.d").exist?
Expand Down

0 comments on commit e6ec5f7

Please sign in to comment.