View | Details | Raw Unified | Return to bug 239868
Collapse All | Expand All

(-)sysutils/snmp_exporter/Makefile (-10 / +4 lines)
Lines 12-37 Link Here
12
12
13
LIB_DEPENDS=	libnetsnmp.so:net-mgmt/net-snmp
13
LIB_DEPENDS=	libnetsnmp.so:net-mgmt/net-snmp
14
14
15
USES=		go
15
USES=		go:modules
16
USE_GITHUB=	yes
16
USE_GITHUB=	yes
17
USE_RC_SUBR=	snmp_exporter
17
USE_RC_SUBR=	snmp_exporter
18
18
19
GH_ACCOUNT=	prometheus
19
GH_ACCOUNT=	prometheus
20
20
21
GO_PKGNAME=	github.com/${GH_ACCOUNT}/${PORTNAME}
21
GO_TARGET=	. ./generator
22
GO_TARGET=	github.com/${GH_ACCOUNT}/${PORTNAME}
23
22
24
do-build:
25
	(cd ${GO_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GO_ENV} ${GO_CMD} install -v ${GO_TARGET})
26
	(cd ${GO_WRKSRC}/generator; ${SETENV} ${MAKE_ENV} ${GO_ENV} ${GO_CMD} install -v ${GO_TARGET}/generator)
27
28
post-patch:
23
post-patch:
29
	@${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|g' ${GO_WRKSRC}/generator/main.go
24
	@${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|g' ${GO_WRKSRC}/generator/main.go
30
25
31
do-install:
26
post-install:
32
	${MKDIR} ${STAGEDIR}${PREFIX}/etc/snmp_exporter/
27
	${MKDIR} ${STAGEDIR}${PREFIX}/etc/snmp_exporter/
33
	${INSTALL_DATA} ${FILESDIR}/generator.yml ${STAGEDIR}${PREFIX}/etc/snmp_exporter/generator.yml
28
	${INSTALL_DATA} ${FILESDIR}/generator.yml ${STAGEDIR}${PREFIX}/etc/snmp_exporter/generator.yml
34
	${INSTALL_PROGRAM} ${WRKDIR}/bin/snmp_exporter ${STAGEDIR}${PREFIX}/bin
29
	${MV} ${STAGEDIR}${PREFIX}/bin/generator ${STAGEDIR}${PREFIX}/bin/snmp_exporter_generator
35
	${INSTALL_PROGRAM} ${WRKDIR}/bin/generator ${STAGEDIR}${PREFIX}/bin/snmp_exporter_generator
36
30
37
.include <bsd.port.mk>
31
.include <bsd.port.mk>

Return to bug 239868