SUMMARY="Lightweight PNG C library"
DESCRIPTION="
pnglite is a small and simple library for loading and writing PNG images.
"
HOMEPAGE="http://sourceforge.net/projects/pnglite"
COPYRIGHT="
	2007 Daniel Karling
	"
LICENSE="Zlib"
SOURCE_URI="http://prdownloads.sourceforge.net/pnglite/pnglite-$portVersion.zip"
CHECKSUM_SHA256="6444b13b9ec5b6f9de8f72513a00870325779e3b05bfcf554edb1ab0c90f5962"
REVISION="1"
ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

SOURCE_DIR=""

PROVIDES="
	pnglite$secondaryArchSuffix = $portVersion
	lib:libpnglite$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libz$secondaryArchSuffix >= 1.0.4
	"
BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:sed
	"

PATCH()
{
	sed -i 's:"../zlib/zlib.h":<zlib.h>:' pnglite.c
}

BUILD()
{
	gcc -o libpnglite.so.0 -shared -Wl,-soname=libpnglite.so.0 pnglite.c -lz
}

INSTALL()
{
	mkdir -p $includeDir $libDir
	cp pnglite.h $includeDir/
	cp libpnglite.so.0 $libDir/
	
	prepareInstalledDevelLibs libpnglite
	
	# devel package
	packageEntries devel \
		$developDir	
}

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

PROVIDES_devel="
	pnglite${secondaryArchSuffix}_devel = $portVersion
	devel:libpnglite$secondaryArchSuffix = $portVersion
	"
REQUIRES_devel="
	pnglite$secondaryArchSuffix == $portVersion base
	"
