homebrew-core/Formula/monit.rb

61 lines
2.1 KiB
Ruby

class Monit < Formula
desc "Manage and monitor processes, files, directories, and devices"
homepage "https://mmonit.com/monit/"
url "https://mmonit.com/monit/dist/monit-5.28.0.tar.gz"
sha256 "9fc6287fd9570b25a85c5d5bf988ee8bd4c54d0e9e01ff04cc4b9398a159849c"
license "AGPL-3.0-or-later"
livecheck do
url "https://mmonit.com/monit/dist/"
regex(/href=.*?monit[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 cellar: :any, arm64_big_sur: "2635e08ee9896137058e5a3aff9e1c4ad6d993e39f4803ce81be2404f26937ad"
sha256 cellar: :any, big_sur: "c8ec9470b6060c09c3e5d8353eab5db894a97c9f0a5b84452b2e8f9cd8431182"
sha256 cellar: :any, catalina: "bbbea23f89982c86609669e2f14744bafb0c739dc0d81965652758c3ba8f1a10"
sha256 cellar: :any, mojave: "1101ccef8a0357079e11d59fa5f55c6e144c3ccf71e5a58e66c84bf0395c5669"
end
depends_on "openssl@1.1"
def install
system "./configure", "--prefix=#{prefix}",
"--localstatedir=#{var}/monit",
"--sysconfdir=#{etc}/monit",
"--with-ssl-dir=#{Formula["openssl@1.1"].opt_prefix}"
system "make"
system "make", "install"
etc.install "monitrc"
end
plist_options manual: "monit -I -c #{HOMEBREW_PREFIX}/etc/monitrc"
def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key> <string>#{plist_name}</string>
<key>ProcessType</key> <string>Adaptive</string>
<key>Disabled</key> <false/>
<key>RunAtLoad</key> <true/>
<key>LaunchOnlyOnce</key> <false/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/monit</string>
<string>-I</string>
<string>-c</string>
<string>#{etc}/monitrc</string>
</array>
</dict>
</plist>
EOS
end
test do
system bin/"monit", "-c", "#{etc}/monitrc", "-t"
end
end