public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/fastnetmon] epel10: rebuild with libbson and libmongc v2
@ 2026-06-26  9:31 Remi Collet
  0 siblings, 0 replies; only message in thread
From: Remi Collet @ 2026-06-26  9:31 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/fastnetmon
            Branch : epel10
            Commit : 7b44beef10a9cfd946f0b44ccc7a047b42d73ece
            Author : Remi Collet <remi@fedoraproject.org>
            Date   : 2026-02-26T10:15:22+01:00
            Stats  : +89/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/fastnetmon/c/7b44beef10a9cfd946f0b44ccc7a047b42d73ece?branch=epel10

            Log:
            rebuild with libbson and libmongc v2

add upstream patch to fix FTBFS #2440923

---
diff --git a/fastnetmon.spec b/fastnetmon.spec
index 67a7326..f5eb3a7 100644
--- a/fastnetmon.spec
+++ b/fastnetmon.spec
@@ -11,7 +11,7 @@
 
 Name:              fastnetmon
 Version:           1.2.1
-Release:           32.%{date}git%{shortcommit0}%{?dist}
+Release:           33.%{date}git%{shortcommit0}%{?dist}
 
 Summary:           DDoS detection tool with sFlow, Netflow, IPFIX and port mirror support
 # Automatically converted from old format: GPLv2 - review is highly recommended.
@@ -41,6 +41,8 @@ Patch0:            fastnetmon-pr968-g++13-header.patch
 # fastnetmon: FTBFS in Fedora Rawhide/F44 with Boost 1.90
 # https://bugzilla.redhat.com/show_bug.cgi?id=2429533
 Patch1:            0001-Boost-migration-patch-by-Marek-Zarychta.-Closes-1027.patch
+# Added new logic to find Mongo-C v2 library
+Patch2:            mongoc2.patch
 
 BuildRequires:     make
 BuildRequires:     gcc
@@ -135,6 +137,10 @@ install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/fastnetmon.conf
 %doc README.md SECURITY.md THANKS.md
 
 %changelog
+* Thu Feb 26 2026 Remi Collet <remi@fedoraproject.org> - 1.2.1-33.20220528git420e7b8
+- rebuild with libbson and libmongc v2
+- add upstream patch to fix FTBFS #2440923
+
 * Wed Jan 28 2026 Benjamin A. Beasley <code@musicinmybrain.net> - 1.2.1-32.20220528git420e7b8
 - Rebuilt for abseil-cpp 20260107.0
 

diff --git a/mongoc2.patch b/mongoc2.patch
new file mode 100644
index 0000000..489197e
--- /dev/null
+++ b/mongoc2.patch
@@ -0,0 +1,82 @@
+diff -up ./src/CMakeLists.txt.old ./src/CMakeLists.txt
+--- ./src/CMakeLists.txt.old	2026-02-19 11:14:22.035463356 +0100
++++ ./src/CMakeLists.txt	2026-02-19 11:33:11.855330916 +0100
+@@ -1,4 +1,4 @@
+-cmake_minimum_required (VERSION 2.8)
++cmake_minimum_required (VERSION 3.5)
+ 
+ # cmake versions:
+ # Debian 6 - 2.8.2
+@@ -574,27 +574,38 @@ if (ENABLE_CAPNP_SUPPORT)
+ endif()
+ 
+ 
+-### Find mongo-c
+-find_path(MONGOC_INCLUDES_FOLDER NAMES libmongoc-1.0/mongoc.h PATHS "${MONGO_C_CUSTOM_INSTALL_PATH}/include" ${DISABLE_DEFAULT_PATH_SEARCH_VAR})
+-find_library(MONGOC_LIBRARY_PATH NAMES mongoc-1.0 PATHS "${MONGO_C_CUSTOM_INSTALL_PATH}/lib" ${DISABLE_DEFAULT_PATH_SEARCH_VAR})
+-
+-### find bson
+-find_path(BSON_INCLUDES_FOLDER NAMES libbson-1.0/bson.h PATHS "${MONGO_C_CUSTOM_INSTALL_PATH}/include" ${DISABLE_DEFAULT_PATH_SEARCH_VAR})
+-find_library(BSON_LIBRARY_PATH NAMES bson-1.0 PATHS "${MONGO_C_CUSTOM_INSTALL_PATH}/lib" ${DISABLE_DEFAULT_PATH_SEARCH_VAR})
+-
+-if (MONGOC_INCLUDES_FOLDER AND MONGOC_LIBRARY_PATH AND BSON_INCLUDES_FOLDER AND BSON_LIBRARY_PATH)
+-    message(STATUS "We found mongo-c library ${MONGOC_INCLUDES_FOLDER} ${MONGOC_LIBRARY_PATH} ${BSON_INCLUDES_FOLDER} ${BSON_LIBRARY_PATH}")
+-    add_definitions(-DMONGO)
+-
+-    # We add suffix name because cmake could not detect it correctly...
+-    include_directories("${MONGOC_INCLUDES_FOLDER}/libmongoc-1.0")
+-    include_directories("${BSON_INCLUDES_FOLDER}/libbson-1.0")
++    find_package(bson QUIET)
++    find_package(mongoc QUIET)
+ 
+-    target_link_libraries(fastnetmon ${MONGOC_LIBRARY_PATH} ${BSON_LIBRARY_PATH})
+-    target_link_libraries(fastnetmon_logic ${MONGOC_LIBRARY_PATH} ${BSON_LIBRARY_PATH})
+-else()
+-    message(FATAL_ERROR "We can't find Mongo C library")
+-endif()
++    if (bson_FOUND AND mongoc_FOUND)
++        message(STATUS "We found mongo-c library mongoc::mongoc bson::bson")
++        add_definitions(-DMONGO -DUSING_MONGO2)
++        target_link_libraries(fastnetmon mongoc::mongoc)
++        target_link_libraries(fastnetmon_logic mongoc::mongoc)
++    else()
++
++        ### Find mongo-c
++        find_path(MONGOC_INCLUDES_FOLDER NAMES libmongoc-1.0/mongoc.h PATHS "${MONGO_C_CUSTOM_INSTALL_PATH}/include" ${DISABLE_DEFAULT_PATH_SEARCH_VAR})
++        find_library(MONGOC_LIBRARY_PATH NAMES mongoc-1.0 PATHS "${MONGO_C_CUSTOM_INSTALL_PATH}/lib" ${DISABLE_DEFAULT_PATH_SEARCH_VAR})
++
++        ### find bson
++        find_path(BSON_INCLUDES_FOLDER NAMES libbson-1.0/bson.h PATHS "${MONGO_C_CUSTOM_INSTALL_PATH}/include" ${DISABLE_DEFAULT_PATH_SEARCH_VAR})
++        find_library(BSON_LIBRARY_PATH NAMES bson-1.0 PATHS "${MONGO_C_CUSTOM_INSTALL_PATH}/lib" ${DISABLE_DEFAULT_PATH_SEARCH_VAR})
++
++        if (MONGOC_INCLUDES_FOLDER AND MONGOC_LIBRARY_PATH AND BSON_INCLUDES_FOLDER AND BSON_LIBRARY_PATH)
++            message(STATUS "We found mongo-c library ${MONGOC_INCLUDES_FOLDER} ${MONGOC_LIBRARY_PATH} ${BSON_INCLUDES_FOLDER} ${BSON_LIBRARY_PATH}")
++            add_definitions(-DMONGO)
++
++            # We add suffix name because cmake could not detect it correctly...
++            include_directories("${MONGOC_INCLUDES_FOLDER}/libmongoc-1.0")
++            include_directories("${BSON_INCLUDES_FOLDER}/libbson-1.0")
++
++            target_link_libraries(fastnetmon ${MONGOC_LIBRARY_PATH} ${BSON_LIBRARY_PATH})
++            target_link_libraries(fastnetmon_logic ${MONGOC_LIBRARY_PATH} ${BSON_LIBRARY_PATH})
++        else()
++            message(FATAL_ERROR "We can't find Mongo C library")
++        endif()
++    endif()
+ 
+ ### Look for libpcap
+ 
+diff -up ./src/fastnetmon_logic.cpp.old ./src/fastnetmon_logic.cpp
+--- ./src/fastnetmon_logic.cpp.old	2026-02-19 11:19:38.856780167 +0100
++++ ./src/fastnetmon_logic.cpp	2026-02-19 11:19:49.502779126 +0100
+@@ -34,8 +34,8 @@
+ #include "example_plugin/example_collector.h"
+ 
+ #ifdef MONGO
+-#include <bson.h>
+-#include <mongoc.h>
++#include <bson/bson.h>
++#include <mongoc/mongoc.h>
+ #endif
+ 
+ #include "fastnetmon_networks.hpp"

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-26  9:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-26  9:31 [rpms/fastnetmon] epel10: rebuild with libbson and libmongc v2 Remi Collet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox