public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-filter/rspamd/, mail-filter/rspamd/files/
Date: Tue, 12 Apr 2022 08:20:30 +0000 (UTC)	[thread overview]
Message-ID: <1649751612.eac08ceb58e0fe52a1932960c290e31d3b0638e3.sam@gentoo> (raw)

commit:     eac08ceb58e0fe52a1932960c290e31d3b0638e3
Author:     Petr Vaněk <arkamar <AT> atlas <DOT> cz>
AuthorDate: Wed Apr  6 21:07:02 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Apr 12 08:20:12 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eac08ceb

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 <AT> atlas.cz>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 mail-filter/rspamd/Manifest                        |   1 +
 .../rspamd/files/rspamd-3.2-unbundle-lua.patch     |  61 ++++++++++
 mail-filter/rspamd/rspamd-3.2.ebuild               | 128 +++++++++++++++++++++
 3 files changed, 190 insertions(+)

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"
+}


             reply	other threads:[~2022-04-12  8:20 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-12  8:20 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-10-02 17:44 [gentoo-commits] repo/gentoo:master commit in: mail-filter/rspamd/, mail-filter/rspamd/files/ Petr Vaněk
2024-07-13 20:43 Petr Vaněk
2024-03-13 17:32 Petr Vaněk
2023-12-03 22:01 Petr Vaněk
2023-08-07 17:22 Sam James
2023-08-07  5:43 Sam James
2022-11-15  0:56 Sam James
2022-11-06  6:17 Sam James
2021-09-07 20:25 Sam James
2021-09-07 20:25 Sam James
2021-08-22  2:50 Sam James
2020-10-08 19:41 Sam James
2020-04-04  8:06 Joonas Niilola
2020-02-24  5:55 Joonas Niilola
2019-12-14  8:41 Joonas Niilola
2019-11-04 11:22 Dirkjan Ochtman
2018-03-11 14:07 Dirkjan Ochtman
2017-06-13 19:52 Dirkjan Ochtman
2016-09-10 14:56 Dirkjan Ochtman
2016-04-26 19:33 Dirkjan Ochtman
2016-01-13 16:30 Dirkjan Ochtman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1649751612.eac08ceb58e0fe52a1932960c290e31d3b0638e3.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox