SUMMARY="Network service discovery using Zeroconf"
DESCRIPTION="KDNSSD is a library for handling the DNS-based Service Discovery \
Protocol (DNS-SD), the layer of Zeroconf that allows network services, such \
as printers, to be discovered without any user intervention or centralized \
infrastructure."
HOMEPAGE="https://github.com/KDE/kdnssd/"
COPYRIGHT="2010-2022 KDE Organisation"
LICENSE="GNU LGPL v2"
REVISION="1"
SOURCE_URI="https://github.com/KDE/kdnssd/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="57411124bb11188e16611178febff4b850a1c72ed87c3b539255d841374ad316"

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

PROVIDES="
	kdnssd$secondaryArchSuffix = $portVersion
	lib:libkf5dnssd$secondaryArchSuffix = $portVersion compat >= 5
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libQt5Core$secondaryArchSuffix
	"

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

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	extra_cmake_modules$secondaryArchSuffix >= $portVersion
	devel:libQt5Core$secondaryArchSuffix >= 5.7
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:g++$secondaryArchSuffix
	cmd:lrelease$secondaryArchSuffix >= 5
	cmd:make
	"

BUILD()
{
	mkdir -p build
	cd build

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

INSTALL()
{
	cd build
	make install

	prepareInstalledDevelLibs \
		libKF5DNSSD

	fixPkgconfig

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

TEST()
{
	cd build
	make test
}
