aboutsummaryrefslogtreecommitdiffstats
path: root/community/borgbackup/APKBUILD
blob: 6545a67885527e2c4dc7b3ce8c61d9ca1ddb98c8 (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
68
# Contributor: Olivier Mauras <olivier@mauras.ch>
# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=borgbackup
_pkgname=borg
pkgver=1.1.11
pkgrel=0
pkgdesc="Deduplicating backup program"
url="https://www.borgbackup.org/"
arch="all !s390x !mips !mips64" # limited by py3-pyzmq
license="BSD-3-Clause"
depends="python3 py3-pyzmq"
makedepends="python3-dev lz4-dev acl-dev attr-dev openssl-dev linux-headers
	py3-setuptools zstd-dev"
checkdepends="py3-pytest py3-pytest-benchmark"
subpackages="$pkgname-doc
	$pkgname-bash-completion:bashcomp:noarch
	$pkgname-fish-completion:fishcomp:noarch
	$pkgname-zsh-completion:zshcomp:noarch"
source="https://github.com/borgbackup/borg/releases/download/$pkgver/borgbackup-$pkgver.tar.gz"

build() {
	python3 setup.py build
}

check() {
	PYTHONPATH="$(echo "$builddir"/build/lib.linux-*)" pytest -v --benchmark-skip --pyargs borg.testsuite
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"

	install -Dm644 -t "$pkgdir"/usr/share/man/man1 \
		"$builddir"/docs/man/*.1

	# Clean some useless files.
	cd "$pkgdir"/usr/lib/python*/site-packages/borg
	find . -name '*.h' -delete -o -name '*.c' -delete -o -name '*.pyx' -delete
}

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

	install -Dm644 "$builddir"/scripts/shell_completions/bash/$_pkgname \
		"$subpkgdir"/usr/share/bash-completion/completions/$_pkgname
}

fishcomp() {
	pkgdesc="Fish completions for $pkgname"
	depends=""
	install_if="$pkgname=$pkgver-r$pkgrel fish"

	install -Dm644 "$builddir"/scripts/shell_completions/fish/$_pkgname.fish \
		"$subpkgdir"/usr/share/fish/completions/$_pkgname.fish
}

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

	install -Dm644 "$builddir"/scripts/shell_completions/zsh/_$_pkgname \
		"$subpkgdir"/usr/share/zsh/site-functions/_$_pkgname
}

sha512sums="cf629f31d38d27ce6350670ff27b4937f2f30eddf9e0cd9209cd9d57a4ffa653f5a291ea1e1c79614dd2c08bcf5c50bc3e4e0f222e0d3cd1bbfb2d756b4a4573  borgbackup-1.1.11.tar.gz"