summaryrefslogtreecommitdiff
path: root/community/py3-pycryptodome/APKBUILD
blob: 319b94dad1e907d32a6575415aabbeabae99893b (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
# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=py3-pycryptodome
pkgver=3.16.0
pkgrel=0
pkgdesc="Self-contained cryptographic library"
url="https://www.pycryptodome.org"
arch="all"
license="BSD-2-Clause Unlicense"
depends="gmp"
makedepends="python3-dev py3-setuptools"
source="$pkgname-$pkgver.tar.gz::https://github.com/Legrandin/pycryptodome/archive/v$pkgver.tar.gz"
subpackages="${pkgname}x:pycryptodomex"
builddir="$srcdir"/pycryptodome-$pkgver
_xbuilddir="$srcdir"/pycryptodomex-$pkgver

replaces="py-pycryptodome py3-crypto" # Backwards compatibility
provides="py-pycryptodome=$pkgver-r$pkgrel py3-crypto=$pkgver-r$pkgrel" # Backwards compatibility

prepare() {
	default_prepare

	cp -r "$builddir" "$_xbuilddir"
	touch "$_xbuilddir/.separate_namespace"
}

build() {
	# pycryptodome - "Crypto" namespace (PyCrypto compatible)
	python3 setup.py --quiet build

	# pycryptodomex - "Cryptodome" namespace
	cd "$_xbuilddir"
	python3 setup.py --quiet build
}

check() {
	python3 setup.py test

	cd "$_xbuilddir"
	python3 setup.py test
}

package() {
	python3 setup.py --quiet install --skip-build --root="$pkgdir"
}

pycryptodomex() {
	cd "$_xbuilddir"
	python3 setup.py --quiet install --skip-build --root="$subpkgdir"
}

sha512sums="
945c5bda213a08ba12a0ace8e4bf76730461f8dfce94fa426a97dfab846234ea06e121b176ae823d0f7da9316de50aafde6507a2f17efec4d4a0629d4d68d870  py3-pycryptodome-3.16.0.tar.gz
"