# Template file for 'Lucene++'
pkgname=Lucene++
version=3.0.9
revision=4
build_style=cmake
makedepends="boost-devel-minimal libboost_filesystem libboost_iostreams
 libboost_thread gtest-devel zlib-devel"
short_desc="C++ port of the popular text search engine"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="LGPL-3.0-or-later, Apache-2.0"
homepage="https://github.com/luceneplusplus/LucenePlusPlus"
distfiles="https://github.com/luceneplusplus/LucenePlusPlus/archive/rel_${version}.tar.gz"
checksum=4e69e29d5d79a976498ef71eab70c9c88c7014708be4450a9fda7780fe93584e

post_patch() {
	sed -i '/cmake_minimum_require/d' cmake/*.cmake
	sed -i '/add_subdirectory.gtest/d' src/test/CMakeLists.txt
}

do_check() {
	./build/src/test/lucene++-tester --test_dir=$wrksrc/src/test/testfiles
}

xpost_install() {
	# Install missing header files
	vcopy "include/*" usr/include/lucene++
	vcopy "build/include/*" usr/include/lucene++
}

Lucene++-devel_package() {
	depends="Lucene++>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.so"
	}
}
