# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=libdatovka
pkgver=0.6.2
pkgrel=0
pkgdesc="Client library for accessing SOAP services of ISDS (Czech Data Boxes)"
url="https://www.datovka.cz/"
arch="all"
license="LGPL-3.0-or-later AND GPL-3.0-or-later"
makedepends="
	$depends_dev
	curl-dev
	docbook-xsl
	expat-dev
	gnutls-dev
	libxml2-dev
	libxslt-dev
	openssl-dev
	"
subpackages="$pkgname-dev $pkgname-doc"
source="https://secure.nic.cz/files/datove_schranky/libdatovka/libdatovka-$pkgver.tar.xz
	test-skip-invalid-datestring.patch
	test-skip-non-utf-locale.patch
	"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-rpath \
		--disable-nls \
		--enable-test \
		--enable-openssl-backend \
		--with-docbook-xsl-stylesheets=/usr/share/xml/docbook/xsl-stylesheets \
		--with-libcurl
	make
}

check() {
	make check
}

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

sha512sums="
5eace37bcf3ede1ac6c35f9ce62e8eb0bb963c1eba16afa001f0d3033ad4761b4a6e9023d2a0eaa3c9d8a51423c918c7c1a98b1336d6f4c6844d7fbaa3ee2b26  libdatovka-0.6.2.tar.xz
bc1681f128bb8308886f95405d7b69b5c8ade4d9609b4a60e6eef25a0b81e2224249b2a109169a6936da8647f6ab56b60ff93169b154d5c582d4a901b2fefd89  test-skip-invalid-datestring.patch
9535167a6991468f6a66765a2e58fc0fefc4238219b702f282650687d46889759013bc5f1fed784b73a3c2dd20c2d056e473d048d0a6fd99317bd920ecaacdfd  test-skip-non-utf-locale.patch
"
