SUMMARY="An implementation of the smjpeg decoding library"
DESCRIPTION="
smjpeg is an implementation of the smjpeg decoding library, which runs on just \
about any platform. It comes with one sample deoder, smjpeg_decode (console, \
no UI)."
HOMEPAGE="http://www.icculus.org/smjpeg" 
SRC_URI="svn://svn.icculus.org/smjpeg/trunk/"
LICENSE="GNU LGPL v2"
COPYRIGHT="1999-2004 Sam Lantinga, Joe Tennies."

REVISION="1"

ARCHITECTURES="x86_gcc2 x86 ?x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	smjpeg$secondaryArchSuffix = $portVersion compat >= 0
	lib:libsmjpeg$secondaryArchSuffix = 0.2_0.0.2 compat >= 0.2_0
	lib:libsmjpeg_0.2$secondaryArchSuffix = 0.0.2 compat >= 0
	cmd:smjpeg_encode$secondaryArchSuffix = $portVersion compat >= 0
	cmd:smjpeg_decode$secondaryArchSuffix = $portVersion compat >= 0
	"

REQUIRES="
	haiku$secondaryArchSuffix
	libsdl$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libsdl$secondaryArchSuffix
	"

BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:libtoolize
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:ld$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	rm -f aclocal.m4
	rm -f acinclude.m4
	libtoolize --force --copy --install
	aclocal
	automake --foreign --add-missing
	autoconf
	runConfigure ./configure --enable-shared
	make $jobArgs
}

INSTALL()
{
	make install

	prepareInstalledDevelLibs libsmjpeg
	fixPkgconfig

	# devel package
	packageEntries devel \
		$developDir
}

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

PROVIDES_devel="
	smjpeg${secondaryArchSuffix}_devel = $portVersion
	devel:libsmjpeg$secondaryArchSuffix = 0.2_0.0.2 compat >= 0.2_0
	devel:libsmjpeg_0.2$secondaryArchSuffix = 0.0.2 compat >= 0
	"

REQUIRES_devel="
	smjpeg$secondaryArchSuffix == $portVersion base
	"
