summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 09a9b7723a01b2772a98afb8141d6e63bbe8bf90 (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
# Maintainer: Lex Black <autumn-wind at web dot de>
# Contributor: Michael Serajnik <m at mser dot at>

pkgname=patool-git
_pkgname=patool
pkgver=4.0.5.r7.gce1248b
pkgrel=2
pkgdesc="portable command line archive file manager (git checkout)"
arch=('any')
url="https://wummel.github.io/patool/"
license=('GPL-3.0-only')
depends=(python)
makedepends=(git python-build python-installer python-wheel python-setuptools-reproducible python-argcomplete)
optdepends=("lz4: extracting LZ4 archives"
    "7zip: extracting various not natively supported formats (upstream suggested)"
    "unarchiver: extracting various not natively supported formats"
    "unrar: extracting RAR files")
provides=("patool")
conflicts=("patool")
source=("git+https://github.com/wummel/${_pkgname}.git")
sha256sums=("SKIP")


pkgver() {
  cd ${_pkgname}
  git describe --long --tags | sed 's/^dist\/patool-//;s/^upstream\///;s/^v//;s/\([^-]*-g\)/r\1/;s/-py2.py3-none-any.whl././g;s/-/./g'
}

build() {
  cd ${_pkgname}
  python -m build --wheel --no-isolation
}

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