From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-filter/rspamd/files/, mail-filter/rspamd/
Date: Sun, 22 Aug 2021 02:50:12 +0000 (UTC) [thread overview]
Message-ID: <1629600541.9545e21cc8b4178834e21537b9ff74f9c1032412.sam@gentoo> (raw)
commit: 9545e21cc8b4178834e21537b9ff74f9c1032412
Author: Petr Vaněk <arkamar <AT> atlas <DOT> cz>
AuthorDate: Sat Aug 21 20:50:40 2021 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Aug 22 02:49:01 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9545e21c
mail-filter/rspamd: add 3.0
- Use new -DSYSTEM_ZSTD=ON instead of unbundle patch
- Apply patch for -DSYSTEM_FMT=ON, it is already merged in upstream
- Make the src_test work
Closes: https://bugs.gentoo.org/809308
Signed-off-by: Petr Vaněk <arkamar <AT> atlas.cz>
Signed-off-by: Sam James <sam <AT> gentoo.org>
mail-filter/rspamd/Manifest | 1 +
.../files/rspamd-3.0-cmake-lua-version.patch | 64 +++++++++++
.../rspamd/files/rspamd-3.0-system-libfmt.patch | 48 ++++++++
mail-filter/rspamd/rspamd-3.0.ebuild | 123 +++++++++++++++++++++
4 files changed, 236 insertions(+)
diff --git a/mail-filter/rspamd/Manifest b/mail-filter/rspamd/Manifest
index df4f86e665d..48c11b72f36 100644
--- a/mail-filter/rspamd/Manifest
+++ b/mail-filter/rspamd/Manifest
@@ -1,2 +1,3 @@
DIST rspamd-2.6.tar.gz 5079444 BLAKE2B acb9d9471d0bb457da33b4d23e3c75ef87ea26a47e6c731bfd5fbbfe28567244e2bc72fd25ca3408db0928dab4e4ab66596e38cf3eff7cb9690eec59d3b62372 SHA512 79e4c1aa763aef753c8d7b2a941ed92b384e96c25e6d1b3bd1321c5acc0ecb934d033a3bf19cb94c89809fd92edec25192cffe97de9e5251681e1a71216b734a
DIST rspamd-2.7.tar.gz 5126227 BLAKE2B 70f57dba6ac9abe93d735d42e84bd17a1797035322029577a8e4376409bcee5345d4624925d3dd071bddce038858ebfdce8ee4f87f81b1fc8b1f71ad14e85930 SHA512 8779771baf85ef6ca1d7d2180429072ab1547ab834b073ee9222dcc6494efdd0a23f5e7ac52a777c23fd89296769f5b6f182593e714097c6f11ca7c9165e4ba7
+DIST rspamd-3.0.tar.gz 5535659 BLAKE2B 605ac59b947b49efb026e04d153df5fc0d56c65712def3f2c54a949db32b8534e634d172a1899cc08e98e0a9da839fc00f0f569dc8c52a743f38bd71b8abaeaa SHA512 1ea6f9ffe58b7f280dbd31e39db6412ebeddda634ca8a669fa5bff2951d17123a5d4a09ec0f366c6b0c0b585f868e646fd49e4d45bd451408675b927ec2557c4
diff --git a/mail-filter/rspamd/files/rspamd-3.0-cmake-lua-version.patch b/mail-filter/rspamd/files/rspamd-3.0-cmake-lua-version.patch
new file mode 100644
index 00000000000..55665b887c3
--- /dev/null
+++ b/mail-filter/rspamd/files/rspamd-3.0-cmake-lua-version.patch
@@ -0,0 +1,64 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b53793008..5d092d654 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -147,55 +147,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.4"
+- LIB_SUFFIXES "lua5.4"
+- INCLUDE lua.h INCLUDE_SUFFIXES
+- "include/lua-5.4"
+- "include/lua5.4"
+- "include/lua54"
+- "include/lua"
+- ROOT ${LUA_ROOT}
+- MODULES lua54
+- 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()
+- ENDIF()
++ MODULES lua)
+ ENDIF(ENABLE_LUAJIT MATCHES "ON")
+
+ IF(ENABLE_JEMALLOC MATCHES "ON" AND NOT SANITIZE)
+--
+2.26.3
+
diff --git a/mail-filter/rspamd/files/rspamd-3.0-system-libfmt.patch b/mail-filter/rspamd/files/rspamd-3.0-system-libfmt.patch
new file mode 100644
index 00000000000..a6439b465e9
--- /dev/null
+++ b/mail-filter/rspamd/files/rspamd-3.0-system-libfmt.patch
@@ -0,0 +1,48 @@
+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.ebuild b/mail-filter/rspamd/rspamd-3.0.ebuild
new file mode 100644
index 00000000000..1a472d6db57
--- /dev/null
+++ b/mail-filter/rspamd/rspamd-3.0.ebuild
@@ -0,0 +1,123 @@
+# 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 pcre2 test"
+RESTRICT="!test? ( test )"
+
+# A part of tests use ffi luajit extension
+REQUIRED_USE="${LUA_REQUIRED_USE}
+ jit? ( lua_single_target_luajit )
+ test? ( 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/libfmt:=
+ dev-libs/libsodium:=
+ dev-libs/snowball-stemmer
+ sys-apps/file
+ 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=] )"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ dev-util/ragel
+ virtual/pkgconfig
+"
+
+PATCHES=(
+ "${FILESDIR}/${P}-cmake-lua-version.patch"
+ "${FILESDIR}/${P}-system-libfmt.patch"
+ "${FILESDIR}/${PN}-2.6-unbundle-lua.patch"
+ "${FILESDIR}/${PN}-2.5-unbundle-snowball.patch"
+)
+
+src_prepare() {
+ cmake_src_prepare
+
+ rm -vrf contrib/{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_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"
+}
next reply other threads:[~2021-08-22 2:50 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-22 2:50 Sam James [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-05-29 10:59 [gentoo-commits] repo/gentoo:master commit in: mail-filter/rspamd/files/, mail-filter/rspamd/ Andreas Sturmlechner
2023-01-26 7:23 Sam James
2022-12-24 8:59 Andreas Sturmlechner
2022-11-06 6:17 Sam James
2021-01-09 12:33 Sam James
2021-01-09 12:33 Sam James
2021-01-09 12:33 Sam James
2020-11-20 10:12 Joonas Niilola
2020-11-20 10:12 Joonas Niilola
2020-10-07 15:58 Sam James
2020-10-02 7:32 Joonas Niilola
2020-10-02 7:32 Joonas Niilola
2020-04-04 8:06 Joonas Niilola
2019-01-16 3:15 Thomas Deutschmann
2018-03-29 13:41 Dirkjan Ochtman
2017-05-05 9:40 Dirkjan Ochtman
2017-01-03 19:00 Dirkjan Ochtman
2016-12-18 15:41 Dirkjan Ochtman
2016-01-30 15:29 Dirkjan Ochtman
2015-12-26 13:21 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=1629600541.9545e21cc8b4178834e21537b9ff74f9c1032412.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