summaryrefslogtreecommitdiffstats
path: root/abs/core/python_modules/python-urllib3/PKGBUILD
blob: 3f881d24413e938f8fdea43872cd12e031d45e12 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# $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=(python2-urllib3)
pkgver=1.21.1
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=('python2-setuptools'
             'python2-ndg-httpsclient' 'python2-pyasn1'
             'python2-pyopenssl' 'python2-pysocks' 'python2-mock')
checkdepends=('python2-nose' 'python2-tornado'
              'python2-coverage' 'python2-psutil')
source=("$pkgbase-$pkgver.tar.gz::https://github.com/shazow/urllib3/archive/$pkgver.tar.gz")
md5sums=('b0a2c692ea273dc120b209a027b0df3c')

prepare() {
  cp -a urllib3-$pkgver{,-py2}
}

build() {
#  cd "$srcdir"/urllib3-$pkgver
#  python setup.py build

  cd "$srcdir"/urllib3-$pkgver-py2
  python2 setup.py build

  # Build with Python 2 since autodoc produces errors on Python 3
#  cd "$srcdir"/urllib3-$pkgver/docs
#  make SPHINXBUILD=sphinx-build2 html
}

check() {
#  cd "$srcdir"/urllib3-$pkgver
#  nosetests3 || warning "Tests failed"

  cd "$srcdir"/urllib3-$pkgver-py2
  nosetests2 || warning "Tests failed"
}

package_python-urllib3() {
  depends=('python')
  optdepends=('python-pysocks: SOCKS support')

  cd urllib3-$pkgver
  python setup.py install --root="$pkgdir"
  install -Dm644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.txt
}

package_python2-urllib3() {
  depends=('python2')
  optdepends=('python2-pysocks: SOCKS support')

  cd urllib3-$pkgver-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-$pkgver/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
}