90 lines
2.7 KiB
Ruby
90 lines
2.7 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.2104.0.tar.gz"
|
|
sha256 "710981c3c34f88d5d1fb55ecfc042aecad8af69414b2b1602b304f4dedbf9f43"
|
|
license all_of: ["Apache-2.0", "GPL-3.0-or-later", "LGPL-3.0-or-later"]
|
|
|
|
livecheck do
|
|
url :homepage
|
|
regex(/Current Version.+?v?(\d+(?:\.\d+)+)/im)
|
|
end
|
|
|
|
bottle do
|
|
sha256 arm64_big_sur: "13b1e937c9c9c3cfeba0b0e57ea39587d23b6162dc19214f9e3913b70cf03af7"
|
|
sha256 big_sur: "dd86787cf71a618813d16d0aacf866d8402fdada714050f6f13c6be55911213b"
|
|
sha256 catalina: "d3f76c216277d141f713ca6ebe531c82ee58d3573b91a91525c8a74283f6befa"
|
|
sha256 mojave: "08c4305668014a2861735ba8d5e468570af66746748a7546876b921c24e0016b"
|
|
end
|
|
|
|
depends_on "pkg-config" => :build
|
|
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"
|
|
|
|
args = %W[
|
|
--prefix=#{prefix}
|
|
--disable-dependency-tracking
|
|
--enable-imfile
|
|
--enable-usertools
|
|
--enable-diagtools
|
|
--disable-uuid
|
|
--disable-libgcrypt
|
|
]
|
|
|
|
system "./configure", *args
|
|
system "make"
|
|
system "make", "install"
|
|
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"
|
|
|
|
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>KeepAlive</key>
|
|
<true/>
|
|
<key>ProgramArguments</key>
|
|
<array>
|
|
<string>#{opt_sbin}/rsyslogd</string>
|
|
<string>-n</string>
|
|
<string>-f</string>
|
|
<string>#{etc}/rsyslog.conf</string>
|
|
<string>-i</string>
|
|
<string>#{var}/run/rsyslogd.pid</string>
|
|
</array>
|
|
<key>StandardErrorPath</key>
|
|
<string>#{var}/log/rsyslogd.log</string>
|
|
<key>StandardOutPath</key>
|
|
<string>#{var}/log/rsyslogd.log</string>
|
|
</dict>
|
|
</plist>
|
|
EOS
|
|
end
|
|
end
|