# Template file for 'findutils'
pkgname=findutils
version=4.10.0
revision=1
bootstrap=yes
build_style=gnu-configure
configure_args="--program-prefix=g"
hostmakedepends="automake gettext"
short_desc="GNU Find Utilities"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-3.0-or-later"
homepage="http://www.gnu.org/software/findutils"
changelog="https://git.savannah.gnu.org/cgit/findutils.git/plain/NEWS"
distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
checksum=1387e0b67ff247d2abde998f90dfbf70c1491391a59ddfecb8ae698789f0a4f5

case $XBPS_TARGET_MACHINE in
	arm*) configure_args+=" --disable-year2038";;
esac

if [ "$XBPS_TARGET_LIBC" = musl ]; then
	export ac_cv_lib_error_at_line=no
	export ac_cv_header_sys_cdefs_h=no
	checkdepends+=" musl-legacy-compat"
fi

alternatives="
 xargs:xargs:/usr/bin/gxargs
 xargs:xargs.1:/usr/share/man/man1/gxargs.1
 find:find:/usr/bin/gfind
 find:find.1:/usr/share/man/man1/gfind.1
"

post_extract() {
	sed -i '/SUBDIRS/s/locate//' Makefile.in
}
pre_check() {
	# LFS reccomends disabling this due to to the possibility of looping forever on some machines
	# see: http://www.linuxfromscratch.org/lfs/view/development/chapter06/findutils.html
	vsed -i 's/test-lock..EXEEXT.//' gnulib-tests/Makefile
	# help-version is broken because we do not build locate
	vsed -i "/tests\/misc\/help-version.sh/d" Makefile
}
post_configure() {
	make -C locate dblocation.texi
}
