archrelease: copy trunk to extra-x86_64
[arch-packages.git] / python-beaker / trunk / PKGBUILD
blob587b4665fd744f87bb88828b7a81237b09ae3c83
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 >
5 pkgname=python-beaker
6 pkgver=1.12.0
7 pkgrel=3
8 arch=('any')
9 license=('custom')
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/"
12 depends=('python')
13 makedepends=('python-setuptools')
14 checkdepends=('python-pytest' '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=('d7ef5070f036ca7ea100c348df58aa98edad0ee8e361c0a600485b6e1de301f3381ecc782dcbc4b1b2735a4b54e8aff7fd516a7c9d655d2c10517e358ffe031c')
21 prepare() {
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
30 build() {
31   cd beaker-$pkgver
32   python3 setup.py build
35 check() {
36   cd beaker-$pkgver
37   # it_IT.UTF-8 is missing in test env
38   pifpaf run memcached --port 11211 -- pifpaf run redis -- \
39     pytest --deselect tests/test_cookie_expires.py::test_cookie_expires_different_locale
42 package() {
43   cd beaker-$pkgver
44   python setup.py install --root="$pkgdir" --optimize=1
45   install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/python-beaker/