# $Id: PKGBUILD 226064 2014-11-11 18:14:17Z anatolik $
# Maintainer : Rémy Oudompheng <remy@archlinux.org>

pkgname=python-pyelftools
_pypiname=pyelftools
pkgver=0.23
pkgrel=1
pkgdesc="Python library for analyzing ELF files and DWARF debugging information"
arch=('any')
url="https://github.com/eliben/pyelftools"
license=('custom')
depends=('python')
source=("https://github.com/eliben/pyelftools/archive/v${pkgver}.zip")
sha1sums=('49cc8d9efb1b7b2a5ae11cf3f9757e0c469049c8')

build() {
  cd ${srcdir}/${_pypiname}-${pkgver}
  python setup.py build
}

check() {
  cd ${srcdir}/${_pypiname}-${pkgver}
  python test/run_all_unittests.py
}

package() {
  cd ${srcdir}/${_pypiname}-${pkgver}
  python setup.py install --root=${pkgdir}
  install -D -m 644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
}

