SUMMARY="Easily extensible archiver"
DESCRIPTION="
The XAR project aims to provide an easily extensible archive format. Important \
design decisions include an easily extensible XML table of contents for random \
access to archived files, storing the toc at the beginning of the archive to \
allow for efficient handling of streamed archives, the ability to handle files \
of arbitrarily large sizes, the ability to choose independent encodings for \
individual files in the archive, the ability to store checksums for individual \
files in both compressed and uncompressed form, and the ability to query the \
table of content's rich meta-data.
"
LICENSE="BSD (3-clause)"
COPYRIGHT="2005 Rob Braun"
HOMEPAGE="http://code.google.com/p/xar/"
SRC_URI="http://xar.googlecode.com/files/xar-1.5.2.tar.gz"
CHECKSUM_SHA256="4c5d5682803cdfab16d72365cf51fc4075d597c5eeaa8c7d1990fea98cdae3e6"
REVISION="2"
ARCHITECTURES="x86"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
	# x86_gcc2 is fine as primary target architecture as long as we're building
	# for a different secondary architecture.
	ARCHITECTURES="$ARCHITECTURES x86_gcc2"
else
	ARCHITECTURES="$ARCHITECTURES !x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	xar$secondaryArchSuffix = $portVersion compat = 1.5.2
	cmd:xar$secondaryArchSuffix = $portVersion compat = 1.5.2
	lib:libxar$secondaryArchSuffix = $portVersion compat = 1.5.2
	"

REQUIRES="
	haiku$secondaryArchSuffix >= $haikuVersion
	lib:libxml2$secondaryArchSuffix
	lib:libcrypto$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	lib:libbz2$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel >= $haikuVersion
	devel:libxml2$secondaryArchSuffix
	devel:libcrypto$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	devel:libbz2$secondaryArchSuffix
	"

BUILD_PREREQUIRES="
	cmd:libtoolize
	cmd:aclocal
	cmd:autoconf
	cmd:make
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	"

PROVIDES_devel="
	devel:libxar$secondaryArchSuffix = $portVersion compat = 1.5.2
	"

REQUIRES_devel="
	xar$secondaryArchSuffix == $portVersion
	"

PATCHES="xar-1.5.2.patchset"

BUILD()
{
	libtoolize --force --copy --install
	aclocal
	autoconf
	runConfigure ./configure
	make
}

INSTALL()
{
	make install

	prepareInstalledDevelLibs libxar

	packageEntries devel \
	$developDir
}
