123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302 |
- %bcond_with systemd
- %bcond_with jemalloc
- %define rspamd_user _rspamd
- %define rspamd_group %{rspamd_user}
- %define rspamd_home %{_localstatedir}/lib/rspamd
- %define rspamd_logdir %{_localstatedir}/log/rspamd
- %define rspamd_confdir %{_sysconfdir}/rspamd
- %define rspamd_pluginsdir %{_datadir}/rspamd/plugins
- %define rspamd_rulesdir %{_datadir}/rspamd/rules
- %define rspamd_wwwdir %{_datadir}/rspamd/www
- Summary: Rapid spam filtering system
- Name: rspamd
- Version: 3.0
- Release: 3%{?_dist_release}%{?with_systemd:.systemd}
- Group: servers
- Vendor: Project Vine
- Distribution: Vine Linux
- License: ASL 2.0
- URL: https://rspamd.com
- Source0: https://github.com/rspamd/rspamd/archive/%{version}.tar.gz#/%{name}-%{version}.tar.xz
- Patch0: rspamd-3.0-lua54.patch
- # to build with glibc-2.34+
- # https://github.com/onqtam/doctest/commit/099d5414e97244ec44cf46b14cd176b3a3dc52e3
- Patch1: doctest-SIGSTKSZ.patch
- Patch2: rspamd-openssl3.patch
- BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
- BuildRequires: cmake
- BuildRequires: file-devel
- BuildRequires: glib2-devel
- BuildRequires: gmime-devel
- %ifarch x86_64
- BuildRequires: hyperscan-devel
- %endif
- %if %{with jemalloc}
- BuildRequires: jemalloc-devel
- %endif
- BuildRequires: libevent-devel
- BuildRequires: libicu-devel
- BuildRequires: libsodium-devel
- BuildRequires: libunwind-devel
- BuildRequires: lua-devel
- BuildRequires: openssl-devel
- BuildRequires: pcre2-devel
- BuildRequires: perl
- BuildRequires: ragel
- BuildRequires: sqlite3-devel
- %if %{with systemd}
- BuildRequires: systemd
- %endif
- Requires: logrotate
- Requires(pre): shadow-utils
- %if %{with systemd}
- Requires(pre): systemd
- Requires(post): systemd
- Requires(preun): systemd
- Requires(postun): systemd
- %else
- Requires(post): chkconfig
- Requires(preun): chkconfig, initscripts
- Requires(postun): initscripts
- %endif
- %description
- Rspamd is a rapid, modular and lightweight spam filter. It is designed to work
- with big amount of mail and can be easily extended with own filters written in
- lua.
- %debug_package
- %prep
- %setup
- %patch0 -p1
- pushd contrib/doctest
- %patch1 -p1
- popd
- %patch2 -p1
- %build
- %cmake \
- -DCMAKE_INSTALL_PREFIX=%{_prefix} \
- -DCONFDIR=%{_sysconfdir}/rspamd \
- -DINCLUDEDIR=%{_includedir} \
- -DLIBDIR=%{_libdir}/rspamd/ \
- -DMANDIR=%{_mandir} \
- -DSHAREDIR=%{_datadir}/rspamd \
- -DDBDIR=%{_localstatedir}/lib/rspamd \
- -DRUNDIR=%{_localstatedir}/run/rspamd \
- -DLOGDIR=%{_localstatedir}/log/rspamd \
- -DEXAMPLESDIR=%{_datadir}/examples/rspamd \
- -DNO_SHARED=ON \
- -DDEBIAN_BUILD=0 \
- -DRSPAMD_GROUP=%{rspamd_group} \
- -DRSPAMD_USER=%{rspamd_user} \
- %if %{with systemd}
- -DWANT_SYSTEMD_UNITS=ON \
- -DSYSTEMDDIR=%{_unitdir} \
- %else
- -DWANT_SYSTEMD_UNITS=OFF \
- -DDISABLE_PTHREAD_MUTEX=1 \
- %endif
- %ifarch x86_64
- -DENABLE_HYPERSCAN=ON \
- %endif
- -DENABLE_LIBUNWIND=ON \
- -DENABLE_LUAJIT=OFF \
- -DENABLE_PCRE2=ON \
- %if %{with jemalloc}
- -DENABLE_JEMALLOC=ON \
- %endif
- %nil
- #-DCMAKE_SKIP_INSTALL_RPATH=ON \
- %cmake_build
- %install
- %cmake_install INSTALLDIRS=vendor
- pushd ./centos/sources/
- %if %{with systemd}
- %{__install} -p -D -m 0644 80-rspamd.preset %{buildroot}%{_presetdir}/80-rspamd.preset
- %{__install} -p -D -m 0644 %{name}.logrotate.systemd %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
- %{__install} -d -p -m 0755 %{buildroot}%{rspamd_logdir}
- %else
- %{__install} -p -D -m 0755 %{name}.init %{buildroot}%{_initrddir}/%{name}
- %{__install} -d -p -m 0755 %{buildroot}%{_localstatedir}/run/rspamd
- %{__install} -p -D -m 0644 %{name}.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
- %{__install} -d -p -m 0755 %{buildroot}%{rspamd_logdir}
- %endif
- %{__install} -d -p -m 0755 %{buildroot}%{rspamd_home}
- %{__install} -p -D -d -m 0755 %{buildroot}%{_sysconfdir}/%{name}/local.d/
- %{__install} -p -D -d -m 0755 %{buildroot}%{_sysconfdir}/%{name}/override.d/
- popd
- %clean
- rm -rf %{buildroot}
- %pre
- %{_sbindir}/groupadd -r %{rspamd_group} 2>/dev/null || :
- %{_sbindir}/useradd -g %{rspamd_group} -c "Rspamd user" -s /bin/false -r -d %{rspamd_home} %{rspamd_user} 2>/dev/null || :
- %post
- #to allow easy upgrade from 0.8.1
- %{__chown} -R %{rspamd_user}:%{rspamd_group} %{rspamd_home}
- %if %{with systemd}
- #Macro is not used as we want to do this on upgrade
- #%systemd_post %{name}.service
- systemctl --no-reload preset %{name}.service >/dev/null 2>&1 || :
- %{__chown} %{rspamd_user}:%{rspamd_group} %{rspamd_logdir}
- %else
- /sbin/chkconfig --add %{name}
- %endif
- %preun
- %if %{with systemd}
- %systemd_preun %{name}.service
- %else
- if [ $1 = 0 -o -x /bin/systemctl ]; then
- /sbin/service %{name} stop >/dev/null 2>&1
- /sbin/chkconfig --del %{name}
- fi
- %endif
- %postun
- %if %{with systemd}
- %systemd_postun_with_restart %{name}.service
- %else
- if [ $1 -ge 1 ]; then
- /sbin/service %{name} condrestart > /dev/null 2>&1 || :
- fi
- %endif
- %files
- %defattr(-,root,root,-)
- %license LICENSE.md
- %doc AUTHORS.md ChangeLog README.md
- %if %{with systemd}
- %{_unitdir}/%{name}.service
- %{_presetdir}/80-rspamd.preset
- %else
- %{_initrddir}/%{name}
- %dir %{_localstatedir}/run/rspamd
- %endif
- %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
- %dir %{rspamd_logdir}
- %{_mandir}/man8/%{name}.*
- %{_mandir}/man1/rspamc.*
- %{_mandir}/man1/rspamadm.*
- %{_bindir}/rspamd
- %{_bindir}/rspamd-*
- %{_bindir}/rspamd_stats
- %{_bindir}/rspamc
- %{_bindir}/rspamc-*
- %{_bindir}/rspamadm
- %{_bindir}/rspamadm-*
- %attr(-, %{rspamd_user}, %{rspamd_group}) %dir %{rspamd_home}
- %dir %{rspamd_confdir}
- %dir %{rspamd_confdir}/modules.d
- %dir %{rspamd_confdir}/local.d
- %dir %{rspamd_confdir}/maps.d
- %dir %{rspamd_confdir}/override.d
- %dir %{rspamd_confdir}/scores.d
- %dir %{rspamd_wwwdir}
- %dir %{_libdir}/rspamd
- %config(noreplace) %{rspamd_confdir}/*.conf
- %config(noreplace) %{rspamd_confdir}/*.inc
- %config(noreplace) %{rspamd_confdir}/maps.d/*
- %config(noreplace) %{rspamd_confdir}/modules.d/*
- %config(noreplace) %{rspamd_confdir}/scores.d/*
- %dir %{rspamd_pluginsdir}
- %{rspamd_pluginsdir}/*.lua
- %dir %{_datadir}/rspamd/lualib
- %dir %{_datadir}/rspamd/lualib/lua_content
- %dir %{_datadir}/rspamd/lualib/lua_ffi
- %dir %{_datadir}/rspamd/lualib/lua_magic
- %dir %{_datadir}/rspamd/lualib/lua_selectors
- %dir %{_datadir}/rspamd/lualib/lua_scanners
- %dir %{_datadir}/rspamd/lualib/plugins
- %dir %{_datadir}/rspamd/lualib/rspamadm
- %{_datadir}/rspamd/lualib/*.lua
- %{_datadir}/rspamd/lualib/lua_content/*.lua
- %{_datadir}/rspamd/lualib/lua_ffi/*.lua
- %{_datadir}/rspamd/lualib/lua_magic/*.lua
- %{_datadir}/rspamd/lualib/lua_selectors/*.lua
- %{_datadir}/rspamd/lualib/lua_scanners/*.lua
- %{_datadir}/rspamd/lualib/plugins/*.lua
- %{_datadir}/rspamd/lualib/rspamadm/*.lua
- %dir %{rspamd_rulesdir}
- %dir %{rspamd_rulesdir}/regexp
- %{rspamd_rulesdir}/regexp/*.lua
- %dir %{rspamd_rulesdir}/controller
- %{rspamd_rulesdir}/controller/*.lua
- %{rspamd_rulesdir}/*.lua
- %{rspamd_wwwdir}/*
- %{_libdir}/rspamd/*
- %{_datadir}/rspamd/effective_tld_names.dat
- %dir %{_datadir}/rspamd/languages
- %{_datadir}/rspamd/languages/*
- %dir %{_datadir}/rspamd/elastic
- %{_datadir}/rspamd/elastic/*
- %changelog
- * Sat Oct 16 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0-3
- - disabled jemalloc as default: SIGSEGV was occured.
- * Sat Oct 16 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0-2
- - added Patch2 to build with openssl-3.0.0.
- - built with jemalloc.
- * Thu Aug 19 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0-1
- - new upstream release.
- - updated Patch0.
- - imported Patch1 from upstream of doctest to build with glibc-2.34+.
- * Thu Apr 08 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.7-2
- - rebuilt with icu69.
- * Sat Jan 09 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.7-1
- - new upstream release.
- * Tue Jan 05 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.6-3
- - updated Patch0.
- * Thu Oct 08 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.6-2
- - updated Patch0.
- * Fri Oct 02 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.6-1
- - new upstream release.
- - added Patch0 to build with lua-5.4.
- * Tue Aug 18 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.5-3
- - rebuilt with current envirionment.
- * Fri Apr 24 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.5-2
- - rebuilt with icu-67.
- * Thu Apr 02 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.5-1
- - new upstream release.
- * Thu Mar 19 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.4-2
- - rebuilt with libicu66.
- * Sat Mar 07 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.4-1
- - initial build for Vine Linux.
|