--- UIDs (revision 539551) +++ UIDs (working copy) @@ -819,7 +819,7 @@ archiva:*:871:871::0:0:Apache Archiva Daemon:/nonexistent:/usr/sbin/nologin bitmark:*:872:872::0:0:Bitmark Property System:/var/lib/bitmarkd:/usr/sbin/nologin bitmark-recorder:*:873:873::0:0:Bitmark Property Recorder:/var/lib/recorderd:/usr/sbin/nologin -# free: 874 +librespeed:*:874:874::0:0:LibreSpeed user:/nonexistent:/usr/sbin/nologin # free: 875 # free: 876 # free: 877 --- GIDs (revision 539551) +++ GIDs (working copy) @@ -814,7 +814,7 @@ # free: 871 bitmark:*:872: bitmark-recorder:*:873: -# free: 874 +librespeed:*:874: # free: 875 # free: 876 # free: 877 --- net/librespeed-go/Makefile (revision 539551) +++ net/librespeed-go/Makefile (working copy) @@ -2,7 +2,7 @@ PORTNAME= librespeed-go DISTVERSIONPREFIX= v -DISTVERSION= 1.0.0 +DISTVERSION= 1.0.1 CATEGORIES= net www MAINTAINER= driesm.michiels@gmail.com @@ -43,21 +43,31 @@ spf13:viper:v1.6.2:spf13_viper/vendor/github.com/spf13/viper \ subosito:gotenv:v1.2.0:subosito_gotenv/vendor/github.com/subosito/gotenv -GO_TARGET= ./:${PREFIX}/libexec/librespeed-go/librespeed-go +USERS= librespeed +GROUPS= librespeed SUB_FILES= pkg-message +PLIST_SUB= LIBRESPEED_USER=${USERS} LIBRESPEED_GROUP=${GROUPS} +SUB_LIST= LIBRESPEED_USER=${USERS} LIBRESPEED_GROUP=${GROUPS} PORTNAME=${PORTNAME} OPTIONS_DEFINE= EXAMPLES post-patch: ${REINPLACE_CMD} -e 's|"."|"${ETCDIR}"|g' ${WRKSRC}/config/config.go + ${REINPLACE_CMD} -e 's|"./assets"|"${WWWDIR}"|g' ${WRKSRC}/config/config.go +pre-install: + ${REINPLACE_CMD} -e 's|"./assets"|"${WWWDIR}"|g' ${WRKSRC}/settings.toml + ${REINPLACE_CMD} -e 's|"speedtest.db"|"/var/db/${PORTNAME}/speedtest.db"|g' ${WRKSRC}/settings.toml + post-install: - ${MKDIR} ${STAGEDIR}${PREFIX}/libexec/${PORTNAME}/assets - ${CP} -a ${WRKSRC}/assets/*.js ${STAGEDIR}${PREFIX}/libexec/librespeed-go/assets - ${CP} -a ${WRKSRC}/assets/*.ttf ${STAGEDIR}${PREFIX}/libexec/librespeed-go/assets + ${MKDIR} ${STAGEDIR}${WWWDIR} + ${CP} -a ${WRKSRC}/assets/*.js ${STAGEDIR}${WWWDIR} + ${CP} -a ${WRKSRC}/assets/*.ttf ${STAGEDIR}${WWWDIR} ${MKDIR} ${STAGEDIR}${ETCDIR} ${INSTALL_DATA} ${WRKSRC}/settings.toml ${STAGEDIR}${ETCDIR}/settings.toml.sample + ${MKDIR} ${STAGEDIR}/var/db/${PORTNAME} + ${MKDIR} ${STAGEDIR}/var/run/${PORTNAME} post-install-EXAMPLES-on: ${MKDIR} ${STAGEDIR}${EXAMPLESDIR} --- net/librespeed-go/distinfo (revision 539551) +++ net/librespeed-go/distinfo (working copy) @@ -1,6 +1,6 @@ -TIMESTAMP = 1591867495 -SHA256 (librespeed-speedtest-go-v1.0.0_GH0.tar.gz) = 8d9c572bc06d0994f01757496016b180e61ab422ecc9c03a13f1bdab9bbd766a -SIZE (librespeed-speedtest-go-v1.0.0_GH0.tar.gz) = 2232423 +TIMESTAMP = 1592422992 +SHA256 (librespeed-speedtest-go-v1.0.1_GH0.tar.gz) = 1f8bfc80326af71e27f65716c35cc09c642f7424849f013dbe566826d3dfd31e +SIZE (librespeed-speedtest-go-v1.0.1_GH0.tar.gz) = 2233115 SHA256 (etcd-io-bbolt-v1.3.3_GH0.tar.gz) = 089ae9a1651531dcac069370212abfe16e83af1c6f331d59e0154fa64fe9b120 SIZE (etcd-io-bbolt-v1.3.3_GH0.tar.gz) = 94626 SHA256 (fsnotify-fsnotify-v1.4.7_GH0.tar.gz) = b7530d973d0ab0e58ad8ce1b9a4b963d6f57b3d72f2f9e13d49846976361b1cd --- net/librespeed-go/files/librespeed-go.in (revision 539551) +++ net/librespeed-go/files/librespeed-go.in (working copy) @@ -2,7 +2,7 @@ # $FreeBSD$ # -# PROVIDE: librespeed-go +# PROVIDE: %%PORTNAME%% # REQUIRE: SERVERS # KEYWORD: shutdown # @@ -10,13 +10,15 @@ # to enable this service: # # librespeed_go_enable: Set to NO by default. -# Set it to YES to enable librenms +# Set it to YES to enable librespeed-go # librespeed_go_pid: Path of the pid file. -# Default /var/run/librenms/librenms.pid +# Default /var/run/%%PORTNAME%%/%%PšRTNAME%%.pid +# librespeed_go_user: The user account used to run the daemon. +# Default: %%LIBRESPEED_USER%% +# librespeed_go_group: The group used to run the daemon. +# Default: %%LIBRESPEED_GROUP%% # librespeed_go_daemonflags: Flags passed to daemon(8) # Default -f which prevents any logging -# librespeed_go_chdir: Dir to run the daemon in -# Default /usr/local/libexec/librespeed-go . /etc/rc.subr @@ -27,12 +29,13 @@ load_rc_config $name : ${librespeed_go_enable:="NO"} -: ${librespeed_go_pid:="/var/run/librespeed-go.pid"} +: ${librespeed_go_pid:="/var/run/%%PORTNAME%%/%%PORTNAME%%.pid"} +: ${librespeed_go_user:="%%LIBRESPEED_USER%%"} +: ${librespeed_go_group:="%%LIBRESPEED_GROUP%%"} : ${librespeed_go_daemonflags:="-f"} -: ${librespeed_go_chdir:="%%PREFIX%%/libexec/librespeed-go"} pidfile="$librespeed_go_pid" -procname="%%PREFIX%%/libexec/librespeed-go/librespeed-go" +procname="%%PREFIX%%/bin/%%PORTNAME%%" command_args="$librespeed_go_daemonflags -p $pidfile $procname" run_rc_command "$1" --- net/librespeed-go/files/patch-settings.toml (revision 539551) +++ net/librespeed-go/files/patch-settings.toml (nonexistent) @@ -1,8 +0,0 @@ ---- settings.toml.orig 2020-06-02 10:10:50 UTC -+++ settings.toml -@@ -21,4 +21,4 @@ database_username="" - database_password="" - - # if you use `bolt` as database, set database_file to database file location --database_file="speedtest.db" -+database_file="/var/db/speedtest.db" --- net/librespeed-go/files/pkg-message.in (revision 539551) +++ net/librespeed-go/files/pkg-message.in (working copy) @@ -1,10 +1,10 @@ [ { type: install message: <