From e0cc7f032415b7c681e75ea79bd2e62d25d4118b Mon Sep 17 00:00:00 2001 From: Petr Vaněk Date: Wed, 7 Oct 2020 15:58:16 +0000 Subject: mail-filter/rspamd: bump to 2.6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Package-Manager: Portage-3.0.4, Repoman-3.0.1 Signed-off-by: Petr Vaněk Closes: https://github.com/gentoo/gentoo/pull/17834 Signed-off-by: Sam James --- mail-filter/rspamd/Manifest | 1 + .../rspamd/files/rspamd-2.6-unbundle-hiredis.patch | 93 +++++++++++++++ .../rspamd/files/rspamd-2.6-unbundle-lua.patch | 101 ++++++++++++++++ .../rspamd/files/rspamd-2.6-unbundle-zstd.patch | 128 +++++++++++++++++++++ .../files/rspamd-9999-unbundle-hiredis.patch | 93 --------------- .../rspamd/files/rspamd-9999-unbundle-lua.patch | 101 ---------------- .../rspamd/files/rspamd-9999-unbundle-zstd.patch | 128 --------------------- mail-filter/rspamd/rspamd-2.6.ebuild | 119 +++++++++++++++++++ mail-filter/rspamd/rspamd-9999.ebuild | 6 +- 9 files changed, 445 insertions(+), 325 deletions(-) create mode 100644 mail-filter/rspamd/files/rspamd-2.6-unbundle-hiredis.patch create mode 100644 mail-filter/rspamd/files/rspamd-2.6-unbundle-lua.patch create mode 100644 mail-filter/rspamd/files/rspamd-2.6-unbundle-zstd.patch delete mode 100644 mail-filter/rspamd/files/rspamd-9999-unbundle-hiredis.patch delete mode 100644 mail-filter/rspamd/files/rspamd-9999-unbundle-lua.patch delete mode 100644 mail-filter/rspamd/files/rspamd-9999-unbundle-zstd.patch create mode 100644 mail-filter/rspamd/rspamd-2.6.ebuild (limited to 'mail-filter') diff --git a/mail-filter/rspamd/Manifest b/mail-filter/rspamd/Manifest index 31a2bd1b901e..7b2fbeee7132 100644 --- a/mail-filter/rspamd/Manifest +++ b/mail-filter/rspamd/Manifest @@ -1 +1,2 @@ DIST rspamd-2.5.tar.gz 4490310 BLAKE2B 8d117b1b03e8092d0c724a4da4de23dd145f5b22696aa6b4ef1c208ade28f0d143dd783c9173b6987514b2aef9327ff8fd29eeae5e3da3039d2568384e50a697 SHA512 6068309da98eeb75f95188414b12ce9443aef31200853f820646e70e1dbf2d9d1e2c661a86df2183c175cc01cfb09f6a5c7b8ba358901a56ec6cdb9d9fef4540 +DIST rspamd-2.6.tar.gz 5079444 BLAKE2B acb9d9471d0bb457da33b4d23e3c75ef87ea26a47e6c731bfd5fbbfe28567244e2bc72fd25ca3408db0928dab4e4ab66596e38cf3eff7cb9690eec59d3b62372 SHA512 79e4c1aa763aef753c8d7b2a941ed92b384e96c25e6d1b3bd1321c5acc0ecb934d033a3bf19cb94c89809fd92edec25192cffe97de9e5251681e1a71216b734a diff --git a/mail-filter/rspamd/files/rspamd-2.6-unbundle-hiredis.patch b/mail-filter/rspamd/files/rspamd-2.6-unbundle-hiredis.patch new file mode 100644 index 000000000000..875009da41aa --- /dev/null +++ b/mail-filter/rspamd/files/rspamd-2.6-unbundle-hiredis.patch @@ -0,0 +1,93 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0afb5feff..966173075 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -170,6 +170,8 @@ ELSE() + ROOT ${PCRE_ROOT_DIR} MODULES pcre libpcre pcre3 libpcre3) + ENDIF() + ++ProcessPackage(HIREDIS LIBRARY hiredis INCLUDE hiredis.h ++ ROOT ${HIREDIS_ROOT_DIR} MODULES hiredis) + ProcessPackage(ZSTD LIBRARY zstd INCLUDE zstd.h + ROOT ${ZSTD_ROOT_DIR} MODULES libzstd) + ProcessPackage(SQLITE3 LIBRARY sqlite3 INCLUDE sqlite3.h INCLUDE_SUFFIXES include/sqlite3 include/sqlite +@@ -555,9 +557,7 @@ ENDIF(NOT DESTDIR) + + + ################################ SUBDIRS SECTION ########################### +-ADD_SUBDIRECTORY(contrib/hiredis) + SET(WITH_HIREDIS 1) +-INCLUDE_DIRECTORIES(BEFORE "${CMAKE_SOURCE_DIR}/contrib/hiredis") + + LIST(APPEND RSPAMD_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") + IF(HAVE_FETCH_H) +@@ -604,7 +604,6 @@ ENDIF() + IF (ENABLE_SNOWBALL MATCHES "ON") + LIST(APPEND RSPAMD_REQUIRED_LIBRARIES stemmer) + ENDIF() +-LIST(APPEND RSPAMD_REQUIRED_LIBRARIES rspamd-hiredis) + + LIST(APPEND RSPAMD_REQUIRED_LIBRARIES rspamd-actrie) + LIST(APPEND RSPAMD_REQUIRED_LIBRARIES rspamd-t1ha) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index e0e2edd58..4908013da 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -190,7 +190,6 @@ ENDIF() + IF (ENABLE_SNOWBALL MATCHES "ON") + TARGET_LINK_LIBRARIES(rspamd-server stemmer) + ENDIF() +-TARGET_LINK_LIBRARIES(rspamd-server rspamd-hiredis) + + IF (ENABLE_FANN MATCHES "ON") + TARGET_LINK_LIBRARIES(rspamd-server fann) +diff --git a/src/libserver/fuzzy_backend/fuzzy_backend_redis.c b/src/libserver/fuzzy_backend/fuzzy_backend_redis.c +index d1e3e7532..882acdf6a 100644 +--- a/src/libserver/fuzzy_backend/fuzzy_backend_redis.c ++++ b/src/libserver/fuzzy_backend/fuzzy_backend_redis.c +@@ -22,8 +22,8 @@ + #include "cryptobox.h" + #include "str_util.h" + #include "upstream.h" +-#include "contrib/hiredis/hiredis.h" +-#include "contrib/hiredis/async.h" ++#include ++#include + #include "lua/lua_common.h" + + #define REDIS_DEFAULT_PORT 6379 +diff --git a/src/libserver/redis_pool.c b/src/libserver/redis_pool.c +index 7e835013c..fccf189e1 100644 +--- a/src/libserver/redis_pool.c ++++ b/src/libserver/redis_pool.c +@@ -18,9 +18,9 @@ + #include "contrib/libev/ev.h" + #include "redis_pool.h" + #include "cfg_file.h" +-#include "contrib/hiredis/hiredis.h" +-#include "contrib/hiredis/async.h" +-#include "contrib/hiredis/adapters/libev.h" ++#include ++#include ++#include + #include "cryptobox.h" + #include "logger.h" + +diff --git a/src/lua/lua_redis.c b/src/lua/lua_redis.c +index f9dbbdd13..b885a8b61 100644 +--- a/src/lua/lua_redis.c ++++ b/src/lua/lua_redis.c +@@ -17,8 +17,8 @@ + #include "lua_thread_pool.h" + #include "utlist.h" + +-#include "contrib/hiredis/hiredis.h" +-#include "contrib/hiredis/async.h" ++#include ++#include + + #define REDIS_DEFAULT_TIMEOUT 1.0 + +-- +2.25.3 + diff --git a/mail-filter/rspamd/files/rspamd-2.6-unbundle-lua.patch b/mail-filter/rspamd/files/rspamd-2.6-unbundle-lua.patch new file mode 100644 index 000000000000..c6f6324befc7 --- /dev/null +++ b/mail-filter/rspamd/files/rspamd-2.6-unbundle-lua.patch @@ -0,0 +1,101 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b794b9dbd..90caf4048 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -111,7 +111,6 @@ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/" + "${CMAKE_SOURCE_DIR}/contrib/librdns" + "${CMAKE_SOURCE_DIR}/contrib/aho-corasick" + "${CMAKE_SOURCE_DIR}/contrib/lc-btrie" +- "${CMAKE_SOURCE_DIR}/contrib/lua-lpeg" + "${CMAKE_BINARY_DIR}/src" #Stored in the binary dir + "${CMAKE_BINARY_DIR}/src/libcryptobox") + +@@ -624,7 +623,6 @@ ENDIF() + ADD_SUBDIRECTORY(contrib/libucl) + ADD_SUBDIRECTORY(contrib/librdns) + ADD_SUBDIRECTORY(contrib/aho-corasick) +-ADD_SUBDIRECTORY(contrib/lua-lpeg) + ADD_SUBDIRECTORY(contrib/t1ha) + ADD_SUBDIRECTORY(contrib/libev) + ADD_SUBDIRECTORY(contrib/kann) +@@ -632,10 +630,6 @@ ADD_SUBDIRECTORY(contrib/fastutf8) + ADD_SUBDIRECTORY(contrib/google-ced) + + +-IF (NOT WITH_LUAJIT) +- ADD_SUBDIRECTORY(contrib/lua-bit) +-ENDIF() +- + IF (ENABLE_LUA_REPL MATCHES "ON") + ADD_SUBDIRECTORY(contrib/replxx) + SET(WITH_LUA_REPL 1) +@@ -735,7 +729,6 @@ INSTALL(FILES "contrib/lua-fun/fun.lua" DESTINATION ${LUALIBDIR}) + INSTALL(FILES "contrib/lua-argparse/argparse.lua" DESTINATION ${LUALIBDIR}) + INSTALL(FILES "contrib/lua-tableshape/tableshape.lua" DESTINATION ${LUALIBDIR}) + INSTALL(FILES "contrib/lua-lupa/lupa.lua" DESTINATION ${LUALIBDIR}) +-INSTALL(FILES "contrib/lua-lpeg/lpegre.lua" DESTINATION ${LUALIBDIR}) + + # systemd unit + IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND WANT_SYSTEMD_UNITS MATCHES "ON") +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 9a34d2ac4..54b2e4083 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -180,7 +180,6 @@ ENDIF() + TARGET_LINK_LIBRARIES(rspamd-server rspamd-http-parser) + TARGET_LINK_LIBRARIES(rspamd-server rspamd-fpconv) + TARGET_LINK_LIBRARIES(rspamd-server rspamd-cdb) +-TARGET_LINK_LIBRARIES(rspamd-server rspamd-lpeg) + TARGET_LINK_LIBRARIES(rspamd-server lcbtrie) + TARGET_LINK_LIBRARIES(rspamd-server rspamd-zstd) + TARGET_LINK_LIBRARIES(rspamd-server rspamd-fastutf8) +@@ -189,10 +188,6 @@ IF (ENABLE_CLANG_PLUGIN MATCHES "ON") + ADD_DEPENDENCIES(rspamd-server rspamd-clang) + ENDIF() + +-IF (NOT WITH_LUAJIT) +- TARGET_LINK_LIBRARIES(rspamd-server rspamd-bit) +-ENDIF() +- + IF (ENABLE_SNOWBALL MATCHES "ON") + TARGET_LINK_LIBRARIES(rspamd-server stemmer) + ENDIF() +diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c +index b7fcc2034..b8120af97 100644 +--- a/src/lua/lua_common.c ++++ b/src/lua/lua_common.c +@@ -14,7 +14,6 @@ + * limitations under the License. + */ + #include "lua_common.h" +-#include "lptree.h" + #include "utlist.h" + #include "unix-std.h" + #include "ottery.h" +@@ -922,10 +921,6 @@ rspamd_lua_wipe_realloc (void *ud, + return NULL; + } + +-#ifndef WITH_LUAJIT +-extern int luaopen_bit(lua_State *L); +-#endif +- + lua_State * + rspamd_lua_init (bool wipe_mem) + { +@@ -981,7 +976,6 @@ rspamd_lua_init (bool wipe_mem) + luaopen_spf (L); + luaopen_tensor (L); + #ifndef WITH_LUAJIT +- rspamd_lua_add_preload (L, "bit", luaopen_bit); + lua_settop (L, 0); + #endif + +@@ -991,7 +985,6 @@ rspamd_lua_init (bool wipe_mem) + rspamd_lua_new_class (L, "rspamd{session}", NULL); + lua_pop (L, 1); + +- rspamd_lua_add_preload (L, "lpeg", luaopen_lpeg); + luaopen_ucl (L); + rspamd_lua_add_preload (L, "ucl", luaopen_ucl); + diff --git a/mail-filter/rspamd/files/rspamd-2.6-unbundle-zstd.patch b/mail-filter/rspamd/files/rspamd-2.6-unbundle-zstd.patch new file mode 100644 index 000000000000..1a7f4453c86f --- /dev/null +++ b/mail-filter/rspamd/files/rspamd-2.6-unbundle-zstd.patch @@ -0,0 +1,128 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 90caf4048..e2e5d182c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -198,6 +198,8 @@ ELSE() + ROOT ${PCRE_ROOT_DIR} MODULES pcre libpcre pcre3 libpcre3) + ENDIF() + ++ProcessPackage(ZSTD LIBRARY zstd INCLUDE zstd.h ++ ROOT ${ZSTD_ROOT_DIR} MODULES libzstd) + ProcessPackage(SQLITE3 LIBRARY sqlite3 INCLUDE sqlite3.h INCLUDE_SUFFIXES include/sqlite3 include/sqlite + ROOT ${SQLITE3_ROOT_DIR} MODULES sqlite3 sqlite) + ProcessPackage(ICUDATA LIBRARY icudata INCLUDE unicode/ucnv.h +@@ -615,7 +617,6 @@ ADD_SUBDIRECTORY(contrib/http-parser) + ADD_SUBDIRECTORY(contrib/fpconv) + ADD_SUBDIRECTORY(contrib/lc-btrie) + ADD_SUBDIRECTORY(contrib/libottery) +-ADD_SUBDIRECTORY(contrib/zstd) + IF(ENABLE_SNOWBALL MATCHES "ON") + ADD_SUBDIRECTORY(contrib/snowball) + SET(WITH_SNOWBALL 1) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 54b2e4083..e0e2edd58 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -181,7 +181,6 @@ TARGET_LINK_LIBRARIES(rspamd-server rspamd-http-parser) + TARGET_LINK_LIBRARIES(rspamd-server rspamd-fpconv) + TARGET_LINK_LIBRARIES(rspamd-server rspamd-cdb) + TARGET_LINK_LIBRARIES(rspamd-server lcbtrie) +-TARGET_LINK_LIBRARIES(rspamd-server rspamd-zstd) + TARGET_LINK_LIBRARIES(rspamd-server rspamd-fastutf8) + + IF (ENABLE_CLANG_PLUGIN MATCHES "ON") +diff --git a/src/client/rspamdclient.c b/src/client/rspamdclient.c +index bcb25672e..48ca58e94 100644 +--- a/src/client/rspamdclient.c ++++ b/src/client/rspamdclient.c +@@ -19,7 +19,7 @@ + #include "libserver/http/http_private.h" + #include "libserver/protocol_internal.h" + #include "unix-std.h" +-#include "contrib/zstd/zstd.h" ++#include + + #ifdef HAVE_FETCH_H + #include +diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c +index 78e3fc79f..40110c693 100644 +--- a/src/libserver/cfg_utils.c ++++ b/src/libserver/cfg_utils.c +@@ -36,8 +36,7 @@ + #include "contrib/libottery/ottery.h" + #include "contrib/fastutf8/fastutf8.h" + +-#define ZSTD_STATIC_LINKING_ONLY +-#include "contrib/zstd/zstd.h" ++#include + + #ifdef HAVE_OPENSSL + #include +diff --git a/src/libserver/maps/map.c b/src/libserver/maps/map.c +index 8b9f522b2..8cf03ffd6 100644 +--- a/src/libserver/maps/map.c ++++ b/src/libserver/maps/map.c +@@ -23,7 +23,7 @@ + #include "libserver/http/http_connection.h" + #include "libserver/http/http_private.h" + #include "rspamd.h" +-#include "contrib/zstd/zstd.h" ++#include + #include "contrib/libev/ev.h" + #include "contrib/uthash/utlist.h" + +diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c +index 9d1276064..6f0a66fb8 100644 +--- a/src/libserver/protocol.c ++++ b/src/libserver/protocol.c +@@ -21,7 +21,7 @@ + #include "worker_private.h" + #include "libserver/cfg_file_private.h" + #include "libmime/scan_result_private.h" +-#include "contrib/zstd/zstd.h" ++#include + #include "lua/lua_common.h" + #include "unix-std.h" + #include "protocol_internal.h" +diff --git a/src/libserver/task.c b/src/libserver/task.c +index 53da0dae6..6538abdbf 100644 +--- a/src/libserver/task.c ++++ b/src/libserver/task.c +@@ -25,7 +25,7 @@ + #include "stat_api.h" + #include "unix-std.h" + #include "utlist.h" +-#include "contrib/zstd/zstd.h" ++#include + #include "libserver/mempool_vars_internal.h" + #include "libserver/cfg_file_private.h" + #include "libmime/lang_detection.h" +diff --git a/src/lua/lua_util.c b/src/lua/lua_util.c +index 0787736d5..21474317a 100644 +--- a/src/lua/lua_util.c ++++ b/src/lua/lua_util.c +@@ -17,7 +17,7 @@ + #include "html.h" + #include "tokenizers/tokenizers.h" + #include "unix-std.h" +-#include "contrib/zstd/zstd.h" ++#include + #include "contrib/uthash/utlist.h" + #include "libmime/email_addr.h" + #include "libmime/content_type.h" +diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c +index 4ed8cfab7..5f8808e40 100644 +--- a/src/rspamd_proxy.c ++++ b/src/rspamd_proxy.c +@@ -36,7 +36,7 @@ + #include "libserver/milter.h" + #include "libserver/milter_internal.h" + #include "libmime/lang_detection.h" +-#include "contrib/zstd/zstd.h" ++#include + + #include + +-- +2.26.2 + diff --git a/mail-filter/rspamd/files/rspamd-9999-unbundle-hiredis.patch b/mail-filter/rspamd/files/rspamd-9999-unbundle-hiredis.patch deleted file mode 100644 index 875009da41aa..000000000000 --- a/mail-filter/rspamd/files/rspamd-9999-unbundle-hiredis.patch +++ /dev/null @@ -1,93 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 0afb5feff..966173075 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -170,6 +170,8 @@ ELSE() - ROOT ${PCRE_ROOT_DIR} MODULES pcre libpcre pcre3 libpcre3) - ENDIF() - -+ProcessPackage(HIREDIS LIBRARY hiredis INCLUDE hiredis.h -+ ROOT ${HIREDIS_ROOT_DIR} MODULES hiredis) - ProcessPackage(ZSTD LIBRARY zstd INCLUDE zstd.h - ROOT ${ZSTD_ROOT_DIR} MODULES libzstd) - ProcessPackage(SQLITE3 LIBRARY sqlite3 INCLUDE sqlite3.h INCLUDE_SUFFIXES include/sqlite3 include/sqlite -@@ -555,9 +557,7 @@ ENDIF(NOT DESTDIR) - - - ################################ SUBDIRS SECTION ########################### --ADD_SUBDIRECTORY(contrib/hiredis) - SET(WITH_HIREDIS 1) --INCLUDE_DIRECTORIES(BEFORE "${CMAKE_SOURCE_DIR}/contrib/hiredis") - - LIST(APPEND RSPAMD_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") - IF(HAVE_FETCH_H) -@@ -604,7 +604,6 @@ ENDIF() - IF (ENABLE_SNOWBALL MATCHES "ON") - LIST(APPEND RSPAMD_REQUIRED_LIBRARIES stemmer) - ENDIF() --LIST(APPEND RSPAMD_REQUIRED_LIBRARIES rspamd-hiredis) - - LIST(APPEND RSPAMD_REQUIRED_LIBRARIES rspamd-actrie) - LIST(APPEND RSPAMD_REQUIRED_LIBRARIES rspamd-t1ha) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index e0e2edd58..4908013da 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -190,7 +190,6 @@ ENDIF() - IF (ENABLE_SNOWBALL MATCHES "ON") - TARGET_LINK_LIBRARIES(rspamd-server stemmer) - ENDIF() --TARGET_LINK_LIBRARIES(rspamd-server rspamd-hiredis) - - IF (ENABLE_FANN MATCHES "ON") - TARGET_LINK_LIBRARIES(rspamd-server fann) -diff --git a/src/libserver/fuzzy_backend/fuzzy_backend_redis.c b/src/libserver/fuzzy_backend/fuzzy_backend_redis.c -index d1e3e7532..882acdf6a 100644 ---- a/src/libserver/fuzzy_backend/fuzzy_backend_redis.c -+++ b/src/libserver/fuzzy_backend/fuzzy_backend_redis.c -@@ -22,8 +22,8 @@ - #include "cryptobox.h" - #include "str_util.h" - #include "upstream.h" --#include "contrib/hiredis/hiredis.h" --#include "contrib/hiredis/async.h" -+#include -+#include - #include "lua/lua_common.h" - - #define REDIS_DEFAULT_PORT 6379 -diff --git a/src/libserver/redis_pool.c b/src/libserver/redis_pool.c -index 7e835013c..fccf189e1 100644 ---- a/src/libserver/redis_pool.c -+++ b/src/libserver/redis_pool.c -@@ -18,9 +18,9 @@ - #include "contrib/libev/ev.h" - #include "redis_pool.h" - #include "cfg_file.h" --#include "contrib/hiredis/hiredis.h" --#include "contrib/hiredis/async.h" --#include "contrib/hiredis/adapters/libev.h" -+#include -+#include -+#include - #include "cryptobox.h" - #include "logger.h" - -diff --git a/src/lua/lua_redis.c b/src/lua/lua_redis.c -index f9dbbdd13..b885a8b61 100644 ---- a/src/lua/lua_redis.c -+++ b/src/lua/lua_redis.c -@@ -17,8 +17,8 @@ - #include "lua_thread_pool.h" - #include "utlist.h" - --#include "contrib/hiredis/hiredis.h" --#include "contrib/hiredis/async.h" -+#include -+#include - - #define REDIS_DEFAULT_TIMEOUT 1.0 - --- -2.25.3 - diff --git a/mail-filter/rspamd/files/rspamd-9999-unbundle-lua.patch b/mail-filter/rspamd/files/rspamd-9999-unbundle-lua.patch deleted file mode 100644 index c6f6324befc7..000000000000 --- a/mail-filter/rspamd/files/rspamd-9999-unbundle-lua.patch +++ /dev/null @@ -1,101 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b794b9dbd..90caf4048 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -111,7 +111,6 @@ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/" - "${CMAKE_SOURCE_DIR}/contrib/librdns" - "${CMAKE_SOURCE_DIR}/contrib/aho-corasick" - "${CMAKE_SOURCE_DIR}/contrib/lc-btrie" -- "${CMAKE_SOURCE_DIR}/contrib/lua-lpeg" - "${CMAKE_BINARY_DIR}/src" #Stored in the binary dir - "${CMAKE_BINARY_DIR}/src/libcryptobox") - -@@ -624,7 +623,6 @@ ENDIF() - ADD_SUBDIRECTORY(contrib/libucl) - ADD_SUBDIRECTORY(contrib/librdns) - ADD_SUBDIRECTORY(contrib/aho-corasick) --ADD_SUBDIRECTORY(contrib/lua-lpeg) - ADD_SUBDIRECTORY(contrib/t1ha) - ADD_SUBDIRECTORY(contrib/libev) - ADD_SUBDIRECTORY(contrib/kann) -@@ -632,10 +630,6 @@ ADD_SUBDIRECTORY(contrib/fastutf8) - ADD_SUBDIRECTORY(contrib/google-ced) - - --IF (NOT WITH_LUAJIT) -- ADD_SUBDIRECTORY(contrib/lua-bit) --ENDIF() -- - IF (ENABLE_LUA_REPL MATCHES "ON") - ADD_SUBDIRECTORY(contrib/replxx) - SET(WITH_LUA_REPL 1) -@@ -735,7 +729,6 @@ INSTALL(FILES "contrib/lua-fun/fun.lua" DESTINATION ${LUALIBDIR}) - INSTALL(FILES "contrib/lua-argparse/argparse.lua" DESTINATION ${LUALIBDIR}) - INSTALL(FILES "contrib/lua-tableshape/tableshape.lua" DESTINATION ${LUALIBDIR}) - INSTALL(FILES "contrib/lua-lupa/lupa.lua" DESTINATION ${LUALIBDIR}) --INSTALL(FILES "contrib/lua-lpeg/lpegre.lua" DESTINATION ${LUALIBDIR}) - - # systemd unit - IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND WANT_SYSTEMD_UNITS MATCHES "ON") -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 9a34d2ac4..54b2e4083 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -180,7 +180,6 @@ ENDIF() - TARGET_LINK_LIBRARIES(rspamd-server rspamd-http-parser) - TARGET_LINK_LIBRARIES(rspamd-server rspamd-fpconv) - TARGET_LINK_LIBRARIES(rspamd-server rspamd-cdb) --TARGET_LINK_LIBRARIES(rspamd-server rspamd-lpeg) - TARGET_LINK_LIBRARIES(rspamd-server lcbtrie) - TARGET_LINK_LIBRARIES(rspamd-server rspamd-zstd) - TARGET_LINK_LIBRARIES(rspamd-server rspamd-fastutf8) -@@ -189,10 +188,6 @@ IF (ENABLE_CLANG_PLUGIN MATCHES "ON") - ADD_DEPENDENCIES(rspamd-server rspamd-clang) - ENDIF() - --IF (NOT WITH_LUAJIT) -- TARGET_LINK_LIBRARIES(rspamd-server rspamd-bit) --ENDIF() -- - IF (ENABLE_SNOWBALL MATCHES "ON") - TARGET_LINK_LIBRARIES(rspamd-server stemmer) - ENDIF() -diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c -index b7fcc2034..b8120af97 100644 ---- a/src/lua/lua_common.c -+++ b/src/lua/lua_common.c -@@ -14,7 +14,6 @@ - * limitations under the License. - */ - #include "lua_common.h" --#include "lptree.h" - #include "utlist.h" - #include "unix-std.h" - #include "ottery.h" -@@ -922,10 +921,6 @@ rspamd_lua_wipe_realloc (void *ud, - return NULL; - } - --#ifndef WITH_LUAJIT --extern int luaopen_bit(lua_State *L); --#endif -- - lua_State * - rspamd_lua_init (bool wipe_mem) - { -@@ -981,7 +976,6 @@ rspamd_lua_init (bool wipe_mem) - luaopen_spf (L); - luaopen_tensor (L); - #ifndef WITH_LUAJIT -- rspamd_lua_add_preload (L, "bit", luaopen_bit); - lua_settop (L, 0); - #endif - -@@ -991,7 +985,6 @@ rspamd_lua_init (bool wipe_mem) - rspamd_lua_new_class (L, "rspamd{session}", NULL); - lua_pop (L, 1); - -- rspamd_lua_add_preload (L, "lpeg", luaopen_lpeg); - luaopen_ucl (L); - rspamd_lua_add_preload (L, "ucl", luaopen_ucl); - diff --git a/mail-filter/rspamd/files/rspamd-9999-unbundle-zstd.patch b/mail-filter/rspamd/files/rspamd-9999-unbundle-zstd.patch deleted file mode 100644 index 1a7f4453c86f..000000000000 --- a/mail-filter/rspamd/files/rspamd-9999-unbundle-zstd.patch +++ /dev/null @@ -1,128 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 90caf4048..e2e5d182c 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -198,6 +198,8 @@ ELSE() - ROOT ${PCRE_ROOT_DIR} MODULES pcre libpcre pcre3 libpcre3) - ENDIF() - -+ProcessPackage(ZSTD LIBRARY zstd INCLUDE zstd.h -+ ROOT ${ZSTD_ROOT_DIR} MODULES libzstd) - ProcessPackage(SQLITE3 LIBRARY sqlite3 INCLUDE sqlite3.h INCLUDE_SUFFIXES include/sqlite3 include/sqlite - ROOT ${SQLITE3_ROOT_DIR} MODULES sqlite3 sqlite) - ProcessPackage(ICUDATA LIBRARY icudata INCLUDE unicode/ucnv.h -@@ -615,7 +617,6 @@ ADD_SUBDIRECTORY(contrib/http-parser) - ADD_SUBDIRECTORY(contrib/fpconv) - ADD_SUBDIRECTORY(contrib/lc-btrie) - ADD_SUBDIRECTORY(contrib/libottery) --ADD_SUBDIRECTORY(contrib/zstd) - IF(ENABLE_SNOWBALL MATCHES "ON") - ADD_SUBDIRECTORY(contrib/snowball) - SET(WITH_SNOWBALL 1) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 54b2e4083..e0e2edd58 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -181,7 +181,6 @@ TARGET_LINK_LIBRARIES(rspamd-server rspamd-http-parser) - TARGET_LINK_LIBRARIES(rspamd-server rspamd-fpconv) - TARGET_LINK_LIBRARIES(rspamd-server rspamd-cdb) - TARGET_LINK_LIBRARIES(rspamd-server lcbtrie) --TARGET_LINK_LIBRARIES(rspamd-server rspamd-zstd) - TARGET_LINK_LIBRARIES(rspamd-server rspamd-fastutf8) - - IF (ENABLE_CLANG_PLUGIN MATCHES "ON") -diff --git a/src/client/rspamdclient.c b/src/client/rspamdclient.c -index bcb25672e..48ca58e94 100644 ---- a/src/client/rspamdclient.c -+++ b/src/client/rspamdclient.c -@@ -19,7 +19,7 @@ - #include "libserver/http/http_private.h" - #include "libserver/protocol_internal.h" - #include "unix-std.h" --#include "contrib/zstd/zstd.h" -+#include - - #ifdef HAVE_FETCH_H - #include -diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c -index 78e3fc79f..40110c693 100644 ---- a/src/libserver/cfg_utils.c -+++ b/src/libserver/cfg_utils.c -@@ -36,8 +36,7 @@ - #include "contrib/libottery/ottery.h" - #include "contrib/fastutf8/fastutf8.h" - --#define ZSTD_STATIC_LINKING_ONLY --#include "contrib/zstd/zstd.h" -+#include - - #ifdef HAVE_OPENSSL - #include -diff --git a/src/libserver/maps/map.c b/src/libserver/maps/map.c -index 8b9f522b2..8cf03ffd6 100644 ---- a/src/libserver/maps/map.c -+++ b/src/libserver/maps/map.c -@@ -23,7 +23,7 @@ - #include "libserver/http/http_connection.h" - #include "libserver/http/http_private.h" - #include "rspamd.h" --#include "contrib/zstd/zstd.h" -+#include - #include "contrib/libev/ev.h" - #include "contrib/uthash/utlist.h" - -diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c -index 9d1276064..6f0a66fb8 100644 ---- a/src/libserver/protocol.c -+++ b/src/libserver/protocol.c -@@ -21,7 +21,7 @@ - #include "worker_private.h" - #include "libserver/cfg_file_private.h" - #include "libmime/scan_result_private.h" --#include "contrib/zstd/zstd.h" -+#include - #include "lua/lua_common.h" - #include "unix-std.h" - #include "protocol_internal.h" -diff --git a/src/libserver/task.c b/src/libserver/task.c -index 53da0dae6..6538abdbf 100644 ---- a/src/libserver/task.c -+++ b/src/libserver/task.c -@@ -25,7 +25,7 @@ - #include "stat_api.h" - #include "unix-std.h" - #include "utlist.h" --#include "contrib/zstd/zstd.h" -+#include - #include "libserver/mempool_vars_internal.h" - #include "libserver/cfg_file_private.h" - #include "libmime/lang_detection.h" -diff --git a/src/lua/lua_util.c b/src/lua/lua_util.c -index 0787736d5..21474317a 100644 ---- a/src/lua/lua_util.c -+++ b/src/lua/lua_util.c -@@ -17,7 +17,7 @@ - #include "html.h" - #include "tokenizers/tokenizers.h" - #include "unix-std.h" --#include "contrib/zstd/zstd.h" -+#include - #include "contrib/uthash/utlist.h" - #include "libmime/email_addr.h" - #include "libmime/content_type.h" -diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c -index 4ed8cfab7..5f8808e40 100644 ---- a/src/rspamd_proxy.c -+++ b/src/rspamd_proxy.c -@@ -36,7 +36,7 @@ - #include "libserver/milter.h" - #include "libserver/milter_internal.h" - #include "libmime/lang_detection.h" --#include "contrib/zstd/zstd.h" -+#include - - #include - --- -2.26.2 - diff --git a/mail-filter/rspamd/rspamd-2.6.ebuild b/mail-filter/rspamd/rspamd-2.6.ebuild new file mode 100644 index 000000000000..4c166ee4b01a --- /dev/null +++ b/mail-filter/rspamd/rspamd-2.6.ebuild @@ -0,0 +1,119 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake pax-utils systemd tmpfiles + +if [[ ${PV} == *9999 ]] ; then + EGIT_REPO_URI="https://github.com/rspamd/rspamd.git" + inherit git-r3 +else + SRC_URI="https://github.com/rspamd/rspamd/archive/${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~x86" +fi + +DESCRIPTION="Rapid spam filtering system" +HOMEPAGE="https://rspamd.com https://github.com/rspamd/rspamd" +LICENSE="Apache-2.0 Boost-1.0 BSD BSD-1 BSD-2 CC0-1.0 LGPL-3 MIT public-domain unicode ZLIB" +SLOT="0" +IUSE="blas cpu_flags_x86_ssse3 jemalloc +jit libressl pcre2" + +RDEPEND=" + acct-group/rspamd + acct-user/rspamd + app-arch/zstd + dev-db/sqlite:3 + dev-libs/glib:2 + dev-libs/hiredis:= + dev-libs/icu:= + dev-libs/libev + dev-libs/libsodium + dev-libs/snowball-stemmer + net-libs/libnsl + sys-apps/file + blas? ( + virtual/blas + virtual/lapack + ) + cpu_flags_x86_ssse3? ( dev-libs/hyperscan ) + jemalloc? ( dev-libs/jemalloc ) + jit? ( + dev-lang/luajit:2 + dev-lua/lpeg[luajit] + ) + !jit? ( + dev-lang/lua:* + dev-lua/lpeg[-luajit] + dev-lua/LuaBitOp + ) + !libressl? ( dev-libs/openssl:0=[-bindist] ) + libressl? ( dev-libs/libressl:0= ) + pcre2? ( dev-libs/libpcre2[jit=] ) + !pcre2? ( dev-libs/libpcre[jit=] )" +DEPEND="${RDEPEND}" +BDEPEND=" + dev-util/ragel + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}/rspamd-2.6-unbundle-lua.patch" + "${FILESDIR}/rspamd-2.6-unbundle-zstd.patch" + "${FILESDIR}/rspamd-2.5-unbundle-snowball.patch" + "${FILESDIR}/rspamd-2.6-unbundle-hiredis.patch" +) + +src_prepare() { + cmake_src_prepare + + rm -vrf contrib/{hiredis,lua-{bit,lpeg},snowball,zstd} || die + + sed -i -e 's/User=_rspamd/User=rspamd/g' \ + rspamd.service \ + || die +} + +src_configure() { + local mycmakeargs=( + -DCONFDIR=/etc/rspamd + -DRUNDIR=/var/run/rspamd + -DDBDIR=/var/lib/rspamd + -DLOGDIR=/var/log/rspamd + -DENABLE_BLAS=$(usex blas ON OFF) + -DENABLE_HYPERSCAN=$(usex cpu_flags_x86_ssse3 ON OFF) + -DENABLE_JEMALLOC=$(usex jemalloc ON OFF) + -DENABLE_LUAJIT=$(usex jit ON OFF) + -DENABLE_PCRE2=$(usex pcre2 ON OFF) + ) + cmake_src_configure +} + +src_test() { + cmake_src_test +} + +src_install() { + cmake_src_install + + newconfd "${FILESDIR}"/rspamd.conf rspamd + newinitd "${FILESDIR}/rspamd-r7.init" rspamd + systemd_newunit rspamd.service rspamd.service + + newtmpfiles "${FILESDIR}"/${PN}.tmpfile ${PN}.conf + + # Remove mprotect for JIT support + if use jit; then + pax-mark m "${ED}"/usr/bin/rspamd-* "${ED}"/usr/bin/rspamadm-* + fi + + insinto /etc/logrotate.d + newins "${FILESDIR}"/rspamd-r1.logrotate rspamd + + diropts -o rspamd -g rspamd + keepdir /var/{lib,log}/rspamd +} + +pkg_postinst() { + tmpfiles_process "${PN}.conf" +} diff --git a/mail-filter/rspamd/rspamd-9999.ebuild b/mail-filter/rspamd/rspamd-9999.ebuild index cad053757027..4c166ee4b01a 100644 --- a/mail-filter/rspamd/rspamd-9999.ebuild +++ b/mail-filter/rspamd/rspamd-9999.ebuild @@ -58,10 +58,10 @@ BDEPEND=" " PATCHES=( - "${FILESDIR}/rspamd-9999-unbundle-lua.patch" - "${FILESDIR}/rspamd-9999-unbundle-zstd.patch" + "${FILESDIR}/rspamd-2.6-unbundle-lua.patch" + "${FILESDIR}/rspamd-2.6-unbundle-zstd.patch" "${FILESDIR}/rspamd-2.5-unbundle-snowball.patch" - "${FILESDIR}/rspamd-9999-unbundle-hiredis.patch" + "${FILESDIR}/rspamd-2.6-unbundle-hiredis.patch" ) src_prepare() { -- cgit v1.2.3-65-gdbad