freebsd-ports/net-mgmt/kapacitor/Makefile
Rene Ladan ee06ec39ce Clean up support for FreeBSD 11.2.
While here, modernize some comments in Mk/bsd.*.mk.

Note that graphics/drm-fbsd11.2-kmod is not renamed yet, this was somewhat
under discussion.

Submitted by:	rene
Reviewed by:	antoine, jbeich, mat, zeising
Differential Revision:	https://reviews.freebsd.org/D21974
2019-11-07 16:30:12 +00:00

69 lines
1.7 KiB
Makefile

# Created by: Stefan Lambrev <cheffo@freebsd-bg.org>
# $FreeBSD$
PORTNAME= kapacitor
DISTVERSIONPREFIX= v
DISTVERSION= 1.5.1
CATEGORIES= net-mgmt
MAINTAINER= cheffo@freebsd-bg.org
COMMENT= Time-series data collection
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
ONLY_FOR_ARCHS= amd64 armv6 armv7 i386
USES= go
USE_RC_SUBR= kapacitord
USE_GITHUB= yes
GH_ACCOUNT= influxdata
GH_SUBDIR= src/github.com/${GH_ACCOUNT}/${PORTNAME}
GO_BUILDFLAGS+= -ldflags "-X main.version=${DISTVERSION}"
GO_TARGET= ./cmd/kapacitor \
./cmd/kapacitord
SUB_FILES= kapacitord
SUB_LIST+= KAPACITORD_USER=${KAPACITORD_USER} \
KAPACITORD_GROUP=${KAPACITORD_GROUP} \
KAPACITORD_DBDIR=${KAPACITORD_DBDIR} \
KAPACITORD_LOGDIR=${KAPACITORD_LOGDIR}
PLIST_SUB= KAPACITORD_USER=${KAPACITORD_USER} \
KAPACITORD_GROUP=${KAPACITORD_GROUP} \
KAPACITORD_DBDIR=${KAPACITORD_DBDIR} \
KAPACITORD_LOGDIR=${KAPACITORD_LOGDIR}
#Use influxd user as it's aleary present in ports system
KAPACITORD_USER= influxd
KAPACITORD_GROUP= influxd
USERS= ${KAPACITORD_USER}
GROUPS= ${KAPACITORD_GROUP}
.include <bsd.port.pre.mk>
.if ${OPSYS} == "FreeBSD" && (${OSVERSION} < 1200000 || ${OSVERSION} >= 1200015)
SUB_LIST+= KAPACITORD_LOGCMD="daemon"
.else
SUB_LIST+= KAPACITORD_LOGCMD="logger"
.endif
KAPACITORD_DBDIR= /var/db/${PORTNAME}/
KAPACITORD_LOGDIR= /var/log/${PORTNAME}/
post-install:
${MKDIR} ${STAGEDIR}${KAPACITORD_DBDIR} \
${STAGEDIR}${KAPACITORD_LOGDIR}
@${SED} -i .bak -e \
"s|/var/lib/kapacitor|/var/db/kapacitor|g" \
${WRKSRC}/etc/${PORTNAME}/${PORTNAME}.conf
${INSTALL_DATA} \
${WRKSRC}/etc/${PORTNAME}/${PORTNAME}.conf \
${STAGEDIR}${PREFIX}/etc/${PORTNAME}.conf.sample
.include <bsd.port.post.mk>