sys-cluster/nomad/nomad-0.12.8.ebuild
author Da Risk <da_risk@geekorum.com>
Sat, 20 Feb 2021 15:30:24 -0400
changeset 244 dd84d90b2177
parent 238 115a8fb29060
permissions -rw-r--r--
remove pep257-> replaced by pydocstyle

# Copyright 2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7
inherit go-module systemd
GIT_COMMIT=99fa2774301199ee20e661c7c1832a6ee1d5c553

DESCRIPTION="A simple and flexible workload orchestrator "
HOMEPAGE="https://nomadproject.io"
SRC_URI="https://github.com/hashicorp/nomad/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="MPL-2.0"
SLOT="0"
KEYWORDS="~amd64"
IUSE="nvidia"

RESTRICT+=" test"

src_compile() {
	local go_ldflags go_tags
	go_ldflags="-X github.com/hashicorp/nomad/version.GitCommit=${GIT_COMMIT}"
	go_tags="codegen_generated ui $(usex nvidia '' 'nonvidia')"
	CGO_ENABLED=1 \
		go build \
		-trimpath \
		-ldflags "${go_ldflags}" \
		-mod=vendor \
		-tags "${go_tags}" \
		-o bin/${PN} || die "compile failed"
}

src_install() {
	dobin bin/${PN}
	systemd_dounit dist/systemd/nomad.service
	insinto /etc/nomad.d
	newins dist/client.hcl client.hcl.example
	newins dist/server.hcl server.hcl.example
	einstalldocs
dodoc CHANGELOG.md
	keepdir /var/lib/nomad /var/log/nomad
	newconfd "${FILESDIR}/nomad.confd" nomad
	newinitd "${FILESDIR}/nomad.initd" nomad
	insinto /etc/logrotate.d
	newins "${FILESDIR}/nomad.logrotated" nomad
}