Lines 2-8
Link Here
|
2 |
|
2 |
|
3 |
PORTNAME= prometheus |
3 |
PORTNAME= prometheus |
4 |
DISTVERSIONPREFIX= v |
4 |
DISTVERSIONPREFIX= v |
5 |
DISTVERSION= 2.2.1 |
5 |
DISTVERSION= 2.3.1 |
6 |
CATEGORIES= net-mgmt |
6 |
CATEGORIES= net-mgmt |
7 |
|
7 |
|
8 |
MAINTAINER= dor.bsd@xm0.uk |
8 |
MAINTAINER= dor.bsd@xm0.uk |
Lines 16-23
GO_PKGNAME= github.com/${GH_ACCOUNT}/${GH_PROJECT}
Link Here
|
16 |
USE_GITHUB= yes |
16 |
USE_GITHUB= yes |
17 |
USE_RC_SUBR= prometheus |
17 |
USE_RC_SUBR= prometheus |
18 |
|
18 |
|
19 |
USERS= prometheus |
19 |
OPTIONS_DEFINE= EXAMPLES |
20 |
GROUPS= prometheus |
20 |
OPTIONS_DEFAULT= EXAMPLES |
|
|
21 |
EXAMPLES_DESC= Install example configuration files for syslog and newsyslog |
22 |
|
23 |
PROMETHEUS_USER?= prometheus |
24 |
PROMETHEUS_GROUP?= prometheus |
25 |
|
26 |
USERS= ${PROMETHEUS_USER} |
27 |
GROUPS= ${PROMETHEUS_GROUP} |
28 |
|
29 |
PROMETHEUS_BINARIES= prometheus promtool |
30 |
PROMETHEUS_SHARE_DIR= ${DATADIR} |
31 |
PROMETHEUS_CONSOLES_DIR= ${PROMETHEUS_SHARE_DIR}/consoles |
32 |
PROMETHEUS_CONSOLE_LIBRARIES_DIR= ${PROMETHEUS_SHARE_DIR}/console_libraries |
33 |
PROMETHEUS_DB_DIR= /var/db/${PORTNAME} |
34 |
PROMETHEUS_LOG_DIR= /var/log/prometheus |
35 |
PROMETHEUS_LOG_FILE= ${PROMETHEUS_LOG_DIR}/prometheus.log |
36 |
|
37 |
SUB_FILES= prometheus \ |
38 |
newsyslog.conf \ |
39 |
syslog.d.conf |
40 |
|
41 |
SUB_LIST+= PROMETHEUS_USER=${PROMETHEUS_USER} \ |
42 |
PROMETHEUS_GROUP=${PROMETHEUS_GROUP} \ |
43 |
PROMETHEUS_CONSOLE_LIBRARIES_DIR=${PROMETHEUS_CONSOLE_LIBRARIES_DIR} \ |
44 |
PROMETHEUS_CONSOLES_DIR=${PROMETHEUS_CONSOLES_DIR} \ |
45 |
PROMETHEUS_DB_DIR=${PROMETHEUS_DB_DIR} \ |
46 |
PROMETHEUS_LOG_DIR=${PROMETHEUS_LOG_DIR} \ |
47 |
PROMETHEUS_LOG_FILE=${PROMETHEUS_LOG_FILE} \ |
48 |
PROMETHEUS_SHARE_DIR=${PROMETHEUS_SHARE_DIR} |
49 |
|
50 |
PLIST_SUB+= PROMETHEUS_CONSOLE_LIBRARIES_DIR=${PROMETHEUS_CONSOLE_LIBRARIES_DIR} \ |
51 |
PROMETHEUS_CONSOLES_DIR=${PROMETHEUS_CONSOLES_DIR} \ |
52 |
PROMETHEUS_DB_DIR=${PROMETHEUS_DB_DIR} \ |
53 |
PROMETHEUS_LOG_DIR=${PROMETHEUS_LOG_DIR} |
21 |
|
54 |
|
22 |
BUILD_USER?= ${USER} |
55 |
BUILD_USER?= ${USER} |
23 |
LD_FLAG_X_PREFIX= -X ${GO_PKGNAME}/vendor/${GO_PKGNAME:H}/common/version |
56 |
LD_FLAG_X_PREFIX= -X ${GO_PKGNAME}/vendor/${GO_PKGNAME:H}/common/version |
Lines 26-47
LD_FLAG_STRING= -s \
Link Here
|
26 |
${LD_FLAG_X_PREFIX}.Revision=${PORTREVISION} \ |
59 |
${LD_FLAG_X_PREFIX}.Revision=${PORTREVISION} \ |
27 |
${LD_FLAG_X_PREFIX}.Branch=release-${PORTVERSION:R} \ |
60 |
${LD_FLAG_X_PREFIX}.Branch=release-${PORTVERSION:R} \ |
28 |
${LD_FLAG_X_PREFIX}.BuildUser=${BUILD_USER} |
61 |
${LD_FLAG_X_PREFIX}.BuildUser=${BUILD_USER} |
29 |
PROMETHEUS_BINARIES= prometheus promtool |
|
|
30 |
|
62 |
|
31 |
do-build: |
63 |
do-build: |
32 |
.for bin in ${PROMETHEUS_BINARIES} |
64 |
.for bin in ${PROMETHEUS_BINARIES} |
33 |
( cd ${GO_WRKSRC}/cmd/${bin} ; \ |
65 |
( cd ${GO_WRKSRC}/cmd/${bin} ; \ |
34 |
${SETENV} ${MAKE_ENV} ${GO_ENV} go install -ldflags "${LD_FLAG_STRING}" ) |
66 |
${SETENV} ${MAKE_ENV} ${GO_ENV} \ |
|
|
67 |
${GO_CMD} install -v -ldflags "${LD_FLAG_STRING}" ) |
35 |
.endfor |
68 |
.endfor |
36 |
|
69 |
|
37 |
do-install: |
70 |
do-install: |
38 |
.for bin in ${PROMETHEUS_BINARIES} |
71 |
.for bin in ${PROMETHEUS_BINARIES} |
39 |
${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/${bin} ${STAGEDIR}${PREFIX}/bin |
72 |
${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/${bin} ${STAGEDIR}${PREFIX}/bin |
40 |
.endfor |
73 |
.endfor |
|
|
74 |
|
41 |
${INSTALL_DATA} \ |
75 |
${INSTALL_DATA} \ |
42 |
${WRKSRC}/documentation/examples/prometheus.yml \ |
76 |
${WRKSRC}/documentation/examples/prometheus.yml \ |
43 |
${STAGEDIR}${LOCALBASE}/etc/prometheus.yml.sample |
77 |
${STAGEDIR}${LOCALBASE}/etc/prometheus.yml.sample |
44 |
|
78 |
|
45 |
${MKDIR} ${STAGEDIR}${DESTDIR}/var/db/prometheus |
79 |
${MKDIR} ${STAGEDIR}${DESTDIR}${PROMETHEUS_DB_DIR} |
|
|
80 |
${MKDIR} ${STAGEDIR}${DESTDIR}${PROMETHEUS_CONSOLES_DIR} |
81 |
${MKDIR} ${STAGEDIR}${DESTDIR}${PROMETHEUS_CONSOLE_LIBRARIES_DIR} |
82 |
${MKDIR} ${STAGEDIR}${PROMETHEUS_LOG_DIR} |
83 |
|
84 |
( cd ${WRKSRC}/console_libraries \ |
85 |
&& ${COPYTREE_SHARE} . ${STAGEDIR}${PROMETHEUS_CONSOLE_LIBRARIES_DIR} \ |
86 |
) |
87 |
( cd ${WRKSRC}/consoles \ |
88 |
&& ${COPYTREE_SHARE} . ${STAGEDIR}${PROMETHEUS_CONSOLES_DIR} \ |
89 |
) |
90 |
|
91 |
post-install-EXAMPLES-on: |
92 |
${MKDIR} ${STAGEDIR}${EXAMPLESDIR} |
93 |
${INSTALL_DATA} \ |
94 |
${WRKDIR}/syslog.d.conf \ |
95 |
${STAGEDIR}${EXAMPLESDIR}/syslog.d.conf |
96 |
|
97 |
${INSTALL_DATA} \ |
98 |
${WRKDIR}/newsyslog.conf \ |
99 |
${STAGEDIR}${EXAMPLESDIR}/newsyslog.conf |
46 |
|
100 |
|
47 |
.include <bsd.port.mk> |
101 |
.include <bsd.port.mk> |