summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 17f8b679f3cce90744a724b3286a6639b5dc7ae1 (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
# Maintainer: Claudia Pellegrino <aur ät cpellegrino.de>

pkgname=python-pip-audit-git
_gitpkgname=pip-audit
pkgver=r280.0ea49c4
pkgrel=1
pkgdesc='A tool for scanning Python environments for known vulnerabilities'
arch=('any')
url='https://github.com/trailofbits/pip-audit'
license=('Apache')
depends=(
  # Upstream requires pip-api >= 0.0.28 but Arch’s Community
  # repository is on 0.0.18, which causes an error message that
  # says “failed to list installed distributions.”
  # Once community/python-pip-api catches up to version 0.0.28,
  # remove the `>=0.0.28` part from the following line.
  'python-pip-api>=0.0.28'
  'python-pip-requirements-parser'
  'python-packaging'
  'python-dataclasses'
  'python-progress'
  'python-resolvelib'
  'python-html5lib'
  # Upstream requires cachecontrol >= 0.12.10 but Arch’s Community
  # repository is at 0.12.6.
  # The 0.12.6 version appears to work just fine, so let’s ignore
  # the mismatch.
  'python-cachecontrol'
  'python-lockfile'
  'python-cyclonedx-lib'
)
makedepends=('git' 'python-flit' 'python-installer')
conflicts=('python-pip-audit')
options=('!strip')
source=("${_gitpkgname}::git+https://github.com/trailofbits/pip-audit.git")
sha512sums=('SKIP')

pkgver() {
  printf "r%s.%s" \
    "$(git -C "${_gitpkgname}" rev-list --count HEAD)" \
    "$(git -C "${_gitpkgname}" rev-parse --short HEAD)"
}

build() {
  cd "${srcdir}/${_gitpkgname}"
  python -m flit build --format wheel
}

package() {
  cd "${srcdir}/${_gitpkgname}"
  python -I -X pycache_prefix=pycache -m installer \
    --destdir="${pkgdir}" dist/*.whl
  rm -rf pycache
  install -D -m 644 -t "${pkgdir}/usr/share/licenses/${pkgname}" \
    LICENSE
}