archrelease: copy trunk to community-any
[ArchLinux/community.git] / python-xapian-haystack / repos / community-any / PKGBUILD
blob794424dd401cf7a29bc0eff7770d1ac364ec1a70
1 # Maintainer: David Runge <dvzrv@archlinux.org>
3 _name=xapian-haystack
4 _django_name=django-haystack
5 _django_haystack_pkgver=3.1.1
6 pkgname=python-xapian-haystack
7 pkgver=3.0.1
8 pkgrel=3
9 pkgdesc="Xapian backend for Django-Haystack"
10 arch=(any)
11 url="https://github.com/notanumber/xapian-haystack"
12 license=(GPL2)
13 depends=(python-django python-django-haystack python-six python-xapian)
14 makedepends=(python-setuptools)
15 checkdepends=(python-pytest)
16 source=(
17   "https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/${_name}-${pkgver}.tar.gz"
18   "https://files.pythonhosted.org/packages/source/${_django_name::1}/${_django_name}/${_django_name}-${_django_haystack_pkgver}.tar.gz"
20 sha512sums=('f486c26f5c7e8db2fa551040dc436744edb4fc9613a06197b4866d5f687ad755eb6327f4940ef3a4d482039dc390cf922cebff5037eb0de12d2ec7d899e1d260'
21             '509c2c922b6c6c5a2961b2d10b640cf82e8bc2536203c865c2c7a6fdebd2c7173616ce22d620bfd5ef14b61e11a9c88f64cc941195ff2adc2d62604d2c13717c')
22 b2sums=('f1ae6c84bc3f5e06dbf94f7298590ad7aa57e1d812ef159f49baecaf1528c2fae95c386483865972b150d5d7cb2ffad618cf355789a7094b6eb8702c83fd85fc'
23         '2e30f428de9e3c8eea4160821e5e409d53226523e6849c1f4412e895176c136f3332d93644e0c0397c0c67bef2779dd394082ae2bd89626b19ebb1e95174a290')
25 build() {
26   cd "$_name-${pkgver}"
27   python setup.py build
30 check() {
31   cd "$_name-${pkgver}"
32   # inserting xapian-haystack tests into django-haystack (because... pain)
33   ln -sv "${PWD}/build/lib/xapian_backend.py" ../${_django_name}-${_django_haystack_pkgver}/haystack/backends/
34   cp -rv "${PWD}/tests/"* ../${_django_name}-${_django_haystack_pkgver}/test_haystack/
35   ln -svf "${PWD}/tests/xapian_tests/__init__.py" ../${_django_name}-${_django_haystack_pkgver}/test_haystack/
37   cd "../${_django_name}-${_django_haystack_pkgver}"
38   PYTHONPATH="${PWD}:${PYTHONPATH}" django-admin test test_haystack.xapian_tests --settings=test_haystack.xapian_settings \
39     || echo "Known issues: https://github.com/notanumber/xapian-haystack/issues/215"
42 package() {
43   cd "$_name-${pkgver}"
44   python setup.py install --optimize=1 --root="${pkgdir}"
45   install -vDm 644 {AUTHORS,README.rst} -t "${pkgdir}/usr/share/doc/${pkgname}"