archrelease: copy trunk to community-any
[ArchLinux/community.git] / python-lmdb / trunk / PKGBUILD
blobd766c14af1292cbca926ddfb5e99ec6701e1e8ba
1 # Maintainer: Daniel Bermond <dbermond@archlinux.org>
2 # Maintainer: Bruno Pagani <archange@archlinux.org>
4 _pkg=py-lmdb
5 pkgname=python-lmdb
6 pkgver=1.4.1
7 pkgrel=2
8 pkgdesc="Universal Python binding for the LMDB Lightning Database"
9 arch=(x86_64)
10 url="https://github.com/jnwatson/py-lmdb/"
11 license=('custom: OpenLDAP')
12 depends=(python python-cffi lmdb)
13 makedepends=(python-build python-installer python-setuptools python-wheel)
14 checkdepends=(python-pytest)
15 source=(${url}/archive/${_pkg}_${pkgver}.tar.gz)
16 sha256sums=('c574035dd85ef7f5b1d6d9c9f639fcaff51fcf85a397c5b6d721e161e6077f51')
18 build() {
19   cd ${_pkg}-${_pkg}_${pkgver}
20   LMDB_FORCE_SYSTEM=1 python -m build --wheel --no-isolation
23 check() {
24   cd ${_pkg}-${_pkg}_${pkgver}
25   local _pyver
26   _pyver="$(python -c 'import sys; print("".join(map(str, sys.version_info[:2])))')"
27   LMDB_FORCE_SYSTEM=1 PYTHONPATH="${PWD}"/build/lib.linux-$CARCH-cpython-${_pyver} pytest -vv --color=yes
30 package() {
31   cd ${_pkg}-${_pkg}_${pkgver}
32   local _pyver
33   _pyver="$(python -c 'import sys; print("%s.%s" %sys.version_info[0:2])')"
34   LMDB_FORCE_SYSTEM=1 python -m installer --destdir="$pkgdir" dist/*.whl
35   install -d -m755 "${pkgdir}"/usr/share/licenses/${pkgname}
36   ln -s ../../../lib/python${_pyver}/site-packages/lmdb-${pkgver}.dist-info/LICENSE \
37     "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE