SUMMARY="Reads and writes MNG images"
DESCRIPTION="LibMNG reads and writes MNG format image files, a PNG-like image \
format supporting multiple image, animation and transparent JPEG."
HOMEPAGE="http://www.libmng.com"
COPYRIGHT="2000-2007 Gerard Juyn"
LICENSE="LIBMNG"
REVISION="4"
SOURCE_URI="http://sourceforge.net/projects/libmng/files/libmng-devel/$portVersion/libmng-$portVersion.tar.xz"
CHECKSUM_SHA256="4a462fdd48d4bc82c1d7a21106c8a18b62f8cc0042454323058e6da0dbb57dd3"
PATCHES="libmng-$portVersion.patchset"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	libmng$secondaryArchSuffix = $portVersion compat >= 2.0
	lib:libmng$secondaryArchSuffix = 2.0.2 compat >= 2
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libjpeg$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"

PROVIDES_devel="
	libmng${secondaryArchSuffix}_devel = $portVersion compat >= 2.0
	devel:libmng$secondaryArchSuffix = 2.0.2 compat >= 2
	"
REQUIRES_devel="
	libmng$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libjpeg$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	autoreconf -fi
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

	# remove libtool file
	rm $libDir/libmng.la

	prepareInstalledDevelLibs libmng
	fixPkgconfig

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

TEST()
{
	make check
}
