blob: 50062cf483e11cff11bcee5a99cfdc93bd89bba2 (
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
PORTNAME= prometheus
DISTVERSIONPREFIX= v
DISTVERSION= 2.25.2
CATEGORIES= net-mgmt
MAINTAINER= dor.bsd@xm0.uk
COMMENT= Systems monitoring and alerting toolkit
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= go:modules gmake
USE_GITHUB= yes
GH_TUPLE= ports-assets:net-mgmt_prometheus2:${DISTVERSIONFULL}:assets
USE_RC_SUBR= prometheus
GO_BUILDFLAGS= -v -ldflags "${LD_FLAG_STRING}" -tags netgo,builtinassets
GO_TARGET= ./cmd/prometheus \
./cmd/promtool
SUB_LIST+= PROMETHEUS_USER=${PROMETHEUS_USER} \
PROMETHEUS_GROUP=${PROMETHEUS_GROUP} \
PROMETHEUS_CONSOLE_LIBRARIES_DIR=${PROMETHEUS_CONSOLE_LIBRARIES_DIR} \
PROMETHEUS_CONSOLES_DIR=${PROMETHEUS_CONSOLES_DIR} \
PROMETHEUS_DB_DIR=${PROMETHEUS_DB_DIR}
USERS= ${PROMETHEUS_USER}
GROUPS= ${PROMETHEUS_GROUP}
PLIST_SUB+= PROMETHEUS_USER=${PROMETHEUS_USER} \
PROMETHEUS_GROUP=${PROMETHEUS_GROUP} \
PROMETHEUS_CONSOLE_LIBRARIES_DIR=${PROMETHEUS_CONSOLE_LIBRARIES_DIR} \
PROMETHEUS_CONSOLES_DIR=${PROMETHEUS_CONSOLES_DIR}
OPTIONS_DEFINE= DOCS
BUILD_USER?= ${USER}
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} \
${LD_FLAG_X_PREFIX}.BuildDate=${SOURCE_DATE_EPOCH:U${SOURCE_DATE_EPOCH_CMD:sh}}
LD_FLAG_X_PREFIX= -X github.com/prometheus/common/version
PROMETHEUS_USER?= prometheus
PROMETHEUS_GROUP?= prometheus
PROMETHEUS_CONSOLES_DIR?= ${DATADIR}/consoles
PROMETHEUS_CONSOLE_LIBRARIES_DIR?= ${DATADIR}/console_libraries
PROMETHEUS_DB_DIR?= /var/db/${PORTNAME}
# Bring DISTINFO_FILE into scope so we can get the timestamp.
.include <bsd.port.pre.mk>
SOURCE_DATE_EPOCH_CMD= date -ur $$(${GREP} TIMESTAMP ${DISTINFO_FILE} | ${SED} -e 's/[^0-9]//g') '+%Y%m%d-%T'
# This file includes the GH_TUPLE and a post-extract section. Generated by
# make gomod-vendor. Ensure that the GH_TUPLE in this file is +=, otherwise
# it will clobber our assets tuple above.
# Generated with: sudo env M2T_GITHUB=$M2T_GITHUB make gomod-vendor > out
# sudo required because gomod-vendor appears to be doing special things as root
.include "Makefile.modules"
post-patch:
@${LN} -s ${WRKSRC_assets}/web/ui/assets_vfsdata.go \
${WRKSRC}/web/ui/assets_vfadata.go
post-install:
${MKDIR} ${STAGEDIR}${DESTDIR}${PROMETHEUS_CONSOLES_DIR}
${MKDIR} ${STAGEDIR}${DESTDIR}${PROMETHEUS_CONSOLE_LIBRARIES_DIR}
${INSTALL_DATA} \
${WRKSRC}/documentation/examples/prometheus.yml \
${STAGEDIR}${LOCALBASE}/etc/prometheus.yml.sample
( cd ${WRKSRC}/console_libraries \
&& ${COPYTREE_SHARE} . ${STAGEDIR}${PROMETHEUS_CONSOLE_LIBRARIES_DIR} )
( cd ${WRKSRC}/consoles \
&& ${COPYTREE_SHARE} . ${STAGEDIR}${PROMETHEUS_CONSOLES_DIR} )
post-install-DOCS-on:
${MKDIR} ${STAGEDIR}${DOCSDIR}
( cd ${WRKSRC}/docs \
&& ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR} )
.include <bsd.port.post.mk>
|