89 lines
2.6 KiB
Ruby
89 lines
2.6 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.2008.0.tar.gz"
|
|
sha256 "09d2b6c8bc2f016598aed2bb719e03f822bb01d720c61e4d6e725e00dca1b650"
|
|
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 "97381545007f27c0cfe29662eedb197aeea7c01a221e87f5553a0f45dfc8f1cf" => :catalina
|
|
sha256 "95c46152ac156ee1bfff208092e41d64ab2bded77d25eff90390529ed37bba06" => :mojave
|
|
sha256 "26f9d1750e98bcce954c824408cebb9450f57e3e927777ed246b668bf029d93e" => :high_sierra
|
|
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.8.tar.gz"
|
|
sha256 "3544c757668b4a257825b3cbc26f800f59ef3c1ff2a260f40f96b48ab1d59e07"
|
|
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
|