homebrew-core/Formula/zabbix-cli.rb

69 lines
3.2 KiB
Ruby

class ZabbixCli < Formula
include Language::Python::Virtualenv
desc "CLI tool for interacting with Zabbix monitoring system"
homepage "https://github.com/unioslo/zabbix-cli/"
url "https://github.com/unioslo/zabbix-cli/archive/2.3.0.tar.gz"
sha256 "76a5abb5bad02b2305f6f92dff6251d1290a8efe383a17af54cf7c0aa71ba88e"
license "GPL-3.0-or-later"
head "https://github.com/unioslo/zabbix-cli.git", branch: "master"
livecheck do
url :stable
regex(/^v?(\d+(?:\.\d+)+)$/i)
end
bottle do
rebuild 1
sha256 cellar: :any_skip_relocation, arm64_ventura: "43721eecd306e7a65ab883d5567e59eaf57380a02d00f1c9d4c4a9502f4c2a49"
sha256 cellar: :any_skip_relocation, arm64_monterey: "5ae0b87404c2c6f6242137ae906afa68afdd66bcc1deb64163ad3f2f3217308d"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "79d7ce0ae4767400dc2c7c3219bdd4ba569677e16963e652d3ca7023447154e3"
sha256 cellar: :any_skip_relocation, monterey: "ad323071b6f0426221d3a039a5ba792227c4580827b6dc190a25757f70be4eaa"
sha256 cellar: :any_skip_relocation, big_sur: "1a91cd80a519730d0f6f88780018e340f255b48d0b75d94848a9bb412e3277ab"
sha256 cellar: :any_skip_relocation, catalina: "f57a99ba9ea40c21b9f4087a0bbd40277d826e3b81ea7b71414ab640ace2b16a"
sha256 cellar: :any_skip_relocation, x86_64_linux: "1c6eb4257b29e2c6dd27a7b7ddebb16082e849ee0a4d8c089ff943376d042b83"
end
depends_on "python@3.11"
resource "certifi" do
url "https://files.pythonhosted.org/packages/cc/85/319a8a684e8ac6d87a1193090e06b6bbb302717496380e225ee10487c888/certifi-2022.6.15.tar.gz"
sha256 "84c85a9078b11105f04f3036a9482ae10e4621616db313fe045dd24743a0820d"
end
resource "charset-normalizer" do
url "https://files.pythonhosted.org/packages/56/31/7bcaf657fafb3c6db8c787a865434290b726653c912085fbd371e9b92e1c/charset-normalizer-2.0.12.tar.gz"
sha256 "2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597"
end
resource "idna" do
url "https://files.pythonhosted.org/packages/62/08/e3fc7c8161090f742f504f40b1bccbfc544d4a4e09eb774bf40aafce5436/idna-3.3.tar.gz"
sha256 "9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d"
end
resource "requests" do
url "https://files.pythonhosted.org/packages/e9/23/384d9953bb968731212dc37af87cb75a885dc48e0615bd6a303577c4dc4b/requests-2.28.0.tar.gz"
sha256 "d568723a7ebd25875d8d1eaf5dfa068cd2fc8194b2e483d7b1f7c81918dbec6b"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/1b/a5/4eab74853625505725cefdf168f48661b2cd04e7843ab836f3f63abf81da/urllib3-1.26.9.tar.gz"
sha256 "aabaf16477806a5e1dd19aa41f8c2b7950dd3c746362d7e3223dbe6de6ac448e"
end
def install
# script tries to install config into /usr/local/bin (macOS) or /usr/share (Linux)
inreplace %w[setup.py etc/zabbix-cli.conf zabbix_cli/config.py], %r{(["' ])/usr/share/}, "\\1#{share}/"
inreplace "setup.py", "/usr/local/bin", share
virtualenv_install_with_resources
end
test do
system bin/"zabbix-cli-init", "-z", "https://homebrew-test.example.com/"
config = testpath/".zabbix-cli/zabbix-cli.conf"
assert_predicate config, :exist?
assert_match "homebrew-test.example.com", config.read
end
end