SUMMARY="A free implementation of the unicode bidirectional algorithm"
DESCRIPTION="
This is GNU FriBidi. The Free Implementation of the Unicode Bidirectional \
Algorithm. One of the missing links stopping the penetration of free software \
in Middle East is the lack of support for the Arabic and Hebrew alphabets. In \
order to have proper Arabic and Hebrew support, the BiDi algorithm should have \
been implemented. It is our hope that this library will stimulate more free \
software in the Middle Eastern countries.
"
HOMEPAGE="http://fribidi.org/"
SRC_URI="http://fribidi.org/download/fribidi-0.19.5.tar.bz2"
CHECKSUM_MD5="925bafb97afee8a2fc2d0470c072a155"
REVISION="1"

LICENSE="GNU LGPL v2.1"
COPYRIGHT="2004 Sharif FarsiWeb, Inc
	2001,2002 Behdad Esfahbod
	1999,2000 Dov Grobgeld"

ARCHITECTURES="x86_gcc2 x86"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	fribidi$secondaryArchSuffix = $portVersion
	cmd:fribidi$secondaryArchSuffix = 0.19.5 compat >= 0.19
	lib:libfribidi$secondaryArchSuffix = 0.3.4 compat >= 0
	"

REQUIRES="
	haiku$secondaryArchSuffix >= $haikuVersion
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel >= $haikuVersion
	"

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

PATCH()
{
	sed -i 's/PKG_CHECK_MODULES(GLIB,$GLIB_PACKAGE >= $GLIB_MINVERSION/#/' configure.ac
	sed -i 's/FRIBIDI_USE_GLIB=1/FRIBIDI_USE_GLIB=0/' configure.ac
	sed -i 's/FRIBIDI_USE_GLIB=0)/#/' configure.ac
}

BUILD()
{
	libtoolize --force --copy --install
	aclocal
	autoconf
	automake --add-missing
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install
	prepareInstalledDevelLibs \
		libfribidi

	fixPkgconfig

	# devel package
	packageEntries devel \
		$developDir
}

TEST()
{
	make test
}

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

PROVIDES_devel="
	fribidi${secondaryArchSuffix}_devel = $portVersion
	devel:libfribidi$secondaryArchSuffix = 0.3.4 compat >= 0
	devel:fribidi$secondaryArchSuffix = 0.19.5 compat >= 0.19
	"

REQUIRES_devel="
	fribidi$secondaryArchSuffix == $portVersion base
	"
