# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=pg-gvm
pkgver=22.6.5
#PostgreSQL version
_pgver=16
pkgrel=0
pkgdesc="Greenbone Library for helper functions in PostgreSQL"
url="https://github.com/greenbone/pg-gvm"
arch="all"
license="GPL-3.0"
options="!check" # no check available
makedepends="cmake glib libical-dev gvm-libs-dev postgresql$_pgver-dev ninja"
source="$pkgname-$pkgver.tar.gz::https://github.com/greenbone/pg-gvm/archive/refs/tags/v$pkgver.tar.gz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DPostgreSQL_INCLUDE_DIRS=/usr/include/postgresql/$_pgver/ \
		-DPostgreSQL_TYPE_INCLUDE_DIR=/usr/include/postgresql/$_pgver/
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
1e4e6004dd77a974c2d072154f1bd4bcae8286b0fbd6dc6f395488e97a1853a59cc24eb18b7937b318ea21c354008c970e21feb451841ca7dbd27267c0ed2985  pg-gvm-22.6.5.tar.gz
"
