# $Id$
# Maintainer:
# Contributor: Tobias Powalowski <tpowa@archlinux.org>

pkgname=talloc
pkgver=2.1.5
pkgrel=1
pkgdesc="Hierarchical pool based memory allocator with destructors"
arch=('i686' 'x86_64')
license=('GPL3')
url="http://talloc.samba.org/"
depends=('glibc')
makedepends=('python2' 'docbook-xsl')
optdepends=('python2: for python bindings')
source=(http://samba.org/ftp/${pkgname}/${pkgname}-${pkgver}.tar.{gz,asc}
        fix_test_path.patch)
sha1sums=('bdf3b3d8449e2c354f1ebc43d3e1058160eb4adb'
          'SKIP'
          '34132be289f9ce1c38c8b367def8d91ac7dbb706')
validpgpkeys=(9147A339719518EE9011BCB54793916113084025) # samba-bugs@samba.org

prepare() {
   cd "${srcdir}/${pkgname}-${pkgver}"
   patch -p1 < ../fix_test_path.patch
   sed -i -e 's#python#python2#g' buildtools/bin/waf
}

build() {
   cd "${srcdir}/${pkgname}-${pkgver}"
   ./configure --prefix=/usr \
     --sysconfdir=/etc/samba \
     --localstatedir=/var \
     --bundled-libraries=NONE \
     --builtin-libraries=replace \
     --enable-talloc-compat1
   make
}

check() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make check
}

package() {
   cd "${srcdir}/${pkgname}-${pkgver}"
   make DESTDIR="${pkgdir}" install
}