2014-09-06 00:07:39 +08:00
|
|
|
#
|
|
|
|
# Platform Packages for Chakra, part of chakra-project.org
|
|
|
|
#
|
|
|
|
# Maintainer: Adrian Chaves Fernandez (Gallaecio) <adriyetichaves@gmail.com>
|
|
|
|
|
2016-03-17 05:49:57 +08:00
|
|
|
pkgbase=python-twisted
|
2014-09-06 00:07:39 +08:00
|
|
|
pkgname=(python3-twisted python2-twisted)
|
2016-03-17 05:49:57 +08:00
|
|
|
pkgver=16.0.0
|
|
|
|
pkgrel=1
|
2014-09-06 00:07:39 +08:00
|
|
|
pkgdesc="Asynchronous networking framework written in Python"
|
|
|
|
arch=('x86_64')
|
|
|
|
url="http://twistedmatrix.com/"
|
|
|
|
license=('MIT')
|
|
|
|
makedepends=('python3-crypto' 'python2-crypto' 'python3-zope-interface' 'python2-zope-interface'
|
|
|
|
'python3-setuptools' 'python2-setuptools' 'python3-service-identity' 'python2-service-identity')
|
2016-03-17 05:49:57 +08:00
|
|
|
source=("git+https://github.com/twisted/twisted.git#tag=twisted-$pkgver")
|
|
|
|
sha1sums=('SKIP')
|
2014-09-06 00:07:39 +08:00
|
|
|
|
|
|
|
prepare() {
|
2016-03-17 05:49:57 +08:00
|
|
|
cp -a "twisted"{,-py2}
|
2014-09-06 00:07:39 +08:00
|
|
|
|
2016-03-17 05:49:57 +08:00
|
|
|
cd "twisted-py2"
|
2014-09-06 00:07:39 +08:00
|
|
|
sed -i 's:^#!.*bin.*python:#!/usr/bin/python2:' \
|
|
|
|
twisted/python/test/pullpipe.py \
|
|
|
|
twisted/mail/test/pop3testserver.py \
|
|
|
|
twisted/trial/test/scripttest.py
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
2016-03-17 05:49:57 +08:00
|
|
|
cd "$srcdir/twisted"
|
2014-09-06 00:07:39 +08:00
|
|
|
python3 setup.py build
|
|
|
|
|
2016-03-17 05:49:57 +08:00
|
|
|
cd "$srcdir/twisted-py2"
|
2014-09-06 00:07:39 +08:00
|
|
|
python2 setup.py build
|
|
|
|
}
|
|
|
|
|
|
|
|
check() {
|
2016-03-17 05:49:57 +08:00
|
|
|
cd "$srcdir/twisted"
|
|
|
|
LC_CTYPE=en_US.utf8 xvfb-run python3 admin/run-python3-tests || warning "Tests failed"
|
2014-09-06 00:07:39 +08:00
|
|
|
|
2016-03-17 05:49:57 +08:00
|
|
|
cd "$srcdir/twisted-py2"
|
|
|
|
LC_CTYPE=en_US.utf8 xvfb-run python2 bin/trial twisted || warning "Tests failed"
|
2014-09-06 00:07:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
package_python3-twisted() {
|
|
|
|
depends=('python3-crypto' 'python3-zope-interface')
|
|
|
|
optdepends=('python3-pyopenssl'
|
|
|
|
'python3-service-identity: for TLS client hostname verification'
|
|
|
|
'python3-pyasn1: for using conch'
|
|
|
|
'tk: for using tkconch')
|
|
|
|
|
2016-03-17 05:49:57 +08:00
|
|
|
cd "$srcdir/twisted"
|
2014-09-06 00:07:39 +08:00
|
|
|
python3 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1
|
2016-03-17 05:49:57 +08:00
|
|
|
|
|
|
|
# Wrong path, wrong!
|
|
|
|
cp -a "$pkgdir"/usr/twisted/* "$pkgdir"/usr/lib/python3.5/site-packages/twisted/
|
|
|
|
rm -r "$pkgdir"/usr/twisted
|
|
|
|
|
|
|
|
# twisted in python 3 supports only few command line tools for now.
|
|
|
|
# Let's rename the tools the other way round after the python 3 version supports all.
|
|
|
|
for name in trial twistd; do
|
|
|
|
mv "$pkgdir/usr/bin/$name"{,3}
|
|
|
|
done
|
|
|
|
|
2014-09-06 00:07:39 +08:00
|
|
|
install -D -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
|
|
|
}
|
|
|
|
|
|
|
|
package_python2-twisted() {
|
|
|
|
depends=('python2-crypto' 'python2-zope-interface')
|
|
|
|
optdepends=('python2-pyopenssl'
|
|
|
|
'python2-service-identity: for TLS client hostname verification'
|
|
|
|
'python2-soappy: for twisted.web.soap'
|
|
|
|
'python2-pyasn1: for using conch'
|
|
|
|
'pygtk: for using manhole'
|
|
|
|
'tk: for using tkconch')
|
|
|
|
provides=("twisted=$pkgver")
|
|
|
|
conflicts=('twisted<14.0.0')
|
|
|
|
replaces=('twisted<14.0.0')
|
|
|
|
|
2016-03-17 05:49:57 +08:00
|
|
|
cd "$srcdir/twisted-py2"
|
2014-09-06 00:07:39 +08:00
|
|
|
python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1
|
|
|
|
install -D -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
2016-03-17 05:49:57 +08:00
|
|
|
}
|