aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-10-15 21:52:46 +0600
committerGitHub <noreply@github.com>2024-10-15 21:52:46 +0600
commit7cb20cfe3f45fb0915933bb1b2673003404b9483 (patch)
tree48fcf8586f0f80db118ada2c679d56ce9d650c5a
parent68b4601ed596ae1ce1890f83988a34d3445acc87 (diff)
parent04bcc9fe35ef3e9bdeab7bdf800b1d08a55b12b9 (diff)
downloadrspamd-7cb20cfe3f45fb0915933bb1b2673003404b9483.tar.gz
rspamd-7cb20cfe3f45fb0915933bb1b2673003404b9483.zip
Merge pull request #5189 from rspamd/vstakhov-some-build-fixes
Some build fixes
-rw-r--r--CMakeLists.txt12
-rw-r--r--config.h.in1
-rwxr-xr-xdebian/rules2
-rw-r--r--rpm/rspamd.spec3
-rw-r--r--src/CMakeLists.txt4
-rw-r--r--src/client/CMakeLists.txt4
-rw-r--r--src/libserver/ssl_util.c12
-rw-r--r--src/rspamadm/CMakeLists.txt4
8 files changed, 24 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3d384fa1b..6daced05a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -798,13 +798,11 @@ ADD_CUSTOM_TARGET(dist ${CMAKE_SOURCE_DIR}/dist.sh
COMMENT "Create source distribution"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
-IF (NOT DEBIAN_BUILD)
- ADD_CUSTOM_TARGET(check DEPENDS rspamd-test-cxx rspamd-test)
- ADD_CUSTOM_TARGET(run-test DEPENDS check
- COMMAND test/rspamd-test-cxx
- COMMAND sh -c 'LUA_PATH="${CMAKE_SOURCE_DIR}/lualib/?.lua\;${CMAKE_SOURCE_DIR}/lualib/?/?.lua\;${CMAKE_SOURCE_DIR}/lualib/?/init.lua\;${CMAKE_SOURCE_DIR}/contrib/lua-?/?.lua"
- test/rspamd-test -p /rspamd/lua')
-ENDIF (NOT DEBIAN_BUILD)
+ADD_CUSTOM_TARGET(check DEPENDS rspamd-test-cxx rspamd-test)
+ADD_CUSTOM_TARGET(run-test DEPENDS check
+ COMMAND test/rspamd-test-cxx
+ COMMAND sh -c 'LUA_PATH="${CMAKE_SOURCE_DIR}/lualib/?.lua\;${CMAKE_SOURCE_DIR}/lualib/?/?.lua\;${CMAKE_SOURCE_DIR}/lualib/?/init.lua\;${CMAKE_SOURCE_DIR}/contrib/lua-?/?.lua"
+ test/rspamd-test -p /rspamd/lua')
# PVS Studio
diff --git a/config.h.in b/config.h.in
index 9aff90783..0ed2cd6b2 100644
--- a/config.h.in
+++ b/config.h.in
@@ -116,6 +116,7 @@
#cmakedefine WITH_FASTTEXT 1
#cmakedefine BACKWARD_ENABLE 1
#cmakedefine HAVE_BUILTIN_CPU_SUPPORTS 1
+#cmakedefine RSPAMD_LEGACY_SSL_PROVIDER 1
#cmakedefine DISABLE_PTHREAD_MUTEX 1
diff --git a/debian/rules b/debian/rules
index 74771ede3..be06aa6d6 100755
--- a/debian/rules
+++ b/debian/rules
@@ -39,7 +39,7 @@ configure_%:
-DSYSTEMDDIR=/lib/systemd/system \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
- -DDEBIAN_BUILD=1 \
+ -DNO_TARGET_VERSIONS=1 \
-DENABLE_PCRE2=ON \
-DENABLE_LIBUNWIND=ON \
-DWANT_SYSTEMD_UNITS=ON \
diff --git a/rpm/rspamd.spec b/rpm/rspamd.spec
index 7a1a15c92..663fa0929 100644
--- a/rpm/rspamd.spec
+++ b/rpm/rspamd.spec
@@ -136,7 +136,8 @@ rm -f %{_builddir}/luajit-build/lib/*.so || true
-DSYSTEMDDIR=%{_unitdir} \
-DWANT_SYSTEMD_UNITS=ON \
-DNO_SHARED=ON \
- -DDEBIAN_BUILD=1 \
+ -DNO_TARGET_VERSIONS=1 \
+ -DRSPAMD_LEGACY_SSL_PROVIDER=1 \
%ifarch x86_64 amd64 arm64 aarch64
-DENABLE_HYPERSCAN=ON \
%endif
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 173917703..f7fdcef7b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -235,9 +235,9 @@ ADD_EXECUTABLE(rspamd ${RSPAMDSRC} ${CMAKE_CURRENT_BINARY_DIR}/workers.c ${CMAKE
ADD_BACKWARD(rspamd)
SET_TARGET_PROPERTIES(rspamd PROPERTIES LINKER_LANGUAGE CXX)
SET_TARGET_PROPERTIES(rspamd-server PROPERTIES LINKER_LANGUAGE CXX)
-IF(NOT DEBIAN_BUILD)
+IF(NOT NO_TARGET_VERSIONS)
SET_TARGET_PROPERTIES(rspamd PROPERTIES VERSION ${RSPAMD_VERSION})
-ENDIF(NOT DEBIAN_BUILD)
+ENDIF()
#TARGET_LINK_LIBRARIES(rspamd ${RSPAMD_REQUIRED_LIBRARIES})
TARGET_LINK_LIBRARIES(rspamd rspamd-server)
diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt
index edf3cc1c4..543fc629c 100644
--- a/src/client/CMakeLists.txt
+++ b/src/client/CMakeLists.txt
@@ -9,8 +9,8 @@ SET_TARGET_PROPERTIES(rspamc PROPERTIES COMPILE_FLAGS "-I${CMAKE_SOURCE_DIR}/lib
TARGET_LINK_LIBRARIES(rspamc rspamd-server)
SET_TARGET_PROPERTIES(rspamc PROPERTIES LINKER_LANGUAGE CXX)
-IF(NOT DEBIAN_BUILD)
+IF(NOT NO_TARGET_VERSIONS)
SET_TARGET_PROPERTIES(rspamc PROPERTIES VERSION ${RSPAMD_VERSION})
-ENDIF(NOT DEBIAN_BUILD)
+ENDIF()
INSTALL(TARGETS rspamc RUNTIME DESTINATION bin)
diff --git a/src/libserver/ssl_util.c b/src/libserver/ssl_util.c
index b739961a8..b97e2a498 100644
--- a/src/libserver/ssl_util.c
+++ b/src/libserver/ssl_util.c
@@ -1,11 +1,11 @@
-/*-
- * Copyright 2016 Vsevolod Stakhov
+/*
+ * Copyright 2024 Vsevolod Stakhov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -1054,6 +1054,9 @@ gpointer rspamd_init_ssl_ctx_noverify(void)
return ssl_ctx_noverify;
}
+#if defined(RSPAMD_LEGACY_SSL_PROVIDER) && OPENSSL_VERSION_NUMBER >= 0x30000000L
+#include <openssl/provider.h>
+#endif
void rspamd_openssl_maybe_init(void)
{
@@ -1075,6 +1078,9 @@ void rspamd_openssl_maybe_init(void)
#else
OPENSSL_init_ssl(0, NULL);
#endif
+#if defined(RSPAMD_LEGACY_SSL_PROVIDER) && OPENSSL_VERSION_NUMBER >= 0x30000000L
+ (void) OSSL_PROVIDER_load(NULL, "legacy");
+#endif
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
OPENSSL_config(NULL);
diff --git a/src/rspamadm/CMakeLists.txt b/src/rspamadm/CMakeLists.txt
index 5e88ec8dd..2f32a95f5 100644
--- a/src/rspamadm/CMakeLists.txt
+++ b/src/rspamadm/CMakeLists.txt
@@ -22,9 +22,9 @@ ENDIF()
ADD_EXECUTABLE(rspamadm ${RSPAMADMSRC})
TARGET_LINK_LIBRARIES(rspamadm rspamd-server)
-IF (NOT DEBIAN_BUILD)
+IF (NOT NO_TARGET_VERSIONS)
SET_TARGET_PROPERTIES(rspamadm PROPERTIES VERSION ${RSPAMD_VERSION})
-ENDIF (NOT DEBIAN_BUILD)
+ENDIF ()
SET_TARGET_PROPERTIES(rspamadm PROPERTIES LINKER_LANGUAGE CXX)
ADD_BACKWARD(rspamadm)