diff options
Diffstat (limited to 'net-mgmt/prometheus/Makefile')
-rw-r--r-- | net-mgmt/prometheus/Makefile | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/net-mgmt/prometheus/Makefile b/net-mgmt/prometheus/Makefile index d63b8e5c4013..d3f3163a80d8 100644 --- a/net-mgmt/prometheus/Makefile +++ b/net-mgmt/prometheus/Makefile @@ -3,6 +3,7 @@ PORTNAME= prometheus PORTVERSION= 1.8.2 +PORTREVISION= 1 DISTVERSIONPREFIX= v CATEGORIES= net-mgmt @@ -22,13 +23,20 @@ USE_RC_SUBR= prometheus USERS= prometheus GROUPS= prometheus -LD_FLAG_STRING= ${GO_PKGNAME}/vendor/github.com/prometheus/common/version. +BUILD_USER?= ${USER} +LD_FLAG_X_PREFIX= -X ${GO_PKGNAME}/vendor/github.com/prometheus/common/version +LD_FLAG_STRING= -s \ + ${LD_FLAG_X_PREFIX}.Version=${PORTVERSION} \ + ${LD_FLAG_X_PREFIX}.Revision=${PORTREVISION} \ + ${LD_FLAG_X_PREFIX}.Branch=release-${PORTVERSION:R} \ + ${LD_FLAG_X_PREFIX}.BuildUser=${BUILD_USER} + do-build: - (cd ${GO_WRKSRC}/cmd/prometheus ; ${SETENV} ${GO_ENV} go install -ldflags \ - "-s -X ${LD_FLAG_STRING}.Version=${PORTVERSION}") + ( cd ${GO_WRKSRC}/cmd/prometheus ; \ + ${SETENV} ${GO_ENV} go install -ldflags "${LD_FLAG_STRING}" ) - (cd ${GO_WRKSRC}/cmd/promtool ; ${SETENV} ${GO_ENV} go install -ldflags \ - "-s -X ${LD_FLAG_STRING}.Version=${PORTVERSION}") + ( cd ${GO_WRKSRC}/cmd/promtool ; \ + ${SETENV} ${GO_ENV} go install -ldflags "${LD_FLAG_STRING}" ) do-install: ${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/prometheus ${STAGEDIR}${PREFIX}/bin |