summaryrefslogtreecommitdiff
blob: 8aba54f81df9f2cf29dc1b7d5f02c48ced3e704f (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6
inherit vcs-snapshot

DESCRIPTION="command line client for the opsgenie service"
HOMEPAGE="https://docs.opsgenie.com/docs/lamp-command-line-interface-for-opsgenie"
HASH=062016b
SRC_URI="https://github.com/opsgenie/${PN}/archive/${HASH}.tar.gz -> ${P}.tar.gz
	https://dev.gentoo.org/~williamh/dist/${P}-vendor.tar.gz"

# I followed the following steps to create the vendor tarball:
#
# git clone https://github.com/opsgenie/opsgenie-lamp
# cd opsgenie-lamp
# go mod init # creates go.mod and go.sum
# go mod vendor # updates go.mod/sum and adds vendor directory
# mv -i go.mod go.sum vendor
# tar cf ${P}.tar vendor
# gzip ${P}.tar
#
# Upstream doesn't tag releases, but the most recent version number is
# in the  sources, see the lampVersion variable.

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"

DEPEND="dev-lang/go:="

RESTRICT="strip"

src_prepare() {
		mv ../${P}-vendor vendor || die "mv failed"
		mv vendor/go.mod vendor/go.sum . || die "mv failed"
	default
}

src_compile() {
	GOCACHE="${T}"/go-cache go build -mod vendor || die "build failed"
}

src_install() {
	newbin ${PN} lamp
dodoc conf/lamp.conf
	einstalldocs
}