aboutsummaryrefslogtreecommitdiffstats
path: root/community/py3-pycryptodome/APKBUILD
blob: 95c23abe088850872a7c0a8f8808f319045c0cc0 (plain) (blame)
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
# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=py3-pycryptodome
pkgver=3.9.9
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 --prefix=/usr --root="$pkgdir"
}

pycryptodomex() {
	cd "$_xbuilddir"
	python3 setup.py --quiet install --prefix=/usr --root="$subpkgdir"
}

sha512sums="a1aad4d52256220fe3d5d7f399c2c5e7338d6eb88058da0571fe1c686d74d33ff4bc1c275d4b9373e0ff22f4ddcded75a25387e76fc65047f8612f8856c1bd4d  py3-pycryptodome-3.9.9.tar.gz"