# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Timothy Redaelli <timothy.redaelli@gmail.com>
# Contributor: sh0 <mee@sh0.org>
# Contributor: Maxwel <msg.maxwel@gmail.com>

pkgname=pax-utils
pkgver=1.2.4
pkgrel=1
pkgdesc='ELF utils that can check files for security relevant properties'
url='https://wiki.gentoo.org/wiki/Hardened/PaX_Utilities'
arch=('x86_64')
license=('GPL2')
depends=('bash' 'libcap' 'libseccomp' 'python-pyelftools')
source=(https://dev.gentoo.org/~slyfox/distfiles/${pkgname}-${pkgver}.tar.xz)
sha256sums=('52858b8cf32b027b59a2ffe79ee21d7c4a09a634f03f5e737b0baec104357906')
sha512sums=('03b84054c59e8ce64d2c07276c61245c8e9b3eca2fc430269531e2dafe120009b541ebb6adc4ff54c13a1da63caf0755fb026ba272cf17d04f75e06b893a3e95')

prepare() {
  cd ${pkgname}-${pkgver}
  sed -E 's|(  paths =) \[\]|\1 ["/usr/lib"]|g' -i lddtree.py
}

build() {
  cd ${pkgname}-${pkgver}
  ./configure \
    --prefix=/usr \
    --with-caps \
    --with-seccomp \
    --with-python
  make
}

check() {
  cd ${pkgname}-${pkgver}
  LD_LIBRARY_PATH=/usr/lib make check
}

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

# vim: ts=2 sw=2 et:
