SUMMARY="Portable Network Graphics library (BeOS compatibility version)"
DESCRIPTION="
libpng is the official PNG reference library. It supports almost all PNG \
features, is extensible, and has been extensively tested for over 17 years.

This is libpng 1.2, an olderversion which may be needed for compatibility with \
BeOS application. For new developments please use the current libpng package.
"
HOMEPAGE="http://www.libpng.org"
COPYRIGHT="
	1998-2011 Glenn Randers-Pehrson
	1996-1997 Andreas Dilger
	1995-1996 Guy Eric Schalnat, Group 42, Inc.
	"
LICENSE="LibPNG"
SOURCE_URI="http://sourceforge.net/projects/libpng/files/libpng12/$portVersion/libpng-$portVersion.tar.bz2"
CHECKSUM_SHA256="57405e667b3c64c490f5ef03cc8bb7b5a89ded7292f84ba1a2f54c2412f4d5fb"
SOURCE_DIR="libpng-$portVersion"
REVISION="1"
ARCHITECTURES="x86_gcc2"
SECONDARY_ARCHITECTURES="x86_gcc2"

PROVIDES="
	libpng12$secondaryArchSuffix = $portVersion compat >= 1.2
	lib:libpng$secondaryArchSuffix = 3.53.0 compat >= 3
	lib:libpng12$secondaryArchSuffix = 3.53.0 compat >= 3
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libz$secondaryArchSuffix >= 1.0.4
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize
	cmd:make
	"

BUILD()
{
	aclocal
	libtoolize --force --copy --install
	./autogen.sh
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

	prepareInstalledDevelLibs libpng libpng12
	fixPkgconfig

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

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

PROVIDES_devel="
	libpng12${secondaryArchSuffix}_devel = $portVersion compat >= 1.2
	cmd:libpng_config$secondaryArchSuffix = $portVersion compat >= 1.2
	cmd:libpng12_config$secondaryArchSuffix = $portVersion compat >= 1.2
	devel:libpng$secondaryArchSuffix = 3.53.0 compat >= 3
	devel:libpng12$secondaryArchSuffix = 3.53.0 compat >= 3
	"
REQUIRES_devel="
	libpng12$secondaryArchSuffix == $portVersion base
	"
