SUMMARY="Remote Desktop Client"
DESCRIPTION="KRDC is a client application that allows you to view or even \
control the desktop session on another machine that is running a compatible \
server. VNC and RDP is supported."
HOMEPAGE="https://github.com/KDE/krdc/"
COPYRIGHT="2010-2018 KDE Organisation"
LICENSE="GNU LGPL v2"
REVISION="1"
SOURCE_URI="https://github.com/KDE/krdc/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="1d5fa9f3577975bedc0e346d5d69b95edf6f4a5ef1bf4b4536af5df27e056d1f"
PATCHES="krdc-$portVersion.patchset"

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

PROVIDES="
	krdc$secondaryArchSuffix = $portVersion
	app:KRDC$secondaryArchSuffix = $portVersion
	cmd:krdc$secondaryArchSuffix = $portVersion
	lib:libkrdccore$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libKF5Auth$secondaryArchSuffix
	lib:libKF5Bookmarks$secondaryArchSuffix
	lib:libKF5Codecs$secondaryArchSuffix
	lib:libKF5Completion$secondaryArchSuffix
	lib:libKF5ConfigCore$secondaryArchSuffix
	lib:libKF5ConfigGui$secondaryArchSuffix
	lib:libKF5ConfigWidgets$secondaryArchSuffix
	lib:libKF5CoreAddons$secondaryArchSuffix
	lib:libKF5DNSSD$secondaryArchSuffix
	lib:libKF5I18n$secondaryArchSuffix
	lib:libKF5IconThemes$secondaryArchSuffix
	lib:libKF5ItemViews$secondaryArchSuffix
	lib:libKF5KCMUtils$secondaryArchSuffix
	lib:libKF5Notifications$secondaryArchSuffix
	lib:libKF5NotifyConfig$secondaryArchSuffix
	lib:libKF5Service$secondaryArchSuffix
	lib:libKF5TextWidgets$secondaryArchSuffix
	lib:libKF5Wallet$secondaryArchSuffix
	lib:libKF5WidgetsAddons$secondaryArchSuffix
	lib:libKF5XmlGui$secondaryArchSuffix
	lib:libQt5DBus$secondaryArchSuffix
	lib:libQt5Gui$secondaryArchSuffix
	lib:libQt5Network$secondaryArchSuffix
	lib:libQt5Script$secondaryArchSuffix
	lib:libQt5Widgets$secondaryArchSuffix
	lib:libQt5Xml$secondaryArchSuffix
#	lib:libssh2$secondaryArchSuffix
	lib:libvncserver$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	extra_cmake_modules >= 5.47
	devel:libKF5Auth$secondaryArchSuffix
	devel:libKF5Bookmarks$secondaryArchSuffix
	devel:libKF5Codecs$secondaryArchSuffix
	devel:libKF5Completion$secondaryArchSuffix
	devel:libKF5ConfigCore$secondaryArchSuffix
	devel:libKF5ConfigWidgets$secondaryArchSuffix
	devel:libKF5CoreAddons$secondaryArchSuffix
	devel:libKF5DNSSD$secondaryArchSuffix
	devel:libKF5I18n$secondaryArchSuffix
	devel:libKF5IconThemes$secondaryArchSuffix
	devel:libKF5ItemViews$secondaryArchSuffix
	devel:libKF5KCMUtils$secondaryArchSuffix
	devel:libKF5Notifications$secondaryArchSuffix
	devel:libKF5NotifyConfig$secondaryArchSuffix
	devel:libKF5Service$secondaryArchSuffix
	devel:libKF5Wallet$secondaryArchSuffix
	devel:libKF5WidgetsAddons$secondaryArchSuffix
	devel:libKF5XmlGui$secondaryArchSuffix
	devel:libQt5Core$secondaryArchSuffix >= 5.7
#	devel:libssh2$secondaryArchSuffix
	devel:libvncserver$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:g++$secondaryArchSuffix
	cmd:make
	cmd:python2
	"

BUILD()
{
	mkdir -p build
	cd build

	cmake .. $cmakeDirArgs \
		-DECM_DIR=/system/data/cmake/Modules/ECM/cmake \
		-DKDE_INSTALL_QTPLUGINDIR=$addOnsDir/Qt5
	make $jobArgs
}

INSTALL()
{
	cd build
	make install
}

TEST()
{
	cd build
	make test
}
