summaryrefslogtreecommitdiffstats
path: root/centos
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-12-19 17:51:53 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-12-19 17:51:53 +0000
commitc2788dafc65595414bc8ce3979758e22d183d6e8 (patch)
treea203f04d7081d856fbfb56161919a893c0fc2e28 /centos
parent85aa2f308b388f6a42f0eb14b8207310db992a4e (diff)
downloadrspamd-c2788dafc65595414bc8ce3979758e22d183d6e8.tar.gz
rspamd-c2788dafc65595414bc8ce3979758e22d183d6e8.zip
Fix linux packages.
Diffstat (limited to 'centos')
-rw-r--r--centos/rspamd.spec28
-rw-r--r--centos/sources/rspamd.init9
2 files changed, 30 insertions, 7 deletions
diff --git a/centos/rspamd.spec b/centos/rspamd.spec
index 938dc9f9f..7a1e1051c 100644
--- a/centos/rspamd.spec
+++ b/centos/rspamd.spec
@@ -7,6 +7,12 @@
%define USE_JUDY 0
+%if 0%{?suse_version}
+%define __cmake cmake
+%define __install install
+%define __make make
+%endif
+
Name: rspamd
Version: 0.6.4
Release: 1
@@ -18,19 +24,23 @@ Group: System Environment/Daemons
License: BSD
URL: https://rspamd.com
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
-%if USE_JUDY
-BuildRequires: cmake,glib2-devel,gmime-devel,libevent-devel,openssl-devel,lua-devel,Judy-devel
+%if "%{USE_JUDY}" == "1"
+BuildRequires: cmake,glib2-devel,gmime-devel,libevent-devel,openssl-devel,lua-devel,Judy-devel,pcre-devel
Requires: glib2,gmime,lua,Judy,libevent
%else
-BuildRequires: cmake,glib2-devel,gmime-devel,libevent-devel,openssl-devel,lua-devel
+BuildRequires: cmake,glib2-devel,gmime-devel,libevent-devel,openssl-devel,lua-devel,pcre-devel
Requires: glib2,gmime,lua,libevent
%endif
# for /user/sbin/useradd
+%if 0%{?suse_version}
+Requires(pre): shadow
+%else
Requires(pre): shadow-utils
Requires(post): chkconfig
# for /sbin/service
Requires(preun): chkconfig, initscripts
Requires(postun): initscripts
+%endif
Source0: http://cdn.bitbucket.org/vstakhov/rspamd/downloads/%{name}-%{version}.tar.gz
Source1: %{name}.init
@@ -61,7 +71,7 @@ rm -rf %{buildroot}
-DDEBIAN_BUILD=1 \
-DRSPAMD_GROUP=%{rspamd_group} \
-DRSPAMD_USER=%{rspamd_user} \
-%if USE_JUDY
+%if "%{USE_JUDY}" == "1"
-DENABLE_JUDY=ON
%else
-DENABLE_JUDY=OFF
@@ -75,13 +85,14 @@ rm -rf %{buildroot}
%{__install} -p -D -m 0755 %{SOURCE1} %{buildroot}%{_initrddir}/%{name}
%{__install} -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
%{__install} -d -p -m 0755 %{buildroot}%{rspamd_logdir}
-%{__install} -o %{rspamd_user} -g %{rspamd_group} -d -p -m 0755 %{buildroot}%{rspamd_home}
%clean
rm -rf %{buildroot}
%pre
-%{_sbindir}/useradd -c "Rspamd user" -s /bin/false -r -d %{rspamd_home} %{rspamd_user} 2>/dev/null || :
+%{_sbindir}/groupadd -r %{rspamd_group} 2>/dev/null || :
+%{_sbindir}/useradd -g %{rspamd_group} -c "Rspamd user" -s /bin/false -N -r -d %{rspamd_home} %{rspamd_user} 2>/dev/null || :
+%{__install} -o %{rspamd_user} -g %{rspamd_group} -d -p -m 0755 %{buildroot}%{rspamd_home}
%post
/sbin/chkconfig --add %{name}
@@ -114,8 +125,11 @@ fi
%config(noreplace) %{rspamd_confdir}/workers.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%dir %{rspamd_logdir}
+%dir %{rspamd_confdir}/lua/regexp
+%dir %{rspamd_confdir}/lua
%dir %{rspamd_confdir}
-%attr(755, %{rspamd_user}, %{rspamd_group}) %dir %{rspamd_home}
+%dir %{rspamd_pluginsdir}/lua
+%dir %{rspamd_pluginsdir}
%config(noreplace) %{rspamd_confdir}/2tld.inc
%config(noreplace) %{rspamd_confdir}/surbl-whitelist.inc
%config(noreplace) %{rspamd_pluginsdir}/lua/forged_recipients.lua
diff --git a/centos/sources/rspamd.init b/centos/sources/rspamd.init
index 864b915b5..78714a935 100644
--- a/centos/sources/rspamd.init
+++ b/centos/sources/rspamd.init
@@ -1,6 +1,15 @@
#!/bin/sh
#
# rspamd - this script starts and stops the rspamd daemon
+### BEGIN INIT INFO
+# Provides: rspamd
+# Required-Start: $remote_fs $network
+# Required-Stop: $network $remote_fs
+# Default-Start: 5
+# Default-Stop:
+# Short-Description: Rspamd daemon
+# Description: Rspamd spam filtering daemon process
+### END INIT INFO
#
# chkconfig: - 85 15
# description: rspamd is a spam filtering system