SUMMARY="Save optimized PNG files"
DESCRIPTION="
The OptiPNGTranslator for Haiku allows you to save images as PNG files which \
have been optimized by OptiPNG.
"
HOMEPAGE="https://github.com/noryb009/OptiPNGTranslator/"
SOURCE_URI="git://github.com/noryb009/OptiPNGTranslator.git#8e3996a92d840f3c097cf954e001d4f371265161"
LICENSE="MIT"
COPYRIGHT="2013 Luke (noryb009)"
REVISION="1"
ARCHITECTURES="x86_gcc2 x86 x86_64"

if [ $buildArchitecture = x86_gcc2 ] && \
		[ $targetArchitecture = x86_gcc2 ]; then
	optipngSuffix="_x86"
fi

PROVIDES="
	optipngtranslator = $portVersion
	app:OptiPNGTranslator = $portVersion
	"

REQUIRES="
	haiku
	cmd:optipng$optipngSuffix
	"

BUILD_REQUIRES="
	haiku_devel
	"
BUILD_PREREQUIRES="
	cmd:as
	cmd:gcc
	makefile_engine
	cmd:make
	"

BUILD()
{
	make \
		BUILDHOME=`finddir B_SYSTEM_DEVELOP_DIRECTORY` \
		TARGET_DIR=.
}

INSTALL()
{
	mkdir -p $addOnsDir/Translators
	cp OptiPNGTranslator $addOnsDir/Translators
}
