equal
deleted
inserted
replaced
|
1 # Copyright 2020-2021 Gentoo Authors |
|
2 # Distributed under the terms of the GNU General Public License v2 |
|
3 |
|
4 EAPI=8 |
|
5 inherit go-module systemd |
|
6 GIT_COMMIT=958556d77ee6f32d9a92cfbe39ec9d33781b1cdc |
|
7 |
|
8 DESCRIPTION="A simple and flexible workload orchestrator" |
|
9 HOMEPAGE="https://nomadproject.io" |
|
10 SRC_URI="https://github.com/hashicorp/nomad/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
|
11 |
|
12 LICENSE="MPL-2.0" |
|
13 SLOT="0" |
|
14 KEYWORDS="~amd64" |
|
15 IUSE="nvidia ui" |
|
16 |
|
17 RESTRICT=" test" |
|
18 |
|
19 src_compile() { |
|
20 local go_ldflags go_tags |
|
21 go_ldflags="-X github.com/hashicorp/nomad/version.GitCommit=${GIT_COMMIT}" |
|
22 go_tags="codegen_generated $(usex ui 'ui' '') $(usex nvidia '' 'nonvidia')" |
|
23 CGO_ENABLED=1 \ |
|
24 go build \ |
|
25 -ldflags "${go_ldflags}" \ |
|
26 -mod=vendor \ |
|
27 -tags "${go_tags}" \ |
|
28 -trimpath \ |
|
29 -o bin/${PN} || die "compile failed" |
|
30 } |
|
31 |
|
32 src_install() { |
|
33 dobin bin/${PN} |
|
34 systemd_dounit dist/systemd/nomad.service |
|
35 insinto /etc/nomad.d |
|
36 newins dist/client.hcl client.hcl.example |
|
37 newins dist/server.hcl server.hcl.example |
|
38 einstalldocs |
|
39 dodoc CHANGELOG.md |
|
40 keepdir /var/lib/nomad /var/log/nomad |
|
41 newconfd "${FILESDIR}/nomad.confd" nomad |
|
42 newinitd "${FILESDIR}/nomad.initd" nomad |
|
43 insinto /etc/logrotate.d |
|
44 newins "${FILESDIR}/nomad.logrotated" nomad |
|
45 } |