class Rsyslog < Formula desc "Enhanced, multi-threaded syslogd" homepage "https://www.rsyslog.com/" url "https://www.rsyslog.com/files/download/rsyslog/rsyslog-8.1911.0.tar.gz" sha256 "e1f4776b1c62ad7220f4d624a89a96b0c3d4738006899356eaaef0f1f91ee104" bottle do sha256 "8cbbdf9f7bc2c174f5241dfab3902fa323d92d420abac42760c432144e7c0fa8" => :catalina sha256 "39c3d6a1a9cd35449dcf5b5f4e378030ec413e77573ca52d0e35430091cf3728" => :mojave sha256 "3d6934b9dbbf2834b18ebc4a57bbbe6123817da898600db82b261e5641506729" => :high_sierra end depends_on "pkg-config" => :build depends_on "libestr" 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 plist_options :manual => "rsyslogd -f #{HOMEBREW_PREFIX}/etc/rsyslog.conf -i #{HOMEBREW_PREFIX}/var/run/rsyslogd.pid" def plist; <<~EOS Label #{plist_name} KeepAlive ProgramArguments #{opt_sbin}/rsyslogd -n -f #{etc}/rsyslog.conf -i #{var}/run/rsyslogd.pid StandardErrorPath #{var}/log/rsyslogd.log StandardOutPath #{var}/log/rsyslogd.log EOS end end