# 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.3.3
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' 'libcap.so' 'libseccomp' 'python' 'python-pyelftools')
makedepends=('linux-headers')
source=(https://distfiles.gentoo.org/distfiles//${pkgname}-${pkgver}.tar.xz)
sha512sums=('bb0d03371cf8f0cc26a83cbee888a6d91e70416dedc740476cd5549ddaef67048c6802e30e469ab1aced0fd7f63f84e9644744602b2d483ef7af37191505f72e')
b2sums=('17004a4fe57f05e80e0c51a156931975cbaf73e20d96fa50dedf6bd1538ff3f8383591f4b5fd0df926a6a6b75cb083724aaf92b1a4d4ebc67290500520919c29')

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 USE_SECCOMP=yes USE_CAP=yes USE_PYTHON=yes
}

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:
