aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/immortal/Makefile
blob: 6b61c552fbc83eafa4c7798146444d7ae5f4dc2c (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
# $FreeBSD$

PORTNAME=   immortal
PORTVERSION=    0.12.0
CATEGORIES= sysutils

MAINTAINER= nbari@tequila.io
COMMENT=    Unix cross-platform (OS agnostic) supervisor

LICENSE=    BSD3CLAUSE
LICENSE_FILE=   ${WRKSRC}/LICENSE

USE_RC_SUBR=    immortaldir
USES=       go
USE_GITHUB= yes
GH_TUPLE=   immortal:logrotate:3691ab5:logrotate/src/github.com/immortal/logrotate \
        immortal:multiwriter:2555774:multiwriter/src/github.com/immortal/multiwriter \
        immortal:natcasesort:69368b7:natcasesort/src/github.com/immortal/natcasesort \
        immortal:xtime:fb1aca1:xtime/src/github.com/immortal/xtime \
        nbari:violetear:502d8b0:nbari/src/github.com/nbari/violetear \
        go-yaml:yaml:v2:yaml/src/gopkg.in/yaml.v2
GH_SUBDIR=  src/github.com/${PORTNAME}/${PORTNAME}

STRIP=      # stripping can break go binaries

do-build:
    @cd ${WRKSRC}/src/github.com/${GH_ACCOUNT}/${GH_PROJECT}; \
    ${SETENV} ${BUILD_ENV} GOPATH=${WRKSRC} go build -ldflags \
    "-s -w -X main.version=${PORTVERSION}" -o immortal cmd/immortal/main.go;
    @cd ${WRKSRC}/src/github.com/${GH_ACCOUNT}/${GH_PROJECT}; \
    ${SETENV} ${BUILD_ENV} GOPATH=${WRKSRC} go build -ldflags \
    "-s -w -X main.version=${PORTVERSION}" -o immortalctl cmd/immortalctl/main.go;
    @cd ${WRKSRC}/src/github.com/${GH_ACCOUNT}/${GH_PROJECT}; \
    ${SETENV} ${BUILD_ENV} GOPATH=${WRKSRC} go build -ldflags \
    "-s -w -X main.version=${PORTVERSION}" -o immortaldir cmd/immortaldir/main.go;

do-install:
    ${INSTALL_PROGRAM} ${WRKSRC}/src/github.com/immortal/immortal/immortal ${STAGEDIR}${PREFIX}/bin/immortal
    ${INSTALL_PROGRAM} ${WRKSRC}/src/github.com/immortal/immortal/immortalctl ${STAGEDIR}${PREFIX}/bin/immortalctl
    ${INSTALL_PROGRAM} ${WRKSRC}/src/github.com/immortal/immortal/immortaldir ${STAGEDIR}${PREFIX}/bin/immortaldir
    ${INSTALL_MAN} ${WRKSRC}/src/github.com/immortal/immortal/man/*.8 ${STAGEDIR}${MAN8PREFIX}/man/man8/

post-install:
    @${MKDIR} ${STAGEDIR}${ETCDIR}
    ${INSTALL_DATA} ${FILESDIR}/www.yml ${STAGEDIR}${ETCDIR}/www.yml.sample

.include <bsd.port.mk>