SUMMARY="XML parser toolkit"
DESCRIPTION="
Expat is an XML parser library written in C. It is a stream-oriented parser in \
which an application registers handlers for things the parser might find in \
the XML document (like start tags).
"
HOMEPAGE="http://expat.sourceforge.net/"
COPYRIGHT="
	1998-2000 Thai Open Source Software Center Ltd and Clark Cooper
	2001-2006 Expat maintainers.
	"
LICENSE="MIT"
SRC_URI="http://iweb.dl.sourceforge.net/project/expat/expat/2.0.1/expat-2.0.1.tar.gz"
CHECKSUM_MD5="ee8b492592568805593f81f8cdf2a04c"
REVISION="7"
ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	expat$secondaryArchSuffix = $portVersion compat >= 2.0
	lib:libexpat$secondaryArchSuffix = 1.5.2 compat >= 1
	"
if [ -z "$secondaryArchSuffix" ]; then
	PROVIDES="$PROVIDES
		cmd:xmlwf = $portVersion compat >= 2.0
		"
fi

REQUIRES="
	haiku$secondaryArchSuffix >= $haikuVersion
	"
BUILD_REQUIRES="
	"
BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel >= $haikuVersion
	cmd:aclocal
	cmd:autoconf
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize
	cmd:make
	"

PATCH()
{
	echo "AC_CONFIG_MACRO_DIR([m4])" >> configure.in
	echo "ACLOCAL_AMFLAGS = -I m4" >> Makefile.am
}

BUILD()
{
	rm -f conftools/libtool.m4
	libtoolize --force --copy --install
	aclocal -I conftools -I m4
	autoconf
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

	# remove command for secondary architecture
	if [ -n "$secondaryArchSuffix" ]; then
		rm -rf $binDir
	fi

	# prepare develop/lib
	prepareInstalledDevelLibs libexpat

	# devel package
	packageEntries devel \
		$developDir
}

# ----- devel package -------------------------------------------------------

PROVIDES_devel="
	expat${secondaryArchSuffix}_devel = $portVersion
	devel:libexpat${secondaryArchSuffix} = 1.5.2 compat >= 1
	"
REQUIRES_devel="
	expat${secondaryArchSuffix} == $portVersion base
	"
