# Maintainer: Natanael Copa pkgname=ldb pkgver=1.3.8 pkgrel=0 pkgdesc="A schema-less, ldap like, API and database" url="https://ldb.samba.org/" arch="all" license="LGPL-3.0-or-later" makedepends="libtirpc-dev tevent-dev py2-tevent tdb-dev py2-tdb talloc-dev python2-dev python3-dev popt-dev cmocka-dev" subpackages="$pkgname-dev py2-$pkgname:_py2 py3-$pkgname:_py3 $pkgname-tools" source="https://www.samba.org/ftp/pub/ldb/$pkgname-$pkgver.tar.gz disable-compile-error-test.patch " builddir="$srcdir/$pkgname-$pkgver" # secfixes: # 1.3.5-r0: # - CVE-2018-1140 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 \ --builtin-libraries=replace \ --with-modulesdir=/usr/lib/ldb/modules \ --extra-python=/usr/bin/python3 make } check() { cd "$builddir" make check } package() { cd "$builddir" make DESTDIR="$pkgdir" install } _py2() { pkgdesc="Python 2 binding for the ldb library" provides="py-ldb=$pkgver-r$pkgrel" # for backward compatibility replaces="py-ldb" # for backward compatibility mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/python2* "$subpkgdir"/usr/lib/ mv "$pkgdir"/usr/lib/libpyldb-util.so.* "$subpkgdir"/usr/lib/ } _py3() { pkgdesc="Python 3 binding for the ldb library" mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/python3* "$subpkgdir"/usr/lib/ mv "$pkgdir"/usr/lib/libpyldb-util.cpython* "$subpkgdir"/usr/lib/ } tools() { pkgdesc="Tools to manage LDB files" mkdir -p "$subpkgdir"/usr/lib/ldb mv "$pkgdir"/usr/bin "$subpkgdir"/usr/ mv "$pkgdir"/usr/lib/ldb/libldb-cmdline.* "$subpkgdir"/usr/lib/ldb/ } sha512sums="06d1b4c2badbf0c27733a64f979c48af8b599747cef7cd7f5417cd55a76447e8f8987bd061694c5af63261fdb35433e3844122c14103d5cc8b4eaab1f4752541 ldb-1.3.8.tar.gz ed55d5151bbcaf5c0a1b70a1f44b461a501ad94ce02ee97e3ea10c560ce3656a190510697bbd3c5b6f70a74519bf7c0a91210bcb415ffd97d9440045e10a02e8 disable-compile-error-test.patch"