summaryrefslogtreecommitdiffstats
path: root/abs/core/python_modules/python-beaker/PKGBUILD
blob: 8947e3f818d409cd667cee45e36b5d40a947d9f4 (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
# $Id$
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Massimiliano Torromeo < massimiliano DOT torromeo AT gmail DOT com >

pkgbase=python-beaker
pkgname=('python-beaker' 'python2-beaker')
pkgver=1.8.1
pkgrel=2
arch=('any')
license=('custom')
pkgdesc="Caching and sessions WSGI middleware for use with web applications and stand-alone Python scripts and applications"
url="http://beaker.groovie.org/"
makedepends=('python-setuptools' 'python2-setuptools' 'git')
checkdepends=('python-nose' 'python2-nose' 'python-mock' 'python2-mock' 'python-sqlalchemy' 'python2-sqlalchemy'
              'python-crypto' 'python2-crypto' 'python-coverage' 'python2-coverage' 'python-webtest' 'python2-webtest'
              'python-beautifulsoup4' 'python2-beautifulsoup4')
source=("git+https://github.com/bbangert/beaker.git#tag=$pkgver")
md5sums=('SKIP')

prepare() {
    cp -a beaker{,-py2}

    sed -i "s#/usr/bin/python#/usr/bin/python3#" beaker/beaker/crypto/pbkdf2.py
    sed -i "s#/usr/bin/python#/usr/bin/python2#" beaker-py2/beaker/crypto/pbkdf2.py
}

build() {
    cd "$srcdir"/beaker
    python3 setup.py build

    cd "$srcdir"/beaker-py2
    python2 setup.py build
}

check() {
    cd "$srcdir"/beaker
    mkdir tests_py3
    2to3 -w -n -o tests_py3 tests/*.py
    PYTHONPATH="$PWD/build/lib:$PYTHONPATH" nosetests3 --py3where=tests_py3

    cd "$srcdir"/beaker-py2
    PYTHONPATH="$PWD/build/lib:$PYTHONPATH" nosetests2
}

package_python-beaker() {
    depends=('python')

    cd beaker
    python3 setup.py install --root="$pkgdir" --optimize=1
    install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/python-beaker/LICENSE
}

package_python2-beaker() {
    depends=('python2')

    cd beaker-py2
    python2 setup.py install --root="$pkgdir" --optimize=1
    install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/python2-beaker/LICENSE
}