aboutsummaryrefslogtreecommitdiffstats
path: root/net/cf/Makefile
blob: 0e503470971949c08b3c499836da9a7c733484f6 (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
50
51
52
53
54
# $FreeBSD$

PORTNAME=   cf
PORTVERSION=    6.12.2
DISTVERSIONPREFIX=  v
CATEGORIES= net

MAINTAINER= swills@FreeBSD.org
COMMENT=    CLI for Cloud Foundry written in Go

BUILD_DEPENDS=  ${LOCALBASE}/bin/go:${PORTSDIR}/lang/go \
        ${LOCALBASE}/bin/go-bindata:${PORTSDIR}/devel/go-bindata

USE_GITHUB= yes
GH_ACCOUNT= cloudfoundry
GH_PROJECT= cli

PLIST_FILES=    bin/cf

PORTDOCS=   BUILDING.md CHANGELOG.md INSTALL.md LICENSE README.md VERSION

STRIP=      # stripping can break go binaries

OPTIONS_DEFINE= DOCS

post-patch:
    @${REINPLACE_CMD} -e "s/BUILT_FROM_SOURCE/${PORTVERSION}/g" ${WRKSRC}/cf/app_constants.go
    @cd ${WRKSRC} ; ${MKDIR} Godeps/_workspace/src/github.com/${GH_ACCOUNT}/${GH_PROJECT} ; \
        ${CP} -R .gitignore .travis.yml BUILDING.md CHANGELOG.md \
        INSTALL.md LICENSE README.md VERSION bin cf \
        cf_commands_excluded.json ci excluded.json fileutils fixtures \
        flags generic glob installers json main makefile plugin \
        plugin_examples release testhelpers utils words \
        Godeps/_workspace/src/github.com/${GH_ACCOUNT}/${GH_PROJECT}

do-build:
    cd ${WRKSRC}/Godeps/_workspace/src/github.com/${GH_ACCOUNT}/${GH_PROJECT} ; \
        ${SETENV} GOPATH=${WRKSRC}/Godeps/_workspace go-bindata -pkg \
        resources -o cf/resources/i18n_resources.go \
        cf/i18n/resources/...  cf/i18n/test_fixtures/...
    cd ${WRKSRC} ; \
        ${SETENV} GOPATH=${WRKSRC}/Godeps/_workspace go build -o out/cf ./main

do-install:
    ${INSTALL_PROGRAM} ${WRKSRC}/out/cf \
        ${STAGEDIR}${PREFIX}/bin/

do-install-DOCS-on:
    ${MKDIR} ${STAGEDIR}${DOCSDIR}
.for x in ${PORTDOCS}
    ${INSTALL_MAN} ${WRKSRC}/${x} ${STAGEDIR}${DOCSDIR}
.endfor

.include <bsd.port.mk>