# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: 
pkgname=pax-utils
pkgver=1.2.3
pkgrel=0
pkgdesc="ELF related utils for ELF 32/64 binaries"
url="https://wiki.gentoo.org/wiki/Hardened/PaX_Utilities"
arch="all"
options="!check"  # Requires unpackaged dependencies
license="GPL-2.0-only"
depends="scanelf"
makedepends_build=""
makedepends_host="linux-headers libcap-dev"
makedepends="$makedepends_build $makedepends_host"
source="http://distfiles.gentoo.org/distfiles/${pkgname}-${pkgver}.tar.xz
	fix-eitype.patch"
subpackages="$pkgname-doc scanelf:_scanelf"

build() {
	cd "$builddir"
	make USE_CAP=yes
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir/" install

	# Don't conflict with lddtree package
	rm -f "$pkgdir"/usr/bin/lddtree
}

_scanelf() {
	pkgdesc="Scan ELF binaries for stuff"
	depends=
	replaces="pax-utils"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/scanelf "$subpkgdir"/usr/bin/
}

sha512sums="efcbce49aa7e5cd433f9b3fbc8fa82f6d7b0eb80ec40aafde453d6fe96e3565e066e5020f04d71537d8d4e820147f4203c0df2dd330ebb1358a26def3dd5484c  pax-utils-1.2.3.tar.xz
7150f162a64d9095fab4f73c4a0c531550e2286d6e09a686c62b3a692353b9e33a770ad196f647b5f26b5acafcdef05187dc9d40b40b46d508900dc3e33324a6  fix-eitype.patch"