# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=tevent
pkgver=0.9.34
pkgrel=0
pkgdesc="The tevent library"
url="http://tevent.samba.org/"
arch="all"
license="LGPL-3.0-or-later"
makedepends="python2-dev talloc-dev"
replaces="samba"
subpackages="$pkgname-dev py-$pkgname:_py"
source="http://samba.org/ftp/tevent/tevent-$pkgver.tar.gz"

builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--disable-rpath \
		--bundled-libraries=NONE \
		--without-gettext
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

_py() {
	pkgdesc="Python binding for the tevent library"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/python* "$subpkgdir"/usr/lib/
}

sha512sums="29ff88cedc05d9345749ee241f8ab083fc6f98d3975b2739629a3a75a766db6ec42133eeb6c9297315ee0c68ab512c70b8b927d2df5ea61880c673ef33b44183  tevent-0.9.34.tar.gz"
