desktop/python-urllib3/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

73 lines
2.0 KiB
Bash

# $Id$
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Patrice Peterson <runiq at archlinux dot us>
# Contributor: Chris Brannon <cmbrannon79@gmail.com>
# Contributor: BorgHunter <borghunter at gmail dot com>
pkgbase=python-urllib3
pkgname=(python3-urllib3 python2-urllib3 python-urllib3-doc)
pkgver=1.14
pkgrel=1
pkgdesc="HTTP library with thread-safe connection pooling and file post support"
arch=("any")
url="https://github.com/shazow/urllib3"
license=("MIT")
makedepends=('python3-setuptools' 'python2-setuptools' 'python2-sphinx' 'git'
'python3-pyasn1'
'python2-pyasn1' 'python3-pyopenssl' 'python2-pyopenssl')
checkdepends=('python3-nose' 'python2-nose' 'python3-mock' 'python2-mock'
'python3-tornado' 'python2-tornado')
source=("git+https://github.com/shazow/urllib3.git#tag=$pkgver")
md5sums=('SKIP')
prepare() {
cp -a urllib3{,-py2}
}
build() {
cd "$srcdir/urllib3"
python3 setup.py build
cd "$srcdir/urllib3-py2"
python2 setup.py build
# Build with Python 2 since autodoc produces errors on Python 3
cd "$srcdir/urllib3/docs"
make SPHINXBUILD=sphinx-build2 html
}
check() {
# Expected failure when asking for external resources
cd "$srcdir/urllib3"
nosetests3 || warning "Tests failed"
cd "$srcdir/urllib3-py2"
nosetests2 || warning "Tests failed"
}
package_python3-urllib3() {
depends=('python3')
cd urllib3
python3 setup.py install --root="${pkgdir}"
install -Dm644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
}
package_python2-urllib3() {
depends=('python2')
cd urllib3-py2
python2 setup.py install --root="${pkgdir}"
install -Dm644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
}
package_python-urllib3-doc() {
pkgdesc="urllib3 Documentation"
cd urllib3/docs
install -d "$pkgdir/usr/share/doc"
cp -r _build/html "$pkgdir/usr/share/doc/python-urllib3"
install -Dm644 ../LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
}