From 7902438bfdb8ec624e58e1b8daca8de1fa26f231 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Wed, 11 Mar 2015 21:45:06 +0200 Subject: [PATCH] Fix RPM packaging properly --- centos/rspamd.spec | 16 +++++----------- centos/sources/rspamd.service | 6 ++++++ 2 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 centos/sources/rspamd.service diff --git a/centos/rspamd.spec b/centos/rspamd.spec index 462bc22f8..de6054ef6 100644 --- a/centos/rspamd.spec +++ b/centos/rspamd.spec @@ -6,8 +6,6 @@ %define rspamd_pluginsdir %{_datadir}/rspamd %define rspamd_wwwdir %{_datadir}/rspamd/www -%{!?_tmpfilesdir:%global _tmpfilesdir /usr/lib/tmpfiles.d} - %if 0%{?suse_version} %define __cmake cmake %define __install install @@ -58,7 +56,7 @@ Source0: https://rspamd.com/downloads/%{name}-%{version}.tar.xz Source1: %{name}.init Source2: %{name}.logrotate %else -Source5: tmpfiles.d +Source3: %{name}.service %endif %description @@ -100,8 +98,7 @@ lua. %{__install} -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} %{__install} -d -p -m 0755 %{buildroot}%{rspamd_logdir} %else -%{__install} -d -m 0755 %{buildroot}%{_tmpfilesdir} -%{__install} -m 0644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/%{name}.conf +%{__install} -p -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service %endif %{__install} -d -p -m 0755 %{buildroot}%{rspamd_home} @@ -127,10 +124,8 @@ rm -rf %{buildroot} %systemd_post %{name}.service %systemd_post %{name}.socket %endif -%if %{undefined suse_version} && %{undefined fedora} && 0%{?rhel} < 7 +%if 0%{?el6} /sbin/chkconfig --add %{name} -%else -systemd-tmpfiles --create %{_tmpfilesdir}/%{name}.conf %endif %preun @@ -170,9 +165,8 @@ fi %if 0%{?suse_version} || 0%{?fedora} || 0%{?rhel} >= 7 %{_unitdir}/%{name}.service %{_unitdir}/%{name}.socket -%dir %{_tmpfilesdir} -%{_tmpfilesdir}/%{name}.conf -%else +%endif +%if 0%{?el6} %{_initrddir}/%{name} %dir %{_localstatedir}/run/rspamd %endif diff --git a/centos/sources/rspamd.service b/centos/sources/rspamd.service new file mode 100644 index 000000000..14545569a --- /dev/null +++ b/centos/sources/rspamd.service @@ -0,0 +1,6 @@ +[Unit] +Description=rapid spam filtering system +After=nss-lookup.target + +[Service] +ExecStart=/usr/bin/rspamd -c /etc/rspamd/rspamd.conf -f -u _rspamd -g _rspamd -- 2.39.5