File PKGBUILD of Package patool

# Maintainer on AUR : Lex Black <autumn-wind at web dot de>
# Maintainer on OBS : James Ed Randson <jimedrand@disroot.org>
# Contributor : patlefort <northon_patrick3 at yahoo dot ca>
# Contributor : Daniel Larsson <znixen@live.se>

pkgname=patool
pkgver=4.0.1
pkgrel=1
pkgdesc="portable command line archive file manager"
arch=('any')
url="https://wummel.github.io/patool/"
license=('GPL-3-only')
depends=(python)
makedepends=(python-build python-installer python-wheel python-setuptools-reproducible python-argcomplete)
optdepends=("lz4: extracting LZ4 archives"
    "p7zip: extracting ZIP and 7z files"
    "unarchiver: extracting various formats"
    "unrar: extracting RAR files"
    "zstd: extracting ZSTANDARD files")
source=(https://github.com/wummel/${pkgname}/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('41f7ee21be337a5baf07b2cb4796e9d94397ab741d2379c622f98fc001099802')


build() {
  cd "${pkgname}-${pkgver}"
  python -m build --wheel --no-isolation
}

package() {
  cd "${pkgname}-${pkgver}"
  python -m installer --destdir="$pkgdir" dist/*.whl

  install -dm755 "${pkgdir}/usr/share/bash-completion/completions"
  register-python-argcomplete patool > "${pkgdir}/usr/share/bash-completion/completions/patool"

  install -Dm644 'doc/patool.1' -t "${pkgdir}/usr/share/man/man1"
}
openSUSE Build Service is sponsored by