summaryrefslogtreecommitdiff
path: root/www/oneshot/Makefile
blob: 2c61785924f66b0dfb559e3798c86bd45fd131fb (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
45
46
47
48
49
50
51
52
53
54
55
56
PORTNAME=	oneshot
DISTVERSIONPREFIX=	v
DISTVERSION=	1.5.1
PORTREVISION=	21
CATEGORIES=	www

MAINTAINER=	lcook@FreeBSD.org
COMMENT=	First-come-first-serve single-fire HTTP server
WWW=		https://github.com/raphaelreyna/oneshot

LICENSE=	MIT
LICENSE_FILE=	${WRKSRC}/LICENSE

USES=		go:modules
USE_GITHUB=	nodefault
GH_TUPLE=	golang:net:v0.8.0:net \
		golang:sys:v0.6.0:sys

_BUILD_VERSION=	${DISTVERSIONFULL}
_BUILD_DATE=	$$(date +%d-%B-%Y)

GO_MODULE=	github.com/raphaelreyna/${PORTNAME}
GO_BUILDFLAGS=	-ldflags "\
		${STRIP} -w \
		-X ${GO_MODULE}/cmd.version=${_BUILD_VERSION} \
		-X ${GO_MODULE}/cmd.date=${_BUILD_DATE}"

PORTDOCS=	README.md

OPTIONS_DEFINE=		DOCS MANPAGES
OPTIONS_DEFAULT=	MANPAGES
OPTIONS_SUB=		yes

MANPAGES_DESC=	Build and install auto-generated manpages

pre-patch:
.for m in net sys
	${RM} -r ${WRKSRC}/vendor/golang.org/x/$m
	${LN} -s ${WRKDIR}/$m-* ${WRKSRC}/vendor/golang.org/x/$m
.endfor

do-build-MANPAGES-on:
	cd ${GO_WRKSRC} && \
		${SETENV} ${MAKE_ENV} ${GO_ENV} ${GO_CMD} run ${GO_BUILDFLAGS} \
		./doc/man/main.go > ${PORTNAME}.1

post-install-DOCS-on:
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
	${INSTALL_DATA} ${GO_WRKSRC}/${PORTDOCS} \
		${STAGEDIR}${DOCSDIR}

post-install-MANPAGES-on:
	${INSTALL_MAN} ${GO_WRKSRC}/${PORTNAME}.1 \
		${STAGEDIR}${PREFIX}/share/man/man1

.include <bsd.port.mk>