class Logcheck < Formula desc "Mail anomalies in the system logfiles to the administrator" homepage "https://packages.debian.org/sid/logcheck" url "https://deb.debian.org/debian/pool/main/l/logcheck/logcheck_1.4.7.tar.xz" sha256 "cc160cbcac28f39388e8b96e462c4e62d005453b6957f1f0eaa8c093ff9cf3df" license "GPL-2.0-only" livecheck do url "https://packages.debian.org/unstable/logcheck" regex(/href=.*?logcheck[._-]v?(\d+(?:\.\d+)+)\.t/i) end bottle do sha256 cellar: :any_skip_relocation, all: "19ea8aec29460a47f04121aea1ff7151a215179bff66fd3091cb546664ed74dd" end on_macos do depends_on "gnu-sed" => :build end def install # use gnu-sed on macOS ENV.prepend_path "PATH", Formula["gnu-sed"].libexec/"gnubin" if OS.mac? # Fix dependency on `dpkg-parsechangelog` inreplace "Makefile", "$$(dpkg-parsechangelog -S version)", version.to_s inreplace "Makefile", "$(DESTDIR)/$(CONFDIR)", "$(CONFDIR)" system "make", "install", "--always-make", "DESTDIR=#{prefix}", "SBINDIR=sbin", "BINDIR=bin", "CONFDIR=#{etc}/logcheck" end test do (testpath/"README").write "Boaty McBoatface" output = shell_output("#{sbin}/logtail -f #{testpath}/README") assert_match "Boaty McBoatface", output end end