summaryrefslogtreecommitdiff
path: root/community/python-tornado/PKGBUILD
blob: 7f72742a95a754b3124ee3e8759c2c719a84304a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# $Id: PKGBUILD 116040 2014-07-21 07:50:57Z fyan $
# Maintainer: Felix Yan <felixonmars@gmail.com>
# Contributor: Thomas Dziedzic < gostrc at gmail >

pkgname=('python-tornado' 'python2-tornado')
pkgver=4.0.0
pkgrel=1
pkgdesc='open source version of the scalable, non-blocking web server and tools'
arch=('i686' 'x86_64')
url='http://www.tornadoweb.org/'
license=('Apache')
makedepends=('python-setuptools' 'python2-setuptools' 'python2-backports.ssl_match_hostname' 'git' 'python-certifi' 'python2-certifi')
checkdepends=('python-pycurl' 'python2-pycurl' 'python-mock' 'python2-mock' 'python-twisted' 'python2-twisted')
source=("git+https://github.com/facebook/tornado.git#tag=v$pkgver")
sha512sums=('SKIP')

prepare() {
  cp -a tornado{,-py2}

  # python -> python2 rename
  find tornado-py2 -name '*py' -exec sed -e 's_#!/usr/bin/env python_&2_' -i {} \;
}

build() {
  cd tornado
  python setup.py build

  cd ../tornado-py2
  python2 setup.py build
}

check() {
  cd tornado
  python -m tornado.test.runtests || warning "Tests failed"
  python -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOLoop || warning "Tests with AsyncIO failed"
  python -m tornado.test.runtests --ioloop=tornado.platform.select.SelectIOLoop || warning "Tests with SelectIO failed"
  python -m tornado.test.runtests --ioloop=tornado.platform.twisted.TwistedIOLoop || warning "Tests with TwistedIO failed"

  cd ../tornado-py2
  python2 -m tornado.test.runtests || warning "Tests failed"
  python2 -m tornado.test.runtests --ioloop=tornado.platform.twisted.TwistedIOLoop || warning "Tests with TwistedIO failed"
  python2 -m tornado.test.runtests --ioloop=tornado.platform.select.SelectIOLoop || warning "Tests with SelectIO failed"
}

package_python-tornado() {
  depends=('python-certifi')

  cd tornado
  python setup.py install --root="${pkgdir}" --optimize=1
}

package_python2-tornado() {
  depends=('python2-certifi' 'python2-backports.ssl_match_hostname')

  cd tornado-py2
  python2 setup.py install --root="${pkgdir}" --optimize=1
}