Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-filter/rspamd/files/, mail-filter/rspamd/
Date: Fri, 02 Oct 2020 07:32:30
Message-Id: 1601623304.08f5c2682300ed9088fc4ead069a4e69fc85b4dc.juippis@gentoo
1 commit: 08f5c2682300ed9088fc4ead069a4e69fc85b4dc
2 Author: Petr Vaněk <arkamar <AT> atlas <DOT> cz>
3 AuthorDate: Tue Sep 1 12:06:43 2020 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Fri Oct 2 07:21:44 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=08f5c268
7
8 mail-filter/rspamd: sync live
9
10 Package-Manager: Portage-3.0.4, Repoman-2.3.23
11 Signed-off-by: Petr Vaněk <arkamar <AT> atlas.cz>
12 Closes: https://github.com/gentoo/gentoo/pull/17345
13 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
14
15 .../files/rspamd-9999-unbundle-hiredis.patch | 93 +++++++++++++++
16 .../rspamd/files/rspamd-9999-unbundle-lua.patch | 101 ++++++++++++++++
17 .../rspamd/files/rspamd-9999-unbundle-zstd.patch | 128 +++++++++++++++++++++
18 mail-filter/rspamd/rspamd-9999.ebuild | 13 ++-
19 4 files changed, 331 insertions(+), 4 deletions(-)
20
21 diff --git a/mail-filter/rspamd/files/rspamd-9999-unbundle-hiredis.patch b/mail-filter/rspamd/files/rspamd-9999-unbundle-hiredis.patch
22 new file mode 100644
23 index 00000000000..875009da41a
24 --- /dev/null
25 +++ b/mail-filter/rspamd/files/rspamd-9999-unbundle-hiredis.patch
26 @@ -0,0 +1,93 @@
27 +diff --git a/CMakeLists.txt b/CMakeLists.txt
28 +index 0afb5feff..966173075 100644
29 +--- a/CMakeLists.txt
30 ++++ b/CMakeLists.txt
31 +@@ -170,6 +170,8 @@ ELSE()
32 + ROOT ${PCRE_ROOT_DIR} MODULES pcre libpcre pcre3 libpcre3)
33 + ENDIF()
34 +
35 ++ProcessPackage(HIREDIS LIBRARY hiredis INCLUDE hiredis.h
36 ++ ROOT ${HIREDIS_ROOT_DIR} MODULES hiredis)
37 + ProcessPackage(ZSTD LIBRARY zstd INCLUDE zstd.h
38 + ROOT ${ZSTD_ROOT_DIR} MODULES libzstd)
39 + ProcessPackage(SQLITE3 LIBRARY sqlite3 INCLUDE sqlite3.h INCLUDE_SUFFIXES include/sqlite3 include/sqlite
40 +@@ -555,9 +557,7 @@ ENDIF(NOT DESTDIR)
41 +
42 +
43 + ################################ SUBDIRS SECTION ###########################
44 +-ADD_SUBDIRECTORY(contrib/hiredis)
45 + SET(WITH_HIREDIS 1)
46 +-INCLUDE_DIRECTORIES(BEFORE "${CMAKE_SOURCE_DIR}/contrib/hiredis")
47 +
48 + LIST(APPEND RSPAMD_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
49 + IF(HAVE_FETCH_H)
50 +@@ -604,7 +604,6 @@ ENDIF()
51 + IF (ENABLE_SNOWBALL MATCHES "ON")
52 + LIST(APPEND RSPAMD_REQUIRED_LIBRARIES stemmer)
53 + ENDIF()
54 +-LIST(APPEND RSPAMD_REQUIRED_LIBRARIES rspamd-hiredis)
55 +
56 + LIST(APPEND RSPAMD_REQUIRED_LIBRARIES rspamd-actrie)
57 + LIST(APPEND RSPAMD_REQUIRED_LIBRARIES rspamd-t1ha)
58 +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
59 +index e0e2edd58..4908013da 100644
60 +--- a/src/CMakeLists.txt
61 ++++ b/src/CMakeLists.txt
62 +@@ -190,7 +190,6 @@ ENDIF()
63 + IF (ENABLE_SNOWBALL MATCHES "ON")
64 + TARGET_LINK_LIBRARIES(rspamd-server stemmer)
65 + ENDIF()
66 +-TARGET_LINK_LIBRARIES(rspamd-server rspamd-hiredis)
67 +
68 + IF (ENABLE_FANN MATCHES "ON")
69 + TARGET_LINK_LIBRARIES(rspamd-server fann)
70 +diff --git a/src/libserver/fuzzy_backend/fuzzy_backend_redis.c b/src/libserver/fuzzy_backend/fuzzy_backend_redis.c
71 +index d1e3e7532..882acdf6a 100644
72 +--- a/src/libserver/fuzzy_backend/fuzzy_backend_redis.c
73 ++++ b/src/libserver/fuzzy_backend/fuzzy_backend_redis.c
74 +@@ -22,8 +22,8 @@
75 + #include "cryptobox.h"
76 + #include "str_util.h"
77 + #include "upstream.h"
78 +-#include "contrib/hiredis/hiredis.h"
79 +-#include "contrib/hiredis/async.h"
80 ++#include <hiredis.h>
81 ++#include <async.h>
82 + #include "lua/lua_common.h"
83 +
84 + #define REDIS_DEFAULT_PORT 6379
85 +diff --git a/src/libserver/redis_pool.c b/src/libserver/redis_pool.c
86 +index 7e835013c..fccf189e1 100644
87 +--- a/src/libserver/redis_pool.c
88 ++++ b/src/libserver/redis_pool.c
89 +@@ -18,9 +18,9 @@
90 + #include "contrib/libev/ev.h"
91 + #include "redis_pool.h"
92 + #include "cfg_file.h"
93 +-#include "contrib/hiredis/hiredis.h"
94 +-#include "contrib/hiredis/async.h"
95 +-#include "contrib/hiredis/adapters/libev.h"
96 ++#include <hiredis.h>
97 ++#include <async.h>
98 ++#include <adapters/libev.h>
99 + #include "cryptobox.h"
100 + #include "logger.h"
101 +
102 +diff --git a/src/lua/lua_redis.c b/src/lua/lua_redis.c
103 +index f9dbbdd13..b885a8b61 100644
104 +--- a/src/lua/lua_redis.c
105 ++++ b/src/lua/lua_redis.c
106 +@@ -17,8 +17,8 @@
107 + #include "lua_thread_pool.h"
108 + #include "utlist.h"
109 +
110 +-#include "contrib/hiredis/hiredis.h"
111 +-#include "contrib/hiredis/async.h"
112 ++#include <hiredis.h>
113 ++#include <async.h>
114 +
115 + #define REDIS_DEFAULT_TIMEOUT 1.0
116 +
117 +--
118 +2.25.3
119 +
120
121 diff --git a/mail-filter/rspamd/files/rspamd-9999-unbundle-lua.patch b/mail-filter/rspamd/files/rspamd-9999-unbundle-lua.patch
122 new file mode 100644
123 index 00000000000..c6f6324befc
124 --- /dev/null
125 +++ b/mail-filter/rspamd/files/rspamd-9999-unbundle-lua.patch
126 @@ -0,0 +1,101 @@
127 +diff --git a/CMakeLists.txt b/CMakeLists.txt
128 +index b794b9dbd..90caf4048 100644
129 +--- a/CMakeLists.txt
130 ++++ b/CMakeLists.txt
131 +@@ -111,7 +111,6 @@ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/"
132 + "${CMAKE_SOURCE_DIR}/contrib/librdns"
133 + "${CMAKE_SOURCE_DIR}/contrib/aho-corasick"
134 + "${CMAKE_SOURCE_DIR}/contrib/lc-btrie"
135 +- "${CMAKE_SOURCE_DIR}/contrib/lua-lpeg"
136 + "${CMAKE_BINARY_DIR}/src" #Stored in the binary dir
137 + "${CMAKE_BINARY_DIR}/src/libcryptobox")
138 +
139 +@@ -624,7 +623,6 @@ ENDIF()
140 + ADD_SUBDIRECTORY(contrib/libucl)
141 + ADD_SUBDIRECTORY(contrib/librdns)
142 + ADD_SUBDIRECTORY(contrib/aho-corasick)
143 +-ADD_SUBDIRECTORY(contrib/lua-lpeg)
144 + ADD_SUBDIRECTORY(contrib/t1ha)
145 + ADD_SUBDIRECTORY(contrib/libev)
146 + ADD_SUBDIRECTORY(contrib/kann)
147 +@@ -632,10 +630,6 @@ ADD_SUBDIRECTORY(contrib/fastutf8)
148 + ADD_SUBDIRECTORY(contrib/google-ced)
149 +
150 +
151 +-IF (NOT WITH_LUAJIT)
152 +- ADD_SUBDIRECTORY(contrib/lua-bit)
153 +-ENDIF()
154 +-
155 + IF (ENABLE_LUA_REPL MATCHES "ON")
156 + ADD_SUBDIRECTORY(contrib/replxx)
157 + SET(WITH_LUA_REPL 1)
158 +@@ -735,7 +729,6 @@ INSTALL(FILES "contrib/lua-fun/fun.lua" DESTINATION ${LUALIBDIR})
159 + INSTALL(FILES "contrib/lua-argparse/argparse.lua" DESTINATION ${LUALIBDIR})
160 + INSTALL(FILES "contrib/lua-tableshape/tableshape.lua" DESTINATION ${LUALIBDIR})
161 + INSTALL(FILES "contrib/lua-lupa/lupa.lua" DESTINATION ${LUALIBDIR})
162 +-INSTALL(FILES "contrib/lua-lpeg/lpegre.lua" DESTINATION ${LUALIBDIR})
163 +
164 + # systemd unit
165 + IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND WANT_SYSTEMD_UNITS MATCHES "ON")
166 +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
167 +index 9a34d2ac4..54b2e4083 100644
168 +--- a/src/CMakeLists.txt
169 ++++ b/src/CMakeLists.txt
170 +@@ -180,7 +180,6 @@ ENDIF()
171 + TARGET_LINK_LIBRARIES(rspamd-server rspamd-http-parser)
172 + TARGET_LINK_LIBRARIES(rspamd-server rspamd-fpconv)
173 + TARGET_LINK_LIBRARIES(rspamd-server rspamd-cdb)
174 +-TARGET_LINK_LIBRARIES(rspamd-server rspamd-lpeg)
175 + TARGET_LINK_LIBRARIES(rspamd-server lcbtrie)
176 + TARGET_LINK_LIBRARIES(rspamd-server rspamd-zstd)
177 + TARGET_LINK_LIBRARIES(rspamd-server rspamd-fastutf8)
178 +@@ -189,10 +188,6 @@ IF (ENABLE_CLANG_PLUGIN MATCHES "ON")
179 + ADD_DEPENDENCIES(rspamd-server rspamd-clang)
180 + ENDIF()
181 +
182 +-IF (NOT WITH_LUAJIT)
183 +- TARGET_LINK_LIBRARIES(rspamd-server rspamd-bit)
184 +-ENDIF()
185 +-
186 + IF (ENABLE_SNOWBALL MATCHES "ON")
187 + TARGET_LINK_LIBRARIES(rspamd-server stemmer)
188 + ENDIF()
189 +diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c
190 +index b7fcc2034..b8120af97 100644
191 +--- a/src/lua/lua_common.c
192 ++++ b/src/lua/lua_common.c
193 +@@ -14,7 +14,6 @@
194 + * limitations under the License.
195 + */
196 + #include "lua_common.h"
197 +-#include "lptree.h"
198 + #include "utlist.h"
199 + #include "unix-std.h"
200 + #include "ottery.h"
201 +@@ -922,10 +921,6 @@ rspamd_lua_wipe_realloc (void *ud,
202 + return NULL;
203 + }
204 +
205 +-#ifndef WITH_LUAJIT
206 +-extern int luaopen_bit(lua_State *L);
207 +-#endif
208 +-
209 + lua_State *
210 + rspamd_lua_init (bool wipe_mem)
211 + {
212 +@@ -981,7 +976,6 @@ rspamd_lua_init (bool wipe_mem)
213 + luaopen_spf (L);
214 + luaopen_tensor (L);
215 + #ifndef WITH_LUAJIT
216 +- rspamd_lua_add_preload (L, "bit", luaopen_bit);
217 + lua_settop (L, 0);
218 + #endif
219 +
220 +@@ -991,7 +985,6 @@ rspamd_lua_init (bool wipe_mem)
221 + rspamd_lua_new_class (L, "rspamd{session}", NULL);
222 + lua_pop (L, 1);
223 +
224 +- rspamd_lua_add_preload (L, "lpeg", luaopen_lpeg);
225 + luaopen_ucl (L);
226 + rspamd_lua_add_preload (L, "ucl", luaopen_ucl);
227 +
228
229 diff --git a/mail-filter/rspamd/files/rspamd-9999-unbundle-zstd.patch b/mail-filter/rspamd/files/rspamd-9999-unbundle-zstd.patch
230 new file mode 100644
231 index 00000000000..1a7f4453c86
232 --- /dev/null
233 +++ b/mail-filter/rspamd/files/rspamd-9999-unbundle-zstd.patch
234 @@ -0,0 +1,128 @@
235 +diff --git a/CMakeLists.txt b/CMakeLists.txt
236 +index 90caf4048..e2e5d182c 100644
237 +--- a/CMakeLists.txt
238 ++++ b/CMakeLists.txt
239 +@@ -198,6 +198,8 @@ ELSE()
240 + ROOT ${PCRE_ROOT_DIR} MODULES pcre libpcre pcre3 libpcre3)
241 + ENDIF()
242 +
243 ++ProcessPackage(ZSTD LIBRARY zstd INCLUDE zstd.h
244 ++ ROOT ${ZSTD_ROOT_DIR} MODULES libzstd)
245 + ProcessPackage(SQLITE3 LIBRARY sqlite3 INCLUDE sqlite3.h INCLUDE_SUFFIXES include/sqlite3 include/sqlite
246 + ROOT ${SQLITE3_ROOT_DIR} MODULES sqlite3 sqlite)
247 + ProcessPackage(ICUDATA LIBRARY icudata INCLUDE unicode/ucnv.h
248 +@@ -615,7 +617,6 @@ ADD_SUBDIRECTORY(contrib/http-parser)
249 + ADD_SUBDIRECTORY(contrib/fpconv)
250 + ADD_SUBDIRECTORY(contrib/lc-btrie)
251 + ADD_SUBDIRECTORY(contrib/libottery)
252 +-ADD_SUBDIRECTORY(contrib/zstd)
253 + IF(ENABLE_SNOWBALL MATCHES "ON")
254 + ADD_SUBDIRECTORY(contrib/snowball)
255 + SET(WITH_SNOWBALL 1)
256 +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
257 +index 54b2e4083..e0e2edd58 100644
258 +--- a/src/CMakeLists.txt
259 ++++ b/src/CMakeLists.txt
260 +@@ -181,7 +181,6 @@ TARGET_LINK_LIBRARIES(rspamd-server rspamd-http-parser)
261 + TARGET_LINK_LIBRARIES(rspamd-server rspamd-fpconv)
262 + TARGET_LINK_LIBRARIES(rspamd-server rspamd-cdb)
263 + TARGET_LINK_LIBRARIES(rspamd-server lcbtrie)
264 +-TARGET_LINK_LIBRARIES(rspamd-server rspamd-zstd)
265 + TARGET_LINK_LIBRARIES(rspamd-server rspamd-fastutf8)
266 +
267 + IF (ENABLE_CLANG_PLUGIN MATCHES "ON")
268 +diff --git a/src/client/rspamdclient.c b/src/client/rspamdclient.c
269 +index bcb25672e..48ca58e94 100644
270 +--- a/src/client/rspamdclient.c
271 ++++ b/src/client/rspamdclient.c
272 +@@ -19,7 +19,7 @@
273 + #include "libserver/http/http_private.h"
274 + #include "libserver/protocol_internal.h"
275 + #include "unix-std.h"
276 +-#include "contrib/zstd/zstd.h"
277 ++#include <zstd.h>
278 +
279 + #ifdef HAVE_FETCH_H
280 + #include <fetch.h>
281 +diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c
282 +index 78e3fc79f..40110c693 100644
283 +--- a/src/libserver/cfg_utils.c
284 ++++ b/src/libserver/cfg_utils.c
285 +@@ -36,8 +36,7 @@
286 + #include "contrib/libottery/ottery.h"
287 + #include "contrib/fastutf8/fastutf8.h"
288 +
289 +-#define ZSTD_STATIC_LINKING_ONLY
290 +-#include "contrib/zstd/zstd.h"
291 ++#include <zstd.h>
292 +
293 + #ifdef HAVE_OPENSSL
294 + #include <openssl/rand.h>
295 +diff --git a/src/libserver/maps/map.c b/src/libserver/maps/map.c
296 +index 8b9f522b2..8cf03ffd6 100644
297 +--- a/src/libserver/maps/map.c
298 ++++ b/src/libserver/maps/map.c
299 +@@ -23,7 +23,7 @@
300 + #include "libserver/http/http_connection.h"
301 + #include "libserver/http/http_private.h"
302 + #include "rspamd.h"
303 +-#include "contrib/zstd/zstd.h"
304 ++#include <zstd.h>
305 + #include "contrib/libev/ev.h"
306 + #include "contrib/uthash/utlist.h"
307 +
308 +diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c
309 +index 9d1276064..6f0a66fb8 100644
310 +--- a/src/libserver/protocol.c
311 ++++ b/src/libserver/protocol.c
312 +@@ -21,7 +21,7 @@
313 + #include "worker_private.h"
314 + #include "libserver/cfg_file_private.h"
315 + #include "libmime/scan_result_private.h"
316 +-#include "contrib/zstd/zstd.h"
317 ++#include <zstd.h>
318 + #include "lua/lua_common.h"
319 + #include "unix-std.h"
320 + #include "protocol_internal.h"
321 +diff --git a/src/libserver/task.c b/src/libserver/task.c
322 +index 53da0dae6..6538abdbf 100644
323 +--- a/src/libserver/task.c
324 ++++ b/src/libserver/task.c
325 +@@ -25,7 +25,7 @@
326 + #include "stat_api.h"
327 + #include "unix-std.h"
328 + #include "utlist.h"
329 +-#include "contrib/zstd/zstd.h"
330 ++#include <zstd.h>
331 + #include "libserver/mempool_vars_internal.h"
332 + #include "libserver/cfg_file_private.h"
333 + #include "libmime/lang_detection.h"
334 +diff --git a/src/lua/lua_util.c b/src/lua/lua_util.c
335 +index 0787736d5..21474317a 100644
336 +--- a/src/lua/lua_util.c
337 ++++ b/src/lua/lua_util.c
338 +@@ -17,7 +17,7 @@
339 + #include "html.h"
340 + #include "tokenizers/tokenizers.h"
341 + #include "unix-std.h"
342 +-#include "contrib/zstd/zstd.h"
343 ++#include <zstd.h>
344 + #include "contrib/uthash/utlist.h"
345 + #include "libmime/email_addr.h"
346 + #include "libmime/content_type.h"
347 +diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c
348 +index 4ed8cfab7..5f8808e40 100644
349 +--- a/src/rspamd_proxy.c
350 ++++ b/src/rspamd_proxy.c
351 +@@ -36,7 +36,7 @@
352 + #include "libserver/milter.h"
353 + #include "libserver/milter_internal.h"
354 + #include "libmime/lang_detection.h"
355 +-#include "contrib/zstd/zstd.h"
356 ++#include <zstd.h>
357 +
358 + #include <math.h>
359 +
360 +--
361 +2.26.2
362 +
363
364 diff --git a/mail-filter/rspamd/rspamd-9999.ebuild b/mail-filter/rspamd/rspamd-9999.ebuild
365 index b5d45580a5d..cad05375702 100644
366 --- a/mail-filter/rspamd/rspamd-9999.ebuild
367 +++ b/mail-filter/rspamd/rspamd-9999.ebuild
368 @@ -25,13 +25,17 @@ RDEPEND="
369 app-arch/zstd
370 dev-db/sqlite:3
371 dev-libs/glib:2
372 + dev-libs/hiredis:=
373 dev-libs/icu:=
374 dev-libs/libev
375 dev-libs/libsodium
376 dev-libs/snowball-stemmer
377 net-libs/libnsl
378 sys-apps/file
379 - blas? ( sci-libs/openblas )
380 + blas? (
381 + virtual/blas
382 + virtual/lapack
383 + )
384 cpu_flags_x86_ssse3? ( dev-libs/hyperscan )
385 jemalloc? ( dev-libs/jemalloc )
386 jit? (
387 @@ -54,15 +58,16 @@ BDEPEND="
388 "
389
390 PATCHES=(
391 - "${FILESDIR}/rspamd-2.5-unbundle-lua.patch"
392 - "${FILESDIR}/rspamd-2.5-unbundle-zstd.patch"
393 + "${FILESDIR}/rspamd-9999-unbundle-lua.patch"
394 + "${FILESDIR}/rspamd-9999-unbundle-zstd.patch"
395 "${FILESDIR}/rspamd-2.5-unbundle-snowball.patch"
396 + "${FILESDIR}/rspamd-9999-unbundle-hiredis.patch"
397 )
398
399 src_prepare() {
400 cmake_src_prepare
401
402 - rm -vrf contrib/{lua-{bit,lpeg},snowball,zstd} || die
403 + rm -vrf contrib/{hiredis,lua-{bit,lpeg},snowball,zstd} || die
404
405 sed -i -e 's/User=_rspamd/User=rspamd/g' \
406 rspamd.service \