diff options
author | Petr Vaněk <arkamar@atlas.cz> | 2022-11-05 20:20:21 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-11-06 06:16:51 +0000 |
commit | e22b9e780258d9aede2b057cff5e7ab8b9c6af2f (patch) | |
tree | 49dea73fde270b21ba12377f82d03199dcb7ec45 /mail-filter | |
parent | app-admin/sudo: Stabilize 1.9.12_p1 ppc64, #879953 (diff) | |
download | gentoo-e22b9e780258d9aede2b057cff5e7ab8b9c6af2f.tar.gz gentoo-e22b9e780258d9aede2b057cff5e7ab8b9c6af2f.tar.bz2 gentoo-e22b9e780258d9aede2b057cff5e7ab8b9c6af2f.zip |
mail-filter/rspamd: drop 3.0-r4, 3.1-r2, 3.2
Issues from two bugs bellow seems to be fixed in more recent versions.
Closes: https://bugs.gentoo.org/817866
Closes: https://bugs.gentoo.org/828584
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 | 3 | ||||
-rw-r--r-- | mail-filter/rspamd/files/rspamd-3.0-fix-null-dereference.patch | 46 | ||||
-rw-r--r-- | mail-filter/rspamd/files/rspamd-3.0-system-doctest.patch | 72 | ||||
-rw-r--r-- | mail-filter/rspamd/files/rspamd-3.0-system-libfmt.patch | 48 | ||||
-rw-r--r-- | mail-filter/rspamd/rspamd-3.0-r4.ebuild | 128 | ||||
-rw-r--r-- | mail-filter/rspamd/rspamd-3.1-r2.ebuild | 128 | ||||
-rw-r--r-- | mail-filter/rspamd/rspamd-3.2.ebuild | 129 |
7 files changed, 0 insertions, 554 deletions
diff --git a/mail-filter/rspamd/Manifest b/mail-filter/rspamd/Manifest index e0065dc95ea1..cfddb0fa2c14 100644 --- a/mail-filter/rspamd/Manifest +++ b/mail-filter/rspamd/Manifest @@ -1,5 +1,2 @@ DIST rspamd-2.7.tar.gz 5126227 BLAKE2B 70f57dba6ac9abe93d735d42e84bd17a1797035322029577a8e4376409bcee5345d4624925d3dd071bddce038858ebfdce8ee4f87f81b1fc8b1f71ad14e85930 SHA512 8779771baf85ef6ca1d7d2180429072ab1547ab834b073ee9222dcc6494efdd0a23f5e7ac52a777c23fd89296769f5b6f182593e714097c6f11ca7c9165e4ba7 -DIST rspamd-3.0.tar.gz 5535659 BLAKE2B 605ac59b947b49efb026e04d153df5fc0d56c65712def3f2c54a949db32b8534e634d172a1899cc08e98e0a9da839fc00f0f569dc8c52a743f38bd71b8abaeaa SHA512 1ea6f9ffe58b7f280dbd31e39db6412ebeddda634ca8a669fa5bff2951d17123a5d4a09ec0f366c6b0c0b585f868e646fd49e4d45bd451408675b927ec2557c4 -DIST rspamd-3.1.tar.gz 5566920 BLAKE2B dfb31534e7dbce303729e89537f83eea90d6524a0ccf81633e0d55840f21936985ba5991f2a2ed9ca5594a4a3938f9366f7a1879fc553f41ab52bb89460b87dc SHA512 3c3c06c10d3dfc90e4bc92c7ebaff4bd4854d3b0e56d6476f0223918c4a52f4cc7a8b381b1f867164199ee18ea00eda77ae0315925f3fd71596d610200667178 -DIST rspamd-3.2.tar.gz 5637835 BLAKE2B 8d42b34dacdc818689fd8602abf8c4d5ff2431eb30b2d8fae6e78642ce4361d39a54cb4b981c58cd31205b0f2013978896081e0d7364620312db3fa855d14b1e SHA512 fd3570da24d7f09f48ba6e98c210789b85006c51adaf37336c83a570ef5b9239d4a09491b647464254d3600fbea7c662ec271e9a77ee4108236962490c677a79 DIST rspamd-3.3.tar.gz 5680874 BLAKE2B 2fbafabc0a59ca4ad1bbdc1b7ceb5b5bc281dc75d2997ac50c080cdf5ced2582409e3f98b63239bab64fafbcc63016d857967fe00c371a6d5b896d170f5da4a9 SHA512 02c5e62cb9ce32cdd6da859c4afe2bf03fcaff456d79f68ab7c3c288a0b36f11a701825c3cb7f0ecaccd419f84ce693961c1ed955ce4dbcfe291a8e978e2e69c diff --git a/mail-filter/rspamd/files/rspamd-3.0-fix-null-dereference.patch b/mail-filter/rspamd/files/rspamd-3.0-fix-null-dereference.patch deleted file mode 100644 index d355f701a273..000000000000 --- a/mail-filter/rspamd/files/rspamd-3.0-fix-null-dereference.patch +++ /dev/null @@ -1,46 +0,0 @@ -From abea3ac21f764658a966dad475fc99e4b79530d7 Mon Sep 17 00:00:00 2001 -From: Jan Smutny <js@excello.cz> -Date: Tue, 31 Aug 2021 14:25:23 +0200 -Subject: [PATCH] [Fix] src/lua/lua_mimepart.c: fix null dereference - ---- - -This patch is taken from upstream. It fixes possible runtime segfaults. - -PR: https://github.com/rspamd/rspamd/pull/3873 - -diff --git a/src/lua/lua_mimepart.c b/src/lua/lua_mimepart.c -index 66b588e3a..21a46d496 100644 ---- a/src/lua/lua_mimepart.c -+++ b/src/lua/lua_mimepart.c -@@ -1240,7 +1240,16 @@ lua_textpart_get_fuzzy_hashes (lua_State * L) - rspamd_stat_token_t *word; - struct lua_shingle_filter_cbdata cbd; - -- if (part && pool) { -+ -+ if (part == NULL || pool == NULL) { -+ return luaL_error (L, "invalid arguments"); -+ } -+ -+ if (IS_TEXT_PART_EMPTY (part) || part->utf_words == NULL) { -+ lua_pushnil (L); -+ lua_pushnil (L); -+ } -+ else { - /* TODO: add keys and algorithms support */ - rspamd_cryptobox_hash (key, "rspamd", strlen ("rspamd"), NULL, 0); - -@@ -1294,9 +1303,6 @@ lua_textpart_get_fuzzy_hashes (lua_State * L) - } - } - } -- else { -- return luaL_error (L, "invalid arguments"); -- } - - return 2; - } --- -2.31.1 - diff --git a/mail-filter/rspamd/files/rspamd-3.0-system-doctest.patch b/mail-filter/rspamd/files/rspamd-3.0-system-doctest.patch deleted file mode 100644 index bb315ee7a459..000000000000 --- a/mail-filter/rspamd/files/rspamd-3.0-system-doctest.patch +++ /dev/null @@ -1,72 +0,0 @@ -From d37a3764e9889e6de0a7341ba3195ee8a314de23 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Petr=20Van=C4=9Bk?= <arkamar@atlas.cz> -Date: Wed, 1 Sep 2021 13:30:56 +0200 -Subject: [PATCH] Add SYSTEM_DOCTEST cmake option - -This gives packagers option to use system version of doctest rather than -bundled one. It is disabled by default. Additionally, there is no need -to link rspamd-test-cxx with doctest as it is is single header library. - -Main reason for this change is that currently bundled version of -doctest-2.4.5 can't compile with glibc-2.34 [1]. However, this issue was -already fixed in upstream doctest-2.4.6 [2] in commit [3]. With this, -packagers can just bump doctest to fixed version. - -[1] https://github.com/onqtam/doctest/issues/473 -[2] https://github.com/onqtam/doctest/blob/master/CHANGELOG.md#246-2021-03-22 -[3] https://github.com/onqtam/doctest/commit/099d5414e97244ec44cf46b14cd176b3a3dc52e3 ---- - -Merged-to-upstream: https://github.com/rspamd/rspamd/pull/3875 - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index fc4175677..ced49730d 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -59,6 +59,7 @@ OPTION(ENABLE_LUA_TRACE "Trace all Lua C API invocations [default: OFF]" OFF) - OPTION(ENABLE_LUA_REPL "Enables Lua repl (requires C++11 compiler) [default: ON]" ON) - OPTION(SYSTEM_ZSTD "Use system zstd instead of bundled one [default: OFF]" OFF) - OPTION(SYSTEM_FMT "Use system fmt instead of bundled one [defalut: OFF]" OFF) -+OPTION(SYSTEM_DOCTEST "Use system doctest instead of bundled one [default: OFF]" OFF) - - ############################# INCLUDE SECTION ############################################# - -@@ -118,7 +119,6 @@ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/" - "${CMAKE_SOURCE_DIR}/contrib/lc-btrie" - "${CMAKE_SOURCE_DIR}/contrib/lua-lpeg" - "${CMAKE_SOURCE_DIR}/contrib/frozen/include" -- "${CMAKE_SOURCE_DIR}/contrib/doctest" - "${CMAKE_SOURCE_DIR}/contrib/fu2/include" - "${CMAKE_BINARY_DIR}/src" #Stored in the binary dir - "${CMAKE_BINARY_DIR}/src/libcryptobox") -@@ -656,7 +656,12 @@ IF(SYSTEM_FMT MATCHES "OFF") - ELSE() - find_package(fmt) - ENDIF() --ADD_SUBDIRECTORY(contrib/doctest) -+IF(SYSTEM_DOCTEST MATCHES "OFF") -+ ADD_SUBDIRECTORY(contrib/doctest) -+ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/contrib/doctest") -+ELSE() -+ find_package(doctest) -+ENDIF() - - IF (NOT WITH_LUAJIT) - ADD_SUBDIRECTORY(contrib/lua-bit) -diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt -index 9e56cbad7..08e9556f3 100644 ---- a/test/CMakeLists.txt -+++ b/test/CMakeLists.txt -@@ -24,9 +24,7 @@ SET(CXXTESTSSRC rspamd_cxx_unit.cxx) - ADD_EXECUTABLE(rspamd-test-cxx EXCLUDE_FROM_ALL ${CXXTESTSSRC}) - SET_TARGET_PROPERTIES(rspamd-test-cxx PROPERTIES LINKER_LANGUAGE CXX) - ADD_DEPENDENCIES(rspamd-test-cxx rspamd-server) --ADD_DEPENDENCIES(rspamd-test-cxx doctest) - TARGET_LINK_LIBRARIES(rspamd-test-cxx PRIVATE rspamd-server) --TARGET_LINK_LIBRARIES(rspamd-test-cxx PRIVATE doctest) - SET_TARGET_PROPERTIES(rspamd-test-cxx PROPERTIES LINKER_LANGUAGE CXX) - - IF(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}") --- -2.31.1 - diff --git a/mail-filter/rspamd/files/rspamd-3.0-system-libfmt.patch b/mail-filter/rspamd/files/rspamd-3.0-system-libfmt.patch deleted file mode 100644 index a6439b465e92..000000000000 --- a/mail-filter/rspamd/files/rspamd-3.0-system-libfmt.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 309bb213cffb23e6bee98157b53cf5db31f97ef9 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Petr=20Van=C4=9Bk?= <arkamar@atlas.cz> -Date: Sat, 21 Aug 2021 11:24:35 +0200 -Subject: [PATCH] Add SYSTEM_FMT cmake option - -This gives packagers option to use system version of fmt rather than -bundled one. It is disabled by default. ---- - -Merged-to-upstream: https://github.com/rspamd/rspamd/pull/3855 - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2c38758f3..fc4175677 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -58,6 +58,7 @@ OPTION(ENABLE_LIBUNWIND "Use libunwind to print crash traces [default: OFF]" - OPTION(ENABLE_LUA_TRACE "Trace all Lua C API invocations [default: OFF]" OFF) - OPTION(ENABLE_LUA_REPL "Enables Lua repl (requires C++11 compiler) [default: ON]" ON) - OPTION(SYSTEM_ZSTD "Use system zstd instead of bundled one [default: OFF]" OFF) -+OPTION(SYSTEM_FMT "Use system fmt instead of bundled one [defalut: OFF]" OFF) - - ############################# INCLUDE SECTION ############################################# - -@@ -117,7 +118,6 @@ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/" - "${CMAKE_SOURCE_DIR}/contrib/lc-btrie" - "${CMAKE_SOURCE_DIR}/contrib/lua-lpeg" - "${CMAKE_SOURCE_DIR}/contrib/frozen/include" -- "${CMAKE_SOURCE_DIR}/contrib/fmt/include" - "${CMAKE_SOURCE_DIR}/contrib/doctest" - "${CMAKE_SOURCE_DIR}/contrib/fu2/include" - "${CMAKE_BINARY_DIR}/src" #Stored in the binary dir -@@ -650,7 +650,12 @@ ADD_SUBDIRECTORY(contrib/libev) - ADD_SUBDIRECTORY(contrib/kann) - ADD_SUBDIRECTORY(contrib/fastutf8) - ADD_SUBDIRECTORY(contrib/google-ced) --ADD_SUBDIRECTORY(contrib/fmt) -+IF(SYSTEM_FMT MATCHES "OFF") -+ ADD_SUBDIRECTORY(contrib/fmt) -+ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/contrib/fmt/include") -+ELSE() -+ find_package(fmt) -+ENDIF() - ADD_SUBDIRECTORY(contrib/doctest) - - IF (NOT WITH_LUAJIT) --- -2.31.1 - diff --git a/mail-filter/rspamd/rspamd-3.0-r4.ebuild b/mail-filter/rspamd/rspamd-3.0-r4.ebuild deleted file mode 100644 index ad3bcaa4ff19..000000000000 --- a/mail-filter/rspamd/rspamd-3.0-r4.ebuild +++ /dev/null @@ -1,128 +0,0 @@ -# Copyright 1999-2022 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 pcre2 selinux test" -RESTRICT="!test? ( test )" - -# A part of tests use ffi luajit extension -REQUIRED_USE="${LUA_REQUIRED_USE} - test? ( lua_single_target_luajit )" - -RDEPEND="${LUA_DEPS} - $(lua_gen_cond_dep ' - dev-lua/LuaBitOp[${LUA_USEDEP}] - ') - acct-group/rspamd - acct-user/rspamd - app-arch/zstd:= - dev-db/sqlite:3 - dev-cpp/doctest - dev-libs/glib:2 - dev-libs/icu:= - dev-libs/libev - dev-libs/libfmt:= - dev-libs/libsodium:= - dev-libs/snowball-stemmer:= - sys-apps/file - sys-libs/zlib - blas? ( - virtual/blas - virtual/lapack - ) - cpu_flags_x86_ssse3? ( dev-libs/hyperscan ) - jemalloc? ( dev-libs/jemalloc:= ) - dev-libs/openssl:0=[-bindist(-)] - pcre2? ( dev-libs/libpcre2:=[jit=] ) - !pcre2? ( dev-libs/libpcre[jit=] ) - selinux? ( sec-policy/selinux-spamassassin )" -DEPEND="${RDEPEND}" -BDEPEND=" - dev-util/ragel - virtual/pkgconfig -" - -PATCHES=( - "${FILESDIR}/${P}-cmake-lua-version.patch" - "${FILESDIR}/${P}-system-libfmt.patch" - "${FILESDIR}/${P}-system-doctest.patch" - "${FILESDIR}/${P}-fix-null-dereference.patch" - "${FILESDIR}/${PN}-2.6-unbundle-lua.patch" - "${FILESDIR}/${PN}-2.5-unbundle-snowball.patch" -) - -src_prepare() { - cmake_src_prepare - - rm -vrf contrib/{doctest,fmt,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 - - -DSYSTEM_DOCTEST=ON - -DSYSTEM_FMT=ON - -DSYSTEM_ZSTD=ON - - -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_build run-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-3.1-r2.ebuild b/mail-filter/rspamd/rspamd-3.1-r2.ebuild deleted file mode 100644 index ac8b9e2b716a..000000000000 --- a/mail-filter/rspamd/rspamd-3.1-r2.ebuild +++ /dev/null @@ -1,128 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -LUA_COMPAT=( lua5-{1..4} 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 pcre2 selinux test" -RESTRICT="!test? ( test )" - -# A part of tests use ffi luajit extension -REQUIRED_USE="${LUA_REQUIRED_USE} - test? ( lua_single_target_luajit )" - -RDEPEND="${LUA_DEPS} - $(lua_gen_cond_dep ' - dev-lua/LuaBitOp[${LUA_USEDEP}] - ') - 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/libfmt:= - dev-libs/libsodium:= - dev-libs/snowball-stemmer:= - sys-apps/file - sys-libs/zlib - blas? ( - virtual/blas - virtual/lapack - ) - cpu_flags_x86_ssse3? ( dev-libs/hyperscan ) - jemalloc? ( dev-libs/jemalloc:= ) - dev-libs/openssl:0=[-bindist(-)] - pcre2? ( dev-libs/libpcre2:=[jit=] ) - !pcre2? ( dev-libs/libpcre[jit=] ) - selinux? ( sec-policy/selinux-spamassassin )" -DEPEND=" - ${RDEPEND} - dev-cpp/doctest" -BDEPEND=" - dev-util/ragel - virtual/pkgconfig -" - -PATCHES=( - "${FILESDIR}/rspamd-3.0-cmake-lua-version.patch" - "${FILESDIR}/rspamd-2.6-unbundle-lua.patch" - "${FILESDIR}/rspamd-2.5-unbundle-snowball.patch" -) - -src_prepare() { - cmake_src_prepare - - rm -vrf contrib/{doctest,fmt,lua-bit,snowball,zstd} || die - - > cmake/Toolset.cmake || die #827550 - - 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 - - -DSYSTEM_DOCTEST=ON - -DSYSTEM_FMT=ON - -DSYSTEM_ZSTD=ON - - -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_build run-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-3.2.ebuild b/mail-filter/rspamd/rspamd-3.2.ebuild deleted file mode 100644 index 136dcaf7574d..000000000000 --- a/mail-filter/rspamd/rspamd-3.2.ebuild +++ /dev/null @@ -1,129 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -LUA_COMPAT=( lua5-{1..4} 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 selinux test" -RESTRICT="!test? ( test )" - -# A part of tests use ffi luajit extension -REQUIRED_USE="${LUA_REQUIRED_USE} - test? ( lua_single_target_luajit )" - -RDEPEND="${LUA_DEPS} - $(lua_gen_cond_dep ' - dev-lua/LuaBitOp[${LUA_USEDEP}] - dev-lua/lua-argparse[${LUA_USEDEP}] - ') - 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/libfmt:= - dev-libs/libpcre2:=[jit=] - dev-libs/libsodium:= - dev-libs/openssl:0=[-bindist(-)] - dev-libs/snowball-stemmer:= - sys-apps/file - sys-libs/zlib - blas? ( - virtual/blas - virtual/lapack - ) - cpu_flags_x86_ssse3? ( dev-libs/hyperscan ) - jemalloc? ( dev-libs/jemalloc:= ) - selinux? ( sec-policy/selinux-spamassassin ) -" -DEPEND="${RDEPEND} - dev-cpp/doctest -" -BDEPEND=" - dev-util/ragel - virtual/pkgconfig -" - -PATCHES=( - "${FILESDIR}/rspamd-3.0-cmake-lua-version.patch" - "${FILESDIR}/rspamd-3.2-unbundle-lua.patch" - "${FILESDIR}/rspamd-2.5-unbundle-snowball.patch" -) - -src_prepare() { - cmake_src_prepare - - rm -vrf contrib/{doctest,fmt,lua-{argparse,bit},snowball,zstd} || die - - > cmake/Toolset.cmake || die #827550 - - 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 - - -DSYSTEM_DOCTEST=ON - -DSYSTEM_FMT=ON - -DSYSTEM_ZSTD=ON - - -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=ON - ) - cmake_src_configure -} - -src_test() { - cmake_build run-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" -} |