[packages/libmongocrypt] - updated to 1.15.2, fixed .pc files

qboosh qboosh at pld-linux.org
Sun Oct 11 20:32:34 CEST 2026


commit f16004e4d9e23f53390d6791c1f36328f42fa576
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Oct 11 20:33:06 2026 +0200

    - updated to 1.15.2, fixed .pc files

 libmongocrypt-tests.patch | 18 ++++++++++
 libmongocrypt-types.patch | 11 ++++++
 libmongocrypt.spec        | 86 +++++++++++++++++++++++++++++++++++------------
 no-Werror.patch           | 33 ++++++------------
 4 files changed, 104 insertions(+), 44 deletions(-)
---
diff --git a/libmongocrypt.spec b/libmongocrypt.spec
index 3138dee..3779b23 100644
--- a/libmongocrypt.spec
+++ b/libmongocrypt.spec
@@ -1,24 +1,35 @@
 #
 # Conditional build:
 %bcond_without	apidocs		# Doxygen API documentation
+%bcond_without	static_libs	# static library
+%bcond_with	tests		# test suite
 
+%if %{without static_libs}
+# tests rely on static libs (internal symbols)
+%undefine	with_tests
+%endif
 Summary:	The companion C library for client side encryption in drivers
 Summary(pl.UTF-8):	Biblioteka towarzysząca C do szyfrowania w sterownikach po stronie klienta
 Name:		libmongocrypt
-Version:	1.0.4
-Release:	2
+# 1.16+ require libbson2
+Version:	1.15.2
+Release:	1
 # see kms-message/THIRD_PARTY_NOTICES
 # kms-message/src/kms_b64.c is ISC
-# everything else is ASL 2.0
-License:	ASL 2.0 and ISC
+# everything else is Apache v2.0
+License:	Apache v2.0 and ISC
 Group:		Libraries
+#Source0Download: https://github.com/mongodb/libmongocrypt/releases
 Source0:	https://github.com/mongodb/libmongocrypt/archive/%{version}/%{name}-%{version}.tar.gz
-# Source0-md5:	e8939c3ed5c8b797dd8d4ea1290f7652
+# Source0-md5:	4b5235a225256bebcf8cde2e1f5c0c5b
 Patch0:		no-Werror.patch
+Patch1:		%{name}-types.patch
+Patch2:		%{name}-tests.patch
 URL:		https://github.com/mongodb/libmongocrypt
-BuildRequires:	cmake >= 3.5
+BuildRequires:	cmake >= 3.15
 %{?with_apidocs:BuildRequires:	doxygen}
-BuildRequires:	libbson-devel >= 1.11
+BuildRequires:	libbson-devel >= 1.30
+%{?with_static_libs:BuildRequires:	libbson-static >= 1.30}
 BuildRequires:	libstdc++-devel
 BuildRequires:	openssl-devel
 BuildRequires:	pkgconfig
@@ -37,7 +48,8 @@ klienta.
 Summary:	Header files for libmongocrypt library
 Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki libmongocrypt
 Group:		Development/Libraries
-Requires:	%{name} = %{version}-%{release}
+Requires:	%{name}%{?_isa} = %{version}-%{release}
+Requires:	libbson-devel >= 1.30
 
 %description devel
 This package contains the header files and other development files for
@@ -47,6 +59,20 @@ libmongocrypt library.
 Ten pakiet zawiera pliki nagłówkowe i inne pliki programistyczne
 biblioteki libmongocrypt.
 
+%package static
+Summary:	Static libmongocrypt libraries
+Summary(pl.UTF-8):	Statyczne biblioteki libmongocrypt
+Group:		Development/Libraries
+Requires:	%{name}-devel%{?_isa} = %{version}-%{release}
+Requires:	libbson-static >= 1.30
+Requires:	openssl-devel
+
+%description static
+Static libmongocrypt libraries.
+
+%description static -l pl.UTF-8
+Statyczne biblioteki libmongocrypt.
+
 %package apidocs
 Summary:	API documentation for libmongocrypt library
 Summary(pl.UTF-8):	Dokumentacja API biblioteki libmongocrypt
@@ -62,19 +88,25 @@ Dokumentacja API biblioteki libmongocrypt.
 %prep
 %setup -q
 %patch -P0 -p1
+%patch -P1 -p1
+%patch -P2 -p1
 echo "%{version}" > VERSION_CURRENT
 
 %build
-%cmake \
-	-DCMAKE_C_FLAGS="%{optflags} -fPIC" \
-	-DENABLE_SHARED_BSON:BOOL=ON \
-	-DENABLE_STATIC:BOOL=OFF \
-	.
-
-%{__make}
+# .pc file generation expects relative CMAKE_INSTALL_{INSTALL,LIB}DIR
+%cmake -B build \
+	%{!?with_tests:-DBUILD_TESTING:BOOL=OFF} \
+	-DCMAKE_INSTALL_INCLUDEDIR=include \
+	-DCMAKE_INSTALL_LIBDIR=%{_lib} \
+	-DENABLE_ONLINE_TESTS:BOOL=OFF \
+	%{!?with_static_libs:-DENABLE_STATIC:BOOL=OFF} \
+	-DMONGOCRYPT_MONGOC_DIR:STRING="USE-SYSTEM" \
+	-DUSE_SHARED_LIBBSON:BOOL=ON
+
+%{__make} -C build
 
 %if %{with tests}
-%{__make} test
+%{__make} -C build test
 %endif
 
 %if %{with apidocs}
@@ -83,7 +115,8 @@ doxygen doc/Doxygen
 
 %install
 rm -rf $RPM_BUILD_ROOT
-%{__make} install \
+
+%{__make} -C build install \
 	DESTDIR=$RPM_BUILD_ROOT
 
 %clean
@@ -94,15 +127,15 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc LICENSE
-%ghost %{_libdir}/libmongocrypt.so.0
-%attr(755,root,root) %{_libdir}/libmongocrypt.so.*.*.*
+%doc CHANGELOG.md LICENSE README.md
+%{_libdir}/libkms_message.so.*.*.*
 %ghost %{_libdir}/libkms_message.so.0
-%attr(755,root,root) %{_libdir}/libkms_message.so.*.*.*
+%{_libdir}/libmongocrypt.so.*.*.*
+%ghost %{_libdir}/libmongocrypt.so.0
 
 %files devel
 %defattr(644,root,root,755)
-%doc *.md
+%doc integrating.md
 %{_libdir}/libkms_message.so
 %{_libdir}/libmongocrypt.so
 %{_includedir}/kms_message
@@ -112,6 +145,15 @@ rm -rf $RPM_BUILD_ROOT
 %{_pkgconfigdir}/libkms_message.pc
 %{_pkgconfigdir}/libmongocrypt.pc
 
+%if %{with static_libs}
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libbson-static-for-libmongocrypt.a
+%{_libdir}/libkms_message-static.a
+%{_libdir}/libmongocrypt-static.a
+%{_pkgconfigdir}/libmongocrypt-static.pc
+%endif
+
 %if %{with apidocs}
 %files apidocs
 %defattr(644,root,root,755)
diff --git a/libmongocrypt-tests.patch b/libmongocrypt-tests.patch
new file mode 100644
index 0000000..280d241
--- /dev/null
+++ b/libmongocrypt-tests.patch
@@ -0,0 +1,18 @@
+--- libmongocrypt-1.15.2/CMakeLists.txt.orig	2026-10-11 19:20:50.552855168 +0200
++++ libmongocrypt-1.15.2/CMakeLists.txt	2026-10-11 19:50:05.980011869 +0200
+@@ -463,7 +463,6 @@ if (BUILD_TESTING)
+          OUTPUT_NAME "mongo_crypt_v1"
+          )
+    endif ()
+-endif ()
+ 
+ set (TEST_MONGOCRYPT_SOURCES
+    test/test-gcp-auth.c
+@@ -615,6 +614,7 @@ if (NOT MONGOCRYPT_CRYPTO STREQUAL none)
+       target_link_libraries (csfle PRIVATE _mongocrypt::mongoc)
+    endif ()
+ endif ()
++endif ()  # BUILD_TESTING
+ 
+ if (ENABLE_STATIC)
+    set (TARGETS_TO_INSTALL mongocrypt mongocrypt_static)
diff --git a/libmongocrypt-types.patch b/libmongocrypt-types.patch
new file mode 100644
index 0000000..e637690
--- /dev/null
+++ b/libmongocrypt-types.patch
@@ -0,0 +1,11 @@
+--- libmongocrypt-1.15.2/kms-message/test/test_kms_request.c.orig	2025-09-15 14:54:01.000000000 +0200
++++ libmongocrypt-1.15.2/kms-message/test/test_kms_request.c	2026-10-11 19:30:31.383041874 +0200
+@@ -1116,7 +1116,7 @@ kms_request_kmip_prohibited_test (void)
+ static int
+ count_substrings (const char *big, const char *little)
+ {
+-   char *iter;
++   const char *iter;
+    int count = 0;
+ 
+    iter = strstr (big, little);
diff --git a/no-Werror.patch b/no-Werror.patch
index 41a8777..2bb457b 100644
--- a/no-Werror.patch
+++ b/no-Werror.patch
@@ -1,22 +1,11 @@
---- libmongocrypt-1.0.4/CMakeLists.txt~	2020-05-13 21:08:12.000000000 +0200
-+++ libmongocrypt-1.0.4/CMakeLists.txt	2021-10-06 22:18:39.746913269 +0200
-@@ -93,7 +93,7 @@
-    # TODO: add support for clang-cl which is detected as MSVC
- else()
-    # GNU, Clang, AppleClang
--   set(CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} -Wall -Werror -Wno-missing-braces")
-+   set(CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} -Wall -Wno-missing-braces")
- endif()
- 
- # Choose a Crypto provider
---- libmongocrypt-1.0.4/kms-message/CMakeLists.txt~	2020-05-13 21:08:12.000000000 +0200
-+++ libmongocrypt-1.0.4/kms-message/CMakeLists.txt	2021-10-06 22:19:10.140304513 +0200
-@@ -94,7 +94,7 @@
- endif ()
- 
- if ( CMAKE_COMPILER_IS_GNUCC )
--    set(CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} -Wall -Wno-unused-function -Wsign-compare -Werror")
-+    set(CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} -Wall -Wno-unused-function -Wsign-compare")
- endif()
- if ( MSVC )
-     # W4273 - inconsistent dll linkage
+--- libmongocrypt-1.12.0/CMakeLists.txt.orig	2025-02-19 21:55:17.772063686 +0100
++++ libmongocrypt-1.12.0/CMakeLists.txt	2025-02-19 21:56:08.425122608 +0100
+@@ -71,7 +71,7 @@ option (ENABLE_MORE_WARNINGS_AS_ERRORS "
+ if (ENABLE_MORE_WARNINGS_AS_ERRORS)
+    mongoc_add_platform_compile_options (
+       msvc:/W3 msvc:/WX msvc:/wd4996 msvc:/wd4359
+-      gnu-like:-Wall gnu-like:-Werror
++      gnu-like:-Wall
+       gnu-like:-Wswitch-enum gnu-like:-Wswitch-default
+       gnu-like:-Wsign-compare
+       )
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libmongocrypt.git/commitdiff/f16004e4d9e23f53390d6791c1f36328f42fa576



More information about the pld-cvs-commit mailing list