aboutsummaryrefslogtreecommitdiffstats
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
parent85aa2f308b388f6a42f0eb14b8207310db992a4e (diff)
downloadrspamd-c2788dafc65595414bc8ce3979758e22d183d6e8.tar.gz
rspamd-c2788dafc65595414bc8ce3979758e22d183d6e8.zip
Fix linux packages.
-rw-r--r--centos/rspamd.spec28
-rw-r--r--centos/sources/rspamd.init9
-rw-r--r--debian/compat2
-rw-r--r--debian/control2
-rw-r--r--debian/postrm1
-rw-r--r--debian/preinst1
-rwxr-xr-xdebian/rules2
7 files changed, 36 insertions, 9 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
diff --git a/debian/compat b/debian/compat
index ec635144f..7f8f011eb 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-9
+7
diff --git a/debian/control b/debian/control
index 93b6de926..0611624c4 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: rspamd
Section: mail
Priority: optional
Maintainer: Vsevolod Stakhov <vsevolod@highsecure.ru>
-Build-Depends: debhelper (>= 7.0.50~), dpkg-dev (>= 1.16.1~), cmake, libevent-dev (>= 1.3), libglib2.0-dev (>= 2.16.0), libgmime-2.6-dev, liblua5.2-dev, libpcre3-dev, cdbs, libssl-dev (>= 1.0), libjudy-dev, libcurl4-openssl-dev
+Build-Depends: debhelper (>= 7.0.50~), dpkg-dev (>= 1.16.1~), cmake, libevent-dev (>= 1.3), libglib2.0-dev (>= 2.16.0), libgmime-2.6-dev, liblua5.2-dev | liblua5.1-dev | liblua5.1-0-dev, libpcre3-dev, cdbs, libssl-dev (>= 1.0), libcurl4-openssl-dev
Standards-Version: 3.9.5
Homepage: https://bitbucket.org/vstakhov/rspamd/
Vcs-Hg: https://bitbucket.org/vstakhov/rspamd/
diff --git a/debian/postrm b/debian/postrm
index d6910f0cc..14735e0a2 100644
--- a/debian/postrm
+++ b/debian/postrm
@@ -1,5 +1,6 @@
#!/bin/sh
# postrm script for rspamd
+#DEBHELPER#
set -e
diff --git a/debian/preinst b/debian/preinst
index 48d61b979..3588f2f5b 100644
--- a/debian/preinst
+++ b/debian/preinst
@@ -1,5 +1,6 @@
#!/bin/sh
# preinst script for rspamd
+#DEBHELPER#
set -e
diff --git a/debian/rules b/debian/rules
index a08711f7a..ce09d5128 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,6 +2,8 @@
#export DEB_BUILD_MAINT_OPTIONS=hardening=+all
+export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed
+
include /usr/share/dpkg/buildflags.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/cmake.mk