public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/civetweb] epel8: Link to openssl libraries instead of using runtime dynamic loading
@ 2026-08-25  3:02 Mattias Ellert
  0 siblings, 0 replies; only message in thread
From: Mattias Ellert @ 2026-08-25  3:02 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/civetweb
            Branch : epel8
            Commit : 3a3d3df77d7210d381d6e9d72e74f82482888dac
            Author : Mattias Ellert <mattias.ellert@physics.uu.se>
            Date   : 2026-08-25T04:40:56+02:00
            Stats  : +247/-22 in 9 file(s)
            URL    : https://src.fedoraproject.org/rpms/civetweb/c/3a3d3df77d7210d381d6e9d72e74f82482888dac?branch=epel8

            Log:
            Link to openssl libraries instead of using runtime dynamic loading
Let the devel package own the cmake subdirectory
Run tests in check
Add upstream's fix to actually support X_DOM_SOCKET with cmake
Enable ZLIB compression support

---
diff --git a/.gitignore b/.gitignore
index fa0c9fc..a426f4f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 /civetweb-1.*.tar.gz
+/civetweb-check-master.tar.gz

diff --git a/0001-CMakeLists.txt.patch b/0001-CMakeLists.txt.patch
index 028c519..0613554 100644
--- a/0001-CMakeLists.txt.patch
+++ b/0001-CMakeLists.txt.patch
@@ -1,9 +1,35 @@
---- civetweb-1.16/CMakeLists.txt.orig	2025-07-16 07:44:16.982762892 -0400
-+++ civetweb-1.16/CMakeLists.txt	2025-07-16 07:44:32.894505768 -0400
-@@ -1,5 +1,5 @@
+--- civetweb-1.16/CMakeLists.txt.orig	2023-04-08 11:38:36.000000000 -0400
++++ civetweb-1.16/CMakeLists.txt	2026-08-07 13:43:10.279677132 -0400
+@@ -1,8 +1,6 @@
  # Use at least CMake 3.3
 -cmake_minimum_required (VERSION 3.3.0)
-+cmake_minimum_required (VERSION 3.3.0...4.0)
- cmake_policy(VERSION 3.2.2)
- cmake_policy(SET CMP0054 NEW)
- cmake_policy(SET CMP0057 NEW)
+-cmake_policy(VERSION 3.2.2)
+-cmake_policy(SET CMP0054 NEW)
+-cmake_policy(SET CMP0057 NEW)
++cmake_minimum_required (VERSION 3.10)
++cmake_policy(VERSION 3.10)
+ 
+ # Set up the project
+ project (civetweb)
+@@ -88,6 +86,11 @@
+ option(CIVETWEB_ENABLE_WEBSOCKETS "Enable websockets connections" OFF)
+ message(STATUS "Websockets support - ${CIVETWEB_ENABLE_WEBSOCKETS}")
+ 
++# X DOM sockets support
++option(CIVETWEB_ENABLE_X_DOM_SOCKET "Enable X DOM sockets support" OFF)
++message(STATUS "X DOM sockets support - ${CIVETWEB_ENABLE_X_DOM_SOCKET}")
++
++
+ # Server statistics support
+ option(CIVETWEB_ENABLE_SERVER_STATS "Enable server statistics" OFF)
+ message(STATUS "Server statistics support - ${CIVETWEB_ENABLE_SERVER_STATS}")
+@@ -494,6 +497,9 @@
+ if (CIVETWEB_ENABLE_WEBSOCKETS)
+   add_definitions(-DUSE_WEBSOCKET)
+ endif()
++if (CIVETWEB_ENABLE_X_DOM_SOCKET)
++   add_definitions(-DUSE_X_DOM_SOCKET)
++endif()
+ if (CIVETWEB_ENABLE_SERVER_STATS)
+   add_definitions(-DUSE_SERVER_STATS)
+ endif()

diff --git a/0004-unittest-CMakeLists.txt.patch b/0004-unittest-CMakeLists.txt.patch
new file mode 100644
index 0000000..e30e09a
--- /dev/null
+++ b/0004-unittest-CMakeLists.txt.patch
@@ -0,0 +1,25 @@
+From b20a7bc1bf70b66448bec6b68a61328766cd2e19 Mon Sep 17 00:00:00 2001
+From: DL6ER <dl6er@dl6er.de>
+Date: Thu, 11 Sep 2025 19:57:24 +0200
+Subject: [PATCH] Set minimum CMAKE version for tests
+
+Signed-off-by: DL6ER <dl6er@dl6er.de>
+---
+ unittest/CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt
+index 7aa34971..6aa8f0fd 100644
+--- a/unittest/CMakeLists.txt
++++ b/unittest/CMakeLists.txt
+@@ -30,6 +33,7 @@ DOWNLOAD_NAME "master.zip"
+     "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
+     "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}"
+     "-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>"
++    "-DCMAKE_POLICY_VERSION_MINIMUM=3.5"
+   LOG_DOWNLOAD ${THIRD_PARTY_LOGGING}
+   LOG_UPDATE ${THIRD_PARTY_LOGGING}
+   LOG_CONFIGURE ${THIRD_PARTY_LOGGING}
+-- 
+2.55.0
+

diff --git a/0005-unittest-public_server.c.patch b/0005-unittest-public_server.c.patch
new file mode 100644
index 0000000..0ef00d8
--- /dev/null
+++ b/0005-unittest-public_server.c.patch
@@ -0,0 +1,26 @@
+From aa7de369a47903de2417e2a8bf5be1f3df2acd10 Mon Sep 17 00:00:00 2001
+From: yubiuser <github@yubiuser.dev>
+Date: Mon, 23 Sep 2024 21:27:36 +0200
+Subject: [PATCH] Add linux and macOS test using OpenSSL3.0
+
+Signed-off-by: yubiuser <github@yubiuser.dev>
+---
+ unittest/public_server.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/unittest/public_server.c b/unittest/public_server.c
+index 93641f0d..4983ee8c 100644
+--- a/unittest/public_server.c
++++ b/unittest/public_server.c
+@@ -823,7 +823,7 @@ START_TEST(test_mg_server_and_client_tls)
+ 	 * while Ubuntu Xenial, Ubuntu Trusty and Windows test containers at
+ 	 * Travis CI do not. Maybe it is OpenSSL version specific.
+ 	 */
+-#if defined(OPENSSL_API_1_1)
++#if defined(OPENSSL_API_1_1) || defined(OPENSSL_API_3_0) 
+ 	if (client_conn) {
+ 		/* Connect succeeds, but the connection is unusable. */
+ 		mg_printf(client_conn, "GET / HTTP/1.0\r\n\r\n");
+-- 
+2.55.0
+

diff --git a/0006-src-civetweb.c.patch b/0006-src-civetweb.c.patch
new file mode 100644
index 0000000..40c5352
--- /dev/null
+++ b/0006-src-civetweb.c.patch
@@ -0,0 +1,26 @@
+From b8f93aafd3229fff5acea786b74b573202b169f3 Mon Sep 17 00:00:00 2001
+From: ferdymercury <ferdymercury@users.noreply.github.com>
+Date: Mon, 27 Apr 2026 12:13:45 +0200
+Subject: [PATCH] Only include deprecated header when really necessary
+
+deprecated ENGINE API is only used #if !defined(OPENSSL_API_1_1) && !defined(OPENSSL_API_3_0)
+---
+ src/civetweb.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/civetweb.c b/src/civetweb.c
+index f6a60e214..ecbd1a8a4 100644
+--- a/src/civetweb.c
++++ b/src/civetweb.c
+@@ -1797,7 +1797,10 @@ typedef struct SSL_CTX SSL_CTX;
+ #include <openssl/conf.h>
+ #include <openssl/crypto.h>
+ #include <openssl/dh.h>
+-#include <openssl/engine.h>
++
++#if defined(OPENSSL_API_1_0)
++#include <openssl/engine.h> // deprecated later on
++#endif
+ #include <openssl/err.h>
+ #include <openssl/opensslv.h>
+ #include <openssl/pem.h>

diff --git a/0007-src-civetweb.c.patch b/0007-src-civetweb.c.patch
new file mode 100644
index 0000000..9bc016e
--- /dev/null
+++ b/0007-src-civetweb.c.patch
@@ -0,0 +1,28 @@
+From b3449269bbf13852824d19f164d00810432649d0 Mon Sep 17 00:00:00 2001
+From: Mattias Ellert <mattias.ellert@physics.uu.se>
+Date: Thu, 20 Aug 2026 21:04:22 +0200
+Subject: [PATCH] Fix compilation with openssl 4
+
+X509_get_subject_name() and X509_get_issuer_name() now return const.
+---
+ src/civetweb.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/civetweb.c b/src/civetweb.c
+index f6a60e21..e093e094 100644
+--- a/src/civetweb.c
++++ b/src/civetweb.c
+@@ -17125,8 +17125,8 @@ ssl_get_client_cert_info(const struct mg_connection *conn,
+ 		const EVP_MD *digest = EVP_get_digestbyname("sha1");
+ 
+ 		/* Get Subject and issuer */
+-		X509_NAME *subj = X509_get_subject_name(cert);
+-		X509_NAME *iss = X509_get_issuer_name(cert);
++		const X509_NAME *subj = X509_get_subject_name(cert);
++		const X509_NAME *iss = X509_get_issuer_name(cert);
+ 
+ 		/* Get serial number */
+ 		ASN1_INTEGER *serial = X509_get_serialNumber(cert);
+-- 
+2.55.0
+

diff --git a/0008-unittest-private.c.patch b/0008-unittest-private.c.patch
new file mode 100644
index 0000000..ce4b97f
--- /dev/null
+++ b/0008-unittest-private.c.patch
@@ -0,0 +1,53 @@
+From 884bb4d4edabe36a4dbe1d30a439719994b39b84 Mon Sep 17 00:00:00 2001
+From: Mattias Ellert <mattias.ellert@physics.uu.se>
+Date: Thu, 20 Aug 2026 21:07:49 +0200
+Subject: [PATCH] Fix unittest for big endian architectures (e.g. Fedora on
+ s390x)
+
+---
+ unittest/private.c | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/unittest/private.c b/unittest/private.c
+index 7540dba6..ca4c908b 100644
+--- a/unittest/private.c
++++ b/unittest/private.c
+@@ -1411,8 +1411,11 @@ START_TEST(test_mask_data)
+ #endif
+ 
+ 	uint32_t mask = 0x61626364;
+-	/* TODO: adapt test for big endian */
++#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
++	ck_assert((*(unsigned char *)&mask) == 0x61u);
++#else
+ 	ck_assert((*(unsigned char *)&mask) == 0x64u);
++#endif
+ 
+ #if defined(USE_WEBSOCKET)
+ 	memset(in, 0, sizeof(in));
+@@ -1436,14 +1439,21 @@ START_TEST(test_mask_data)
+ 		ck_assert_int_eq((int)((unsigned char)out[i]), (int)0);
+ 	}
+ 
+-	/* TODO: check this for big endian */
+ 	mask_data(in, 5, 0x01020304, out);
++#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
++	ck_assert_uint_eq((unsigned char)out[0], 0u ^ 1u);
++	ck_assert_uint_eq((unsigned char)out[1], 1u ^ 2u);
++	ck_assert_uint_eq((unsigned char)out[2], 2u ^ 3u);
++	ck_assert_uint_eq((unsigned char)out[3], 3u ^ 4u);
++	ck_assert_uint_eq((unsigned char)out[4], 4u ^ 1u);
++#else
+ 	ck_assert_uint_eq((unsigned char)out[0], 0u ^ 4u);
+ 	ck_assert_uint_eq((unsigned char)out[1], 1u ^ 3u);
+ 	ck_assert_uint_eq((unsigned char)out[2], 2u ^ 2u);
+ 	ck_assert_uint_eq((unsigned char)out[3], 3u ^ 1u);
+ 	ck_assert_uint_eq((unsigned char)out[4], 4u ^ 4u);
+ #endif
++#endif
+ }
+ END_TEST
+ 
+-- 
+2.55.0
+

diff --git a/civetweb.spec b/civetweb.spec
index 5f43d35..960239a 100644
--- a/civetweb.spec
+++ b/civetweb.spec
@@ -1,17 +1,40 @@
+%undefine __cmake_in_source_build
 
 #%%global dev rc1
 
 Name:           civetweb
 Summary:        Embedded C/C++ web server
 Version:        1.16
-Release:        11%{?dev:%{dev}}%{?dist}
+Release:        12%{?dev:%{dev}}%{?dist}
 License:        MIT
 Url:            https://github.com/civetweb/civetweb
-Source:         https://github.com/%{name}/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
-Patch0001:	0001-CMakeLists.txt.patch
-Patch0002:	0002-src-civetweb.c.patch
-Patch0003:	0003-src-civetweb.c.patch
+Source0:        https://github.com/%{name}/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
+#               Test framework files
+Source1:        https://github.com/civetweb/check/archive/master/civetweb-check-master.tar.gz
+
+#               Patches based on commits in upstream's git repository
+#               commit: e927db7979e07ca5ceb06a61889a69b733dc029d and
+#                       08b7241f4bce808c3a932a5fddc1181acee5c0c1
+Patch0:         0001-CMakeLists.txt.patch
+#               commit: 76e222bcb77ba8452e5da4e82ae6cecd499c25e0
+Patch1:         0002-src-civetweb.c.patch
+#               commit: 782e18903515f43bafbf2e668994e82bdfa51133
+Patch2:         0003-src-civetweb.c.patch
+#               commit: b20a7bc1bf70b66448bec6b68a61328766cd2e19
+Patch3:         0004-unittest-CMakeLists.txt.patch
+#               commit: aa7de369a47903de2417e2a8bf5be1f3df2acd10
+Patch4:         0005-unittest-public_server.c.patch
+#               Patches based on pull requests not yet merged
+#               https://github.com/civetweb/civetweb/pull/1389
+Patch5:         0006-src-civetweb.c.patch
+#               https://github.com/civetweb/civetweb/pull/1423
+Patch6:         0007-src-civetweb.c.patch
+#               https://github.com/civetweb/civetweb/pull/1424
+Patch7:         0008-unittest-private.c.patch
+
 BuildRequires:  cmake make gcc-c++
+BuildRequires:  openssl-devel
+BuildRequires:  zlib-devel
 
 %description
 Civetweb is an easy to use, powerful, C (C/C++) embeddable web server
@@ -33,28 +56,37 @@ Civetweb shared libs and associated header files
 %autosetup -p1
 
 %build
-
-%{?!_vpath_builddir:%global _vpath_builddir %{_target_platform}}
-
-mkdir -p %{_vpath_builddir}
-cd %{_vpath_builddir} && %{cmake} .. \
+export CHECK_URL=%{SOURCE1}
+%{cmake} . \
     -G "Unix Makefiles" \
     -DCMAKE_BUILD_TYPE=RelWithDebInfo \
     -DBUILD_CONFIG=rpmbuild \
     -DBUILD_SHARED_LIBS:BOOL=ON \
     -DCIVETWEB_ENABLE_CXX:BOOL=ON \
-    -DCIVETWEB_ENABLE_WEBSOCKETS=ON \
-    -DCIVETWEB_ENABLE_X_DOM_SOCKET=ON \
-    -DCIVETWEB_BUILD_TESTING:BOOL=OFF
+    -DCIVETWEB_ENABLE_WEBSOCKETS:BOOL=ON \
+    -DCIVETWEB_ENABLE_X_DOM_SOCKET:BOOL=ON \
+    -DCIVETWEB_ENABLE_ZLIB:BOOL=ON \
+    -DCIVETWEB_ENABLE_SSL_DYNAMIC_LOADING:BOOL=OFF
 
 export GCC_COLORS=
 export VERBOSE=1
 %cmake_build %{?_smp_mflags}
 
 %install
-cd %{_vpath_builddir} && %cmake_install
+%cmake_install
 mkdir -p %{buildroot}%{_docdir}/civetweb
 
+%check
+# Compile cgi program used by tests
+mkdir output
+${CC:-gcc} ${CFLAGS:-} ${LDFLAGS:-} unittest/cgi_test.c -o output/cgi_test.cgi
+
+# The tests use the same ports (8080 and 8443) and can therefore not
+# be run in parallel
+# The excluded client tests require external network and can not be
+# run during a package build
+%ctest -- -j1 -E 'test-publicserver-minimal-https?-client'
+
 %files
 %{_bindir}/civetweb
 %{_libdir}/libcivetweb.so.*
@@ -66,10 +98,17 @@ mkdir -p %{buildroot}%{_docdir}/civetweb
 %{_includedir}/*.h
 %{_libdir}/libcivetweb.so
 %{_libdir}/libcivetweb-cpp.so
-%{_libdir}/cmake/civetweb/*
+%{_libdir}/cmake/civetweb/
 %{_datadir}/pkgconfig/*
 
 %changelog
+* Thu Aug 20 2026 Mattias Ellert <mattias.ellert@physics.uu.se> - 1.16-12
+- Link to openssl libraries instead of using runtime dynamic loading
+- Let the devel package own the cmake subdirectory
+- Run tests in check
+- Add upstream's fix to actually support X_DOM_SOCKET with cmake
+- Enable ZLIB compression support
+
 * Mon Jun 8 2026 Kaleb S. KEITHLEY <kkeithle at redhat.com> - 1.16-11
 - enable WEBSOCKETS and X_DOM_SOCKET as requested
 

diff --git a/sources b/sources
index d19ce22..6d86a69 100644
--- a/sources
+++ b/sources
@@ -1 +1,2 @@
 SHA512 (civetweb-1.16.tar.gz) = a0b943dfc76d7fd47f5a7d2c834fd38ddd4cf01a11730cf2f7cfaf32fea9698f59672f3a0f86ac80e0abc315d94d2367a500d37013f305c87d45e84cf39ca816
+SHA512 (civetweb-check-master.tar.gz) = f6255527fbf5b9fad807eb7989120ef12cf509b511285f4ccb82ba96342f9891e6d8718dc53bbce666d4e7f602a908d14c1cccbd4d908b1e0c4717d9f46945ff

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

only message in thread, other threads:[~2026-08-25  3:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-25  3:02 [rpms/civetweb] epel8: Link to openssl libraries instead of using runtime dynamic loading Mattias Ellert

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