diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2017-07-13 20:33:27 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-07-13 20:33:51 +0200 |
commit | f9fd4e1b4b9b602948ad489541e2adc8afc99011 (patch) | |
tree | 30400000e403f36c38eeb9ac1d804cc1d157f0ea /testing/py-waitress/APKBUILD | |
parent | bba87a330902f8ba2dace0ee3be41097d4110f2c (diff) | |
download | aports-f9fd4e1b4b9b602948ad489541e2adc8afc99011.tar.bz2 aports-f9fd4e1b4b9b602948ad489541e2adc8afc99011.tar.xz |
testing/py-waitress: add py2/py3 subpackages and run tests
Diffstat (limited to 'testing/py-waitress/APKBUILD')
-rw-r--r-- | testing/py-waitress/APKBUILD | 62 |
1 files changed, 42 insertions, 20 deletions
diff --git a/testing/py-waitress/APKBUILD b/testing/py-waitress/APKBUILD index b87841dd45..ec3b610862 100644 --- a/testing/py-waitress/APKBUILD +++ b/testing/py-waitress/APKBUILD @@ -7,33 +7,55 @@ pkgrel=0 pkgdesc="A Python WSGI server" url="https://github.com/Pylons/waitress" arch="noarch" -license="ZPL 2.1" -depends="python2" -depends_dev="" -makedepends="python2-dev py-setuptools" -install="" -subpackages="" +license="ZPL-2.1" +checkdepends="py-nose" +makedepends="python2-dev python3-dev py-setuptools" +subpackages="py2-$_pkgname:_py2 py3-$_pkgname:_py3" source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz" +builddir="$srcdir/$_pkgname-$pkgver" -_builddir="$srcdir"/$_pkgname-$pkgver -prepare() { - local i - cd "$_builddir" - for i in $source; do - case $i in - *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; - esac - done +build() { + cd "$builddir" + + python2 setup.py build + python3 setup.py build } -build() { - cd "$_builddir" - python2 setup.py build || return 1 +check() { + cd "$builddir" + + # XXX: Some tests fail on python2 with "No file descriptors available". + python3 setup.py test } package() { - cd "$_builddir" - python2 setup.py install --prefix=/usr --root="$pkgdir" || return 1 + mkdir -p "$pkgdir"/usr/bin + + ln -s waitress-serve-3 "$pkgdir"/usr/bin/waitress-serve +} + +_py2() { + replaces="$pkgname" + _py python2 +} + +_py3() { + _py python3 +} + +_py() { + local python="$1" + local pyver="${python#python}" + pkgdesc="$pkgdesc (for $python)" + depends="$python" + install_if="$pkgname=$pkgver-r$pkgrel $python" + + cd "$builddir" + $python setup.py install --prefix=/usr --root="$subpkgdir" + + cd "$subpkgdir" + mv usr/bin/waitress-serve usr/bin/waitress-serve-$pyver + rm -R usr/lib/python$pyver*/site-packages/$_pkgname/tests } sha512sums="b7000e1198ac306ce189f70c5dcfcf41318e5ec47c8d6183cdbc360c8759ca726405d5da70f1c7fe3cfeb39d528af94d693767c2a7a1a7fe460c6407857ec6f0 waitress-1.0.2.tar.gz" |