Since there hasn't been a maintainer upload for several years and the last 3 uploads have been NMUs, I have prepared an NMU that fixes the FTBFS. The debdiff is attached to this mail. I also forwarded the patch to upstream, though upstream seems to be non-responsive to GitHub issues and PRs for some time.
The upload is DELAYED/5. Regards, -Roberto -- Roberto C. Sánchez
diff --git a/debian/changelog b/debian/changelog index fbed0e0..33a079f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +nextepc (0.3.10+nods-4.4) unstable; urgency=medium + + * Non-maintainer upload. + * Fix FTBFS w/ libmongoc-dev >= 2.0 (Closes: #1112311) + + -- Roberto C. Sánchez <[email protected]> Thu, 28 Aug 2025 16:50:35 -0400 + nextepc (0.3.10+nods-4.3) unstable; urgency=medium * Non-maintainer upload diff --git a/debian/patches/mongo-c-driver2.patch b/debian/patches/mongo-c-driver2.patch new file mode 100644 index 0000000..88ee4f5 --- /dev/null +++ b/debian/patches/mongo-c-driver2.patch @@ -0,0 +1,375 @@ +Description: support building w/ mongo-c-driver >= 2.0 +Author: Roberto C. Sánchez <[email protected]> +Forwarded: https://github.com/nextepc/nextepc/pull/68 +--- + configure.ac | 5 ++++- + src/common/context.c | 6 +++++- + src/hss/hss_context.c | 8 ++++++-- + src/mme/mme_context.c | 4 ++++ + src/pcrf/pcrf_context.c | 6 +++++- + src/pgw/pgw_context.c | 4 ++++ + src/sgw/sgw_context.c | 4 ++++ + test/basic/attach_test.c | 34 ++++++++++++++++++++++++++++++++++ + test/basic/handover_test.c | 14 ++++++++++++++ + test/basic/volte_test.c | 14 ++++++++++++++ + test/volte/volte_test.c | 14 ++++++++++++++ + 11 files changed, 108 insertions(+), 5 deletions(-) + +--- a/configure.ac ++++ b/configure.ac +@@ -408,7 +408,10 @@ + AM_CONDITIONAL([USRSCTP], [test x$have_usrsctp_lib = xyes]) + + PKG_CHECK_MODULES([YAML], yaml-0.1 >= 0.1.4) +-PKG_CHECK_MODULES([MONGOC], libmongoc-1.0 >= 1.3.1) ++PKG_CHECK_MODULES([MONGOC], mongoc2, ++ [AC_DEFINE([HAVE_MONGOC2], [1], [Have mongoc2.])], ++ [PKG_CHECK_MODULES([MONGOC], libmongoc-1.0 >= 1.3.1) ++]) + FREEDIAMETER_DIR=freeDiameter-1.2.1 + AC_SUBST(FREEDIAMETER_DIR) + +--- a/src/common/context.c ++++ b/src/common/context.c +@@ -5,7 +5,11 @@ + #include "core_lib.h" + #include "core_pkbuf.h" + ++#ifdef HAVE_MONGOC2 ++#include <mongoc/mongoc.h> ++#else + #include <mongoc.h> ++#endif + #include <yaml.h> + #include "yaml_helper.h" + +@@ -388,7 +392,7 @@ + return CORE_ERROR; + } + +-#if MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 4 ++#if MONGOC_MAJOR_VERSION >= 2 || (MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 4) + mongoc_client_set_error_api(self.db_client, 2); + #endif + +--- a/src/hss/hss_context.c ++++ b/src/hss/hss_context.c +@@ -4,7 +4,11 @@ + #include "core_lib.h" + #include "core_network.h" + ++#ifdef HAVE_MONGOC2 ++#include <mongoc/mongoc.h> ++#else + #include <mongoc.h> ++#endif + #include <yaml.h> + #include "common/yaml_helper.h" + +@@ -373,7 +377,7 @@ + mutex_lock(self.db_lock); + + query = BCON_NEW("imsi", BCON_UTF8(imsi_bcd)); +-#if MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 5 ++#if MONGOC_MAJOR_VERSION >= 2 || (MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 5) + cursor = mongoc_collection_find_with_opts( + self.subscriberCollection, query, NULL, NULL); + #else +@@ -555,7 +559,7 @@ + mutex_lock(self.db_lock); + + query = BCON_NEW("imsi", BCON_UTF8(imsi_bcd)); +-#if MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 5 ++#if MONGOC_MAJOR_VERSION >= 2 || (MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 5) + cursor = mongoc_collection_find_with_opts( + self.subscriberCollection, query, NULL, NULL); + #else +--- a/src/mme/mme_context.c ++++ b/src/mme/mme_context.c +@@ -7,7 +7,11 @@ + #include "core_fsm.h" + #include "core_network.h" + ++#ifdef HAVE_MONGOC2 ++#include <mongoc/mongoc.h> ++#else + #include <mongoc.h> ++#endif + #include <yaml.h> + #include "common/yaml_helper.h" + +--- a/src/pcrf/pcrf_context.c ++++ b/src/pcrf/pcrf_context.c +@@ -4,7 +4,11 @@ + #include "core_pkbuf.h" + #include "core_lib.h" + ++#ifdef HAVE_MONGOC2 ++#include <mongoc/mongoc.h> ++#else + #include <mongoc.h> ++#endif + #include <yaml.h> + #include "common/yaml_helper.h" + +@@ -389,7 +393,7 @@ + query = BCON_NEW( + "imsi", BCON_UTF8(imsi_bcd), + "pdn.apn", BCON_UTF8(apn)); +-#if MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 5 ++#if MONGOC_MAJOR_VERSION >= 2 || (MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 5) + opts = BCON_NEW( + "projection", "{", + "imsi", BCON_INT64(1), +--- a/src/pgw/pgw_context.c ++++ b/src/pgw/pgw_context.c +@@ -5,7 +5,11 @@ + #include "core_lib.h" + #include "core_network.h" + ++#ifdef HAVE_MONGOC2 ++#include <mongoc/mongoc.h> ++#else + #include <mongoc.h> ++#endif + #include <yaml.h> + #include "common/yaml_helper.h" + +--- a/src/sgw/sgw_context.c ++++ b/src/sgw/sgw_context.c +@@ -5,7 +5,11 @@ + #include "core_index.h" + #include "core_lib.h" + ++#ifdef HAVE_MONGOC2 ++#include <mongoc/mongoc.h> ++#else + #include <mongoc.h> ++#endif + #include <yaml.h> + #include "common/yaml_helper.h" + +--- a/test/basic/attach_test.c ++++ b/test/basic/attach_test.c +@@ -2,7 +2,11 @@ + #include "core_debug.h" + #include "core_pkbuf.h" + #include "core_lib.h" ++#ifdef HAVE_MONGOC2 ++#include <mongoc/mongoc.h> ++#else + #include <mongoc.h> ++#endif + + #include "common/context.h" + #include "mme/mme_context.h" +@@ -139,8 +143,13 @@ + ABTS_PTR_NOTNULL(tc, doc); + do + { ++#if MONGOC_MAJOR_VERSION >= 2 ++ count = mongoc_collection_count_documents ( ++ collection, doc, NULL, NULL, NULL, &error); ++#else + count = mongoc_collection_count ( + collection, MONGOC_QUERY_NONE, doc, 0, 0, NULL, &error); ++#endif + } while (count == 0); + bson_destroy(doc); + +@@ -627,8 +636,13 @@ + ABTS_PTR_NOTNULL(tc, doc); + do + { ++#if MONGOC_MAJOR_VERSION >= 2 ++ count = mongoc_collection_count_documents ( ++ collection, doc, NULL, NULL, NULL, &error); ++#else + count = mongoc_collection_count ( + collection, MONGOC_QUERY_NONE, doc, 0, 0, NULL, &error); ++#endif + } while (count == 0); + bson_destroy(doc); + +@@ -643,8 +657,13 @@ + ABTS_PTR_NOTNULL(tc, doc); + do + { ++#if MONGOC_MAJOR_VERSION >= 2 ++ count = mongoc_collection_count_documents ( ++ collection, doc, NULL, NULL, NULL, &error); ++#else + count = mongoc_collection_count ( + collection, MONGOC_QUERY_NONE, doc, 0, 0, NULL, &error); ++#endif + } while (count == 0); + bson_destroy(doc); + +@@ -978,8 +997,13 @@ + ABTS_PTR_NOTNULL(tc, doc); + do + { ++#if MONGOC_MAJOR_VERSION >= 2 ++ count = mongoc_collection_count_documents ( ++ collection, doc, NULL, NULL, NULL, &error); ++#else + count = mongoc_collection_count ( + collection, MONGOC_QUERY_NONE, doc, 0, 0, NULL, &error); ++#endif + } while (count == 0); + bson_destroy(doc); + +@@ -1305,8 +1329,13 @@ + ABTS_PTR_NOTNULL(tc, doc); + do + { ++#if MONGOC_MAJOR_VERSION >= 2 ++ count = mongoc_collection_count_documents ( ++ collection, doc, NULL, NULL, NULL, &error); ++#else + count = mongoc_collection_count ( + collection, MONGOC_QUERY_NONE, doc, 0, 0, NULL, &error); ++#endif + } while (count == 0); + bson_destroy(doc); + +@@ -1494,8 +1523,13 @@ + ABTS_PTR_NOTNULL(tc, doc); + do + { ++#if MONGOC_MAJOR_VERSION >= 2 ++ count = mongoc_collection_count_documents ( ++ collection, doc, NULL, NULL, NULL, &error); ++#else + count = mongoc_collection_count ( + collection, MONGOC_QUERY_NONE, doc, 0, 0, NULL, &error); ++#endif + } while (count == 0); + bson_destroy(doc); + +--- a/test/basic/handover_test.c ++++ b/test/basic/handover_test.c +@@ -2,7 +2,11 @@ + #include "core_debug.h" + #include "core_pkbuf.h" + #include "core_lib.h" ++#ifdef HAVE_MONGOC2 ++#include <mongoc/mongoc.h> ++#else + #include <mongoc.h> ++#endif + + #include "common/context.h" + #include "mme/mme_context.h" +@@ -158,8 +162,13 @@ + ABTS_PTR_NOTNULL(tc, doc); + do + { ++#if MONGOC_MAJOR_VERSION >= 2 ++ count = mongoc_collection_count_documents ( ++ collection, doc, NULL, NULL, NULL, &error); ++#else + count = mongoc_collection_count ( + collection, MONGOC_QUERY_NONE, doc, 0, 0, NULL, &error); ++#endif + } while (count == 0); + bson_destroy(doc); + +@@ -487,8 +496,13 @@ + ABTS_PTR_NOTNULL(tc, doc); + do + { ++#if MONGOC_MAJOR_VERSION >= 2 ++ count = mongoc_collection_count_documents ( ++ collection, doc, NULL, NULL, NULL, &error); ++#else + count = mongoc_collection_count ( + collection, MONGOC_QUERY_NONE, doc, 0, 0, NULL, &error); ++#endif + } while (count == 0); + bson_destroy(doc); + +--- a/test/basic/volte_test.c ++++ b/test/basic/volte_test.c +@@ -2,7 +2,11 @@ + #include "core_debug.h" + #include "core_pkbuf.h" + #include "core_lib.h" ++#ifdef HAVE_MONGOC2 ++#include <mongoc/mongoc.h> ++#else + #include <mongoc.h> ++#endif + + #include "common/context.h" + #include "mme/mme_context.h" +@@ -131,8 +135,13 @@ + ABTS_PTR_NOTNULL(tc, doc); + do + { ++#if MONGOC_MAJOR_VERSION >= 2 ++ count = mongoc_collection_count_documents ( ++ collection, doc, NULL, NULL, NULL, &error); ++#else + count = mongoc_collection_count ( + collection, MONGOC_QUERY_NONE, doc, 0, 0, NULL, &error); ++#endif + } while (count == 0); + bson_destroy(doc); + +@@ -443,8 +452,13 @@ + ABTS_PTR_NOTNULL(tc, doc); + do + { ++#if MONGOC_MAJOR_VERSION >= 2 ++ count = mongoc_collection_count_documents ( ++ collection, doc, NULL, NULL, NULL, &error); ++#else + count = mongoc_collection_count ( + collection, MONGOC_QUERY_NONE, doc, 0, 0, NULL, &error); ++#endif + } while (count == 0); + bson_destroy(doc); + +--- a/test/volte/volte_test.c ++++ b/test/volte/volte_test.c +@@ -3,7 +3,11 @@ + #include "core_pkbuf.h" + #include "core_lib.h" + #include "3gpp_types.h" ++#ifdef HAVE_MONGOC2 ++#include <mongoc/mongoc.h> ++#else + #include <mongoc.h> ++#endif + + #include "s1ap/s1ap_message.h" + +@@ -122,8 +126,13 @@ + ABTS_PTR_NOTNULL(tc, doc); + do + { ++#if MONGOC_MAJOR_VERSION >= 2 ++ count = mongoc_collection_count_documents ( ++ collection, doc, NULL, NULL, NULL, &error); ++#else + count = mongoc_collection_count ( + collection, MONGOC_QUERY_NONE, doc, 0, 0, NULL, &error); ++#endif + } while (count == 0); + bson_destroy(doc); + +@@ -471,8 +480,13 @@ + ABTS_PTR_NOTNULL(tc, doc); + do + { ++#if MONGOC_MAJOR_VERSION >= 2 ++ count = mongoc_collection_count_documents ( ++ collection, doc, NULL, NULL, NULL, &error); ++#else + count = mongoc_collection_count ( + collection, MONGOC_QUERY_NONE, doc, 0, 0, NULL, &error); ++#endif + } while (count == 0); + bson_destroy(doc); + diff --git a/debian/patches/series b/debian/patches/series index 127b37a..4f99c9e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -6,3 +6,4 @@ 0006-Fix-big-endian-bug.patch 0007-Patch-deprecated-sys-sysctl.h-problem.patch gcc-11.patch +mongo-c-driver2.patch

