homebrew-core/Formula/rsyslog.rb

82 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.2206.0.tar.gz"
sha256 "a1377218b26c0767a7a3f67d166d5338af7c24b455d35ec99974e18e6845ba27"
license all_of: ["Apache-2.0", "GPL-3.0-or-later", "LGPL-3.0-or-later"]
revision 1
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: "fe1ddb1079eff2990189bfd9fe42ef73d23da5632469c975edf5f5fda485533f"
sha256 arm64_big_sur: "df837498be1b1076a9be313d9ecc8b6a3fe9112888263bacc692bcfe07c2d8a9"
sha256 monterey: "a3a67b29caf18c88c5e270c4fe20b46ef76b28bc36b5ca2a0b5b8ada41aac699"
sha256 big_sur: "208cb1aadcabe729e8efd79f8c8525d1cfbff51fc621e195fa209595643b0446"
sha256 catalina: "66943603d3a17f0b53b634b0597674c2c713a00e95dada6d34dfb3a4b7aea92a"
sha256 x86_64_linux: "3a3ce732fe9ca2c455999d140a2915326acbcb927a2f8776e5f7027777ef22d4"
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