# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=py3-ldap
_pkgname=python-ldap
pkgver=3.4.4
pkgrel=1
pkgdesc="Python modules for implementing LDAP clients"
url="https://github.com/python-ldap/python-ldap"
arch="all"
license="Python-2.0 AND MIT"
depends="py3-asn1 py3-asn1-modules"
checkdepends="
	openldap
	openldap-back-mdb
	openldap-clients
	openldap-overlay-syncprov
	"
makedepends="python3-dev py3-setuptools openldap-dev"
provides="py3-pyldap=$pkgver-r$pkgrel"  # for backward compatibility with Alpine <3.19
subpackages="$pkgname-pyc"
source="https://github.com/$_pkgname/$_pkgname/archive/$_pkgname-$pkgver.tar.gz
	skip-broken-test.patch"
builddir="$srcdir/$_pkgname-$_pkgname-$pkgver"

case "$CARCH" in
	# FIXME: Some tests fail.
	s390x) options="!check";;
esac

build() {
	python3 setup.py build
}

check() {
	PYTHONPATH=$(echo ./build/lib*) python3 -m unittest discover -v -s Tests -p 't_*'
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"
}

sha512sums="
de87bc6f64540969d1a0ec003f2518c4e8a1899798085371ed017209702fe0c580eea235def8208a5aea42541011b2515c982924f6a75558a84b3f01785254ae  python-ldap-3.4.4.tar.gz
79d09aafb047d53bfbb1dd08ad662099e3493797859c31fd821a4cb9ece7eb5557828262e8e83e8aab7980a728ce3c60682770998256844ea52de5dcee1f220a  skip-broken-test.patch
"
