aboutsummaryrefslogtreecommitdiffstats
path: root/community/restic/APKBUILD
blob: 4202ad5532d85a72d42a228a837c05f544d02f88 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=restic
pkgver=0.10.0
pkgrel=0
pkgdesc="Fast, secure, efficient backup program"
url="https://restic.net/"
arch="all !mips64" # go
license="BSD-2-Clause"
makedepends="go"
options="net"
subpackages="$pkgname-doc
	$pkgname-zsh-completion:zshcomp:noarch
	$pkgname-bash-completion:bashcomp:noarch"
source="https://github.com/restic/restic/releases/download/v$pkgver/restic-$pkgver.tar.gz"
builddir="$srcdir/src/github.com/$pkgname/$pkgname"

export GOPATH="$srcdir"

prepare() {
	mkdir -p "${builddir%/*}"
	ln -s "$srcdir"/$pkgname-$pkgver "$builddir"
	default_prepare
}

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

check() {
	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
}

bashcomp() {
	depends=""
	pkgdesc="Bash completion for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	install -Dm644 "$builddir"/doc/bash-completion.sh \
		"$subpkgdir"/usr/share/bash-completion/completions/$pkgname
}

zshcomp() {
	depends=""
	pkgdesc="Zsh completion for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel zsh"

	install -Dm644 "$builddir"/doc/zsh-completion.zsh \
		"$subpkgdir"/usr/share/zsh/site-functions/_$pkgname
}

cleanup_srcdir() {
	go clean -modcache
	default_cleanup_srcdir
}

sha512sums="122e4ed956749c9c759775a996dae3c8be3934617d2566847f49931b3e25c68e38b202d3ac73ceb403b42e9397af1de766d018a4b851a474f93351701d3b784b  restic-0.10.0.tar.gz"