From 569e598d38adb1918d127ee31af1cd332b072dcf Mon Sep 17 00:00:00 2001 From: Deposite Pirate Date: Sun, 16 Sep 2018 23:29:24 +0200 Subject: Initial commit. --- rspamd/rspamd-fedora.patch | 26 +++++++ rspamd/rspamd-systemd.patch | 15 ++++ rspamd/rspamd.logrotate | 11 +++ rspamd/rspamd.spec | 185 ++++++++++++++++++++++++++++++++++++++++++++ rspamd/rspamd.tmpfiles | 1 + 5 files changed, 238 insertions(+) create mode 100644 rspamd/rspamd-fedora.patch create mode 100644 rspamd/rspamd-systemd.patch create mode 100644 rspamd/rspamd.logrotate create mode 100644 rspamd/rspamd.spec create mode 100644 rspamd/rspamd.tmpfiles (limited to 'rspamd') diff --git a/rspamd/rspamd-fedora.patch b/rspamd/rspamd-fedora.patch new file mode 100644 index 0000000..1e7d023 --- /dev/null +++ b/rspamd/rspamd-fedora.patch @@ -0,0 +1,26 @@ +diff -ru ./src/lua/lua_common.h ../rspamd-0.8.0.p/src/lua/lua_common.h +--- ./src/lua/lua_common.h 2014-12-17 16:51:42.000000000 +0200 ++++ ../rspamd-0.8.0.p/src/lua/lua_common.h 2015-01-09 14:25:09.696650229 +0200 +@@ -25,21 +25,6 @@ + lua_pushnumber (L, val); \ + lua_settable (L, -3); + +-#if LUA_VERSION_NUM > 501 +-static inline void +-luaL_register (lua_State *L, const gchar *name, const struct luaL_reg *methods) +-{ +- if (name != NULL) { +- lua_newtable (L); +- } +- luaL_setfuncs (L, methods, 0); +- if (name != NULL) { +- lua_pushvalue (L, -1); +- lua_setglobal (L, name); +- } +-} +-#endif +- + /* Interface definitions */ + #define LUA_FUNCTION_DEF(class, name) static gint lua_ ## class ## _ ## name ( \ + lua_State * L) + diff --git a/rspamd/rspamd-systemd.patch b/rspamd/rspamd-systemd.patch new file mode 100644 index 0000000..a779603 --- /dev/null +++ b/rspamd/rspamd-systemd.patch @@ -0,0 +1,15 @@ +diff -r -u -N rspamd-0.8.0/rspamd.service rspamd-0.8.0-systemd/rspamd.service +--- rspamd-0.8.0/rspamd.service 2014-04-21 13:31:50.000000000 +0200 ++++ rspamd-0.8.0-systemd/rspamd.service 2015-01-15 05:03:57.519561226 +0100 +@@ -5,10 +5,7 @@ + Type=simple + # Replace Pre/Post with RuntimeDirectory once it is available + PermissionsStartOnly=true +-ExecStartPre=/bin/mkdir -m700 -p /run/rspamd +-ExecStartPre=/bin/chown _rspamd:_rspamd /run/rspamd + ExecStart=/usr/bin/rspamd -f -c /etc/rspamd/rspamd.conf + ExecReload=/bin/kill -HUP $MAINPID +-ExecStopPost=/bin/rm -r /run/rspamd + WorkingDirectory=/var/lib/rspamd +-User=_rspamd ++User=rspamd diff --git a/rspamd/rspamd.logrotate b/rspamd/rspamd.logrotate new file mode 100644 index 0000000..3a155f8 --- /dev/null +++ b/rspamd/rspamd.logrotate @@ -0,0 +1,11 @@ +/var/log/rspamd/*log { + daily + rotate 10 + missingok + notifempty + compress + sharedscripts + postrotate + [ ! -f /run/rspamd.pid ] || kill -USR1 `cat /run/rspamd.pid` + endscript +} diff --git a/rspamd/rspamd.spec b/rspamd/rspamd.spec new file mode 100644 index 0000000..4218914 --- /dev/null +++ b/rspamd/rspamd.spec @@ -0,0 +1,185 @@ +%define rspamd_user rspamd +%define rspamd_group %{rspamd_user} +%define rspamd_homedir %{_localstatedir}/lib/rspamd +%define rspamd_logdir %{_localstatedir}/log/rspamd +%define rspamd_confdir %{_sysconfdir}/rspamd +%define rspamd_pluginsdir %{_datadir}/rspamd +%define rspamd_wwwdir %{_datadir}/rspamd/www + +Name: rspamd +Version: 0.8.0 +Release: 1%{?dist} +Summary: Rapid spam filtering system +Group: System Environment/Daemons +License: BSD +URL: https://rspamd.com +Packager: Christoph J. Thompson +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release} +BuildRequires: cmake,glib2-devel,gmime-devel,libevent-devel,openssl-devel,lua-devel,pcre-devel +Requires: lua, logrotate +Requires(pre): shadow-utils +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd +Source0: https://rspamd.com/downloads/%{name}-%{version}.tar.xz +Source1: %{name}.logrotate +Source2: %{name}.tmpfiles +Patch0: %{name}-fedora.patch +Patch1: %{name}-systemd.patch + +%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. + +%prep +%autosetup -p1 + +%build +%{__cmake} \ + -DCMAKE_INSTALL_PREFIX=%{_prefix} \ + -DCONFDIR=%{rspamd_confdir} \ + -DDSYSTEMDIR=%{_unitdir} \ + -DMANDIR=%{_mandir} \ + -DDBDIR=%{rspamd_homedir} \ + -DRUNDIR=/run/rspamd \ + -DLOGDIR=%{rspamd_logdir} \ + -DEXAMPLESDIR=%{_datadir}/examples/rspamd \ + -DPLUGINSDIR=%{rspamd_pluginsdir} \ + -DLIBDIR=%{_libdir} \ + -DINCLUDEDIR=%{_includedir} \ + -DNO_SHARED=ON \ + -DDEBIAN_BUILD=1 \ + -DRSPAMD_GROUP=%{rspamd_group} \ + -DRSPAMD_USER=%{rspamd_user} +%{__make} %{?_smp_mflags} + +%install +%{__make} install DESTDIR=%{buildroot} INSTALLDIRS=vendor +%{__install} -p -D -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} +%{__install} -p -D -m 0644 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/%{name}.conf +%{__install} -d -p -m 0755 %{buildroot}%{rspamd_logdir} +%{__install} -d -p -m 0755 %{buildroot}%{rspamd_homedir} +cat >> %{buildroot}%{_tmpfilesdir}/%{name}.conf </dev/null || : +%{_sbindir}/useradd -r -g %{rspamd_group} -c "Rspamd user" -s /bin/nologin -d %{rspamd_homedir} %{rspamd_user} 2>/dev/null || : + +%post +%tmpfiles_create %{name}.conf +%systemd_post %{name}.service + +%preun +%systemd_preun %{name}.service + +%postun +%systemd_postun_with_restart %{name}.service + +%files +%defattr(-,root,root,0755) +%{_bindir}/rspamd +%{_bindir}/rspamc +%{_mandir}/man8/%{name}.* +%{_mandir}/man1/rspamc.* +%{_unitdir}/%{name}.service +%{_unitdir}/%{name}.socket +%{_tmpfilesdir}/%{name}.conf +%config(noreplace) %{_sysconfdir}/logrotate.d/%{name} +%dir %{rspamd_confdir} +%dir %{rspamd_confdir}/lua +%dir %{rspamd_confdir}/lua/regexp +%config(noreplace) %{rspamd_confdir}/2tld.inc +%config(noreplace) %{rspamd_confdir}/composites.conf +%config(noreplace) %{rspamd_confdir}/logging.conf +%config(noreplace) %{rspamd_confdir}/metrics.conf +%config(noreplace) %{rspamd_confdir}/modules.conf +%config(noreplace) %{rspamd_confdir}/options.conf +%config(noreplace) %{rspamd_confdir}/%{name}.conf +%config(noreplace) %{rspamd_confdir}/statistic.conf +%config(noreplace) %{rspamd_confdir}/surbl-whitelist.inc +%config(noreplace) %{rspamd_confdir}/workers.conf +%{rspamd_confdir}/lua/rspamd.lua +%{rspamd_confdir}/lua/hfilter.lua +%{rspamd_confdir}/lua/rspamd.classifiers.lua +%{rspamd_confdir}/lua/regexp/drugs.lua +%{rspamd_confdir}/lua/regexp/fraud.lua +%{rspamd_confdir}/lua/regexp/headers.lua +%{rspamd_confdir}/lua/regexp/lotto.lua +%dir %{rspamd_pluginsdir} +%dir %{rspamd_pluginsdir}/lua +%{rspamd_pluginsdir}/lua/emails.lua +%{rspamd_pluginsdir}/lua/forged_recipients.lua +%{rspamd_pluginsdir}/lua/ip_score.lua +%{rspamd_pluginsdir}/lua/maillist.lua +%{rspamd_pluginsdir}/lua/multimap.lua +%{rspamd_pluginsdir}/lua/once_received.lua +%{rspamd_pluginsdir}/lua/phishing.lua +%{rspamd_pluginsdir}/lua/ratelimit.lua +%{rspamd_pluginsdir}/lua/rbl.lua +%{rspamd_pluginsdir}/lua/settings.lua +%{rspamd_pluginsdir}/lua/trie.lua +#%{rspamd_pluginsdir}/lua/whitelist.lua +%dir %{rspamd_wwwdir} +%{rspamd_wwwdir}/* +%dir %{rspamd_logdir} +%dir %{rspamd_homedir} + +%changelog +* Fri Jan 09 2015 Christoph J. Thompson 0.8.0-1 +- Update to 0.8.0 +- "Port" to fedora 21 + +* Mon Nov 24 2014 Vsevolod Stakhov 0.7.6-1 +- Update to 0.7.6 + +* Mon Nov 17 2014 Vsevolod Stakhov 0.7.5-1 +- Update to 0.7.5 + +* Sat Nov 08 2014 Vsevolod Stakhov 0.7.4-1 +- Update to 0.7.4 + +* Mon Nov 03 2014 Vsevolod Stakhov 0.7.3-1 +- Update to 0.7.3 + +* Wed Oct 15 2014 Vsevolod Stakhov 0.7.2-1 +- Update to 0.7.2 + +* Tue Sep 30 2014 Vsevolod Stakhov 0.7.1-1 +- Update to 0.7.1 + +* Mon Sep 1 2014 Vsevolod Stakhov 0.7.0-1 +- Update to 0.7.0 + +* Fri Jan 10 2014 Vsevolod Stakhov 0.6.7-1 +- Update to 0.6.7. + +* Fri Dec 27 2013 Vsevolod Stakhov 0.6.6-1 +- Update to 0.6.6. + +* Fri Dec 20 2013 Vsevolod Stakhov 0.6.5-1 +- Update to 0.6.5. + +* Wed Dec 18 2013 Vsevolod Stakhov 0.6.4-1 +- Update to 0.6.4. + +* Tue Dec 10 2013 Vsevolod Stakhov 0.6.3-1 +- Update to 0.6.3. + +* Fri Dec 06 2013 Vsevolod Stakhov 0.6.2-1 +- Update to 0.6.2. + +* Tue Nov 19 2013 Vsevolod Stakhov 0.6.0-1 +- Update to 0.6.0. + +* Mon Jun 10 2013 Vsevolod Stakhov 0.5.6-1 +- Update to 0.5.6. + +* Sat May 25 2013 Vsevolod Stakhov 0.5.5-1 +- Initial spec version. diff --git a/rspamd/rspamd.tmpfiles b/rspamd/rspamd.tmpfiles new file mode 100644 index 0000000..ea1d1b1 --- /dev/null +++ b/rspamd/rspamd.tmpfiles @@ -0,0 +1 @@ +d /run/rspamd 0700 rspamd rspamd -- cgit v1.2.3-70-g09d2