summaryrefslogtreecommitdiff
blob: c4449b25b091da91f8440a8fc36c9c1edd8fb50a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit go-module

DESCRIPTION="A command-line interface for Hetzner Cloud"
HOMEPAGE="https://github.com/hetznercloud/cli"
SRC_URI="https://dev.gentoo.org/~ago/distfiles/${P}.tar.xz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"

src_compile() {
	ego build -o ${PN} -ldflags "-w -X github.com/hetznercloud/cli/internal/version.versionPrerelease=gentoo" ./cmd/${PN}
}

src_test() {
	# For upstream a simple test is run 'hcloud version'
	./hcloud version
	if [[ $? -ne 0 ]]
	then
		die "Test failed"
	fi
}

src_install() {
	dobin ${PN}
}