# $FreeBSD: head/net-mgmt/prometheus2/Makefile 568858 2021-03-20 10:39:49Z rhurlin $ 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 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