SUMMARY="A library for extracting file metadata"
DESCRIPTION="KFileMetaData provides a simple library for extracting the text \
and metadata from a number of different files. This library is typically used \
by file indexers to retreive the metadata. This library can also be used by \
applications to write metadata."
HOMEPAGE="https://github.com/KDE/kfilemetadata/"
COPYRIGHT="2010-2022 KDE Organisation"
LICENSE="GNU LGPL v2"
REVISION="2"
SOURCE_URI="https://github.com/KDE/kfilemetadata/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="9b07280ef4e525fd487e1429a1e8c19f780a4cf8e28c41dc175461f6c2ff15b6"

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

PROVIDES="
	kfilemetadata$secondaryArchSuffix = $portVersion
	lib:libKF5FileMetadata$secondaryArchSuffix = $portVersion compat >= 5
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libKF5CoreAddons$secondaryArchSuffix
	lib:libKF5I18n$secondaryArchSuffix
	lib:libQt5Core$secondaryArchSuffix
	lib:libQt5Gui$secondaryArchSuffix
	lib:libQt5Xml$secondaryArchSuffix
	"

PROVIDES_devel="
	kfilemetadata${secondaryArchSuffix}_devel = $portVersion
	devel:libKF5FileMetadata$secondaryArchSuffix = $portVersion compat >= 5
	"
REQUIRES_devel="
	kfilemetadata$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	extra_cmake_modules$secondaryArchSuffix >= $portVersion
	devel:libKF5Archive$secondaryArchSuffix == $portVersion
	devel:libKF5CoreAddons$secondaryArchSuffix == $portVersion
	devel:libKF5I18n$secondaryArchSuffix == $portVersion
	devel:libQt5Core$secondaryArchSuffix >= 5.7
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:g++$secondaryArchSuffix
	cmd:make
	cmd:python2
	"

BUILD()
{
	mkdir -p build
	cd build

	cmake .. $cmakeDirArgs \
		-DCMAKE_BUILD_TYPE=Release \
		-DKDE_INSTALL_PLUGINDIR=$addOnsDir/Qt5 \
		-DECM_DIR=/system/data/cmake/Modules/ECM/cmake \
		-DECM_MKSPECS_INSTALL_DIR=$dataDir/Qt5/mkspecs
	make $jobArgs
}

INSTALL()
{
	cd build
	make install

	prepareInstalledDevelLibs \
		libKF5FileMetaData

	packageEntries devel \
		$libDir/cmake \
		$developDir
}

TEST()
{
	cd build
	make test
}
