59 lines
2.0 KiB
Ruby
59 lines
2.0 KiB
Ruby
class Zabbix < Formula
|
|
desc "Availability and monitoring solution"
|
|
homepage "https://www.zabbix.com/"
|
|
url "https://cdn.zabbix.com/zabbix/sources/stable/5.0/zabbix-5.0.5.tar.gz"
|
|
sha256 "ec6d35202bf0308af7897e744f0867121fd54e191fcfa395bf2275ca94ef9280"
|
|
license "GPL-2.0-or-later"
|
|
|
|
# As of writing, the Zabbix SourceForge repository is missing the latest
|
|
# version (4.4.8), so we have to check for the newest version on the Zabbix
|
|
# CDN index page instead. Unfortunately, the versions are separated into
|
|
# folders for a given major/minor version, so this will quietly stop being
|
|
# a proper check sometime in the future and need to be updated.
|
|
livecheck do
|
|
url "https://cdn.zabbix.com/zabbix/sources/stable/5.0/"
|
|
regex(/href=.*?zabbix[._-](\d+(?:\.\d+)+)\.t/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 "28bece83f4f084b122b64cca33dd21456f9390fc617a48acac8dc08adb9d48ce" => :big_sur
|
|
sha256 "8d8af302642f8f1f2afefa8c7f0a256b78815f74e414ad059ff14c928fcf9b1e" => :catalina
|
|
sha256 "d1006aaa464a77392b26239fbe0f8b1987ba8413f00bad0d970d734876a7f45a" => :mojave
|
|
sha256 "c58bee2d8c9ab8ea0f40c3a9d2f2bc704d2414421f28a54dda59389cd6c9c835" => :high_sierra
|
|
end
|
|
|
|
depends_on "openssl@1.1"
|
|
depends_on "pcre"
|
|
|
|
def brewed_or_shipped(db_config)
|
|
brewed_db_config = "#{HOMEBREW_PREFIX}/bin/#{db_config}"
|
|
(File.exist?(brewed_db_config) && brewed_db_config) || which(db_config)
|
|
end
|
|
|
|
def install
|
|
sdk = MacOS::CLT.installed? ? "" : MacOS.sdk_path
|
|
|
|
args = %W[
|
|
--disable-dependency-tracking
|
|
--prefix=#{prefix}
|
|
--sysconfdir=#{etc}/zabbix
|
|
--enable-agent
|
|
--with-iconv=#{sdk}/usr
|
|
--with-libpcre=#{Formula["pcre"].opt_prefix}
|
|
--with-openssl=#{Formula["openssl@1.1"].opt_prefix}
|
|
]
|
|
|
|
if MacOS.version == :el_capitan && MacOS::Xcode.version >= "8.0"
|
|
inreplace "configure", "clock_gettime(CLOCK_REALTIME, &tp);",
|
|
"undefinedgibberish(CLOCK_REALTIME, &tp);"
|
|
end
|
|
|
|
system "./configure", *args
|
|
system "make", "install"
|
|
end
|
|
|
|
test do
|
|
system sbin/"zabbix_agentd", "--print"
|
|
end
|
|
end
|