archrelease: copy trunk to community-any
[ArchLinux/community.git] / python2-tornado / trunk / PKGBUILD
blob07d8f2a003e6257526917611bdf8ea2d0f5ecb52
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Contributor: Thomas Dziedzic < gostrc at gmail >
4 pkgname=python2-tornado
5 pkgver=5.1.1
6 pkgrel=3
7 pkgdesc='open source version of the scalable, non-blocking web server and tools'
8 arch=('x86_64')
9 url='https://www.tornadoweb.org/'
10 license=('Apache')
11 depends=('python2-futures' 'python2-singledispatch' 'python2-backports-abc')
12 optdepends=('python2-monotonic: enable support for a monotonic clock'
13             'python2-pycurl: for tornado.curl_httpclient'
14             'python2-twisted: for tornado.platform.twisted')
15             # 'python2-pycares: an alternative non-blocking DNS resolver'
16 makedepends=('python2-setuptools')
17 checkdepends=('python2-pycurl' 'python2-mock' 'python2-twisted'  'python2-trollius'
18               'python2-monotonic')
19 source=("$pkgname-$pkgver.tar.gz::https://github.com/tornadoweb/tornado/archive/v$pkgver.tar.gz")
20 sha512sums=('b35fa0687ede6e672c35ca82fcc01dbb2ae9d8a7f2e4a65b6e07aa5a8eca861a22d775101172b7e33564951d193e5f11887021a3d762bee88668b9ac0069ab46')
22 export TORNADO_EXTENSION=1
24 prepare() {
25   # python -> python2 rename
26   find tornado-$pkgver -name '*py' -exec sed -e 's_#!/usr/bin/env python_&2_' -i {} \;
29 build() {
30   cd tornado-$pkgver
31   python2 setup.py build
34 check() {
35   # As of 4.5.3, ignoring test failures about resolving "localhost"
36   (
37     cd tornado-$pkgver
38     python2 setup.py install --root="$PWD/tmp_install" --optimize=1
39     export PYTHONPATH="$PWD/tmp_install/usr/lib/python2.7/site-packages:$PYTHONPATH"
40     cd tmp_install
41     python2 -m tornado.test.runtests
42     python2 -m tornado.test.runtests --ioloop=tornado.platform.select.SelectIOLoop
43     python2 -m tornado.test.runtests --httpclient=tornado.curl_httpclient.CurlAsyncHTTPClient
44     python2 -m tornado.test.runtests --ioloop_time_monotonic
45     python2 -m tornado.test.runtests --ioloop=tornado.platform.twisted.TwistedIOLoop
46     python2 -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOLoop
47     python2 -m tornado.test.runtests --resolver=tornado.netutil.ThreadedResolver
48   ) || echo "Tests failed"
51 package() {
52   cd tornado-$pkgver
53   python2 setup.py install --root="$pkgdir" --optimize=1