# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks-old
pkgname=kdnssd5
pkgver=5.116.0
pkgrel=0
# armhf blocked by extra-cmake-modules
arch="all !armhf"
pkgdesc="Network service discovery using Zeroconf"
url="https://community.kde.org/Frameworks"
license="LGPL-2.0-or-later"
depends="avahi"
depends_dev="
	avahi-dev
	qt5-qtbase-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	qt5-qttools-dev
	samurai
	"
_repo_url="https://invent.kde.org/frameworks/kdnssd.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kdnssd-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
builddir="$srcdir/kdnssd-$pkgver"

replaces="kdnssd<=5.110.0-r0"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
542b6ff05ea2d0d43b8563136254f54e690fb561b270517df00158e53a5a2eda23e5371292256cd3f3aae0ee108c8d5cd4f611ac1aa22c259ee80b4815850121  kdnssd-5.116.0.tar.xz
"
