SUMMARY="clucene the open-source, C++ search engine"
DESCRIPTION="CLucene is a high-performance, scalable, cross platform, \
full-featured, open-source indexing and searching API. Specifically, CLucene \
is the guts of a search engine, the hard stuff. You write the easy stuff: the \
UI and the process of selecting and parsing your data files to pump them into \
the search engine yourself, and any specialized queries to pull it back for \
display or further processing.

CLucene is a port of the very popular Java Lucene text search engine API. \
CLucene aims to be a good alternative to Java Lucene when performance really \
matters or if you want to stick to good old C++. CLucene is faster than Lucene \
as it is written in C++, meaning it is being compiled into machine code, has \
no background GC operations, and requires no any extra setup procedures.

Being written in pure cross-platform C++ code, and utilizing the flexible \
CMake build system, CLucene can virtually be used for any purpose, on any \
machine. From PCs running Windows or Linux to Mobile devices. The sky is the \
limit."

HOMEPAGE="http://clucene.sourceforge.net/"
LICENSE="Apache v2"
COPYRIGHT="2003-2006 Ben van Klinken
	2003-2006 CLucene Team
	2003-2006 Jos van den Oever"
SOURCE_URI="http://downloads.sourceforge.net/clucene/clucene-core-2.3.3.4.tar.gz"
CHECKSUM_SHA256="ddfdc433dd8ad31b5c5819cc4404a8d2127472a3b720d3e744e8c51d79732eab"
SOURCE_DIR="clucene-core-2.3.3.4"
PATCHES="clucene-2.3.3.4.patchset"
REVISION="1"
ARCHITECTURES=""
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
	# x86_gcc2 is fine as primary target architecture as long as we're building
	# for a different secondary architecture.
	ARCHITECTURES="$ARCHITECTURES x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	clucene$secondaryArchSuffix = $portVersion
	"

REQUIRES="
	haiku${secondaryArchSuffix}
	boost$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libz$secondaryArchSuffix
	devel:libboost_atomic$secondaryArchSuffix
	"

BUILD_PREREQUIRES="
	cmd:cmake
	cmd:make
	cmd:gcc${secondaryArchSuffix}
	"

BUILD()
{
	mkdir -p build_x86
	cd build_x86
	cmake -G "Unix Makefiles" .. -DLUCENE_SYS_INCLUDES=$relativeIncludeDir
	make $jobArgs
}

INSTALL()
{
	cd build_x86
	make install CMAKE_INSTALL_PREFIX=$prefix
	prepareInstalledDevelLibs libclucene

	packageEntries devel \
		$developDir $includeDir
}
