aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/consul/Makefile
blob: 4b014e40bc43b136b3690a8668ff3b76714ca2dc (plain) (blame)
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
45
46
47
48
49
# $FreeBSD$

PORTNAME=   consul
PORTVERSION=    1.5.1
DISTVERSIONPREFIX=  v
CATEGORIES= sysutils

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

LICENSE=    MPL20

USES=       compiler go

USE_GITHUB= yes
GH_ACCOUNT= hashicorp
GH_SUBDIR=  src/github.com/${GH_ACCOUNT}/${PORTNAME}

USE_RC_SUBR=    consul

PLIST_FILES=    bin/consul

USERS=      consul
GROUPS=     consul

post-extract:
    @${MV} ${WRKSRC}/vendor/ ${WRKSRC}/src/

do-build:
    @cd ${WRKSRC}/src/github.com/hashicorp/consul; ${SETENV} ${MAKE_ENV} CGO_ENABLED=0 ${BUILD_ENV} GOPATH=${WRKSRC} go build \
        -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} \
        " \
        -o bin/consul

do-install:
    ${INSTALL_PROGRAM} ${WRKSRC}/src/github.com/hashicorp/consul/bin/consul ${STAGEDIR}${PREFIX}/bin/consul

.include <bsd.port.pre.mk>

# golang assumes that if clang is in use, it is called "clang" and not "cc". If
# it's called "cc", go fails.
.if ${COMPILER_TYPE} == clang
BUILD_ENV=  CC=clang
.endif

.include <bsd.port.post.mk>