# Contributor: Fabian Affolter # Maintainer: Fabian Affolter pkgname=py-waitress _pkgname=waitress pkgver=1.1.0 pkgrel=1 pkgdesc="A Python WSGI server" url="https://github.com/Pylons/waitress" arch="noarch" license="ZPL-2.1" checkdepends="py-nose" makedepends="python2-dev python3-dev py-setuptools" subpackages="py2-$_pkgname:_py2 py3-$_pkgname:_py3 $pkgname-openrc" source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz waitress.initd waitress.confd" builddir="$srcdir/$_pkgname-$pkgver" build() { cd "$builddir" python2 setup.py build python3 setup.py build } check() { cd "$builddir" # XXX: Some tests fail on python2 with "No file descriptors available". python3 setup.py test } package() { mkdir -p "$pkgdir"/usr/bin cd "$pkgdir" ln -s waitress-serve-3 usr/bin/waitress-serve install -D -m 755 "$srcdir"/waitress.initd etc/init.d/waitress install -D -m 644 "$srcdir"/waitress.confd etc/conf.d/waitress } openrc() { default_openrc depends="$pkgname=$pkgver-r$pkgrel" } _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="d53cf027525aec6fbd49ab78c30fef1b83d8b58c6d2cbb191d45e69141d7c31d6cd195a0924ad862a4cc42e5d098813712c568f768f51825e96fac3dd4132fbe waitress-1.1.0.tar.gz e3dc21abf42d9e867b129004039d901df5e86f696ff3821f9b2efdf22966b64686ecff6c0fac8101ba011b007fc1358d9dab236ab69208d06a477bb29b8d7d15 waitress.initd 15c571e6b21cfa36273e7c3f659f70d15c702c747f9ba8c681e448f52260561b87f04607a78d98f173a6068baacdc399d4593f6d7fdabb98e31578303c1b6fdb waitress.confd"