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

EAPI=8
inherit bash-completion-r1 go-module

KEYWORDS="amd64 ~arm ~arm64 x86"
SRC_URI="
	https://github.com/rclone/rclone/archive/v${PV}.tar.gz -> ${P}.tar.gz
	https://dev.gentoo.org/~slashbeast/distfiles/${PN}/${P}-deps.tar.xz
"

DESCRIPTION="A program to sync files to and from various cloud storage providers"
HOMEPAGE="https://rclone.org/"

LICENSE="Apache-2.0 BSD BSD-2 ISC MIT MPL-2.0"
SLOT="0"
IUSE=""

src_compile() {
	go build -mod=readonly . || die "compile failed"
}

src_test() {
	# Setting CI skips unreliable tests, see fstest/testy/testy.go
	# TestAddPlugin and TestRemovePlugin fail
	RCLONE_CONFIG="/notfound" CI="true" go test -mod=readonly -v -run "!Test.*Plugin" ./... || die "test failed"
}

src_install() {
	dobin ${PN}
	doman ${PN}.1
	dodoc README.md

	./rclone genautocomplete bash ${PN}.bash || die
	newbashcomp ${PN}.bash ${PN}

	./rclone genautocomplete zsh ${PN}.zsh || die
	insinto /usr/share/zsh/site-functions
	newins ${PN}.zsh _${PN}
}