59 lines
1.9 KiB
Ruby
59 lines
1.9 KiB
Ruby
class Goaccess < Formula
|
|
desc "Log analyzer and interactive viewer for the Apache Webserver"
|
|
homepage "https://goaccess.io/"
|
|
url "https://tar.goaccess.io/goaccess-1.4.6.tar.gz"
|
|
sha256 "1d0f27c3382b3fb834b6cc419389a87e100d874a71e343403cd19eb5491c72d0"
|
|
license "MIT"
|
|
head "https://github.com/allinurl/goaccess.git"
|
|
|
|
livecheck do
|
|
url "https://goaccess.io/download"
|
|
regex(/href=.*?goaccess[._-]v?(\d+(?:\.\d+)+)\.t/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 arm64_big_sur: "28622dba228f979a25f0e35e6926b359f6bb5cc0ad3f3383baeec7190fb6b86c"
|
|
sha256 big_sur: "5415410ba76a1fae2b27883ecdc5b734a306d87cb251eee2cb6cc09548b1676e"
|
|
sha256 catalina: "24c96e15f8b60ea0ff6a8b7f140f186c0c6e75f39d7cade67c23722e16a7c66f"
|
|
sha256 mojave: "22143fbfcc714d039ea14dcbb9aeb1ea35cc375b9dce5ef22e53c7580723cc6a"
|
|
end
|
|
|
|
depends_on "autoconf" => :build
|
|
depends_on "automake" => :build
|
|
depends_on "gettext"
|
|
depends_on "libmaxminddb"
|
|
depends_on "tokyo-cabinet"
|
|
|
|
def install
|
|
ENV.append_path "PATH", Formula["gettext"].bin
|
|
system "autoreconf", "-vfi"
|
|
|
|
args = %W[
|
|
--disable-debug
|
|
--disable-dependency-tracking
|
|
--prefix=#{prefix}
|
|
--enable-utf8
|
|
--enable-tcb=btree
|
|
--enable-geoip=mmdb
|
|
--with-libintl-prefix=#{Formula["gettext"].opt_prefix}
|
|
]
|
|
|
|
system "./configure", *args
|
|
system "make", "install"
|
|
end
|
|
|
|
test do
|
|
(testpath/"access.log").write \
|
|
'127.0.0.1 - - [04/May/2015:15:48:17 +0200] "GET / HTTP/1.1" 200 612 "-" ' \
|
|
'"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) ' \
|
|
'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36"'
|
|
|
|
output = shell_output \
|
|
"#{bin}/goaccess --time-format=%T --date-format=%d/%b/%Y " \
|
|
"--log-format='%h %^[%d:%t %^] \"%r\" %s %b \"%R\" \"%u\"' " \
|
|
"-f access.log -o json 2>/dev/null"
|
|
|
|
assert_equal "Chrome", JSON.parse(output)["browsers"]["data"].first["data"]
|
|
end
|
|
end
|