summaryrefslogtreecommitdiff
path: root/pcr-testing/python-falcon/PKGBUILD
blob: bbbfa54dcdb73cf48055246782111a11ef8529ca (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
# Maintainer: bill-auger <bill-auger@programmer.net>
# Maintainer (AUR): tocic <tocic at protonmail dot ch>
# Contributor: Carl George < arch at cgtx dot us >


#_check=1

pkgname=('python-falcon' 'python2-falcon')
pkgver=1.4.1
pkgrel=1
pkgdesc="An unladen web framework for building APIs and app backends."
arch=('i686' 'x86_64')
url=https://falconframework.org
license=('Apache')

makedepends=('cython' 'python-setuptools' 'cython2' 'python2-setuptools')
[[ -v ${_run_check} ]] && checkdepends=('python-pytest>=3.0.1' 'python-jsonschema'
                                        'python-msgpack' 'python-requests'
                                        'python-six>=1.4.0' 'python-testtools' 'python-yaml'
                                        'python2-pytest>=3.0.1' 'python2-jsonschema'
                                        'python2-msgpack' 'python2-requests'
                                        'python2-six>=1.4.0' 'python2-testtools' 'python2-yaml')

_upstream_name='falcon'
_release=${_upstream_name}-${pkgver}
source=(https://files.pythonhosted.org/packages/source/${_upstream_name:0:1}/${_upstream_name}/${_release}.tar.gz)
sha256sums=('3981f609c0358a9fcdb25b0e7fab3d9e23019356fb429c635ce4133135ae1bc4')


build()
{
  cd "${srcdir}/${_release}"

  python setup.py build
  python2 setup.py build
}

check()
{
  cd "${srcdir}/${_release}"

  if [[ -v _check ]] ; then pytest tests ; pytest2 tests ; fi ;
}

package_python-falcon()
{
  depends=('python-six>=1.4.0' 'python-mimeparse>=1.5.2')

  cd "${srcdir}/${_release}"

  python setup.py install --skip-build --root="${pkgdir}" --optimize=1
}

package_python2-falcon()
{
  depends=('python2-six>=1.4.0' 'python2-mimeparse>=1.5.2')

  cd "${srcdir}/${_release}"

  python2 setup.py install --skip-build --root="${pkgdir}" --optimize=1
  mv "${pkgdir}/usr/bin/falcon-bench"        "${pkgdir}/usr/bin/falcon-bench-python2"
  mv "${pkgdir}/usr/bin/falcon-print-routes" "${pkgdir}/usr/bin/falcon-print-routes-python2"
}