sysutils/goaccess: Multiple cleanups

* Use https MASTER_SITES
* Update COMMENT and pkg-descr to note that this does much more than
  Apache logs
* Remove tokyocabinet options; support was removed upstream 2.5 years
  ago
* Remove DEBUG option
* Make UTF8 support mandatory
* Don't install license twice
* Use option helpers
* Update strings in rc(8) file and fix hardcoded paths
This commit is contained in:
Adam Weinberger 2022-11-05 09:02:08 -06:00
parent 225b104b00
commit 7cd917cb9f
4 changed files with 40 additions and 46 deletions

View File

@ -1,10 +1,11 @@
PORTNAME= goaccess
PORTVERSION= 1.6.5
PORTREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= http://tar.goaccess.io/
MASTER_SITES= https://tar.goaccess.io/
MAINTAINER= adamw@FreeBSD.org
COMMENT= Real-time Apache web log analyzer
COMMENT= Real-time web log analyzer
WWW= https://goaccess.io
LICENSE= MIT
@ -15,45 +16,34 @@ USE_RC_SUBR= goaccess
INSTALL_TARGET= install-strip
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --enable-utf8
CFLAGS+= -I${NCURSESINC} -I${LOCALBASE}/include
LDFLAGS+= -L${NCURSESLIB} -L${LOCALBASE}/lib
PORTDOCS= AUTHORS COPYING ChangeLog NEWS README TODO
PORTDOCS= AUTHORS ChangeLog NEWS README TODO
OPTIONS_DEFINE= DOCS DEBUG GEOIP2 NLS SSL UTF8
OPTIONS_DEFAULT= GEOIP2 SSL UTF8
OPTIONS_RADIO= TOKYOCABINET
OPTIONS_RADIO_TOKYOCABINET= TOKYOCABINET_BTREE TOKYOCABINET_MHASH
OPTIONS_DEFINE= DOCS GEOIP2 NLS SSL
OPTIONS_DEFAULT=GEOIP2 SSL
OPTIONS_SUB= yes
DEBUG_CONFIGURE_ON= --enable-debug
NLS_CONFIGURE_ENABLE= nls
NLS_USES= gettext-runtime
UTF8_CONFIGURE_ON= --enable-utf8
GEOIP2_DESC= IP location support
GEOIP2_CONFIGURE_ON= --enable-geoip=mmdb
GEOIP2_CONFIGURE_ENABLE=geoip=mmdb
GEOIP2_LIB_DEPENDS= libmaxminddb.so:net/libmaxminddb
SSL_DESC= Use SSL for WebSocket
SSL_CONFIGURE_ON= --with-openssl
SSL_CONFIGURE_WITH= openssl
SSL_USES= ssl
TOKYOCABINET_DESC= Tokyo Cabinet support
TOKYOCABINET_BTREE_DESC= Storage using on-disk B+ Tree
TOKYOCABINET_MHASH_DESC= Storage using on-memory hash database
TOKYOCABINET_BTREE_CONFIGURE_ON= --enable-tcb=btree
TOKYOCABINET_MHASH_CONFIGURE_ON= --enable-tcb=memhash
TOKYOCABINET_BTREE_LIB_DEPENDS= libtokyocabinet.so:databases/tokyocabinet
TOKYOCABINET_MHASH_LIB_DEPENDS= libtokyocabinet.so:databases/tokyocabinet
do-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}
post-install:
${MV} ${STAGEDIR}${ETCDIR}/${PORTNAME}.conf \
${STAGEDIR}${ETCDIR}/${PORTNAME}.conf.sample
${MV} ${STAGEDIR}${ETCDIR}/goaccess.conf \
${STAGEDIR}${ETCDIR}/goaccess.conf.sample
post-install-DOCS-on:
${MKDIR} ${STAGEDIR}${DOCSDIR}
cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}
.include <bsd.port.mk>

View File

@ -4,14 +4,13 @@
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable goaccess.
# To enable the goaccess daemon, add `goaccess_enable="YES"`' to
# your /etc/rc.conf or /etc/rc.conf.local
#
# goaccess_html (path): Set to /var/run/goaccess/goaccess.html
# by default.
# goaccess_log (path): Set to /var/log/httpd-access.log
# by default.
# goaccess_config (str): Set to %%PREFIX%%/etc/goaccess.conf
# by default. Only used if the file exists.
# Optional settings:
# goaccess_html (path): Output file (/var/run/goaccess/goaccess.html)
# goaccess_log (path): Input log (/var/log/httpd-access.log)
# goaccess_config (path): Default: %%ETCDIR%%/goaccess.conf
. /etc/rc.subr
@ -22,22 +21,20 @@ load_rc_config $name
: ${goaccess_html:=/var/run/goaccess/goaccess.html}
: ${goaccess_log:=/var/log/httpd-access.log}
: ${goaccess_config:=%%PREFIX%%/etc/goaccess/goaccess.conf}
: ${goaccess_config:=%%ETCDIR%%/goaccess.conf}
command=/usr/local/bin/${name}
command=%%PREFIX%%/bin/${name}
pidfile=/var/run/${name}.pid
# This is done to allow Directory be used for when configuring Apache
# as Files does not allow for a full path.
start_precmd=start_precmd
start_precmd()
{
if [ $goaccess_html = /var/run/goaccess/goaccess.html ]; then
if [ ! -d /var/run/goaccess ]; then
mkdir /var/run/goaccess
fi
htmldir=$(dirname "$goaccess_html")
if ! [ -d "$htmldir" ]; then
echo "Creating HTML output dir $htmldir."
mkdir "$htmldir"
fi
}
command_args="--daemonize --real-time-html --pid-file=$pidfile -p $goaccess_config -o $goaccess_html"
command_args="--daemonize --real-time-html --pid-file='$pidfile' -p '$goaccess_config' -o '$goaccess_html'"
run_rc_command "$1"

View File

@ -1,3 +1,10 @@
GoAccess is an open source real-time Apache web log analyzer and interactive
viewer that runs in a terminal and provides fast and valuable HTTP statistics
for system administrators that require a visual report on the fly.
GoAccess is an open source real-time web log analyzer and interactive
viewer that runs in a terminal or through your browser.
It can parse a variety of web log formats, including common and
combined log formats, caddy JSON, and many more. Because it is a log
parser, it does not inject anything into your website and does not
require any scripts or weird 1-pixel images.
GoAccess outputs HTML full of analytics, or runs interactively in
console, continually updated via websockets.

View File

@ -1,7 +1,7 @@
bin/goaccess
%%ETCDIR%%/browsers.list
%%ETCDIR%%/podcast.list
@sample %%ETCDIR%%/goaccess.conf.sample etc/goaccess.conf
@sample %%ETCDIR%%/goaccess.conf.sample
man/man1/goaccess.1.gz
%%NLS%%share/locale/de/LC_MESSAGES/goaccess.mo
%%NLS%%share/locale/es/LC_MESSAGES/goaccess.mo