summaryrefslogtreecommitdiff
path: root/databases/postgres_exporter/Makefile
blob: 7c585f85e32afc32bfb17f4f16e9273c4779adbf (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
# $NetBSD: Makefile,v 1.34 2022/07/13 16:03:04 bsiegert Exp $

DISTNAME=	postgres_exporter-0.5.1
MASTER_SITES=	${MASTER_SITE_GITHUB:=wrouesnel/}
PKGREVISION=	31
CATEGORIES=	databases
GITHUB_TAG=	v${PKGVERSION_NOREV}

MAINTAINER=	pkgsrc-users@pkgsrc.org
HOMEPAGE=	https://github.com/wrouesnel/postgres_exporter
COMMENT=	PostgresSQL metric exporter for Prometheus
LICENSE=	apache-2.0

GO_DIST_BASE=	${DISTNAME}
GO_SRCPATH=	github.com/wrouesnel/postgres_exporter

SMF_METHODS=	${PKGBASE}

EGDIR=			share/examples/${PKGBASE}
PKG_SYSCONFSUBDIR=	${PKGBASE}

INSTALLATION_DIRS+=	${EGDIR}

CONF_FILES_PERMS+=	${EGDIR}/queries.yaml ${PKG_SYSCONFDIR}/queries.yaml \
			${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 644
CONF_FILES_PERMS+=	${EGDIR}/env.conf ${PKG_SYSCONFDIR}/env.conf \
			${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 600

post-build:
	${SED} -e 's,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},g' ${FILESDIR}/env.conf \
	    >${WRKDIR}/.env.conf

post-install:
	${INSTALL_DATA} ${WRKSRC}/queries.yaml \
	    ${DESTDIR}${PREFIX}/share/examples/${PKGBASE}/queries.yaml
	${INSTALL_DATA} ${WRKDIR}/.env.conf \
	    ${DESTDIR}${PREFIX}/share/examples/${PKGBASE}/env.conf

.include "../../lang/go/go-package.mk"
.include "../../mk/bsd.pkg.mk"