--- Makefile (revision 489353) +++ Makefile (working copy) @@ -13,18 +13,20 @@ LICENSE= MIT LICENSE_FILE= ${WRKSRC}/COPYING -GNU_CONFIGURE= yes -INSTALL_TARGET= install-strip +USES= alias pkgconfig ncurses USE_LDCONFIG= yes -USES= alias 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 NLS UTF8 -OPTIONS_DEFAULT= GEOIP UTF8 +OPTIONS_DEFINE= DOCS DEBUG NLS UTF8 SSL +OPTIONS_DEFAULT= GEOIP UTF8 SSL OPTIONS_RADIO= GEOIPDB TOKYOCABINET OPTIONS_RADIO_GEOIPDB= GEOIP GEOIP2 OPTIONS_RADIO_TOKYOCABINET= TOKYOCABINET_BTREE TOKYOCABINET_MHASH @@ -31,6 +33,7 @@ OPTIONS_SUB= yes GEOIPDB_DESC= GeoIP IP location support +SSL_DESC= Use SSL for WebSocket GEOIP_DESC= Legacy/free database format GEOIP2_DESC= New/paid database format @@ -43,6 +46,7 @@ GEOIP_LIB_DEPENDS= libGeoIP.so:net/GeoIP GEOIP2_CONFIGURE_ON= --enable-geoip=mmdb GEOIP2_LIB_DEPENDS= libmaxminddb.so:net/libmaxminddb +SSL_CONFIGURE_ON= --with-openssl TOKYOCABINET_DESC= Tokyo Cabinet support TOKYOCABINET_BTREE_DESC= Storage using on-disk B+ Tree --- files/goaccess.in (nonexistent) +++ files/goaccess.in (working copy) @@ -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"