]> git.pld-linux.org Git - packages/clamav.git/commitdiff
- Made work as user clamav clamav-0_60-4
authorMateusz Korniak <matkor@pld-linux.org>
Thu, 28 Aug 2003 13:10:39 +0000 (13:10 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- Added triggered add clamav user to amavis group (sb. wise pls check it)
- Fixed paths to smooth work with latest amavisd-new config (pld_config.patch)
- Made logging via syslog (clamd)
- Should work out of box with amavisd-new.
- Release 4. STBR for Ra.

Changed files:
    clamav-pld_config.patch -> 1.1
    clamav.spec -> 1.47

clamav-pld_config.patch [new file with mode: 0644]
clamav.spec

diff --git a/clamav-pld_config.patch b/clamav-pld_config.patch
new file mode 100644 (file)
index 0000000..4fe52e6
--- /dev/null
@@ -0,0 +1,83 @@
+diff -urN clamav-0.60.orig/etc/clamav.conf clamav-0.60/etc/clamav.conf
+--- clamav-0.60.orig/etc/clamav.conf   Thu Aug 28 14:14:08 2003
++++ clamav-0.60/etc/clamav.conf        Thu Aug 28 14:15:09 2003
+@@ -5,12 +5,12 @@
+  
+ # Comment or remove the line below.
+-Example
++# Example
+ # Uncomment this option to enable logging.
+ # LogFile must be writable for the user running the daemon.
+ # Full path is required.
+-#LogFile /tmp/clamd.log
++#LogFile /var/log/clamd.log
+ # By default the log file is locked for writing - the lock protects against
+ # running clamd multiple times (if want to run another clamd, please
+@@ -30,19 +30,20 @@
+ #LogTime
+ # Use system logger (can work together with LogFile).
+-#LogSyslog
++LogSyslog
+ # Enable verbose logging.
+-#LogVerbose
++# LogVerbose
+ # This option allows you to save the process identifier of the listening
+ # daemon (main thread).
+-#PidFile /var/run/clamd.pid
++# We use dir becouse covering clamd.pid file couse default rights are sane.
++PidFile /var/run/clamav/clamd.pid 
+ # Path to a directory containing .db files.
+ # Default is the hardcoded directory (mostly /usr/local/share/clamav,
+ # it depends on installation options).
+-#DataDirectory /var/lib/clamav
++DataDirectory /var/lib/clamav
+  
+ # The daemon works in local or network mode. Currently the local mode is
+ # recommended for security reasons.
+@@ -50,7 +51,9 @@
+ # Path to the local socket. The daemon doesn't change the mode of the
+ # created file (portability reasons). You may want to create it in a directory
+ # which is only accessible for a user running daemon.
+-LocalSocket /tmp/clamd
++# LocalSocket /var/run/clamav/clamd.socket
++
++LocalSocket /var/lib/clamav/clamd.socket
+ # TCP port address.
+ #TCPSocket 3310
+@@ -93,11 +96,11 @@
+ # Run as selected user (clamd must be started by root).
+ # By default it doesn't drop privileges.
+-#User clamav
++User clamav
+ # Initialize the supplementary group access (for all groups in /etc/group
+ # user is added in. clamd must be started by root).
+-#AllowSupplementaryGroups
++AllowSupplementaryGroups
+ # Don't fork into background. Useful in debugging.
+ #Foreground
+@@ -107,13 +110,12 @@
+ ##
+ # Uncomment this option if you are planning to scan mail files.
+-#ScanMail
++ScanMail
+ ##
+ ## Archive support
+ ##
+-
+ # Comment this line to disable scanning of the archives.
+ ScanArchive
index 8c2e9b7ebb2a7f532fa271aeb55207ed631c1293..5eb05b5e6eac76c0f632cd6e95506291213d1cbe 100644 (file)
@@ -1,9 +1,14 @@
+# TODO:
+# - Fix inconsistency:
+#   clamd uses syslog but log from (crond) db update goes to
+#   /var/log/clamd.log
+
 %define                database_version 20030813
 Summary:       An anti-virus utility for Unix
 Summary(pl):   Antywirusowe narzêdzie dla Unixów
 Name:          clamav
 Version:       0.60
-Release:       3
+Release:       4
 License:       GPL
 Group:         Applications
 Source0:       http://dl.sourceforge.net/clamav/%{name}-%{version}.tar.gz
@@ -13,6 +18,7 @@ Source2:      %{name}.sysconfig
 # gziped from http://clamav.elektrapro.com/database/:
 Source3:       %{name}-database-%{database_version}.tar.gz
 # Source3-md5: a8848904249edd97b873a43032c0208f
+Patch0:         %{name}-pld_config.patch
 URL:           http://www.clamav.net/
 BuildRequires: autoconf
 BuildRequires: automake
@@ -86,7 +92,8 @@ Bazy wirus
 
 %prep
 %setup -q -a 3
-
+%patch0 -p1
 %build
 rm -f missing
 %{__aclocal}
@@ -120,9 +127,43 @@ install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
 install etc/clamav.conf $RPM_BUILD_ROOT%{_sysconfdir}/
 
+# NOTE: clamd uses sane rights to it's clamd.pid file
+# So better keep it dir
+# If it is fixed use of dir will be unecesary
+install -d $RPM_BUILD_ROOT%{_var}/run/%{name}
+# touch $RPM_BUILD_ROOT%{_var}/run/%{name}/clamd.pid
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+# FIXME: Does %triggerin -- amavis-ng really have to written three times ?
+# It's stolen from mksd.spec - if it's wrong fix mksd.spec too
+
+%triggerin -- amavis-ng
+AMAVIS=$(/usr/bin/getgid amavis)
+RESULT=$?
+if  [ $RESULT -eq 0 ]; then
+        /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
+        echo "adding clamav to amavis group GID=$AMAVIS"
+fi
+
+%triggerin -- amavisd-new
+AMAVIS=$(/usr/bin/getgid amavis)
+RESULT=$?
+if  [ $RESULT -eq 0 ]; then
+        /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
+        echo "adding clamav to amavis group GID=$AMAVIS"
+fi
+
+%triggerin -- amavisd
+AMAVIS=$(/usr/bin/getgid amavis)
+RESULT=$?
+if  [ $RESULT -eq 0 ]; then
+        /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
+        echo "adding clamav to amavis group GID=$AMAVIS"
+fi
+
+
 %pre
 if [ -n "`getgid clamav`" ]; then
         if [ "`getgid clamav`" != "43" ]; then
@@ -179,6 +220,9 @@ fi
 %attr(755,clamav,root) %dir /var/lib/%{name}
 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/mirrors.txt
 %attr(640,clamav,root) %ghost %{_var}/log/%{name}.log
+%attr(750,clamav,clamav) %dir %{_var}/run/%{name}
+# %%attr(666,clamav,clamav) %%ghost %{_var}/run/%{name}/clamd.pid
+
 %attr(750,root,root) %{_sysconfdir}/cron.daily/%{name}
 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/*.conf
 %attr(754,root,root) /etc/rc.d/init.d/clamd
This page took 0.083882 seconds and 4 git commands to generate.