SUMMARY="ELF utils that can check files for security relevant properties"
DESCRIPTION="A suite of ELF tools to aid auditing systems. Contains various \
ELF related utils for ELF32, ELF64 binaries useful for displaying PaX and \
security info on a large groups of binary files."
HOMEPAGE="https://wiki.gentoo.org/index.php?title=Project:Hardened/PaX_Utilities"
COPYRIGHT="
	2003-2016 Gentoo Foundation
	2003-2012 Ned Ludd
	2004-2016 Mike Frysinger
	"
LICENSE="GNU GPL v2"
REVISION="2"
SOURCE_URI="https://dev.gentoo.org/~slyfox/distfiles/pax-utils-$portVersion.tar.xz"
CHECKSUM_SHA256="9742d2a31d53a4e0f6df0d3721ab6f7cf8b0404c95fee3b00e678c1ff6db7f21"
SOURCE_DIR="pax-utils-$portVersion"
PATCHES="pax_utils-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
	commandSuffix=
	commandBinDir=$prefix/bin
fi

PROVIDES="
	pax_utils$secondaryArchSuffix = $portVersion
	cmd:dumpelf$commandSuffix = $portVersion
	cmd:lddtree$commandSuffix = $portVersion
	cmd:scanelf$commandSuffix = $portVersion
	cmd:scanmacho$commandSuffix = $portVersion
	cmd:symtree$commandSuffix = $portVersion
	"

REQUIRES="
	haiku$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"

BUILD_PREREQUIRES="
	cmd:ar$secondaryArchSuffix
	cmd:awk
	cmd:cmp
	cmd:dd
	cmd:make
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:grep
	cmd:egrep
	cmd:sed
	"

BUILD()
{
	runConfigure --omit-dirs binDir ./configure --bindir=$commandBinDir
	make $jobArgs
}

INSTALL()
{
	make install
	# pspax hasn't been ported yet
	rm -f $commandBinDir/pspax$commandSuffix
	rm -f $manDir/man1/pspax.1
}

TEST()
{
	make check
}
