sysutils/snmp_exporter: Switch to USES=go:modules, fix build with go1.13

PR:		239868
Submitted by:	Dmitri Goutnik <dg@syrec.org>
Approved by:	portmgr (unbreak with the upcoming go1.13)
This commit is contained in:
Yuri Victorovich 2019-08-17 01:55:45 +00:00
parent c35fa7d485
commit 25e635087c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=509132

View File

@ -12,26 +12,20 @@ LICENSE= APACHE20
LIB_DEPENDS= libnetsnmp.so:net-mgmt/net-snmp
USES= go
USES= go:modules
USE_GITHUB= yes
USE_RC_SUBR= snmp_exporter
GH_ACCOUNT= prometheus
GO_PKGNAME= github.com/${GH_ACCOUNT}/${PORTNAME}
GO_TARGET= github.com/${GH_ACCOUNT}/${PORTNAME}
do-build:
(cd ${GO_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GO_ENV} ${GO_CMD} install -v ${GO_TARGET})
(cd ${GO_WRKSRC}/generator; ${SETENV} ${MAKE_ENV} ${GO_ENV} ${GO_CMD} install -v ${GO_TARGET}/generator)
GO_TARGET= . ./generator
post-patch:
@${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|g' ${GO_WRKSRC}/generator/main.go
do-install:
post-install:
${MKDIR} ${STAGEDIR}${PREFIX}/etc/snmp_exporter/
${INSTALL_DATA} ${FILESDIR}/generator.yml ${STAGEDIR}${PREFIX}/etc/snmp_exporter/generator.yml
${INSTALL_PROGRAM} ${WRKDIR}/bin/snmp_exporter ${STAGEDIR}${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKDIR}/bin/generator ${STAGEDIR}${PREFIX}/bin/snmp_exporter_generator
${MV} ${STAGEDIR}${PREFIX}/bin/generator ${STAGEDIR}${PREFIX}/bin/snmp_exporter_generator
.include <bsd.port.mk>