freebsd-ports/sysutils/sockaddr/Makefile
Tobias Kortkamp 3726f94254 Convert all Go ports to USES=go
This allows for port testing with lang/go-devel via GO_PORT, setting
up the Go build environment in a single place, and is step one in
simplifying Go ports that often define too complicated do-build
targets themselves.

USES=go gains new arguments 'run' to add lang/go to RUN_DEPENDS and
'no_targets' for ports with composite builds that call 'go' themselves
and do not need the do-build/do-install targets of USES=go.

PR:		238849
Submitted by:	dg@syrec.org (also D20745)
Reviewed by:	mat, tobik
Exp-run by:	antoine
Differential Revision:	https://reviews.freebsd.org/D20746
2019-06-29 03:51:13 +00:00

36 lines
893 B
Makefile

# $FreeBSD$
PORTNAME= sockaddr
DISTVERSION= g20180320
CATEGORIES= sysutils
MAINTAINER= seanc@FreeBSD.org
COMMENT= Command line utility for querying IP information
LICENSE= MPL20
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= go
USE_GITHUB= yes
GH_SUBDIR= src/github.com/hashicorp/go-sockaddr
GH_ACCOUNT= hashicorp
GH_PROJECT= go-sockaddr
GH_TAGNAME= 7165ee1
PLIST_FILES= bin/sockaddr
post-extract:
@${CP} -rp ${WRKSRC}/cmd/${PORTNAME}/vendor/* ${WRKSRC}/src/
do-build:
@cd ${WRKSRC}/src/github.com/${GH_ACCOUNT}/${GH_PROJECT}/cmd/${PORTNAME}/ && \
${SETENV} ${MAKE_ENV} CGO_ENABLED=0 GOPATH=${WRKSRC} \
${LOCALBASE}/bin/go build -ldflags "-X main.version=${DISTVERSIONPREFIX}${PORTVERSION} -w -s" \
-o ${PORTNAME}
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/src/github.com/hashicorp/go-sockaddr/cmd/${PORTNAME}/${PORTNAME} \
${STAGEDIR}${PREFIX}/bin/${PORTNAME}
.include <bsd.port.mk>