46 lines
1.5 KiB
Ruby
46 lines
1.5 KiB
Ruby
class Zabbix < Formula
|
|
desc "Availability and monitoring solution"
|
|
homepage "https://www.zabbix.com/"
|
|
url "https://downloads.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/4.2.7/zabbix-4.2.7.tar.gz"
|
|
sha256 "9d9bdf1d858048d72811de04269a429aba257fac2e4b6e782d5a2b1d3a82f627"
|
|
|
|
bottle do
|
|
sha256 "19302e92ea34068a9b7ca8d07d86ff9f392a88e2aac5e15782804bc70e15fd1d" => :catalina
|
|
sha256 "599478f53fab68e8e9016f13f42e6f52b90fafc9d4e5360997afd5c9d9fd30e1" => :mojave
|
|
sha256 "a3404415483b69565ce1e488990bb8bd71aad6ed6f89233dc05c8d345dd316c4" => :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
|