summaryrefslogtreecommitdiffstats
path: root/centos
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2015-03-13 12:12:38 +0200
committerAndrew Lewis <nerf@judo.za.org>2015-03-13 12:27:57 +0200
commiteac41b87a1bb74bb95ac3f65237e6daf6c1a2f28 (patch)
tree124352cb83bf5ebbbaef7db98886c992a9e9b510 /centos
parent30f404d2ede833fb5346bcda8136e6b4fb28bf89 (diff)
downloadrspamd-eac41b87a1bb74bb95ac3f65237e6daf6c1a2f28.tar.gz
rspamd-eac41b87a1bb74bb95ac3f65237e6daf6c1a2f28.zip
RPM: Clean up and unbreak future upgrades on Fedora/CentOS7
Diffstat (limited to 'centos')
-rw-r--r--centos/rspamd.spec32
1 files changed, 12 insertions, 20 deletions
diff --git a/centos/rspamd.spec b/centos/rspamd.spec
index e285f7f0f..d1f6c3c00 100644
--- a/centos/rspamd.spec
+++ b/centos/rspamd.spec
@@ -6,13 +6,6 @@
%define rspamd_pluginsdir %{_datadir}/rspamd
%define rspamd_wwwdir %{_datadir}/rspamd/www
-%if 0%{?suse_version}
-%define __cmake cmake
-%define __install install
-%define __make make
-%define __chown chown
-%endif
-
Name: rspamd
Version: 0.8.0
Release: 1
@@ -49,14 +42,11 @@ Requires: logrotate
Requires(post): chkconfig
Requires(preun): chkconfig, initscripts
Requires(postun): initscripts
-%endif
-
-Source0: https://rspamd.com/downloads/%{name}-%{version}.tar.xz
-%if 0%{?el6}
Source1: %{name}.init
Source2: %{name}.logrotate
%endif
+Source0: https://rspamd.com/downloads/%{name}-%{version}.tar.xz
Patch0: %{name}.service.patch
%description
@@ -77,8 +67,10 @@ lua.
-DMANDIR=%{_mandir} \
-DDBDIR=%{_localstatedir}/lib/rspamd \
-DRUNDIR=%{_localstatedir}/run/rspamd \
-%if %{undefined suse_version} && %{undefined fedora} && 0%{?rhel} < 7
+%if 0%{?el6}
-DWANT_SYSTEMD_UNITS=OFF \
+%else
+ -DSYSTEMDDIR=%{_unitdir} \
%endif
-DLOGDIR=%{_localstatedir}/log/rspamd \
-DEXAMPLESDIR=%{_datadir}/examples/rspamd \
@@ -118,12 +110,12 @@ rm -rf %{buildroot}
%post
#to allow easy upgrade from 0.8.1
-chown -R %{rspamd_user}:%{rspamd_group} %{rspamd_home}
+%{__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%{?rhel} >= 7
+%if 0%{?fedora} || 0%{?el7}
%systemd_post %{name}.service
%systemd_post %{name}.socket
%endif
@@ -136,11 +128,11 @@ chown -R %{rspamd_user}:%{rspamd_group} %{rspamd_home}
%service_del_preun %{name}.service
%service_del_preun %{name}.socket
%endif
-%if 0%{?fedora} || 0%{?rhel} >= 7
+%if 0%{?fedora} || 0%{?el7}
%systemd_preun %{name}.service
%systemd_preun %{name}.socket
%endif
-%if %{undefined suse_version} && %{undefined fedora} && 0%{?rhel} < 7
+%if 0%{?el6}
if [ $1 = 0 ]; then
/sbin/service %{name} stop >/dev/null 2>&1
/sbin/chkconfig --del %{name}
@@ -152,11 +144,11 @@ fi
%service_del_postun %{name}.service
%service_del_postun %{name}.socket
%endif
-%if 0%{?fedora} || 0%{?rhel} >= 7
-%systemd_postun %{name}.service
+%if 0%{?fedora} || 0%{?el7}
+%systemd_postun_with_restart %{name}.service
%systemd_postun %{name}.socket
%endif
-%if %{undefined suse_version} && %{undefined fedora} && 0%{?rhel} < 7
+%if 0%{?el6}
if [ $1 -ge 1 ]; then
/sbin/service %{name} condrestart > /dev/null 2>&1 || :
fi
@@ -165,7 +157,7 @@ fi
%files
%defattr(-,root,root,-)
-%if 0%{?suse_version} || 0%{?fedora} || 0%{?rhel} >= 7
+%if 0%{?suse_version} || 0%{?fedora} || 0%{?el7}
%{_unitdir}/%{name}.service
%{_unitdir}/%{name}.socket
%endif