diff options
author | Francesco Colista <fcolista@alpinelinux.org> | 2016-07-18 15:58:24 +0000 |
---|---|---|
committer | Francesco Colista <fcolista@alpinelinux.org> | 2016-07-18 16:01:18 +0000 |
commit | eb5d0ba9d249856529a8cfaa7b8f078a7b041d8d (patch) | |
tree | 2f6480bf9ba02b8a2b5a194487816dd19dfd35e1 /main/py-crypto | |
parent | c43d85678d26013cc0a0809805f62c7a67719dad (diff) | |
download | aports-eb5d0ba9d249856529a8cfaa7b8f078a7b041d8d.tar.bz2 aports-eb5d0ba9d249856529a8cfaa7b8f078a7b041d8d.tar.xz |
main/py-crypto: added python3 support. Added py2 and py3 subpackages
Diffstat (limited to 'main/py-crypto')
-rw-r--r-- | main/py-crypto/APKBUILD | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/main/py-crypto/APKBUILD b/main/py-crypto/APKBUILD index a89e6227cf..2d4eed7329 100644 --- a/main/py-crypto/APKBUILD +++ b/main/py-crypto/APKBUILD @@ -3,14 +3,14 @@ pkgname=py-crypto _pkgname=pycrypto pkgver=2.6.1 -pkgrel=0 +pkgrel=1 pkgdesc="A Python collection of cryptographic algorithms and protocols" url="https://www.dlitz.net/software/pycrypto/" -arch="all" +arch="noarch" license="BSD" depends="" -makedepends="gmp-dev python-dev" -subpackages="" +makedepends="gmp-dev python-dev python3-dev" +subpackages="py3-${pkgname/py-/}:_py3 py2-${pkgname/py-/}:_py2" source="http://ftp.dlitz.net/pub/dlitz/crypto/$_pkgname/$_pkgname-$pkgver.tar.gz" _builddir="$srcdir"/$_pkgname-$pkgver @@ -18,13 +18,38 @@ build() { cd "$_builddir" python setup.py build || return 1 python setup.py test || return 1 + + python3 setup.py build || return 1 + python3 setup.py test || return 1 } package() { cd "$_builddir" python setup.py install --prefix=/usr --root="$pkgdir" || return 1 + python3 setup.py install --root=$pkgdir/ --optimize=1 || return 1 } +_py() { + local python=$1 + pkgdesc="$pkgdesc - $python" + arch="all" + install_if="$pkgname=$pkgver-r$pkgrel $python" + local dir=$($python -c 'import sysconfig; print(sysconfig.get_path("stdlib"))') + + mkdir -p "$subpkgdir"${dir} + mv "$pkgdir"${dir}/* "$subpkgdir"${dir} +} + +_py2() { + _py python2 + replaces="$pkgname" +} + +_py3() { + _py python3 +} + + md5sums="55a61a054aa66812daf5161a0d5d7eda pycrypto-2.6.1.tar.gz" sha256sums="f2ce1e989b272cfcb677616763e0a2e7ec659effa67a88aa92b3a65528f60a3c pycrypto-2.6.1.tar.gz" sha512sums="20a4aed4dac4e9e61d773ebc1d48ea577e9870c33f396be53d075a9bf8487d93e75e200179882d81e452efd0f6751789bac434f6f431b3e7c1c8ef9dba392847 pycrypto-2.6.1.tar.gz" |