diff options
author | Petr Vaněk <arkamar@atlas.cz> | 2021-01-09 11:36:58 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2021-01-09 12:33:31 +0000 |
commit | 4cc1b0ce6be1561a2f4e331c06fc4dbb7dd6671e (patch) | |
tree | a0c215cabf55a45b5a8d05124bf0b2a5d837418e /mail-filter | |
parent | x11-plugins/pidgin-telegram: bump to version 1.4.6 (diff) | |
download | gentoo-4cc1b0ce6be1561a2f4e331c06fc4dbb7dd6671e.tar.gz gentoo-4cc1b0ce6be1561a2f4e331c06fc4dbb7dd6671e.tar.bz2 gentoo-4cc1b0ce6be1561a2f4e331c06fc4dbb7dd6671e.zip |
mail-filter/rspamd: bump to 2.7
Closes: https://bugs.gentoo.org/764572
Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Petr Vaněk <arkamar@atlas.cz>
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'mail-filter')
-rw-r--r-- | mail-filter/rspamd/Manifest | 1 | ||||
-rw-r--r-- | mail-filter/rspamd/files/rspamd-2.7-cmake-lua-version.patch | 49 | ||||
-rw-r--r-- | mail-filter/rspamd/files/rspamd-2.7-unbundle-zstd.patch | 125 | ||||
-rw-r--r-- | mail-filter/rspamd/rspamd-2.7-r100.ebuild | 117 | ||||
-rw-r--r-- | mail-filter/rspamd/rspamd-2.7.ebuild | 115 |
5 files changed, 407 insertions, 0 deletions
diff --git a/mail-filter/rspamd/Manifest b/mail-filter/rspamd/Manifest index 7b2fbeee7132..166cfe25a147 100644 --- a/mail-filter/rspamd/Manifest +++ b/mail-filter/rspamd/Manifest @@ -1,2 +1,3 @@ DIST rspamd-2.5.tar.gz 4490310 BLAKE2B 8d117b1b03e8092d0c724a4da4de23dd145f5b22696aa6b4ef1c208ade28f0d143dd783c9173b6987514b2aef9327ff8fd29eeae5e3da3039d2568384e50a697 SHA512 6068309da98eeb75f95188414b12ce9443aef31200853f820646e70e1dbf2d9d1e2c661a86df2183c175cc01cfb09f6a5c7b8ba358901a56ec6cdb9d9fef4540 DIST rspamd-2.6.tar.gz 5079444 BLAKE2B acb9d9471d0bb457da33b4d23e3c75ef87ea26a47e6c731bfd5fbbfe28567244e2bc72fd25ca3408db0928dab4e4ab66596e38cf3eff7cb9690eec59d3b62372 SHA512 79e4c1aa763aef753c8d7b2a941ed92b384e96c25e6d1b3bd1321c5acc0ecb934d033a3bf19cb94c89809fd92edec25192cffe97de9e5251681e1a71216b734a +DIST rspamd-2.7.tar.gz 5126227 BLAKE2B 70f57dba6ac9abe93d735d42e84bd17a1797035322029577a8e4376409bcee5345d4624925d3dd071bddce038858ebfdce8ee4f87f81b1fc8b1f71ad14e85930 SHA512 8779771baf85ef6ca1d7d2180429072ab1547ab834b073ee9222dcc6494efdd0a23f5e7ac52a777c23fd89296769f5b6f182593e714097c6f11ca7c9165e4ba7 diff --git a/mail-filter/rspamd/files/rspamd-2.7-cmake-lua-version.patch b/mail-filter/rspamd/files/rspamd-2.7-cmake-lua-version.patch new file mode 100644 index 000000000000..c8254f1ce95e --- /dev/null +++ b/mail-filter/rspamd/files/rspamd-2.7-cmake-lua-version.patch @@ -0,0 +1,49 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 72382acb6..2335ae4bc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -141,42 +141,8 @@ IF(ENABLE_LUAJIT MATCHES "ON") + ELSE(ENABLE_LUAJIT MATCHES "ON") + + ProcessPackage(LIBLUA LIBRARY "lua" +- "lua-5.3" +- LIB_SUFFIXES "lua5.3" +- INCLUDE lua.h INCLUDE_SUFFIXES +- "include/lua-5.3" +- "include/lua5.3" +- "include/lua53" +- "include/lua" + ROOT ${LUA_ROOT} +- MODULES lua53 +- OPTIONAL) +- +- IF (NOT WITH_LIBLUA) +- ProcessPackage(LIBLUA LIBRARY "lua" +- "lua-5.2" +- LIB_SUFFIXES "lua5.2" +- INCLUDE lua.h INCLUDE_SUFFIXES +- "include/lua-5.2" +- "include/lua5.2" +- "include/lua52" +- "include/lua" +- ROOT ${LUA_ROOT} +- MODULES lua52 +- OPTIONAL) +- +- IF (NOT WITH_LIBLUA) +- ProcessPackage(LIBLUA LIBRARY "lua" +- "lua-5.1" +- INCLUDE lua.h INCLUDE_SUFFIXES +- "include/lua-5.1" +- "include/lua5.1" +- "include/lua51" +- "include/lua" +- ROOT ${LUA_ROOT} +- MODULES lua51) +- ENDIF() +- ENDIF() ++ MODULES lua) + ENDIF(ENABLE_LUAJIT MATCHES "ON") + + IF(ENABLE_JEMALLOC MATCHES "ON" AND NOT SANITIZE) +-- diff --git a/mail-filter/rspamd/files/rspamd-2.7-unbundle-zstd.patch b/mail-filter/rspamd/files/rspamd-2.7-unbundle-zstd.patch new file mode 100644 index 000000000000..f0fc9f8352bd --- /dev/null +++ b/mail-filter/rspamd/files/rspamd-2.7-unbundle-zstd.patch @@ -0,0 +1,125 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 77ad86785..56246807e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -202,6 +202,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 +@@ -619,7 +621,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 <zstd.h> + + #ifdef HAVE_FETCH_H + #include <fetch.h> +diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c +index 987123cbb..51c2e1468 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 <zstd.h> + + #ifdef HAVE_OPENSSL + #include <openssl/rand.h> +diff --git a/src/libserver/maps/map.c b/src/libserver/maps/map.c +index 14792753a..20ca8416e 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 <zstd.h> + #include "contrib/libev/ev.h" + #include "contrib/uthash/utlist.h" + +diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c +index 31b0308cb..62ba3d833 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 <zstd.h> + #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 096933803..f78754ab4 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 <zstd.h> + #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 e879d37af..88451e222 100644 +--- a/src/lua/lua_util.c ++++ b/src/lua/lua_util.c +@@ -15,7 +15,7 @@ + */ + #include "lua_common.h" + #include "unix-std.h" +-#include "contrib/zstd/zstd.h" ++#include <zstd.h> + #include "libmime/email_addr.h" + #include "libmime/content_type.h" + #include "libmime/mime_headers.h" +diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c +index 3fa5da390..c641fb263 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 <zstd.h> + + #include <math.h> + diff --git a/mail-filter/rspamd/rspamd-2.7-r100.ebuild b/mail-filter/rspamd/rspamd-2.7-r100.ebuild new file mode 100644 index 000000000000..0ba250193310 --- /dev/null +++ b/mail-filter/rspamd/rspamd-2.7-r100.ebuild @@ -0,0 +1,117 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +LUA_COMPAT=( lua5-{1..3} luajit ) + +inherit cmake lua-single 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" + +REQUIRED_USE="${LUA_REQUIRED_USE} + jit? ( lua_single_target_luajit )" + +RDEPEND="${LUA_DEPS} + $(lua_gen_cond_dep ' + dev-lua/LuaBitOp[${LUA_USEDEP}] + ' lua5-{1,2}) + 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-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 ) + !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.7-cmake-lua-version.patch" + "${FILESDIR}/rspamd-2.6-unbundle-lua.patch" + "${FILESDIR}/rspamd-2.7-unbundle-zstd.patch" + "${FILESDIR}/rspamd-2.5-unbundle-snowball.patch" +) + +src_prepare() { + cmake_src_prepare + + rm -vrf contrib/{lua-bit,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 lua_single_target_luajit 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 lua_single_target_luajit; 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-2.7.ebuild b/mail-filter/rspamd/rspamd-2.7.ebuild new file mode 100644 index 000000000000..86ced7662db8 --- /dev/null +++ b/mail-filter/rspamd/rspamd-2.7.ebuild @@ -0,0 +1,115 @@ +# Copyright 1999-2021 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/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 + ) + !jit? ( + dev-lang/lua:0= + 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.7-unbundle-zstd.patch" + "${FILESDIR}/rspamd-2.5-unbundle-snowball.patch" +) + +src_prepare() { + cmake_src_prepare + + rm -vrf contrib/{lua-bit,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" +} |