# bunch of undefined things in crypto/blake2b, shirou/gopsutil/disk, shirou/gopsutil/mem
NOT_FOR_ARCHS=		i386

COMMENT=		cluster scheduler

VERSION=		1.11.0
PKGNAME=		nomad-${VERSION}

# nomad-vendored distfile generated by fetching archive from
# https://github.com/hashicorp/nomad/archive/v$VERSION/nomad-$VERSION.tar.gz
# and running "go mod tidy" + "go mod vendor"
DISTNAME=		nomad-vendored-${VERSION}
SITES=			https://distfiles.bsdfrog.org/
ALL_TARGET=		github.com/hashicorp/nomad

CATEGORIES=		sysutils

HOMEPAGE=		https://www.nomadproject.io

MAINTAINER=		Antoine Jacoutot <ajacoutot@openbsd.org>

# BSL-1.1 (https://www.hashicorp.com/bsl)
PERMIT_PACKAGE=		Yes

WANTLIB += c pthread

MODULES=		lang/go

post-extract:
	cp ${FILESDIR}/*.go \
		${WRKDIST}/vendor/github.com/hashicorp/consul/sdk/freeport

post-install:
	${INSTALL_DATA_DIR} ${PREFIX}/share/examples/nomad
	${SUBST_CMD} -c -m 0640 ${FILESDIR}/nomad.hcl \
		${PREFIX}/share/examples/nomad/nomad.hcl
	${INSTALL_DATA} ${WRKSRC}/terraform/shared/config/nomad_client.hcl \
		${PREFIX}/share/examples/nomad/
	${INSTALL_DATA} ${WRKSRC}/terraform/shared/config/nomad.hcl \
		${PREFIX}/share/examples/nomad/nomad_server.hcl

.include <bsd.port.mk>
