summaryrefslogtreecommitdiff
path: root/sysutils/consul/Makefile
blob: 78d4646c4a731723a7ab38274e5e31738cab258b (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
PORTNAME=	consul
PORTVERSION=	1.9.4
DISTVERSIONPREFIX=	v
CATEGORIES=	sysutils

MAINTAINER=	swills@FreeBSD.org
COMMENT=	Service discovery and configuration made easy

LICENSE=	MPL20
LICENSE_FILE=	${WRKSRC}/LICENSE

USES=		go:modules

USE_GITHUB=	yes
GH_ACCOUNT=	hashicorp

GO_BUILDFLAGS=	-ldflags=" \
		-X github.com/hashicorp/consul/version.Version=${PORTVERSION} \
		-X github.com/hashicorp/consul/version.VersionPrerelease= \
		-X github.com/hashicorp/consul/version.GitDescribe=v${PORTVERSION} \
		"

USE_RC_SUBR=	consul

PLIST_FILES=	bin/consul

ETCDIR=			${PREFIX}/etc/${PORTNAME}.d
CONSUL_USER?=		consul
CONSUL_GROUP?=		consul
CONSUL_DBDIR?=		/var/db/${PORTNAME}

USERS=		${CONSUL_USER}
GROUPS=		${CONSUL_GROUP}

SUB_LIST=	CONSUL_DBDIR=${CONSUL_DBDIR} \
		GROUP=${CONSUL_GROUP} \
		USER=${CONSUL_USER}

post-extract:
	${MKDIR} ${WRKSRC}/vendor/github.com/${GH_ACCOUNT}/${PORTNAME}
	${LN} -s ${WRKSRC}/api ${WRKSRC}/vendor/github.com/${GH_ACCOUNT}/${PORTNAME}/api
	${LN} -s ${WRKSRC}/sdk ${WRKSRC}/vendor/github.com/${GH_ACCOUNT}/${PORTNAME}/sdk

.include <bsd.port.mk>