# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Johannes Löthberg <johannes@kyriasis.com>
# Maintainer: BlackIkeEagle <ike DOT devolder AT gmail DOT com>
# Contributor: Ivan Shapovalov <intelfx@intelfx.name>

pkgname=python-pycryptodomex
pkgver=3.20.0
pkgrel=1

pkgdesc='A self-contained Python package of low-level cryptographic primitives'
url='https://www.pycryptodome.org/'
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
license=('BSD')

depends=('python')
makedepends=('python-setuptools')

source=("${pkgname}-${pkgver}.tar.gz::https://github.com/Legrandin/pycryptodome/archive/refs/tags/v${pkgver}x.tar.gz")
sha512sums=('387fd78f27d7c22529eab3c5b87e265b399eaa2727a80b7739ddfe876a613a0bf7b85d78485e6493efd1fc52a8a189728f3debf3f1b3d0d8a142bb67ee026027')

build() {
    cd "pycryptodome-${pkgver}x"
    python setup.py build
}

package_python-pycryptodomex() {
    cd "pycryptodome-${pkgver}x"
    python setup.py install --root="$pkgdir" --optimize=1 --skip-build

    install -Dm644 LICENSE.rst "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.rst
}
