# Contributor: Julian Weigt <juw@posteo.de>
# Maintainer: Julian Weigt <juw@posteo.de>
pkgname=cyrus-sasl-xoauth2
pkgver=0.2
pkgrel=1
pkgdesc="XOAUTH2 mechanism plugin for cyrus-sasl"
arch="all"
url="https://github.com/moriyoshi/cyrus-sasl-xoauth2"
license="MIT"
makedepends="libtool autoconf automake cyrus-sasl-dev"
subpackages="$pkgname-doc $pkgname-static"
source="$pkgname-$pkgver.tar.gz::https://github.com/moriyoshi/cyrus-sasl-xoauth2/archive/refs/tags/v$pkgver.tar.gz"

prepare() {
	default_prepare
	sh autogen.sh
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir/" install
	install -Dm644 COPYING $pkgdir/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="
c3a8fdc7c51a22df9fd8da5418a95e146b46c6865d4990dcf4053f18ca9ee9900b3b564e85cc8ec7bcde75966385b148e8320059b00f2f1374d4601c50e2c821  cyrus-sasl-xoauth2-0.2.tar.gz
"
