From f9e1898e70581acc057e001cb301d091c32cb1df Mon Sep 17 00:00:00 2001 From: Petr Vaněk Date: Wed, 1 Apr 2020 16:33:02 +0200 Subject: mail-filter/rspamd: sync live; unbundle few libraries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Package-Manager: Portage-2.3.89, Repoman-2.3.20 Signed-off-by: Petr Vaněk Signed-off-by: Joonas Niilola --- .../rspamd/files/rspamd-2.5-unbundle-lua.patch | 99 ++++++++++++++++ .../files/rspamd-2.5-unbundle-snowball.patch | 23 ++++ .../rspamd/files/rspamd-2.5-unbundle-zstd.patch | 132 +++++++++++++++++++++ mail-filter/rspamd/rspamd-9999.ebuild | 26 +++- 4 files changed, 277 insertions(+), 3 deletions(-) create mode 100644 mail-filter/rspamd/files/rspamd-2.5-unbundle-lua.patch create mode 100644 mail-filter/rspamd/files/rspamd-2.5-unbundle-snowball.patch create mode 100644 mail-filter/rspamd/files/rspamd-2.5-unbundle-zstd.patch (limited to 'mail-filter') diff --git a/mail-filter/rspamd/files/rspamd-2.5-unbundle-lua.patch b/mail-filter/rspamd/files/rspamd-2.5-unbundle-lua.patch new file mode 100644 index 000000000000..b8deb2d6903b --- /dev/null +++ b/mail-filter/rspamd/files/rspamd-2.5-unbundle-lua.patch @@ -0,0 +1,99 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bbc141170..8e3665c18 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -112,7 +112,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") + +@@ -592,16 +591,11 @@ 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) + ADD_SUBDIRECTORY(contrib/fastutf8) + +-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) +@@ -700,7 +694,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 ce5fff6c5..509ceeb44 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" +@@ -903,10 +902,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) + { +@@ -961,7 +956,6 @@ rspamd_lua_init (bool wipe_mem) + luaopen_kann (L); + luaopen_spf (L); + #ifndef WITH_LUAJIT +- rspamd_lua_add_preload (L, "bit", luaopen_bit); + lua_settop (L, 0); + #endif + +@@ -971,7 +965,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.5-unbundle-snowball.patch b/mail-filter/rspamd/files/rspamd-2.5-unbundle-snowball.patch new file mode 100644 index 000000000000..10b56fa977ad --- /dev/null +++ b/mail-filter/rspamd/files/rspamd-2.5-unbundle-snowball.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ad989f7f2..d08496998 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -108,7 +108,6 @@ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/" + "${CMAKE_SOURCE_DIR}/contrib/libottery" + "${CMAKE_SOURCE_DIR}/contrib/xxhash" + "${CMAKE_SOURCE_DIR}/contrib/cdb" +- "${CMAKE_SOURCE_DIR}/contrib/snowball/include" + "${CMAKE_SOURCE_DIR}/contrib/librdns" + "${CMAKE_SOURCE_DIR}/contrib/aho-corasick" + "${CMAKE_SOURCE_DIR}/contrib/lc-btrie" +@@ -586,7 +585,6 @@ ADD_SUBDIRECTORY(contrib/fpconv) + ADD_SUBDIRECTORY(contrib/lc-btrie) + ADD_SUBDIRECTORY(contrib/libottery) + IF(ENABLE_SNOWBALL MATCHES "ON") +- ADD_SUBDIRECTORY(contrib/snowball) + SET(WITH_SNOWBALL 1) + ENDIF() + ADD_SUBDIRECTORY(contrib/libucl) +-- +2.24.1 + diff --git a/mail-filter/rspamd/files/rspamd-2.5-unbundle-zstd.patch b/mail-filter/rspamd/files/rspamd-2.5-unbundle-zstd.patch new file mode 100644 index 000000000000..e86d70173c64 --- /dev/null +++ b/mail-filter/rspamd/files/rspamd-2.5-unbundle-zstd.patch @@ -0,0 +1,132 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8e3665c18..ad989f7f2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -171,6 +171,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 +@@ -583,7 +585,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 98b51506b..b4ed1cb5e 100644 +--- a/src/client/rspamdclient.c ++++ b/src/client/rspamdclient.c +@@ -19,8 +19,8 @@ + #include "libserver/http/http_private.h" + #include "libserver/protocol_internal.h" + #include "unix-std.h" +-#include "contrib/zstd/zstd.h" +-#include "contrib/zstd/zdict.h" ++#include ++#include + + #ifdef HAVE_FETCH_H + #include +diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c +index d3ad9e210..c7e09c2f9 100644 +--- a/src/libserver/cfg_utils.c ++++ b/src/libserver/cfg_utils.c +@@ -36,9 +36,8 @@ + #include "contrib/libottery/ottery.h" + #include "contrib/fastutf8/fastutf8.h" + +-#define ZSTD_STATIC_LINKING_ONLY +-#include "contrib/zstd/zstd.h" +-#include "contrib/zstd/zdict.h" ++#include ++#include + + #ifdef HAVE_OPENSSL + #include +diff --git a/src/libserver/maps/map.c b/src/libserver/maps/map.c +index a832adc4f..bdc1f8ba0 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 35d50b909..53c23ed51 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 3e8dd381f..150b5d54c 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 91cc18800..d29f8aeaa 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 e9ce9ef5e..a9f3159db 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.24.1 + diff --git a/mail-filter/rspamd/rspamd-9999.ebuild b/mail-filter/rspamd/rspamd-9999.ebuild index ea53c2dbb556..b5d45580a5de 100644 --- a/mail-filter/rspamd/rspamd-9999.ebuild +++ b/mail-filter/rspamd/rspamd-9999.ebuild @@ -22,28 +22,48 @@ 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/icu:= dev-libs/libev dev-libs/libsodium - dev-util/ragel + dev-libs/snowball-stemmer net-libs/libnsl sys-apps/file blas? ( sci-libs/openblas ) cpu_flags_x86_ssse3? ( dev-libs/hyperscan ) jemalloc? ( dev-libs/jemalloc ) - jit? ( dev-lang/luajit:2 ) - !jit? ( dev-lang/lua:* ) + 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.5-unbundle-lua.patch" + "${FILESDIR}/rspamd-2.5-unbundle-zstd.patch" + "${FILESDIR}/rspamd-2.5-unbundle-snowball.patch" +) src_prepare() { cmake_src_prepare + rm -vrf contrib/{lua-{bit,lpeg},snowball,zstd} || die + sed -i -e 's/User=_rspamd/User=rspamd/g' \ rspamd.service \ || die -- cgit v1.2.3-65-gdbad