diff --git a/dansguardian-clamd.conf b/dansguardian-clamd.conf new file mode 100644 index 0000000..1327703 --- /dev/null +++ b/dansguardian-clamd.conf @@ -0,0 +1,20 @@ +# Use system logger. +LogSyslog yes + +# Specify the type of syslog messages - please refer to 'man syslog' +# for facility names. +LogFacility LOG_DAEMON + +# This option allows you to save a process identifier of the listening +# daemon (main thread). +PidFile /var/run/dansguardian/clamd.pid + +# Remove stale socket after unclean shutdown. +# Default: disabled +FixStaleSocket yes + +# Run as a selected user (clamd must be started by root). +User dansguardian + +# Path to a local socket file the daemon will listen on. +LocalSocket /var/run/dansguardian/clamd.sock diff --git a/dansguardian-clamd.init b/dansguardian-clamd.init new file mode 100644 index 0000000..97f3a01 --- /dev/null +++ b/dansguardian-clamd.init @@ -0,0 +1,7 @@ +#!/bin/bash +# +# chkconfig: - 91 9 +# description: The clamd server running for dansguardian + +CLAMD_SERVICE=dansguardian +. /usr/share/clamav/clamd-wrapper diff --git a/dansguardian-clamd.sysconfig b/dansguardian-clamd.sysconfig new file mode 100644 index 0000000..408eef7 --- /dev/null +++ b/dansguardian-clamd.sysconfig @@ -0,0 +1,3 @@ +CLAMD_CONFIGFILE=/etc/clamd.d/dansguardian.conf +CLAMD_SOCKET=/var/run/dansguardian/clamd.sock +CLAMD_OPTIONS= diff --git a/dansguardian.spec b/dansguardian.spec index 3542b70..45e0478 100644 --- a/dansguardian.spec +++ b/dansguardian.spec @@ -1,6 +1,6 @@ Name: dansguardian Version: 2.10.1.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Content filtering web proxy Summary(de): Contentfilter-Proxy @@ -16,6 +16,10 @@ Source0: http://dansguardian.org/downloads/2/Stable/%{name}-%{version}.ta Source1: dansguardian.init Source2: dansguardian.httpd Source3: dansguardian.logrotate +# ClamAV integration +Source4: dansguardian-clamd.conf +Source5: dansguardian-clamd.init +Source6: dansguardian-clamd.sysconfig # This patch removes the upstream restrictions on the GPLv2+ source Patch0: dansguardian-copyright-notice.patch # Fixes some compilation errors with gcc 4.4 @@ -32,6 +36,7 @@ Requires(pre): shadow-utils Requires(post): chkconfig Requires(preun): chkconfig Requires(preun): initscripts +Requires: clamav-server %description @@ -106,6 +111,15 @@ rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/%{name} # create the log dir install -dm 755 $RPM_BUILD_ROOT%{_localstatedir}/log/%{name} +# for clamav integration +install -dm 700 $RPM_BUILD_ROOT%{_localstatedir}/run/%{name} +touch $RPM_BUILD_ROOT%{_localstatedir}/run/%{name}/clamd.sock +( cd $RPM_BUILD_ROOT%{_sbindir} && ln -s clamd clamd.%{name} ) +install -m755 %{SOURCE5} $RPM_BUILD_ROOT%{_initrddir}/clamd.%{name} +install -dm755 $RPM_BUILD_ROOT%{_sysconfdir}/clamd.d +install -m644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/clamd.d/%{name}.conf +install -dm755 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig +install -m644 %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/clamd.%{name} %clean rm -rf $RPM_BUILD_ROOT @@ -128,6 +142,7 @@ if [ "$1" -gt 1 ] ; then fi %post +/sbin/chkconfig --add clamd.%{name} /sbin/chkconfig --add %{name} @@ -135,11 +150,14 @@ fi if [ $1 = 0 ] ; then /sbin/service %{name} stop >/dev/null 2>&1 /sbin/chkconfig --del %{name} + /sbin/service clamd.%{name} stop >/dev/null 2>&1 + /sbin/chkconfig --del clamd.%{name} fi %postun if [ "$1" -ge "1" ] ; then + /sbin/service clamd.%{name} condrestart >/dev/null 2>&1 || : /sbin/service %{name} condrestart >/dev/null 2>&1 || : fi @@ -166,9 +184,18 @@ fi %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf %attr(755,%{name},%{name}) %dir %{_localstatedir}/log/%{name} +%attr(700,%{name},%{name}) %dir %{_localstatedir}/run/%{name} +%{_sbindir}/clamd.%{name} +%{_initrddir}/clamd.%{name} +%ghost %{_localstatedir}/run/%{name}/clamd.sock +%config(noreplace) %{_sysconfdir}/clamd.d/%{name}.conf +%config(noreplace) %{_sysconfdir}/sysconfig/clamd.%{name} %changelog +* Wed Sep 30 2009 Steven Pritchard - 2.10.1.1-4 +- Add Fedora clamav package bits to properly integrate + * Thu Sep 10 2009 Felix Kaechele - 2.10.1.1-3 - fixes for Bugzilla 515159, 515160, 515161, 515363, 519642, 519976, 520440 - lists now reside in /etc/dansguardian/lists