homebrew-core/Formula/rsyslog.rb

81 lines
2.8 KiB
Ruby

class Rsyslog < Formula
desc "Enhanced, multi-threaded syslogd"
homepage "https://www.rsyslog.com/"
url "https://www.rsyslog.com/files/download/rsyslog/rsyslog-8.2208.0.tar.gz"
sha256 "14de68e7b8e5ab0c5d734f82e2dc9fff22cd7f4710ad690727eb10a7b9b3df5e"
license all_of: ["Apache-2.0", "GPL-3.0-or-later", "LGPL-3.0-or-later"]
livecheck do
url "https://www.rsyslog.com/downloads/download-v8-stable/"
regex(/href=.*?rsyslog[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 arm64_monterey: "edd00e75254b249f1456eff2b8897c3e8d6f4058f95748fcf5978e01720197a5"
sha256 arm64_big_sur: "9f8f815a0a92da34bd5508ed0be67cd2da081c37c28fd2a21f912c7262e8d9da"
sha256 monterey: "16a88c82940162d7f7b69d4479ab58d25b7f59126948feb30ea1a8f1d4ba35d4"
sha256 big_sur: "4a74fd32483268e81742f43a312063dc70b2fb620ff26547c5feaff287356681"
sha256 catalina: "5ce3c9823c48a1ee545079960d41ae27703df6c6a702debd47d8dccd3b43bd8b"
sha256 x86_64_linux: "36d09c3d337256db58730835f2a3f59b9b82f07768111f1fc442dab3a94361ab"
end
depends_on "pkg-config" => :build
depends_on "gnutls"
depends_on "libestr"
uses_from_macos "curl"
uses_from_macos "zlib"
resource "libfastjson" do
url "https://download.rsyslog.com/libfastjson/libfastjson-0.99.9.tar.gz"
sha256 "a330e1bdef3096b7ead53b4bad1a6158f19ba9c9ec7c36eda57de7729d84aaee"
end
def install
resource("libfastjson").stage do
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{libexec}"
system "make", "install"
end
ENV.prepend_path "PKG_CONFIG_PATH", libexec/"lib/pkgconfig"
system "./configure", "--prefix=#{prefix}",
"--disable-dependency-tracking",
"--enable-imfile",
"--enable-usertools",
"--enable-diagtools",
"--disable-uuid",
"--disable-libgcrypt",
"--enable-gnutls"
system "make"
system "make", "install"
(etc/"rsyslog.conf").write <<~EOS
# minimal config file for receiving logs over UDP port 10514
$ModLoad imudp
$UDPServerRun 10514
*.* /usr/local/var/log/rsyslog-remote.log
EOS
end
def post_install
mkdir_p var/"run"
end
plist_options manual: "rsyslogd -f #{HOMEBREW_PREFIX}/etc/rsyslog.conf -i #{HOMEBREW_PREFIX}/var/run/rsyslogd.pid"
service do
run [opt_sbin/"rsyslogd", "-n", "-f", etc/"rsyslog.conf", "-i", var/"run/rsyslogd.pid"]
keep_alive true
error_log_path var/"log/rsyslogd.log"
log_path var/"log/rsyslogd.log"
end
test do
result = shell_output("#{opt_sbin}/rsyslogd -f #{etc}/rsyslog.conf -N 1 2>&1")
assert_match "End of config validation run", result
end
end