aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-04-03 16:27:13 -0400
committerLeonardo Arena <rnalrd@alpinelinux.org>2019-04-05 11:55:30 +0000
commitc0bf3b2d6d1c77b52221cf09d95a2972fac34ee9 (patch)
treeb22ddedb2dabb32985315fda610df4d941cdbbbf /testing
parentcf87f41aa6550295205fec7e8dd89fcc9c0d1aa5 (diff)
downloadaports-c0bf3b2d6d1c77b52221cf09d95a2972fac34ee9.tar.bz2
aports-c0bf3b2d6d1c77b52221cf09d95a2972fac34ee9.tar.xz
testing/py-amqp: normalize APKBUILD
Diffstat (limited to 'testing')
-rw-r--r--testing/py-amqp/APKBUILD58
1 files changed, 38 insertions, 20 deletions
diff --git a/testing/py-amqp/APKBUILD b/testing/py-amqp/APKBUILD
index cdc46765bb..23c63b23e7 100644
--- a/testing/py-amqp/APKBUILD
+++ b/testing/py-amqp/APKBUILD
@@ -1,46 +1,64 @@
# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=py-amqp
+_pyname=amqp
pkgver=2.4.2
pkgrel=0
pkgdesc="an AMQP implementation"
url="https://pypi.python.org/pypi/amqp/"
arch="noarch"
license="BSD"
-depends=""
-makedepends="python2-dev python3-dev py-setuptools"
-install=""
-subpackages="py2-amqp:py2 py3-amqp:py3"
-source="https://files.pythonhosted.org/packages/source/a/amqp/amqp-$pkgver.tar.gz"
-builddir="$srcdir/amqp-$pkgver"
+subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
+makedepends="python2 python3 py2-setuptools py3-setuptools"
+checkdepends="
+ py2-vine py3-vine py2-case py3-case py2-nose py3-nose py2-mock py3-mock
+ py2-unittest2
+"
+_pypiprefix="${_pyname%${_pyname#?}}"
+source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"
+builddir=$srcdir/$_pyname-$pkgver
+# requires a running rabbitmq sever, which is more complicated than it sounds
+options="!check"
+
+prepare() {
+ cd "$builddir"
+ sed -i requirements/test.txt -e 's/pytest-sugar.*//g'
+ cp -r "$builddir" "$builddir"-py2
+}
build() {
cd "$builddir"
- python2 setup.py build
python3 setup.py build
+ cd "$builddir"-py2
+ python2 setup.py build
}
-package() {
- mkdir -p "$pkgdir"
+check() {
+ cd "$builddir"
+ python3 setup.py test
+ cd "$builddir"-py2
+ python2 setup.py test
}
-_py() {
- local python="$1"
- pkgdesc="$pkgdesc ${python#python}"
- depends="$depends $python"
- install_if="$pkgname=$pkgver-r$pkgrel $python"
-
- cd "$builddir"
- $python setup.py install --prefix=/usr --root="$subpkgdir"
+package() {
+ mkdir -p "$pkgdir"
}
-py2() {
- cd "$builddir"
+_py2() {
+ cd "$builddir"-py2
_py python2
}
-py3() {
+_py3() {
cd "$builddir"
_py python3
+ }
+
+_py() {
+ _python="$1"
+ pkgdesc="$pkgdesc (for $_python)"
+ depends="$depends $_python"
+ install_if="$pkgname=$pkgver-r$pkgrel $_python"
+ $_python setup.py install --prefix=/usr --root="$subpkgdir"
}
sha512sums="dba880c07ee8b503e02f11ea5804f559ac2eb85717118d796558b1890032482babd15930af78f9d11b77530d496fce3ba8c8579eec71ce5a3f76b8d8a181af34 amqp-2.4.2.tar.gz"