# Contributor: Francesco Colista # Maintainer: Francesco Colista pkgname=gvmd pkgver=9.0.0 pkgrel=3 pkgdesc="Greenbone Vulnerability Manager" url="https://www.openvas.org/" arch="all" license="GPL-2.0-or-later" pkgusers="gvm" pkggroups="gvm" depends="rsync postgresql postgresql-contrib libxslt sed gnutls-utils gvm-libs" makedepends="cmake gvm-libs-dev clang-dev glib-dev gpgme-dev libgcrypt-dev graphviz libical-dev postgresql-dev gnutls-dev doxygen xmltoman perl-sql-translator" checkdepends="cppcheck" subpackages="$pkgname-doc $pkgname-openrc" source="$pkgname-$pkgver.tar.gz::https://github.com/greenbone/gvmd/archive/v$pkgver.tar.gz $pkgname.initd $pkgname.confd $pkgname.logrotate greenbone-certdata-sync.conf greenbone-scapdata-sync.conf greenbone-nvt-sync.conf added-missing-includes.patch bin-openvas-change.patch fix-alpine-sql-syntax.patch sys-siglist.patch fix-gvm-port-update-name-and-backend.patch lockfile.patch" prepare() { default_prepare mkdir build } build() { cd "$builddir"/build # Requires libexecinfo when compiled without -DNDEBUG. CFLAGS="$CFLAGS -DNDEBUG" \ cmake -DCMAKE_BUILD_TYPE=None \ -DSBINDIR=/usr/bin \ -DCMAKE_INSTALL_PREFIX=/usr \ -DSYSCONFDIR=/etc \ -DLOCALSTATEDIR=/var \ -DGVM_RUN_DIR=/var/run/gvmd \ .. make } check() { cd "$builddir"/build make check } package() { cd "$builddir"/build make DESTDIR="$pkgdir" install install -Dm644 "$srcdir/$pkgname.logrotate" "$pkgdir/etc/logrotate.d/$pkgname" install -Dm755 "$srcdir/$pkgname.initd" "$pkgdir/etc/init.d/$pkgname" install -Dm755 "$srcdir/$pkgname.confd" "$pkgdir/etc/conf.d/$pkgname" for f in nvt certdata scapdata; do install -Dm755 "$srcdir"/greenbone-$f-sync.conf "$pkgdir"/etc/gvm/greenbone-$f-sync.conf done mkdir -p "$pkgdir"/var/log/gvm mkdir -p "$pkgdir"/var/lib/gvm mkdir -p "$pkgdir"/var/lib/openvas mkdir -p "$pkgdir"/var/run/gvmd chown -R $pkgusers:$pkggroups "$pkgdir"/var/log/gvm/ chown -R $pkgusers:$pkggroups "$pkgdir"/var/lib/gvm/ chown -R $pkgusers:$pkggroups "$pkgdir"/var/lib/openvas chown -R $pkgusers:$pkggroups "$pkgdir"/var/run/gvmd } doc() { default_doc mkdir -p "$subpkgdir"/usr/share/doc/$pkgname cat >"$subpkgdir"/usr/share/doc/$pkgname/README.alpine <