# Compiling Time: 0.01 SBU
# Maintainer: DeX77 <dex+fw@dragonslave.de>

pkgname=borg
pkgver=1.4.1
pkgrel=1
pkgdesc='Deduplicating backup program with compression and authenticated encryption'
archs=('x86_64')
groups=('apps-extra')
depends=('xfsprogs-acl' 'lz4' 'openssl' 'xz' 'zstd' 'python3-packaging'
         'python3-msgpack' 'xxhash')
makedepends=('python3-build' 'python3-installer' 'python3-setuptools' 'python3-setuptools_scm' 'python3-pkgconfig'
             'python3-sphinx' 'python3-guzzle-sphinx-theme' 'python3-wheel' 'python3-cython')
_F_github_author=borgbackup
Finclude github
source=("https://github.com/${_F_github_author}/$pkgname/releases/download/$pkgver/${_F_github_author}-$pkgver.tar.gz")
signatures=("${source[0]}.asc")
_F_cd_path="${_F_github_author}-$pkgver"

build() {
	Fcd
	Fpatchall
  	Fexec python -m build --wheel --no-isolation || Fdie
  	Fexec python -m installer --destdir="$Fdestdir" dist/*.whl

	Finstallrel 644 scripts/shell_completions/bash/borg usr/share/bash-completion/completions/borg
	Finstallrel 644 scripts/shell_completions/fish/borg.fish usr/share/fish/vendor_completions.d/borg.fish
	Finstallrel 644 scripts/shell_completions/zsh/_borg usr/share/zsh/site-functions/_borg

	Fmanrel "docs/man/"*.1
}


# optimization OK
