sys-cluster/nomad/nomad-1.0.9-r1.ebuild
author Da Risk <da_risk@geekorum.com>
Tue, 23 Aug 2022 09:33:47 -0400
changeset 250 dd0b4cb26d85
parent 246 cf933138cb10
permissions -rw-r--r--
various updates
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
246
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     1
# Copyright 2020-2021 Gentoo Authors
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     2
# Distributed under the terms of the GNU General Public License v2
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     3
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     4
EAPI=8
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     5
inherit go-module systemd
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     6
GIT_COMMIT=958556d77ee6f32d9a92cfbe39ec9d33781b1cdc
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     7
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     8
DESCRIPTION="A simple and flexible workload orchestrator"
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     9
HOMEPAGE="https://nomadproject.io"
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    10
SRC_URI="https://github.com/hashicorp/nomad/archive/v${PV}.tar.gz -> ${P}.tar.gz"
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    11
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    12
LICENSE="MPL-2.0"
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    13
SLOT="0"
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    14
KEYWORDS="~amd64"
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    15
IUSE="nvidia ui"
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    16
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    17
RESTRICT=" test"
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    18
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    19
src_compile() {
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    20
	local go_ldflags go_tags
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    21
	go_ldflags="-X github.com/hashicorp/nomad/version.GitCommit=${GIT_COMMIT}"
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    22
	go_tags="codegen_generated $(usex ui 'ui' '') $(usex nvidia '' 'nonvidia')"
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    23
	CGO_ENABLED=1 \
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    24
		go build \
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    25
		-ldflags "${go_ldflags}" \
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    26
		-mod=vendor \
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    27
		-tags "${go_tags}" \
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    28
		-trimpath \
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    29
		-o bin/${PN} || die "compile failed"
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    30
}
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    31
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    32
src_install() {
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    33
	dobin bin/${PN}
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    34
	systemd_dounit dist/systemd/nomad.service
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    35
	insinto /etc/nomad.d
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    36
	newins dist/client.hcl client.hcl.example
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    37
	newins dist/server.hcl server.hcl.example
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    38
	einstalldocs
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    39
	dodoc CHANGELOG.md
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    40
	keepdir /var/lib/nomad /var/log/nomad
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    41
	newconfd "${FILESDIR}/nomad.confd" nomad
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    42
	newinitd "${FILESDIR}/nomad.initd" nomad
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    43
	insinto /etc/logrotate.d
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    44
	newins "${FILESDIR}/nomad.logrotated" nomad
cf933138cb10 sys-cluster/nomad: bump to 1.0.9 and add ui use flag
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    45
}