summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sysutils/goaccess/Makefile17
-rw-r--r--sysutils/goaccess/files/goaccess.in45
2 files changed, 55 insertions, 7 deletions
diff --git a/sysutils/goaccess/Makefile b/sysutils/goaccess/Makefile
index 0310153540fa..a7dc6feac307 100644
--- a/sysutils/goaccess/Makefile
+++ b/sysutils/goaccess/Makefile
@@ -3,7 +3,7 @@
PORTNAME= goaccess
PORTVERSION= 1.3
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= sysutils
MASTER_SITES= http://tar.goaccess.io/
@@ -13,23 +13,23 @@ COMMENT= Real-time Apache web log analyzer
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/COPYING
-GNU_CONFIGURE= yes
-INSTALL_TARGET= install-strip
-USE_LDCONFIG= yes
USES= alias compiler:c11 pkgconfig ncurses
+USE_RC_SUBR= goaccess
+
+INSTALL_TARGET= install-strip
+GNU_CONFIGURE= yes
CFLAGS+= -I${NCURSESINC} -I${LOCALBASE}/include
LDFLAGS+= -L${NCURSESLIB} -L${LOCALBASE}/lib
PORTDOCS= AUTHORS COPYING ChangeLog NEWS README TODO
-OPTIONS_DEFINE= DOCS DEBUG GEOIP2 NLS UTF8
-OPTIONS_DEFAULT= GEOIP2 UTF8
+OPTIONS_DEFINE= DOCS DEBUG GEOIP2 NLS SSL UTF8
+OPTIONS_DEFAULT= GEOIP2 SSL UTF8
OPTIONS_RADIO= TOKYOCABINET
OPTIONS_RADIO_TOKYOCABINET= TOKYOCABINET_BTREE TOKYOCABINET_MHASH
OPTIONS_SUB= yes
-
DEBUG_CONFIGURE_ON= --enable-debug
NLS_CONFIGURE_ENABLE= nls
NLS_USES= gettext-runtime
@@ -39,6 +39,9 @@ GEOIP2_DESC= IP location support
GEOIP2_CONFIGURE_ON= --enable-geoip=mmdb
GEOIP2_LIB_DEPENDS= libmaxminddb.so:net/libmaxminddb
+SSL_DESC= Use SSL for WebSocket
+SSL_CONFIGURE_ON= --with-openssl
+
TOKYOCABINET_DESC= Tokyo Cabinet support
TOKYOCABINET_BTREE_DESC= Storage using on-disk B+ Tree
TOKYOCABINET_MHASH_DESC= Storage using on-memory hash database
diff --git a/sysutils/goaccess/files/goaccess.in b/sysutils/goaccess/files/goaccess.in
new file mode 100644
index 000000000000..a6806e7bd33c
--- /dev/null
+++ b/sysutils/goaccess/files/goaccess.in
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: goaccess
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf to enable goaccess.
+#
+# 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.
+
+. /etc/rc.subr
+
+name=goaccess
+rcvar=goaccess_enable
+
+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}
+
+command=/usr/local/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
+ fi
+}
+
+command_args="--daemonize --real-time-html --pid-file=$pidfile -p $goaccess_config -o $goaccess_html"
+run_rc_command "$1"