desktop/python-tornado/PKGBUILD
AlmAck 08a66c4024 python3 rebuild for 3.5
new pkg added to fullfill checkdepends
new order file python3.order
2016-03-16 22:36:13 +01:00

93 lines
3.7 KiB
Bash

pkgname=('python3-tornado' 'python2-tornado')
pkgver=4.3.0
pkgrel=2
pkgdesc='open source version of the scalable, non-blocking web server and tools'
arch=('x86_64')
url='http://www.tornadoweb.org/'
license=('Apache')
makedepends=('python3-setuptools' 'python2-setuptools' 'git')
checkdepends=('python3-pycurl' 'python2-pycurl' 'python3-mock' 'python2-mock' 'python3-twisted' 'python2-twisted' 'python2-singledispatch' 'python2-futures' 'python2-backports-abc' 'python2-monotonic' 'python2-trollius')
source=("git+https://github.com/tornadoweb/tornado.git#tag=v$pkgver"
0001-use_system_ca_certificates.patch
0002-get-rid-of-backports-ssl-match-hostname.patch
0003-support-monotonic.patch)
sha512sums=('SKIP'
'cf3dbed20b0bb78cdaa16d4141adc7e12e0b5fd339d2ee9edb5d618dd1c87a643b6ecee19455235b1df712154ce83a1f4149c5579a5a1df5bdf2cd865c766b66'
'4a1a3e83214c9243ac7bd7ca141b25a41279ee25ed1400f7b25259329c52c7c625a8b5724d60b83af170643ae7258fd56f42e2d19c85929d77378f70a4d2205a'
'4dc30c12a6b454a517ee19ca84f71d1733d41b089399102827c0c9e629b26fec415df9eaf6b43ecbe495cbb5b7b938d5f157c8cb617e9daceff3c15739b7f647')
prepare() {
cd tornado
patch -p1 -i ../0001-use_system_ca_certificates.patch
patch -p1 -i ../0002-get-rid-of-backports-ssl-match-hostname.patch
patch -p1 -i ../0003-support-monotonic.patch
cd "$srcdir"
cp -a tornado{,-py2}
# python -> python2 rename
find tornado-py2 -name '*py' -exec sed -e 's_#!/usr/bin/env python_&2_' -i {} \;
export TORNADO_EXTENSION=1
}
build() {
cd tornado
python3 setup.py build
cd ../tornado-py2
python2 setup.py build
}
check() {
(
cd tornado
python3 setup.py install --root="$PWD/tmp_install" --optimize=1
export PYTHONPATH="$PWD/tmp_install/usr/lib/python3.5/site-packages:$PYTHONPATH"
cd tmp_install
python3 -m tornado.test.runtests
python3 -m tornado.test.runtests --ioloop=tornado.platform.select.SelectIOLoop
python3 -m tornado.test.runtests --httpclient=tornado.curl_httpclient.CurlAsyncHTTPClient
python3 -m tornado.test.runtests --ioloop_time_monotonic
python3 -m tornado.test.runtests --ioloop=tornado.platform.twisted.TwistedIOLoop
python3 -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOLoop
python3 -m tornado.test.runtests --resolver=tornado.netutil.ThreadedResolver
)
(
cd tornado-py2
python2 setup.py install --root="$PWD/tmp_install" --optimize=1
export PYTHONPATH="$PWD/tmp_install/usr/lib/python2.7/site-packages:$PYTHONPATH"
cd tmp_install
python2 -m tornado.test.runtests
python2 -m tornado.test.runtests --ioloop=tornado.platform.select.SelectIOLoop
python2 -m tornado.test.runtests --httpclient=tornado.curl_httpclient.CurlAsyncHTTPClient
python2 -m tornado.test.runtests --ioloop_time_monotonic
python2 -m tornado.test.runtests --ioloop=tornado.platform.twisted.TwistedIOLoop
python2 -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOLoop
python2 -m tornado.test.runtests --resolver=tornado.netutil.ThreadedResolver
)
}
package_python3-tornado() {
depends=('python3')
optdepends=('python3-pycurl: for tornado.curl_httpclient'
'python3-twisted: for tornado.platform.twisted')
cd tornado
python3 setup.py install --root="${pkgdir}" --optimize=1
}
package_python2-tornado() {
depends=('python2-singledispatch' 'python2-backports-abc')
optdepends=('python2-futures: recommended thread pool and for tornado.netutil.ThreadedResolver'
'python2-monotonic: enable support for a monotonic clock'
'python2-pycurl: for tornado.curl_httpclient'
'python2-twisted: for tornado.platform.twisted')
cd tornado-py2
python2 setup.py install --root="${pkgdir}" --optimize=1
}