[packages/rspamd] Up to 4.0.0; rel 0.1 for now

arekm arekm at pld-linux.org
Mon Mar 30 23:23:49 CEST 2026


commit f0ef768047d6d2818456bb7fcdc52a90b2d353af
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Mon Mar 30 23:23:27 2026 +0200

    Up to 4.0.0; rel 0.1 for now

 rspamd.init     |   4 +-
 rspamd.spec     | 242 ++++++++++++++++++++++++++++++++++++--------------------
 rspamd.tmpfiles |   2 +-
 3 files changed, 160 insertions(+), 88 deletions(-)
---
diff --git a/rspamd.spec b/rspamd.spec
index a45eddb..6fc13cb 100644
--- a/rspamd.spec
+++ b/rspamd.spec
@@ -1,104 +1,144 @@
 #
-Summary:	Spam filter to replace spamassassin
+# Conditional build:
+%bcond_without	blas		# OpenBLAS/CBLAS for neural network acceleration
+%bcond_without	hyperscan	# Hyperscan/Vectorscan fast regexp processing
+%bcond_without	jemalloc	# jemalloc allocator
+%bcond_without	system_xxhash	# system xxhash instead of bundled
+%bcond_without	system_zstd	# system zstd instead of bundled
+#
+Summary:	Fast, free and open-source spam filtering system
+Summary(pl.UTF-8):	Szybki, wolny system filtrowania spamu
 Name:		rspamd
-Version:	3.11.1
-Release:	1
+Version:	4.0.0
+Release:	0.1
 License:	Apache v2.0
-Group:		Applications
-Source0:	https://github.com/vstakhov/rspamd/archive/%{version}/%{name}-%{version}.tar.gz
-# Source0-md5:	b9dbae75d993d990fb30d1221f2befa4
+Group:		Networking/Daemons
+Source0:	https://github.com/rspamd/rspamd/archive/%{version}/%{name}-%{version}.tar.gz
+# Source0-md5:	cf16e0556c82b7ba749a8035517e8353
 Source1:	%{name}.tmpfiles
 Source2:	%{name}.init
 Source3:	%{name}.sysconfig
 URL:		https://rspamd.com
-BuildRequires:	rpmbuild(macros) >= 1.228
-Requires(post,preun):	/sbin/chkconfig
-BuildRequires:	cmake
-BuildRequires:	glib2-devel
-BuildRequires:	lapack-devel
-BuildRequires:	libarchive-devel
-BuildRequires:	libevent-devel
-BuildRequires:	libffi-devel
+BuildRequires:	cmake >= 3.15
+BuildRequires:	glib2-devel >= 1:2.28
+BuildRequires:	libarchive-devel >= 3.0.0
 BuildRequires:	libicu-devel
-BuildRequires:	libmagic-devel
-BuildRequires:	libsodium-devel
-BuildRequires:	libunwind-devel
-BuildRequires:	lua51-devel
+BuildRequires:	libsodium-devel >= 1.0.0
+BuildRequires:	libstdc++-devel >= 6:10
 BuildRequires:	luajit-devel
-BuildRequires:	pcre-devel
+BuildRequires:	openssl-devel
+BuildRequires:	pcre2-8-devel
+BuildRequires:	perl-base
 BuildRequires:	pkgconfig
 BuildRequires:	ragel
+BuildRequires:	rpmbuild(macros) >= 1.644
 BuildRequires:	sqlite3-devel
+BuildRequires:	zlib-devel
+%{?with_blas:BuildRequires:	cblas-devel}
+%{?with_blas:BuildRequires:	lapack-devel}
+%{?with_hyperscan:BuildRequires:	vectorscan-devel}
+%{?with_jemalloc:BuildRequires:	jemalloc-devel}
+%{?with_system_xxhash:BuildRequires:	xxHash-devel}
+%{?with_system_zstd:BuildRequires:	zstd-devel}
+Requires(post,preun):	/sbin/chkconfig
+Requires(postun):	/usr/sbin/groupdel
+Requires(postun):	/usr/sbin/userdel
+Requires(pre):	/bin/id
+Requires(pre):	/usr/bin/getgid
+Requires(pre):	/usr/sbin/groupadd
+Requires(pre):	/usr/sbin/useradd
+Requires:	glib2 >= 1:2.28
 Requires:	rc-scripts
+Suggests:	redis-server
 Provides:	group(rspamd)
 Provides:	user(rspamd)
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-# debugsource package fails
-%define         _enable_debug_packages 0
+%define		_libdir		%{_prefix}/lib/%{name}
 
 %description
-Rspamd is a complex spam filter that allows to estimate messages by
-many rules, statistical data and custom services like URL black lists.
-Each message is estimated by rspamd and got so called 'spam score'.
-According to spam score and user's settings rspamd send recommended
-action for this message to MTA. Rspamd has own unique features among
-spam filters:
-
-- event driven architecture allowing to process many messages at a
-  time
-- flexible syntax of rules allowing to write rules in lua language
+Rspamd is a fast, free and open-source spam filtering system. It can
+be integrated with any MTA and provides advanced spam filtering
+through multiple analysis methods including statistical, regexp-based,
+and custom Lua rules.
+
+Key features:
+- event driven architecture allowing to process many messages at a time
+- flexible syntax of rules allowing to write rules in Lua language
+- advanced machine learning based statistical module
 - a lot of plugins and rules shipped with rspamd distribution
+- web interface for configuration and monitoring
 - highly optimized mail processing
-- advanced statistic All these features allow rspamd to process
-  messages fast and make good results in spam filtering.
+
+%description -l pl.UTF-8
+Rspamd to szybki, wolny system filtrowania spamu. Może być
+zintegrowany z dowolnym MTA i zapewnia zaawansowane filtrowanie spamu
+poprzez wiele metod analizy, w tym statystyczne, oparte na wyrażeniach
+regularnych i niestandardowe reguły Lua.
 
 %prep
 %setup -q
 
+%{__sed} -i -e '1s,/usr/bin/env perl,/usr/bin/perl,' utils/rspamd_stats.pl utils/mapstats.pl
+
 %build
 install -d build
 cd build
-%{__cmake} \
+CFLAGS="%{rpmcflags}%{?with_jemalloc: -DJEMALLOC_MANGLE}"
+CXXFLAGS="%{rpmcxxflags}%{?with_jemalloc: -DJEMALLOC_MANGLE}"
+export CFLAGS CXXFLAGS
+%cmake \
 	-DCMAKE_INSTALL_PREFIX=%{_prefix} \
 	-DCONFDIR=%{_sysconfdir}/%{name} \
-	-DLIBDIR=%{_libdir} \
+	-DDBDIR=/var/lib/%{name} \
+	%{?with_blas:-DENABLE_BLAS=ON} \
+	%{?with_hyperscan:-DENABLE_HYPERSCAN=ON} \
+	%{?with_jemalloc:-DENABLE_JEMALLOC=ON} \
+	-DENABLE_LUAJIT=ON \
+	-DENABLE_PCRE2=ON \
+	-DENABLE_SNOWBALL=ON \
+	-DINSTALL_WEBUI=ON \
+	-DLOGDIR=/var/log/%{name} \
+	-DMANDIR=%{_mandir} \
+	-DNO_SHARED=ON \
+	-DRSPAMD_LIBDIR=%{_libdir} \
+	-DRUNDIR=/var/run/%{name} \
+	%{?with_system_xxhash:-DSYSTEM_XXHASH=ON} \
+	%{?with_system_zstd:-DSYSTEM_ZSTD=ON} \
+	-DWANT_SYSTEMD_UNITS=OFF \
 	..
 
 %{__make}
-cd ..
-%{__sed} -i -e '1s,/usr/bin/env perl,/usr/bin/perl,' utils/rspamd_stats.pl
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_sysconfdir}/%{name}/{local.d,override.d}} \
-        $RPM_BUILD_ROOT/var/log/%{name} \
-        $RPM_BUILD_ROOT/var/run/%{name}
-
-install -d $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d
-cp -p %SOURCE1 $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/%{name}.conf
-cp -p %SOURCE2 $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
-cp -p %SOURCE3 $RPM_BUILD_ROOT/etc/sysconfig/%{name}
+install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d,tmpfiles.d} \
+	$RPM_BUILD_ROOT/var/{lib,log,run}/%{name}
 
 %{__make} -C build install \
 	DESTDIR=$RPM_BUILD_ROOT
 
+# move example files to doc directory preserving structure
+install -d examples
+cd $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
+find . -name '*.example' | while read f; do
+	install -D -m 644 "$f" $OLDPWD/examples/"$f"
+	%{__rm} "$f"
+done
+cd -
+
+cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/tmpfiles.d/%{name}.conf
+install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %pre
 %groupadd -g 294 %{name}
-%useradd -u 294 -d /var/lib/%{name} -g %{name} -c "rspamd User" %{name}
-
-%postun
-/sbin/ldconfig
-if [ "$1" = "0" ]; then
-	%userremove %{name}
-	%groupremove %{name}
-fi
+%useradd -u 294 -d /var/lib/%{name} -g %{name} -c "rspamd User" -s /sbin/nologin %{name}
 
 %post
-/sbin/ldconfig
 /sbin/chkconfig --add %{name}
 %service %{name} restart
 
@@ -108,57 +148,78 @@ if [ "$1" = "0" ]; then
 	/sbin/chkconfig --del %{name}
 fi
 
+%postun
+if [ "$1" = "0" ]; then
+	%userremove %{name}
+	%groupremove %{name}
+fi
+
 %files
 %defattr(644,root,root,755)
-%doc ChangeLog LICENSE.md README.md
+%doc LICENSE.md README.md examples
 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
 %attr(754,root,root) /etc/rc.d/init.d/%{name}
-%{_sysconfdir}/tmpfiles.d/rspamd.conf
-%attr(755,root,root) %{_bindir}/rspam*
+/etc/tmpfiles.d/%{name}.conf
+%attr(755,root,root) %{_bindir}/rspamc-*
+%{_bindir}/rspamc
+%attr(755,root,root) %{_bindir}/rspamd-*
+%{_bindir}/rspamd
+%attr(755,root,root) %{_bindir}/rspamadm-*
+%{_bindir}/rspamadm
+%attr(755,root,root) %{_bindir}/rspamd_stats
+%attr(755,root,root) %{_bindir}/mapstats
+
+# config
 %dir %{_sysconfdir}/%{name}
-%dir %{_sysconfdir}/%{name}/local.d
-%{_sysconfdir}/%{name}/local.d/*.example
-%dir %{_sysconfdir}/%{name}/override.d
-%{_sysconfdir}/%{name}/override.d/*.example
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/rspamd.conf
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/actions.conf
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/cgp.inc
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/common.conf
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/composites.conf
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/groups.conf
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/lang_detection.inc
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/logging.inc
-%dir %{_sysconfdir}/%{name}/lua.local.d
-%{_sysconfdir}/%{name}/lua.local.d/*.example
-%dir %{_sysconfdir}/%{name}/maps.d
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/maps.d/dmarc_whitelist.inc
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/maps.d/exe_clickbait.inc
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/maps.d/maillist.inc
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/maps.d/mid.inc
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/maps.d/mime_types.inc
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/maps.d/redirectors.inc
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/maps.d/spf_dkim_whitelist.inc
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/maps.d/surbl-whitelist.inc
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/metrics.conf
-%dir %{_sysconfdir}/%{name}/modules.local.d
-%{_sysconfdir}/%{name}/modules.local.d/*.example
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/modules.conf
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/options.inc
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/rspamd.conf
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/settings.conf
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/statistic.conf
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/worker-controller.inc
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/worker-fuzzy.inc
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/worker-normal.inc
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/worker-proxy.inc
-%dir %{_sysconfdir}/%{name}/modules.d/
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/worker-hs_helper.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/worker-hs_helper.inc
+
+%dir %{_sysconfdir}/%{name}/local.d
+%dir %{_sysconfdir}/%{name}/override.d
+%dir %{_sysconfdir}/%{name}/lua.local.d
+%dir %{_sysconfdir}/%{name}/modules.local.d
+
+%dir %{_sysconfdir}/%{name}/maps.d
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/maps.d/*.inc
+
+%dir %{_sysconfdir}/%{name}/modules.d
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/modules.d/*.conf
-%dir %{_sysconfdir}/%{name}/scores.d/
+
+%dir %{_sysconfdir}/%{name}/scores.d
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/scores.d/*.conf
+
+# private libraries
+%dir %{_libdir}
+%attr(755,root,root) %{_libdir}/librspamd-server.so
+%attr(755,root,root) %{_libdir}/librspamd-actrie.so
+%attr(755,root,root) %{_libdir}/librspamd-ev.so
+%attr(755,root,root) %{_libdir}/librspamd-kann.so
+%attr(755,root,root) %{_libdir}/librspamd-replxx.so
+
+# data files
 %dir %{_datadir}/%{name}
 %{_datadir}/%{name}/effective_tld_names.dat
-%dir %{_datadir}/%{name}/languages/
+%dir %{_datadir}/%{name}/languages
 %{_datadir}/%{name}/languages/*.json
 %{_datadir}/%{name}/languages/stop_words
+
+# lua libraries
 %dir %{_datadir}/%{name}/lualib
 %{_datadir}/%{name}/lualib/*.lua
 %dir %{_datadir}/%{name}/lualib/lua_content
@@ -171,29 +232,40 @@ fi
 %{_datadir}/%{name}/lualib/lua_scanners/*.lua
 %dir %{_datadir}/%{name}/lualib/lua_selectors
 %{_datadir}/%{name}/lualib/lua_selectors/*.lua
+%dir %{_datadir}/%{name}/lualib/lua_shape
+%{_datadir}/%{name}/lualib/lua_shape/*.lua
 %dir %{_datadir}/%{name}/lualib/plugins
 %{_datadir}/%{name}/lualib/plugins/*.lua
+%dir %{_datadir}/%{name}/lualib/plugins/neural
+%dir %{_datadir}/%{name}/lualib/plugins/neural/providers
+%{_datadir}/%{name}/lualib/plugins/neural/providers/*.lua
 %dir %{_datadir}/%{name}/lualib/redis_scripts
 %{_datadir}/%{name}/lualib/redis_scripts/*.lua
 %dir %{_datadir}/%{name}/lualib/rspamadm
 %{_datadir}/%{name}/lualib/rspamadm/*.lua
+
+# lua plugins
 %dir %{_datadir}/%{name}/plugins
 %{_datadir}/%{name}/plugins/*.lua
+
+# rules
 %dir %{_datadir}/%{name}/rules
 %{_datadir}/%{name}/rules/*.lua
 %dir %{_datadir}/%{name}/rules/regexp
 %{_datadir}/%{name}/rules/regexp/*.lua
 %dir %{_datadir}/%{name}/rules/controller
 %{_datadir}/%{name}/rules/controller/*.lua
+
+# web UI
 %dir %{_datadir}/%{name}/www
 %{_datadir}/%{name}/www/*
-%attr(755,root,root) %{_libdir}/*.so
+
+# man pages
 %{_mandir}/man1/rspamadm.1*
 %{_mandir}/man1/rspamc.1*
 %{_mandir}/man8/rspamd.8*
-%dir %attr(750,root,logs) /var/log/%{name}
-%dir /var/run/%{name}
 
-%changelog
-* Wed May 15 2013 PLD Linux Team <feedback at pld-linux.org>
-- For complete changelog see:	http://git.pld-linux.org/?p=packages/rspamd.git;a=log
+# runtime directories
+%attr(750,rspamd,rspamd) %dir /var/lib/%{name}
+%attr(750,rspamd,rspamd) %dir /var/log/%{name}
+%attr(755,rspamd,rspamd) %dir /var/run/%{name}
diff --git a/rspamd.init b/rspamd.init
index 504bc85..e8e1629 100644
--- a/rspamd.init
+++ b/rspamd.init
@@ -16,8 +16,8 @@
 # Source networking configuration.
 . /etc/sysconfig/network
 
-SPAMD_OPTS="-d -c"
-# Source configureation.
+RSPAMD_OPTS=""
+# Source configuration.
 if [ -f /etc/sysconfig/rspamd ] ; then
 	. /etc/sysconfig/rspamd
 fi
diff --git a/rspamd.tmpfiles b/rspamd.tmpfiles
index 861b798..8ed9e6b 100644
--- a/rspamd.tmpfiles
+++ b/rspamd.tmpfiles
@@ -1 +1 @@
-d /var/run/rspamd 0700 root root -
+d /var/run/rspamd 0755 rspamd rspamd -
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rspamd.git/commitdiff/f0ef768047d6d2818456bb7fcdc52a90b2d353af



More information about the pld-cvs-commit mailing list