summaryrefslogtreecommitdiff
blob: e3a29977d90f408b8952dbe284f31d06a58d0b51 (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
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

DESCRIPTION="A backup program that is fast, efficient and secure"
HOMEPAGE="https://restic.github.io/"
SRC_URI="https://github.com/restic/restic/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="BSD-2"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
IUSE="test"

DOCS=( README.rst CONTRIBUTING.md doc/design.rst doc/faq.rst doc/index.rst doc/manual.rst
	doc/rest_backend.rst doc/development.rst doc/talks.rst doc/tutorial_aws_s3.rst doc/installation.rst )

DEPEND="dev-lang/go
	test? ( sys-fs/fuse:0 )"

RDEPEND="sys-fs/fuse:0"

src_compile() {
	local mygoargs=(
		-v
		-work
		-x
		-tags release
		-ldflags "-w -X main.version=${PV}"
		-asmflags "-trimpath=${S}/vendor -trimpath=${S}"
		-gcflags "-trimpath=${S}/vendor -trimpath=${S}"
		-o "${S}"/restic cmds/restic
	)

	GOPATH="${S}:${S}/vendor" go build "${mygoargs[@]}" || die
}

src_test() {
	GOPATH="${S}:${S}/vendor" go test -v -work -x restic/... cmds/... || die
}

src_install() {
	dobin restic
	einstalldocs
}