summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 50d4edbeb843fa511622bd786a81bb6013b2b583 (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
# Maintainer: Lauri Niskanen <ape@ape3000.com>
# Contributor: Lukas Fleischer <lfleischer@archlinux.org>
# Contributor: Vlad M. <vlad@archlinux.net>

pkgname=borg-git
_pkgname=borg
pkgver=1.2.0a4.r32.g20756bd3
pkgrel=1
pkgdesc='Deduplicating backup program with compression and authenticated encryption'
url='https://borgbackup.github.io/'
license=('BSD')
arch=('x86_64')
depends=('acl' 'lz4' 'openssl' 'python-msgpack' 'python-setuptools' 'xz' 'zstd')
optdepends=('openssh: repositories on remote hosts'
            'python-llfuse: mounting backups as a FUSE file system')
makedepends=('cython' 'python-sphinx' 'python-guzzle-sphinx-theme' 'git' 'python-pkgconfig')
checkdepends=('python-pytest' 'python-pytest-cov' 'python-pytest-benchmark' 'python-mock')
provides=('borg' 'borgbackup')
conflicts=('borg' 'borgbackup')
source=("${_pkgname}::git+https://github.com/borgbackup/${_pkgname}.git")
sha256sums=('SKIP')

pkgver() {
  cd "${srcdir}/${_pkgname}"
  git describe --tags --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "$srcdir/$_pkgname"
  python setup.py build
}

check() {
  cd "$srcdir/$_pkgname/build/lib.linux-$CARCH-3".*/
  LANG=en_US.UTF-8 PYTHONPATH="$PWD:$PYTHONPATH" py.test --cov=borg \
    --benchmark-skip --pyargs borg.testsuite -v \
    -k 'not test_non_ascii_acl'
}

package() {
  cd "$srcdir/$_pkgname"

  python setup.py install --root="$pkgdir" --optimize=1

  install -Dm644 scripts/shell_completions/bash/borg \
    "$pkgdir/usr/share/bash-completion/completions/borg"
  install -Dm644 scripts/shell_completions/fish/borg.fish \
    "$pkgdir/usr/share/fish/vendor_completions.d/borg.fish"
  install -Dm644 scripts/shell_completions/zsh/_borg "$pkgdir/usr/share/zsh/site-functions/_borg"

  install -Dm644 -t "$pkgdir/usr/share/man/man1/" "docs/man/"*.1
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}