summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 96180ef380c131ca55f7f6bd12ac297ad9852e48 (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
#Maintainer: anonion <aur at anonion dot social>

pkgname=("python-py-natpmp-git")
_name=${pkgname#python-}
pkgver=r21.325af58
pkgrel=3
pkgdesc="A NAT-PMP (Network Address Translation Port Mapping Protocol) library and testing client in Python."
arch=('any')
url="https://github.com/yimingliu/py-natpmp"
license=('BSD')

depends=('python-netifaces')

makedepends=('python-wheel'
             'python-build'
             'python-installer'
             'python-setuptools'
             'git')

source=("${_name}::git+https://github.com/yimingliu/py-natpmp")
sha256sums=('SKIP')

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

package() {
    cd "$_name"
    python -m installer --destdir="$pkgdir" dist/*.whl
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

pkgver() {
    cd "$_name"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}