SUMMARY="A library for the translation of the icns format"
DESCRIPTION="
libicns is a library for manipulation of the Mac OS icns resource format, also \
known as the IconFamily resource type. It can read and write files from the \
Mac OS X icns format, as well as read from Mac OS resource files and macbinary \
encoded Mac OS resource forks.
"
HOMEPAGE="http://sourceforge.net/projects/icns"
COPYRIGHT="
	2001-2012 Matthew Eis
"
LICENSE="GNU LGPL v2.1"
SOURCE_URI="http://sourceforge.net/projects/icns/files/libicns-$portVersion.tar.gz"
CHECKSUM_SHA256="335f10782fc79855cf02beac4926c4bf9f800a742445afbbf7729dab384555c2"
REVISION="2"
ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PATCHES="libicns-$portVersion.patchset"

PROVIDES="
	libicns$secondaryArchSuffix = $portVersion compat >= 0.8
	lib:libicns$secondaryArchSuffix = 1.2.0 compat >= 1
	"
if [ -z "$secondaryArchSuffix" ]; then
	PROVIDES="$PROVIDES
		cmd:icns2png
		cmd:icontainer2icns
		cmd:png2icns
	"
fi
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libjasper$secondaryArchSuffix
	lib:libpng15$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libjasper$secondaryArchSuffix
	devel:libpng15$secondaryArchSuffix
	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()
{
	autoreconf -fi
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install
	
	# Remove stuff we don't need in the secondary architecture base package.
	if [ -n "$secondaryArchSuffix" ]; then
		rm -rf $binDir
	fi 

	prepareInstalledDevelLibs libicns
	fixPkgconfig

	# devel package
	packageEntries devel \
		$developDir
}

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

PROVIDES_devel="
	libicns${secondaryArchSuffix}_devel = $portVersion compat >= 0.8
	devel:libicns$secondaryArchSuffix = 1.2.0 compat >= 1
	"
REQUIRES_devel="
	libicns$secondaryArchSuffix == $portVersion base
	"
