[packages/amavisd-new] - up to 2.8.1 - added systemd service file
baggins
baggins at pld-linux.org
Fri Aug 16 19:09:58 CEST 2013
commit 34bb2dd77b8a5a9c10aed27c6992103755fccb17
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Fri Aug 16 19:09:43 2013 +0200
- up to 2.8.1
- added systemd service file
amavisd-new-config.patch | 10 +++++-----
amavisd-new.service | 13 +++++++++++++
amavisd-new.spec | 21 ++++++++++++++++-----
3 files changed, 34 insertions(+), 10 deletions(-)
---
diff --git a/amavisd-new.spec b/amavisd-new.spec
index a27b53b..f819de9 100644
--- a/amavisd-new.spec
+++ b/amavisd-new.spec
@@ -6,21 +6,22 @@
Summary: A Mail Virus Scanner with SpamAssassin support - daemon
Summary(pl.UTF-8): Antywirusowy skaner poczty elektronicznej z obsługą SpamAssasina - demon
Name: amavisd-new
-Version: 2.7.0
-Release: 2
+Version: 2.8.1
+Release: 1
Epoch: 1
License: GPL
Group: Applications/Mail
Source0: http://www.ijs.si/software/amavisd/%{name}-%{version}.tar.xz
-# Source0-md5: 54e13e9804358982a05624900c9d0d6e
+# Source0-md5: d6a9269438ef6ff43ca94ce9ace77afc
Source1: %{name}.init
Source2: %{name}.tmpfiles
Source3: %{name}.tmpwatch
+Source4: %{name}.service
Patch0: %{name}-config.patch
Patch1: %{name}-tools-dbdir.patch
URL: http://www.ijs.si/software/amavisd/
BuildRequires: rpm-perlprov
-BuildRequires: rpmbuild(macros) >= 1.304
+BuildRequires: rpmbuild(macros) >= 1.671
BuildRequires: tar >= 1:1.22
Requires(post,preun): /sbin/chkconfig
Requires(postun): /usr/sbin/groupdel
@@ -43,6 +44,7 @@ Requires: perl-Unix-Syslog
Requires: perl-libnet
Requires: rc-scripts >= 0.4.1.23
Requires: sh-utils
+Requires: systemd-units >= 38
Suggests: amavisd-milter >= 1.5.0
#Suggests: arc
#Suggests: arj
@@ -135,7 +137,8 @@ Ten pakiet zawiera schemat LDAP do używania z amavisd-new.
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_var}/spool/amavis/{runtime,virusmails,db} \
$RPM_BUILD_ROOT{%{_var}/run/amavisd,/etc/rc.d/init.d,%{_sbindir}} \
- $RPM_BUILD_ROOT{/usr/lib/tmpfiles.d,%{_tmpwatchdir}}
+ $RPM_BUILD_ROOT{/usr/lib/tmpfiles.d,%{_tmpwatchdir}} \
+ $RPM_BUILD_ROOT%{systemdunitdir}
install -p amavisd $RPM_BUILD_ROOT%{_sbindir}
install -p amavisd-agent $RPM_BUILD_ROOT%{_sbindir}
@@ -148,6 +151,7 @@ install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/amavisd
cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_tmpwatchdir}/%{name}.conf
install %{SOURCE2} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
+install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/amavisd.service
install -Dp LDAP.schema $RPM_BUILD_ROOT%{schemadir}/amavisd-new.schema
@@ -163,16 +167,22 @@ if [ "$1" = "0" ]; then
%userremove amavis
%groupremove amavis
fi
+%systemd_reload
%post
/sbin/chkconfig --add amavisd
%service amavisd restart "Amavisd daemon"
+%systemd_post amavisd.service
%preun
if [ "$1" = "0" ]; then
%service amavisd stop
/sbin/chkconfig --del amavisd
fi
+%systemd_preun amavisd.service
+
+%triggerpostun -- %{name} < 1:2.8.1-1
+%systemd_trigger amavisd.service
%post -n openldap-schema-amavisd-new
%openldap_schema_register %{schemadir}/amavisd-new.schema
@@ -192,6 +202,7 @@ fi
%attr(755,root,root) %{_sbindir}/amavisd-nanny
%attr(755,root,root) %{_sbindir}/amavisd-release
%attr(755,root,root) %{_sbindir}/amavisd-submit
+%{systemdunitdir}/amavisd.service
%attr(754,root,root) /etc/rc.d/init.d/amavisd
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/amavisd.conf
%config(noreplace) %verify(not md5 mtime size) %{_tmpwatchdir}/%{name}.conf
diff --git a/amavisd-new-config.patch b/amavisd-new-config.patch
index ecf033e..b2ffb40 100644
--- a/amavisd-new-config.patch
+++ b/amavisd-new-config.patch
@@ -55,23 +55,23 @@
-# ### http://www.clamav.net/
-# ['ClamAV-clamd',
--# \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd"],
+-# \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd.sock"],
-# qr/\bOK$/m, qr/\bFOUND$/m,
-# qr/^.*?: (?!Infected Archive)(.*) FOUND$/m ],
--# # NOTE: run clamd under the same user as amavisd, or run it under its own
+-# # NOTE: run clamd under the same user as amavisd - or run it under its own
-# # uid such as clamav, add user clamav to the amavis group, and then add
-# # AllowSupplementaryGroups to clamd.conf;
-# # NOTE: match socket name (LocalSocket) in clamav.conf to the socket name in
--# # this entry; when running chrooted one may prefer socket "$MYHOME/clamd".
+-# # this entry; when running chrooted one may prefer a socket under $MYHOME.
+['ClamAV-clamd',
+ \&ask_daemon, ["CONTSCAN {}\n", "/var/lib/clamav/clamd.socket"],
+ qr/\bOK$/, qr/\bFOUND$/,
+ qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
-+# NOTE: run clamd under the same user as amavisd, or run it under its own
++# NOTE: run clamd under the same user as amavisd - or run it under its own
+# uid such as clamav, add user clamav to the amavis group, and then add
+# AllowSupplementaryGroups to clamd.conf;
+# NOTE: match socket name (LocalSocket) in clamav.conf to the socket name in
-+# this entry; when running chrooted one may prefer socket "$MYHOME/clamd".
++# this entry; when running chrooted one may prefer a socket under $MYHOME.
# ### http://www.clamav.net/ and CPAN (memory-hungry! clamd is preferred)
# # note that Mail::ClamAV requires perl to be build with threading!
diff --git a/amavisd-new.service b/amavisd-new.service
new file mode 100644
index 0000000..8bae5f0
--- /dev/null
+++ b/amavisd-new.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Interface between MTA and content checkers
+After=network.target
+
+[Service]
+Type=forking
+EnvironmentFile=-/etc/sysconfig/amavisd
+ExecStart=/usr/sbin/amavisd -c /etc/amavisd.conf
+ExecStop=/usr/sbin/amavisd -c /etc/amavisd.conf stop
+ExecReload=/usr/sbin/amavisd -c /etc/amavisd.conf reload
+
+[Install]
+WantedBy=multi-user.target
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/amavisd-new.git/commitdiff/34bb2dd77b8a5a9c10aed27c6992103755fccb17
More information about the pld-cvs-commit
mailing list