%endif
Source0: https://rspamd.com/downloads/%{name}-%{version}.tar.xz
+Source3: 80-rspamd.preset
%description
Rspamd is a rapid, modular and lightweight spam filter. It is designed to work
%install
%{__make} install DESTDIR=%{buildroot} INSTALLDIRS=vendor
+%{__install} -p -D -m 0644 %{SOURCE3} %{buildroot}%{_presetdir}/80-rspamd.preset
%if 0%{?el6}
%{__install} -p -D -m 0755 %{SOURCE1} %{buildroot}%{_initrddir}/%{name}
%if 0%{?suse_version}
%service_add_pre %{name}.service
-%service_add_pre %{name}.socket
%endif
%post
%{__chown} -R %{rspamd_user}:%{rspamd_group} %{rspamd_home}
%if 0%{?suse_version}
%service_add_post %{name}.service
-%service_add_post %{name}.socket
%endif
%if 0%{?fedora} || 0%{?el7}
-%systemd_post %{name}.service
-%systemd_post %{name}.socket
+#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 || :
%endif
%if 0%{?el6}
/sbin/chkconfig --add %{name}
%preun
%if 0%{?suse_version}
%service_del_preun %{name}.service
-%service_del_preun %{name}.socket
%endif
%if 0%{?fedora} || 0%{?el7}
%systemd_preun %{name}.service
-%systemd_preun %{name}.socket
%endif
%if 0%{?el6}
if [ $1 = 0 ]; then
%postun
%if 0%{?suse_version}
%service_del_postun %{name}.service
-%service_del_postun %{name}.socket
%endif
%if 0%{?fedora} || 0%{?el7}
%systemd_postun_with_restart %{name}.service
-%systemd_postun %{name}.socket
%endif
%if 0%{?el6}
if [ $1 -ge 1 ]; then
%defattr(-,root,root,-)
%if 0%{?suse_version} || 0%{?fedora} || 0%{?el7}
%{_unitdir}/%{name}.service
-%{_unitdir}/%{name}.socket
+%{_presetdir}/80-rspamd.preset
%endif
%if 0%{?el6}
%{_initrddir}/%{name}
}
worker {
- bind_socket = "systemd:0";
+ bind_socket = "*:11333";
.include "$CONFDIR/worker-normal.inc"
.include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/worker-normal.inc"
.include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/worker-normal.inc"
}
worker {
- bind_socket = "systemd:1";
+ bind_socket = "localhost:11334";
.include "$CONFDIR/worker-controller.inc"
.include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/worker-controller.inc"
.include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/worker-controller.inc"
override_dh_fixperms:
dh_fixperms
chmod 750 $(CURDIR)/debian/rspamd/var/lib/rspamd
-
-override_dh_systemd_enable:
- dh_systemd_enable rspamd.socket
-
-override_dh_systemd_start:
- dh_systemd_start --restart-after-upgrade --no-start
-
-override_dh_installinit:
- dh_installinit -n