Name scanelf
Description Scan ELF binaries for stuff
Version 1.3.8-r1
Package Base pax-utils
Homepage https://wiki.gentoo.org/wiki/Hardened/PaX_Utilities
Maintainers ['Natanael Copa <ncopa@alpinelinux.org>']
Contributors ['Leo <thinkabit.ukim@gmail.com>', 'Sören Tempel <soeren+alpine@soeren-tempel.net>']
Distro-repo https://gitlab.alpinelinux.org/alpine/aports/-/tree/3.22-stable/main/pax-utils
Sources []
Dependencies ['libc.musl-x86_64.so.1']
Optional-Dependencies []
Build-Dependencies []
Provides ['cmd:scanelf=1.3.8-r1']
Builddate 20-01-2025 23:33:17
Architecture x86_64
Distro-Version v3.22
Licenses ['GPL-2.0-only']
Hash Q1vW3RyCDUdrzfjuOPADvPKnMyOxM=
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=pax-utils
pkgver=1.3.8
pkgrel=1
pkgdesc="ELF related utils for ELF 32/64 binaries"
url="https://wiki.gentoo.org/wiki/Hardened/PaX_Utilities"
arch="all"
license="GPL-2.0-only"
depends="scanelf"
makedepends_build="meson"
makedepends_host="linux-headers libcap-dev"
checkdepends="bash python3 py3-elftools"
subpackages="$pkgname-doc scanelf:_scanelf lddtreepax:_lddtreepax:noarch"
[ -n "$BOOTSTRAP" ] && options="$options !check" # prevent python dependency
source="https://dev.gentoo.org/~sam/distfiles/app-misc/pax-utils/pax-utils-$pkgver.tar.xz"

build() {
	if [ -z "$BOOTSTRAP" ]; then
		local lto="-Db_lto=true"
	fi
	abuild-meson \
		$lto \
		-Dlddtree_implementation=sh \
		-Duse_seccomp=false \
		-Duse_libcap=enabled \
		-Dtests="$(want_check && echo true || echo false)" \
		. output
	meson compile -C output
}

check() {
	meson test --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output

	# Don't conflict with main/lddtree
	mv "$pkgdir"/usr/bin/lddtree "$pkgdir"/usr/bin/lddtreepax
}

_scanelf() {
	depends=""
	pkgdesc="Scan ELF binaries for stuff"
	replaces="pax-utils"

	amove usr/bin/scanelf
}

_lddtreepax() {
	depends="python3 py3-elftools"
	pkgdesc="Read and package ELF dependency trees"

	amove usr/bin/lddtreepax
}

sha512sums="
0dde95f86802729d80b7b38af84dec636e973f6abc70600633edcb05d3d5f95c1b2861300ce478dd7f798c7a1e5eccb1011c06c53adba38e11a996b69d463656  pax-utils-1.3.8.tar.xz
"