diff options
author | Petr Vaněk <arkamar@atlas.cz> | 2022-04-06 23:07:02 +0200 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-04-12 09:20:12 +0100 |
commit | eac08ceb58e0fe52a1932960c290e31d3b0638e3 (patch) | |
tree | c82904b0871e6b8a0d8e34b45678c464ad69df4c /mail-filter | |
parent | sys-devel/bmake: add 20220330 (diff) | |
download | gentoo-eac08ceb58e0fe52a1932960c290e31d3b0638e3.tar.gz gentoo-eac08ceb58e0fe52a1932960c290e31d3b0638e3.tar.bz2 gentoo-eac08ceb58e0fe52a1932960c290e31d3b0638e3.zip |
mail-filter/rspamd: add 3.2
- move dev-cpp/doctest from RDEPEND to DEPEND only
- unbundle dev-lua/lua-argparse
- doctest bug #830624 affects this version as well
- use dev-libs/libpcre2 only, it is upstream default and
dev-libs/libpcre is eol
Closes: https://bugs.gentoo.org/836673
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-3.2-unbundle-lua.patch | 61 | ||||
-rw-r--r-- | mail-filter/rspamd/rspamd-3.2.ebuild | 128 |
3 files changed, 190 insertions, 0 deletions
diff --git a/mail-filter/rspamd/Manifest b/mail-filter/rspamd/Manifest index 78c40cf829a4..4875b2720023 100644 --- a/mail-filter/rspamd/Manifest +++ b/mail-filter/rspamd/Manifest @@ -1,3 +1,4 @@ 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 diff --git a/mail-filter/rspamd/files/rspamd-3.2-unbundle-lua.patch b/mail-filter/rspamd/files/rspamd-3.2-unbundle-lua.patch new file mode 100644 index 000000000000..36aed009c6c8 --- /dev/null +++ b/mail-filter/rspamd/files/rspamd-3.2-unbundle-lua.patch @@ -0,0 +1,61 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 096c2e79e..f323bfd40 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -620,10 +620,6 @@ ELSE() + find_package(doctest) + ENDIF() + +-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) +@@ -721,7 +717,6 @@ ENDFOREACH(LUA_LIB) + + # Install lua fun library + 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}) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 77c8756af..e0476bdc1 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -206,10 +206,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 ab411fa66..85787b31e 100644 +--- a/src/lua/lua_common.c ++++ b/src/lua/lua_common.c +@@ -923,10 +923,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) + { +@@ -984,7 +980,6 @@ rspamd_lua_init (bool wipe_mem) + luaopen_parsers (L); + luaopen_compress (L); + #ifndef WITH_LUAJIT +- rspamd_lua_add_preload (L, "bit", luaopen_bit); + lua_settop (L, 0); + #endif + diff --git a/mail-filter/rspamd/rspamd-3.2.ebuild b/mail-filter/rspamd/rspamd-3.2.ebuild new file mode 100644 index 000000000000..fe5f08fba5e9 --- /dev/null +++ b/mail-filter/rspamd/rspamd-3.2.ebuild @@ -0,0 +1,128 @@ +# 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 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 + blas? ( + virtual/blas + virtual/lapack + ) + cpu_flags_x86_ssse3? ( dev-libs/hyperscan ) + jemalloc? ( dev-libs/jemalloc:= ) +" +# This version is also affected with bug #830624 +DEPEND="${RDEPEND} + <dev-cpp/doctest-2.4.7 +" +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" +} |