SUMMARY="An implementation of the Dirac video codec"
DESCRIPTION="Schroedinger (or "schro" for short) is an implementation of the \
Dirac and SMPTE VC-2 video compression specification.  Dirac was developed \
by BBC Research & Development (http://www.bbc.co.uk/rd/) as an open \
technology with open licensing.

Schroedinger is the C library implementing video encoding and decoding. \
Most end users will want to use an application that uses the Schroedinger \
library for encoding and decoding Dirac streams.  A few such applications \
are Totem, VLC, and Mplayer.

In addition, media frameworks such as GStreamer and decoding libraries such \
as ffmpeg can be configured to use Schroedinger either internally or via \
plugins."
HOMEPAGE="http://www.diracvideo.org"
COPYRIGHT="2006 BBC and Fluendo"
LICENSE="MIT"
REVISION="6"
SOURCE_URI="https://launchpad.net/schroedinger/trunk/$portVersion/+download/schroedinger-$portVersion.tar.gz"
CHECKSUM_SHA256="1e572a0735b92aca5746c4528f9bebd35aa0ccf8619b22fa2756137a8cc9f912"
PATCHES="schroedinger-$portVersion.patchset"

ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	schroedinger$secondaryArchSuffix = $portVersion compat >= 1.0
	lib:libschroedinger_1.0$secondaryArchSuffix = 0.11.0 compat >= 0
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:liborc_0.4$secondaryArchSuffix
	"

PROVIDES_devel="
	schroedinger${secondaryArchSuffix}_devel = $portVersion compat >= 1.0
	devel:libschroedinger_1.0$secondaryArchSuffix = 0.11.0 compat >= 0
	"
REQUIRES_devel="
	schroedinger$secondaryArchSuffix == $portVersion base
	devel:liborc_0.4$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:liborc_0.4$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	autoreconf -f -i -I m4
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

	mv $includeDir/schroedinger-1.0/schroedinger $includeDir/schroedinger
	rm -rf $includeDir/schroedinger-1.0
	prepareInstalledDevelLibs libschroedinger-1.0
	fixPkgconfig

	# devel package
	packageEntries devel \
		$developDir
}
