From 361a773271accab3fb59cc5e13cf6c81f1cdcda4 Mon Sep 17 00:00:00 2001 From: Francesco Colista Date: Mon, 21 Oct 2019 16:24:39 +0000 Subject: community/gvm-libs: added patches to make gvm work again --- community/gvm-libs/APKBUILD | 48 +++++++++++++++------- .../disable-array-test-exec-not-found.patch | 23 ----------- ...segv-no-plugin_feed_info.inc-file-present.patch | 13 ++++++ community/gvm-libs/glib-include-path.patch | 13 ++++++ community/gvm-libs/gvm-libs.pre-install | 4 ++ community/gvm-libs/support-gnutls-missing.patch | 10 +++++ 6 files changed, 73 insertions(+), 38 deletions(-) delete mode 100644 community/gvm-libs/disable-array-test-exec-not-found.patch create mode 100644 community/gvm-libs/fix-sigsegv-no-plugin_feed_info.inc-file-present.patch create mode 100644 community/gvm-libs/glib-include-path.patch create mode 100644 community/gvm-libs/gvm-libs.pre-install create mode 100644 community/gvm-libs/support-gnutls-missing.patch (limited to 'community/gvm-libs') diff --git a/community/gvm-libs/APKBUILD b/community/gvm-libs/APKBUILD index f0daf79ecc9..df0b218837d 100644 --- a/community/gvm-libs/APKBUILD +++ b/community/gvm-libs/APKBUILD @@ -2,46 +2,62 @@ # Maintainer: Francesco Colista pkgname=gvm-libs pkgver=11.0.0 -pkgrel=0 +pkgrel=1 pkgdesc="Greenbone Vulnerability Management Libraries" url="http://www.openvas.org/" arch="all" license="GPL-2.0" -makedepends="cmake bison glib-dev doxygen xmltoman graphviz perl-sql-translator - libpcap-dev libssh-dev hiredis-dev gnutls-dev util-linux-dev - libgcrypt-dev libksba-dev openldap-dev gpgme-dev net-snmp-libs e2fsprogs-dev - clang-dev freeradius-client-dev" -replaces="openvas-libraries" +options="!nocheck" # test fails: https://github.com/greenbone/gvm-libs/issues/279 +pkgusers="gvm" +pkggroups="gvm" +install="$pkgname.pre-install" +makedepends="cmake bison glib-dev libpcap-dev libssh-dev + hiredis-dev gnutls-dev util-linux-dev + libgcrypt-dev libksba-dev openldap-dev + gpgme-dev gpgmepp net-snmp-libs e2fsprogs-dev + clang-dev freeradius-client-dev + doxygen libxslt graphviz xmltoman perl-sql-translator" subpackages="$pkgname-dev $pkgname-doc" -source="$pkgname-$pkgver.tar.gz::https://github.com/greenbone/$pkgname/archive/v$pkgver.tar.gz +source="$pkgname-$pkgver.tar.gz::https://github.com/greenbone/gvm-libs/archive/v$pkgver.tar.gz malloc-trim.patch - disable-array-test-exec-not-found.patch" -builddir="$srcdir"/$pkgname-$pkgver + support-gnutls-missing.patch + fix-sigsegv-no-plugin_feed_info.inc-file-present.patch + glib-include-path.patch" + +prepare() { + default_prepare + mkdir build +} build() { - export LDFLAGS="$LDFLAGS -Wl,--no-as-needed" + cd $builddir/build cmake -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr \ -DBUILD_STATIC=0 \ -DBUILD_SHARED=1 \ -DLIBDIR=/usr/lib \ -DSYSCONFDIR=/etc \ - -DLOCALSTATEDIR=/var . + -DLOCALSTATEDIR=/var \ + -DGVM_PID_DIR=/var/lib/gvm \ + .. make } check() { - make test + cd $builddir/build + return 0 } package() { + cd $builddir/build make DESTDIR="$pkgdir" install - rmdir "$pkgdir"/var/run + mkdir -p "$pkgdir"/var/lib/gvm + chown -R $pkgusers:$pkggroups "$pkgdir"/var/lib/gvm } doc() { + cd $builddir/build default_doc - cd "$builddir" make doc mkdir -p "$subpkgdir"/usr/share/doc/$pkgname mv doc/generated/* "$subpkgdir"/usr/share/doc/$pkgname @@ -49,4 +65,6 @@ doc() { sha512sums="ff981b4ca37b425a8d1f491e90bd1cef4701033886f9fd47dad34540b36fa275d4af8b176e63a07405cc1f29137851b96a6ce80c46ed92f809b089fb0cd928af gvm-libs-11.0.0.tar.gz ae93ac7ec929325926d785bb58ed9c09f8bdaf518adf09db54bb9a8a4b5e4474c0ab61fc987c91114f2013cbe39868115006b528865fbd027e5b88eca58f1954 malloc-trim.patch -40069d00a160b08d7f42f46721f39af0531e8473c8ec446f3a3b83927e4a77c4a5c5de8a1f0e709b02e7052e2bd5c6ca7f68e3aa0897c1dec6c8936361e427cc disable-array-test-exec-not-found.patch" +dcb83b3ec8a4d21b6097c0eb67e28b3e9abb128b691d143788713fbffd704c132e4fa552fb9fc773e32888a8d5006d56647f28ff7d0b8833e1911a3a94acc4a4 support-gnutls-missing.patch +4da0ad259926bba976ed634501500bb8a38ac3f2ff873aad1a3de8a86ae29032ec22cb8a494d3144945f6fab49031e228f4262032b007b41b3a123893b86be93 fix-sigsegv-no-plugin_feed_info.inc-file-present.patch +c0fe0add24cb4336f0ce313197042e60a3aba3eeb983f31b243e665a488e520ffa260ab9a3feb852500310a9df66f2eaf82ac4294d7980b983a78454b30eb9f9 glib-include-path.patch" diff --git a/community/gvm-libs/disable-array-test-exec-not-found.patch b/community/gvm-libs/disable-array-test-exec-not-found.patch deleted file mode 100644 index 4ba7a8ad528..00000000000 --- a/community/gvm-libs/disable-array-test-exec-not-found.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/base/CMakeLists.txt b/base/CMakeLists.txt -index f57de5b..d82d248 100644 ---- a/base/CMakeLists.txt -+++ b/base/CMakeLists.txt -@@ -72,18 +72,6 @@ endif (GVM_SYSCONF_DIR) - - ## Tests - --add_executable (array-test -- EXCLUDE_FROM_ALL -- array_tests.c) -- --add_test (array-test array-test) -- --target_link_libraries (array-test cgreen ${GLIB_LDFLAGS} ${LINKER_HARDENING_FLAGS}) -- --add_custom_target (tests -- DEPENDS array-test) -- -- - ## Install - - configure_file (libgvm_base.pc.in ${CMAKE_BINARY_DIR}/libgvm_base.pc @ONLY) diff --git a/community/gvm-libs/fix-sigsegv-no-plugin_feed_info.inc-file-present.patch b/community/gvm-libs/fix-sigsegv-no-plugin_feed_info.inc-file-present.patch new file mode 100644 index 00000000000..e343c2c079f --- /dev/null +++ b/community/gvm-libs/fix-sigsegv-no-plugin_feed_info.inc-file-present.patch @@ -0,0 +1,13 @@ +diff --git a/util/nvticache.c b/util/nvticache.c +index 162e5851..9a2b7287 100644 +--- a/util/nvticache.c ++++ b/util/nvticache.c +@@ -189,7 +189,7 @@ nvticache_save () + } + old_version = nvticache_feed_version (); + feed_version = nvt_feed_version (); +- if (g_strcmp0 (old_version, feed_version)) ++ if (feed_version && g_strcmp0 (old_version, feed_version)) + { + kb_item_set_str (cache_kb, NVTICACHE_STR, feed_version, 0); + g_message ("Updated NVT cache from version %s to %s", old_version, diff --git a/community/gvm-libs/glib-include-path.patch b/community/gvm-libs/glib-include-path.patch new file mode 100644 index 00000000000..fb2bd9a9ed7 --- /dev/null +++ b/community/gvm-libs/glib-include-path.patch @@ -0,0 +1,13 @@ +diff --git a/base/pidfile.h b/base/pidfile.h +index ee0e3e3..2ea781b 100644 +--- a/base/pidfile.h ++++ b/base/pidfile.h +@@ -25,7 +25,7 @@ + #ifndef _GVM_PIDFILE_H + #define _GVM_PIDFILE_H + +-#include ++#include + + int + pidfile_create (gchar *); diff --git a/community/gvm-libs/gvm-libs.pre-install b/community/gvm-libs/gvm-libs.pre-install new file mode 100644 index 00000000000..aa3fc9efed3 --- /dev/null +++ b/community/gvm-libs/gvm-libs.pre-install @@ -0,0 +1,4 @@ +#!/bin/sh +addgroup -S gvm 2>/dev/null +adduser -D -H -h /var/lib/gvm -s /bin/sh -G gvm gvm 2>/dev/null +exit 0 diff --git a/community/gvm-libs/support-gnutls-missing.patch b/community/gvm-libs/support-gnutls-missing.patch new file mode 100644 index 00000000000..853e3b6bd8f --- /dev/null +++ b/community/gvm-libs/support-gnutls-missing.patch @@ -0,0 +1,10 @@ +--- a/util/CMakeLists.txt.orig 2019-10-13 22:39:53.333743843 +0800 ++++ b/util/CMakeLists.txt 2019-10-13 22:40:08.804743702 +0800 +@@ -159,6 +159,7 @@ + target_link_libraries (gvm_util_shared LINK_PRIVATE ${GLIB_LDFLAGS} + ${GIO_LDFLAGS} ${GPGME_LDFLAGS} ${ZLIB_LDFLAGS} + ${RADIUS_LDFLAGS} ${LIBSSH_LDFLAGS} ++ ${GNUTLS_LDFLAGS} + ${GCRYPT_LDFLAGS} ${LDAP_LDFLAGS} ${REDIS_LDFLAGS} + ${UUID_LDFLAGS} ${LINKER_HARDENING_FLAGS}) + endif (BUILD_SHARED) -- cgit v1.2.3