1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Contributor: Ionut Biru <ibiru@archlinux.org>
3 # Contributor: Massimiliano Torromeo < massimiliano DOT torromeo AT gmail DOT com >
10 pkgdesc="Caching and sessions WSGI middleware for use with web applications and stand-alone Python scripts and applications"
11 url="http://beaker.groovie.org/"
13 makedepends=('python-setuptools')
14 checkdepends=('python-nose' 'python-mock' 'python-sqlalchemy'
15 'python-pycryptodome' 'python-coverage' 'python-webtest' 'python-redis'
16 'python-pymongo' 'python-pylibmc' 'redis' 'python-cryptography'
17 'python-memcached' 'memcached' 'pifpaf' 'python-mongomock')
18 source=("$pkgname-$pkgver.tar.gz::https://github.com/bbangert/beaker/archive/$pkgver.tar.gz")
19 sha512sums=('0eab9ff40314786e0fb2d31a6b932f355680c193ac5c41de442ee5a3f4d5cf62ae1c30f2948f8e2c89c012bad5e4332a5a72be62c9b1cba0b9f2723afe7e9ae3')
22 # Use a fake MongoDB for tests
23 sed -e '/class TestMongoDB/i import mongomock' \
24 -e "s|'mongodb://localhost:27017/beaker_testdb'|mongomock.MongoClient('mongodb://localhost:27017/beaker_testdb')|" \
25 -i beaker-$pkgver/tests/test_managers/test_ext_mongodb.py
27 sed -i "s#/usr/bin/python#/usr/bin/python3#" beaker-$pkgver/beaker/crypto/pbkdf2.py
31 cd "$srcdir"/beaker-$pkgver
32 python3 setup.py build
36 # it_IT.UTF-8 is missing in test env
38 cd "$srcdir"/beaker-$pkgver
39 pifpaf run memcached --port 11211 -- pifpaf run redis python setup.py nosetests || warning "Tests failed"
44 python setup.py install --root="$pkgdir" --optimize=1
45 install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/python-beaker/LICENSE