# 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-applications
pkgname=ksmtp
pkgver=24.08.1
pkgrel=0
pkgdesc="Job-based library to send email through an SMTP server"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://kontact.kde.org"
license="LGPL-2.1-or-later"
depends_dev="
	cyrus-sasl-dev
	kcoreaddons-dev
	ki18n-dev
	kio-dev
	qt6-qtbase-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	graphviz
	samurai
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/pim/ksmtp.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/ksmtp-$pkgver.tar.xz"
# The single test is broken
options="!check"

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="
40b2c533d0e871ff6fb7b23f31779290a82e739d15032c1b5aa527ad810c4a8ffc124bbfce0377fc33632c6ea20d3f99438ff7d4cbe9d6d766d905081e783136  ksmtp-24.08.1.tar.xz
"
