Building OpanVas From Source postgresql v16

Hello,

I’m trying to build OpenVAS from source on a Kali VM running “Linux kali 6.6.15-amd64 #1 SMP PREEMPT_DYNAMIC Kali 6.6.15-2kali1 (2024-05-17) x86_64 GNU/Linux”. While installing GVMD, I received an error while executing this block of code:

mkdir -p $BUILD_DIR/gvmd && cd $BUILD_DIR/gvmd
&& cmake $SOURCE_DIR/gvmd-$GVMD_VERSION
-DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX
-DCMAKE_BUILD_TYPE=Release
-DLOCALSTATEDIR=/var
-DSYSCONFDIR=/etc
-DGVM_DATA_DIR=/var
-DGVMD_RUN_DIR=/run/gvmd
-DOPENVAS_DEFAULT_SOCKET=/run/ospd/ospd-openvas.sock
-DGVM_FEED_LOCK_PATH=/var/lib/gvm/feed-update.lock
-DSYSTEMD_SERVICE_DIR=/lib/systemd/system
-DLOGROTATE_DIR=/etc/logrotate.d

The error is:
– Looking for PostgreSQL…
CMake Error at cmake/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find PostgreSQL (missing: PostgreSQL_TYPE_INCLUDE_DIR) (found
version “16.3”)
Call Stack (most recent call first):
cmake/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
cmake/FindPostgreSQL.cmake:247 (find_package_handle_standard_args)
src/CMakeLists.txt:45 (find_package)

The problem is I installed the newest version of PostgreSQL, which is 16.3, and it seems that some OpenVAS dependencies are not compatible with PostgreSQL 16.3. Is there a workaround for this problem?

Looks like support for PostgreSQL 16.x has been introduced recently in / via: