# PKGBUILD maintained by Andreas Obergrusberger <tradiaz@yahoode>
# PKGBUILD update by Xavier corredorl (epsilom) 2009
# PKGBUILD update by Yiannis Belias 2011

pkgname=elektra
pkgver=0.7.0
pkgrel=2
pkgdesc="Elektra is a universal hierarchical configuration store"
url="http://www.libelektra.org/"
license="BSD"
arch=('i686' 'x86_64')
depends=('libxml2')
makedepends=('docbook-xsl')
source=(http://www.markus-raab.org/ftp/$pkgname-$pkgver.tar.gz)
md5sums=('febdf1276bc7ba91636731f73a30f756')

build() {
  LDFLAGS=$(echo ${LDFLAGS} | sed 's/-Wl, *--as-needed//')

  cd $startdir/src/$pkgname-$pkgver
  ./configure \
    --prefix=/usr \
    --libdir=/lib \
    --bindir=/bin \
    --sysconfdir=/etc \
    --with-docbook=/usr/share/xml/docbook
  make || return 1
}

package() {
  cd $startdir/src/$pkgname-$pkgver
  make DESTDIR=$startdir/pkg install
  mv $pkgdir/usr/include $pkgdir/usr/elektra
  mkdir $pkgdir/usr/include
  mv $pkgdir/usr/elektra $pkgdir/usr/include

  mkdir -p $startdir/pkg/usr/share/licenses/$pkgname
  cp COPYING $startdir/pkg/usr/share/licenses/$pkgname/
}
