SUMMARY="Framework for creation and generation of reports in multiple formats"
DESCRIPTION="The KReport framework implements reporting functionality for creation of reports in MS Access style. \
They are also similar to SAP Crystal Reports and FileMaker reports.\
Reports can be created interactively and programmatically.\
They can be previewed on screen, printed, and saved in a variety of formats such as HTML, PDF and OpenDocument.\
Reports of this kind offer a way to view, format, and summarize the information. \
For example a simple report of contact phone numbers can be prepared, \
or a more complex report on sales for different products, regions, and periods of time."
HOMEPAGE="https://github.com/KDE/kreport/"
COPYRIGHT="2010-2018 KDE Organisation"
LICENSE="GNU LGPL v2"
REVISION="1"
SOURCE_URI="https://github.com/KDE/kreport/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="bb6f8e2797dbc1e11f2b81e6138ddfa57337bca783c9d1143a618d1033b46ff4"

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

PROVIDES="
	kreport$secondaryArchSuffix = $portVersion
	lib:libKReport3$secondaryArchSuffix = $portVersion compat >= 3
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libKF5ConfigCore$secondaryArchSuffix
	lib:libKF5ConfigGui$secondaryArchSuffix
	lib:libKF5CoreAddons$secondaryArchSuffix
	lib:libKF5GuiAddons$secondaryArchSuffix
	lib:libKF5WidgetsAddons$secondaryArchSuffix
	lib:libKPropertyCore3$secondaryArchSuffix
	lib:libKPropertyWidgets3$secondaryArchSuffix
	lib:libQt5Core$secondaryArchSuffix
	lib:libQt5WebKitWidgets$secondaryArchSuffix
	"

PROVIDES_devel="
	kreport${secondaryArchSuffix}_devel = $portVersion
	devel:libKReport3$secondaryArchSuffix = $portVersion compat >= 3
	"
REQUIRES_devel="
	kreport$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	extra_cmake_modules >= 5.46
	devel:libKF5ConfigCore$secondaryArchSuffix
	devel:libKF5ConfigGui$secondaryArchSuffix
	devel:libKF5CoreAddons$secondaryArchSuffix
	devel:libKF5GuiAddons$secondaryArchSuffix
	devel:libKF5WidgetsAddons$secondaryArchSuffix
	devel:libKPropertyCore3$secondaryArchSuffix
	devel:libQt5Core$secondaryArchSuffix >= 5.7
	devel:libQt5WebKitWidgets$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:g++$secondaryArchSuffix
	cmd:make
	cmd:python2
	"

BUILD()
{
	mkdir -p build
	cd build

	cmake .. $cmakeDirArgs \
	-DECM_MKSPECS_INSTALL_DIR=$dataDir/Qt5/mkspecs \
	-DECM_DIR=/system/data/cmake/Modules/ECM/cmake \
	-DKDE_INSTALL_PLUGINDIR=$addOnsDir/Qt5

	make $jobArgs
}

INSTALL()
{
	cd build
	make install

	prepareInstalledDevelLibs \
		libKReport3

	fixPkgconfig

	packageEntries devel \
		$libDir/cmake \
		$dataDir/Qt5/mkspecs \
		$developDir
}

TEST()
{
	cd build
	make test
}
