summaryrefslogtreecommitdiff
path: root/www/nginx-vts-exporter/Makefile
blob: e4ca98ce6dfd3d868f58e468e6971d2617dfa0a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
PORTNAME=			nginx-vts-exporter
DISTVERSIONPREFIX=	v
DISTVERSION=		0.10.7
PORTREVISION=	19
CATEGORIES=			www

MAINTAINER=			joneum@FreeBSD.org
COMMENT=			Server that scraps NGINX vts stats and export them via HTTP
WWW=		https://github.com/hnlq715/nginx-vts-exporter

LICENSE=			MIT
LICENSE_FILE=		${WRKSRC}/LICENSE

USES=				gmake go
USE_RC_SUBR=		nginx_vts_exporter
USE_GITHUB=			yes
GH_ACCOUNT=			hnlq715

GO_BUILDFLAGS=		-v -ldflags "${LD_FLAG_STRING}"

SUB_FILES=			newsyslog.conf nginx_vts_exporter syslog.d.conf

SUB_LIST=			NGINX_VTS_EXPORTER_LOG_FILE=/var/log/nginx_vts_exporter \
					NGINX_VTS_EXPORTER_LOG_TAG=nginx_vts_exporter

BUILD_USER?=		${USER}
LD_FLAG_X_PREFIX=	-X ${GO_PKGNAME}/vendor/github.com/prometheus/common/version
LD_FLAG_STRING=		-s \
					${LD_FLAG_X_PREFIX}.Branch=release-${PORTVERSION:R} \
					${LD_FLAG_X_PREFIX}.BuildUser=${BUILD_USER} \
					${LD_FLAG_X_PREFIX}.Revision=${PORTREVISION} \
					${LD_FLAG_X_PREFIX}.Version=${PORTVERSION}

PLIST_FILES=	bin/nginx_vts_exporter \
			etc/newsyslog.conf.d/nginx-vts-exporter.conf \
			etc/syslog.d/nginx-vts-exporter.conf

do-install:
	${INSTALL_PROGRAM} \
		${GO_WRKDIR_BIN}/${PORTNAME} \
		${STAGEDIR}${PREFIX}/bin/nginx_vts_exporter

	${MKDIR} ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d
	${MKDIR} ${STAGEDIR}${PREFIX}/etc/syslog.d

	${INSTALL_DATA} \
		${WRKDIR}/newsyslog.conf \
		${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d/${PORTNAME}.conf

	${INSTALL_DATA} \
		${WRKDIR}/syslog.d.conf \
		${STAGEDIR}${PREFIX}/etc/syslog.d/${PORTNAME}.conf

.include <bsd.port.mk>