67 lines
3.0 KiB
Ruby
67 lines
3.0 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
|
|
sha256 cellar: :any_skip_relocation, arm64_monterey: "9ab89b9f2fabc3c2722394efb7c8dcb8cf51be41c0710e7e6123f6573af77a86"
|
|
sha256 cellar: :any_skip_relocation, arm64_big_sur: "cbd058a04ae1baec1926fa7958202bcabe31985c5ddd5cd13455f6181bf1d83c"
|
|
sha256 cellar: :any_skip_relocation, monterey: "6b9cebb798c9aa6934009dd8b490fc561abe578f38005efef06982c7ea6854af"
|
|
sha256 cellar: :any_skip_relocation, big_sur: "3b465465c9daa386eb077763f0d147433a39c97012e858fb6d9f9d1879a70188"
|
|
sha256 cellar: :any_skip_relocation, catalina: "d166ddeca40d79b9aaee92f1c9a05711ccdf987c5ec71668e70645b7f350139c"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "d726f40bff1125aa211af1c9dfaeb57ca38df80251d583280877c61a6c3d066c"
|
|
end
|
|
|
|
depends_on "python@3.10"
|
|
|
|
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", File.read(config)
|
|
end
|
|
end
|