SUMMARY="Character set guessing library"
DESCRIPTION="Libguess is a high speed, open source character set encoding \
detector. Libguess employs discrete-finite automata to deduce the character \
set of the input buffer. The advantage of this is that all character sets can \
be checked in parallel, and quickly."
HOMEPAGE="https://atheme.org/projects/libguess.html"
COPYRIGHT="2000-2003 Shiro Kawai
	2009-2013 Tony Vroon"
LICENSE="BSD (3-clause)"
REVISION="2"
SOURCE_URI="http://rabbit.dereferenced.org/~nenolod/distfiles/libguess-$portVersion.tar.bz2"
CHECKSUM_SHA256="8019a16bdc7ca9d2efbdcc1429d48d033d5053d42e45fccea10abf98074f05f8"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	libguess$secondaryArchSuffix = $portVersion compat >= 1.2
	lib:libguess$secondaryArchSuffix = 1.0.0 compat >= 1
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libiconv$secondaryArchSuffix
	"

PROVIDES_devel="
	libguess${secondaryArchSuffix}_devel = $portVersion compat >= 1.2
	devel:libguess$secondaryArchSuffix = 1.0.0 compat >= 1
	"
REQUIRES_devel="
	libguess$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libiconv$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:gettext
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	autoreconf -fi
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

	prepareInstalledDevelLib libguess
	fixPkgconfig

	# devel package
	packageEntries devel \
		$developDir
}

TEST()
{
	make -C src/tests/testbench
}
