COMMENT =	command runner for local and remote hosts

CATEGORIES =	sysutils

MODGO_MODNAME =	github.com/alajmo/sake
MODGO_VERSION =	v0.15.1

DISTNAME =	sake-${MODGO_VERSION}

HOMEPAGE =	https://sakecli.com/

MAINTAINER =	Ruben Llorente <porting@use.startmail.com>

# MIT
PERMIT_PACKAGE =	Yes

WANTLIB +=	c pthread

MODULES =	lang/go

NO_TEST =	Yes

post-build:

	cd ${MODGO_WORKSPACE}/bin && \
		./sake gen
.for s in bash fish zsh
	cd ${MODGO_WORKSPACE}/bin && \
		./sake completion $s > sake.$s
.endfor

do-install:
	${INSTALL_PROGRAM} ${MODGO_WORKSPACE}/bin/sake ${PREFIX}/bin/
	${INSTALL_MAN} ${MODGO_WORKSPACE}/bin/sake.1 ${PREFIX}/man/man1
	${INSTALL_DATA_DIR} ${PREFIX}/share/bash-completion/completions/ \
		${PREFIX}/share/fish/vendor_completions.d/ \
		${PREFIX}/share/zsh/site-functions/
	${INSTALL_DATA} ${MODGO_WORKSPACE}/bin/sake.bash \
		${PREFIX}/share/bash-completion/completions/sake
	${INSTALL_DATA} ${MODGO_WORKSPACE}/bin/sake.fish \
		${PREFIX}/share/fish/vendor_completions.d/
	${INSTALL_DATA} ${MODGO_WORKSPACE}/bin/sake.zsh \
		${PREFIX}/share/zsh/site-functions/_sake

.include "modules.inc"
.include <bsd.port.mk>
