public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/civetweb] epel10: Update package after unretirement re-review
@ 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 : epel10
            Commit : 80ecf9db9554f51b454edb7038aa5af5b4b936fb
            Author : Mattias Ellert <mattias.ellert@physics.uu.se>
            Date   : 2026-08-25T04:18:58+02:00
            Stats  : +204/-3 in 8 file(s)
            URL    : https://src.fedoraproject.org/rpms/civetweb/c/80ecf9db9554f51b454edb7038aa5af5b4b936fb?branch=epel10

            Log:
            Update package after unretirement re-review

- Link to openssl libraries instead of using runtime dynamic loading
- Use openssl 3.0 API instead of the default openssl 1.1 API
- Let the devel package own the cmake subdirectory
- Run tests in check

---
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/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 e46bc72..c032a08 100644
--- a/civetweb.spec
+++ b/civetweb.spec
@@ -4,14 +4,35 @@
 Name:           civetweb
 Summary:        Embedded C/C++ web server
 Version:        1.16
-Release:        15%{?dev:%{dev}}%{?dist}
+Release:        16%{?dev:%{dev}}%{?dist}
 License:        MIT
 Url:            https://github.com/civetweb/civetweb
 Source:         https://github.com/%{name}/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
+#               Test framework files
+Source:         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
 Patch:          0001-CMakeLists.txt.patch
+#               commit: 76e222bcb77ba8452e5da4e82ae6cecd499c25e0
 Patch:          0002-src-civetweb.c.patch
+#               commit: 782e18903515f43bafbf2e668994e82bdfa51133
 Patch:          0003-src-civetweb.c.patch
+#               commit: b20a7bc1bf70b66448bec6b68a61328766cd2e19
+Patch:          0004-unittest-CMakeLists.txt.patch
+#               commit: aa7de369a47903de2417e2a8bf5be1f3df2acd10
+Patch:          0005-unittest-public_server.c.patch
+#               Patches based on pull requests not yet merged
+#               https://github.com/civetweb/civetweb/pull/1389
+Patch:          0006-src-civetweb.c.patch
+#               https://github.com/civetweb/civetweb/pull/1423
+Patch:          0007-src-civetweb.c.patch
+#               https://github.com/civetweb/civetweb/pull/1424
+Patch:          0008-unittest-private.c.patch
+
 BuildRequires:  cmake make gcc-c++
+BuildRequires:  openssl-devel
 BuildRequires:  zlib-devel
 
 %description
@@ -34,6 +55,7 @@ Civetweb shared libs and associated header files
 %autosetup -p1
 
 %build
+export CHECK_URL=%{SOURCE1}
 %{cmake} . \
     -G "Unix Makefiles" \
     -DCMAKE_BUILD_TYPE=RelWithDebInfo \
@@ -43,7 +65,9 @@ Civetweb shared libs and associated header files
     -DCIVETWEB_ENABLE_WEBSOCKETS:BOOL=ON \
     -DCIVETWEB_ENABLE_X_DOM_SOCKET:BOOL=ON \
     -DCIVETWEB_ENABLE_ZLIB:BOOL=ON \
-    -DCIVETWEB_BUILD_TESTING:BOOL=OFF
+    -DCIVETWEB_ENABLE_SSL_DYNAMIC_LOADING:BOOL=OFF \
+    -DCIVETWEB_SSL_OPENSSL_API_1_1:BOOL=OFF \
+    -DCIVETWEB_SSL_OPENSSL_API_3_0:BOOL=ON
 
 export GCC_COLORS=
 export VERBOSE=1
@@ -53,6 +77,17 @@ export VERBOSE=1
 %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.*
@@ -64,10 +99,16 @@ 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-16
+- Link to openssl libraries instead of using runtime dynamic loading
+- Use openssl 3.0 API instead of the default openssl 1.1 API
+- Let the devel package own the cmake subdirectory
+- Run tests in check
+
 * Fri Aug 7 2026 Mattias Ellert <mattias.ellert@physics.uu.se> - 1.16-15
 - Add upstream's fix to actually support X_DOM_SOCKET with cmake
 - Enable ZLIB compression support

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] epel10: Update package after unretirement re-review Mattias Ellert

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