SUMMARY="Extended attributes tools"
DESCRIPTION="Tools and libraries for working with filesystem extended attributes(xattr)."
HOMEPAGE="https://savannah.nongnu.org/projects/attr"
COPYRIGHT="2000-2005 Silicon Graphics, Inc
	2001-2022 Andreas Gruenbacher"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://download.savannah.nongnu.org/releases/attr/attr-$portVersion.tar.gz"
CHECKSUM_SHA256="bae1c6949b258a0d68001367ce0c741cebdacdd3b62965d17e5eb23cd78adaf8"
PATCHES="attr-$portVersion.patchset"

ARCHITECTURES="all"

GLOBAL_WRITABLE_FILES="
	settings/xattr.conf keep-old
	"

PROVIDES="
	attr = $portVersion
	cmd:attr
	cmd:getfattr
	cmd:setfattr
	lib:libattr = $portVersion compat >= 2
	"
REQUIRES="
	haiku
	"

PROVIDES_devel="
	attr_devel = $portVersion
	devel:libattr = $portVersion compat >= 2
	"
REQUIRES_devel="
	attr == $portVersion base
	"

BUILD_REQUIRES="
	haiku_devel
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:autoheader
	cmd:automake
	cmd:autopoint
	cmd:autoreconf
	cmd:awk
	cmd:find
	cmd:gcc
	cmd:grep
	cmd:libtoolize
	cmd:make
	cmd:sed
	"

defineDebugInfoPackage attr \
	$binDir/attr \
	$binDir/getfattr \
	$binDir/setfattr \
	$libDir/libattr.so.1.1.2501

BUILD()
{
	# needed because our patch changes the makefiles
	autoreconf -vfi

	LDFLAGS="-lgnu" runConfigure ./configure --disable-nls --disable-static

	make $jobArgs
}

INSTALL()
{
	make install

	prepareInstalledDevelLib libattr
	fixPkgconfig
	packageEntries devel \
		$developDir \
		$manDir/man3
}

TEST()
{
	make check
}
