SUMMARY="A library to read Metalink files"
DESCRIPTION="Libmetalink is a library to read Metalink XML download \
description format. It supports Metalink version 3 and Metalink version 4 \
(RFC 5854)."
HOMEPAGE="http://launchpad.net/libmetalink"
LICENSE="MIT"
REVISION="2"

ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

SOURCE_URI="https://launchpad.net/libmetalink/trunk/packagingfix/+download/libmetalink-$portVersion.tar.bz2"
CHECKSUM_SHA256="cbed9121bf550ef14a434d6ed3d8806ded7a339db16b698cfa2f39fdc3d48bf6"
COPYRIGHT="2008 Tatsuhiro Tsujikawa"
PATCHES="libmetalink-$portVersion.patchset"

PROVIDES="
	libmetalink$secondaryArchSuffix = $portVersion compat >= 0
	lib:libmetalink$secondaryArchSuffix = 3.0.0 compat >= 3
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libexpat$secondaryArchSuffix
	"
PROVIDES_devel="
	libmetalink${secondaryArchSuffix}_devel = $portVersion compat >= 0
	devel:libmetalink$secondaryArchSuffix = 3.0.0 compat >= 3
	"
REQUIRES_devel="
	libmetalink$secondaryArchSuffix == $portVersion base
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libexpat$secondaryArchSuffix
	devel:libxml2$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize
	cmd:make
	cmd:find
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	libtoolize --force --copy --install
	aclocal
	autoconf
	automake --add-missing
	runConfigure ./configure --disable-dependency-tracking \
		--without-libxml2
	make $jobArgs
}

INSTALL()
{
	make install

	prepareInstalledDevelLibs libmetalink
	fixPkgconfig

	# devel package
	packageEntries devel \
		$developDir \
		$manDir/man3
}
