# $FreeBSD: head/net/librespeed-go/Makefile 568887 2021-03-20 21:48:38Z rhurlin $ PORTNAME= librespeed-go DISTVERSIONPREFIX= v DISTVERSION= 1.1.3 CATEGORIES= net www MAINTAINER= driesm.michiels@gmail.com COMMENT= GO backend for LibreSpeed LICENSE= LGPL3 LICENSE_FILE= ${WRKSRC}/LICENSE USES= go:modules USE_RC_SUBR= librespeed-go GO_MODULE= github.com/librespeed/speedtest-go SUB_FILES= pkg-message SUB_LIST= LIBRESPEED_USER=${USERS} LIBRESPEED_GROUP=${GROUPS} PORTNAME=${PORTNAME} USERS= librespeed GROUPS= librespeed PLIST_SUB= LIBRESPEED_USER=${USERS} LIBRESPEED_GROUP=${GROUPS} 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}${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} ${CP} -a ${WRKSRC}/assets/*.html ${STAGEDIR}${EXAMPLESDIR} .include