# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=signon-plugin-oauth2
pkgver=0.24
pkgrel=1
arch="all"
url="https://gitlab.com/accounts-sso/signon-plugin-oauth2"
pkgdesc="Signond OAuth 1.0 and 2.0 plugin"
license="LGPL-2.1-only"
makedepends="qt5-qtbase-dev signond-dev"
source="https://gitlab.com/accounts-sso/signon-plugin-oauth2/-/archive/VERSION_$pkgver/signon-plugin-oauth2-VERSION_$pkgver.tar.gz"
subpackages="$pkgname-dev"
builddir="$srcdir/$pkgname-VERSION_$pkgver"

prepare() {
	default_prepare

	# Don't install tests and example
	echo 'INSTALLS =' >> tests/tests.pro
	echo 'INSTALLS =' >> example/example.pro
}

build() {
	qmake-qt5 \
		PREFIX=/usr \
		LIBDIR=/usr/lib
	make
}

check() {
	make check
}

package() {
	INSTALL_ROOT="$pkgdir" make install
}

sha512sums="8a1e5be7f34419ded7841cb4de62e03ab56556f39ae40e3e11b549d45c6c51edc6888d1aab254c0ba6746d6306bb8b92dd24e473387542d6a987208c20acf6d9  signon-plugin-oauth2-VERSION_0.24.tar.gz"
