# Maintainer: Ray Donnelly <mingw.android@gmail.com>
# Contributor: Martell Malone <martellmalone@gmail.com>

pkgname=elfutils
pkgver=0.160
pkgrel=1
pkgdesc="Libraries and utilities to handle ELF object files and DWARF debugging information"
arch=('i686' 'x86_64')
url="https://fedorahosted.org/elfutils/"
license=('LGPL3' 'GPL' 'GPL3')
depends=('gcc-libs' 'bzip2')
provides=('libelf')
replaces=('libelf')
conflicts=('libelf')
source=(https://fedorahosted.org/releases/e/l/elfutils/${pkgver}/elfutils-${pkgver}.tar.bz2)
options=('staticlibs')
md5sums=('SKIP')

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  rm -f config.guess config.sub
  automake -a || true
  autoreconf -fi
}

build() {
  cd ${srcdir}/${pkgname}-${pkgver}

  CFLAGS+=" -g"  # required for test-suite success
  ./configure --prefix=/usr --program-prefix="eu-"

  make
}

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