summaryrefslogtreecommitdiff
path: root/community/restic/APKBUILD
blob: ce29e9fd8714b553939dc7280c9732a5c1b838b6 (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
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=restic
pkgver=0.17.0
pkgrel=0
pkgdesc="Fast, secure, efficient backup program"
url="https://restic.net/"
arch="all"
license="BSD-2-Clause"
makedepends="go"
checkdepends="python3"
options="net chmod-clean"
subpackages="$pkgname-doc $pkgname-bash-completion $pkgname-zsh-completion"
source="https://github.com/restic/restic/releases/download/v$pkgver/restic-$pkgver.tar.gz"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -v ./cmd/...
}

check() {
	# may fail if /tmp is tmpfs
	rm internal/restic/node_xattr_all_test.go
	RESTIC_TEST_FUSE=0 make test
}

package() {
	install -Dm755 $pkgname "$pkgdir"/usr/bin/$pkgname

	local man
	for man in doc/man/*.?; do
		install -Dm644 "$man" \
			"$pkgdir"/usr/share/man/man${man##*.}/${man##*/}
	done

	install -Dm644 doc/bash-completion.sh \
		"$pkgdir"/usr/share/bash-completion/completions/$pkgname
	install -Dm644 doc/zsh-completion.zsh \
		"$pkgdir"/usr/share/zsh/site-functions/_$pkgname
}

sha512sums="
f9b91844f8eec7b462af05bf210c489c440ef7e8d2a5109aed4c1ead5988d722c74ca84ba770270e65c683e1c973ed0d36a3a218f2170da936d84028a264938b  restic-0.17.0.tar.gz
"