# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer:
pkgname=poco
pkgver=1.10.0
pkgrel=0
pkgdesc="C++ class libraries for building network- and internet-based applications"
options="!check" # No testsuite
url="https://pocoproject.org/"
arch="all"
license="BSL-1.0"
makedepends="openssl-dev linux-headers zlib-dev pcre-dev expat-dev sqlite-dev"
subpackages="$pkgname-dev"
source="https://pocoproject.org/releases/poco-$pkgver/poco-$pkgver-all.tar.gz
	cxxflags.patch
	"

builddir="$srcdir"/$pkgname-$pkgver-all

build() {
	./configure --config=Linux \
		--prefix=/usr \
		--minimal \
		--shared \
		--no-tests \
		--no-samples \
		--unbundled
	make
}

package() {
	make DESTDIR="$pkgdir" install
	_basedir="$pkgdir"/usr/include/Poco
	for dir in Net Crypto; do
		test -d "$_basedir"/$dir || mkdir "$_basedir"/$dir
	done
	cp NetSSL_OpenSSL/include/Poco/Net/*.h "$_basedir"/Net
	cp Crypto/include/Poco/Crypto/*.h "$_basedir"/Crypto
}

sha512sums="0228f9a22e9cd7ce85ea4b4bee68e85713b97ca14c5d1032d01c7126908490ba82c7ef3ba45aac8a8e0695f0d2e7da4b7b30950e0759dcc7f1a29b72357f0d5b  poco-1.10.0-all.tar.gz
5f72e487074ea26e29e81d6fc244d03989d780d71b33a064456fa19b241aca278fbfd9b303733940b837921ea25781ee62905d70a5f1c57f1b24cd38a2a7d720  cxxflags.patch"
