aboutsummaryrefslogblamecommitdiffstats
path: root/community/restic/APKBUILD
blob: fa0f2246ca49580ad6eb7cbd06ee4f78b1f2ab56 (plain) (tree)
1
2
3
4


                                                              
            

















                                                                                                

                                                    
                       








































                                                                           
                                                                                                                                                                  
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=restic
pkgver=0.9.2
pkgrel=0
pkgdesc="Fast, secure, efficient backup program"
url="https://restic.net/"
arch="all"
license="BSD-2-Clause"
depends=""
makedepends="go"
options="!checkroot"
install=""
subpackages="$pkgname-doc
	$pkgname-zsh-completion:zshcomp:noarch
	$pkgname-bash-completion:bashcomp:noarch"
source="https://github.com/$pkgname/$pkgname/releases/download/v$pkgver/$pkgname-$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() {
	cd "$builddir"
	go build ./cmd/...
}

check() {
	cd "$builddir"
	RESTIC_TEST_FUSE=0 make test
}

package() {
	cd "$builddir"
	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
}

sha512sums="e060e0e16031924df7347ec74972bf52c75c84cca8ae996b1c5dd8a6f42c9022062e004ec17af2ebc0b6e9480ecfdff4ca7f64956afab9b9799201848d0be731  restic-0.9.2.tar.gz"