aboutsummaryrefslogtreecommitdiffstats
path: root/community/py3-pycryptodome/APKBUILD
blob: 08e232287ee543430d0063b92491e40de80650a8 (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.10.1
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="4c7e7e989d5363064e7e184f6b00a174045e03916cdf1199626afd7fe75eb5efcd13888ecdee607b974e96faad465694b384eb6d91edb8de1d0277ad71888c52  py3-pycryptodome-3.10.1.tar.gz"