The attached amavisd.patch and amavisd.spec.patch files do two things. First the amavisd.patch uncomments the clamd daemon startup section of the amavisd.conf file (I figured this was cleaner than attempting to hack this into the shtool edits). The patch to the spec file adds the amavisd.patch handling, and fixes a long-standing bug in the shtool subst handling on the amavisd.conf file where it was replacing on the wrong pattern to point to the clamav socket.
I originally created the amavisd.patch from the CURRENT version of amavisd, but that failed to start on the older Release 2.3 system where I'm doing my production development giving lots of perl errors saying it couldn't find necessary modules. With the exception of the Release date, the patch to the spec file should work on the CURRENT version of amavisd. I would also like to suggest that as a matter of policy, anything like the shtool subst processing should be handled at the beginning of the %build section of spec files, not under %setup. I think that the only things that should be done under %setup is to install sources and apply patches to them. Doing that, an ``openpkg rpm -bp'' command can create a fairly clean directory for doing additional patches without having to deal with the directory after substitutions have been done. Bill -- INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Systems, Inc. UUCP: camco!bill PO Box 820; 6641 E. Mercer Way FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676 URL: http://www.celestial.com/ Government's view of the economy could be summed up in a few short phrases: If it moves, tax it. If it keeps moving, regulate it. And if it stops moving, subsidize it -- Ronald Reagan
diff -uNr ../amavisd-new-2.3.2.orig/amavisd.conf ./amavisd.conf --- ../amavisd-new-2.3.2.orig/amavisd.conf 2005-06-29 03:26:05.000000000 -0700 +++ ./amavisd.conf 2005-08-04 17:23:32.099593481 -0700 @@ -285,14 +285,14 @@ # ### http://www.csupomona.edu/~henson/www/projects/SAVI-Perl/ # ['Sophos SAVI', \&sophos_savi ], -# ### http://www.clamav.net/ -# ['ClamAV-clamd', -# \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd"], -# qr/\bOK$/, qr/\bFOUND$/, -# qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ], -# # NOTE: the easiest is to run clamd under the same user as amavisd; match the -# # socket name (LocalSocket) in clamav.conf to the socket name in this entry -# # When running chrooted one may prefer: ["CONTSCAN {}\n","$MYHOME/clamd"], +### http://www.clamav.net/ +['ClamAV-clamd', + \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd"], + qr/\bOK$/, qr/\bFOUND$/, + qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ], +# NOTE: the easiest is to run clamd under the same user as amavisd; match the +# socket name (LocalSocket) in clamav.conf to the socket name in this entry +# When running chrooted one may prefer: ["CONTSCAN {}\n","$MYHOME/clamd"], # ### http://www.clamav.net/ and CPAN (memory-hungry! clamd is preferred) # ['Mail::ClamAV', \&ask_clamav, "*", [0], [1], qr/^INFECTED: (.+)/],
--- amavisd.spec.orig 2005-02-21 09:02:24.000000000 -0800 +++ amavisd.spec 2005-08-04 17:32:48.572331933 -0700 @@ -34,7 +34,7 @@ Group: Mail License: GPL Version: 2.2.1 -Release: 2.3.0 +Release: 20050804 # package options %option with_milter no @@ -43,6 +43,7 @@ Source0: http://www.ijs.si/software/amavisd/amavisd-new-%{version}.tar.gz Source1: http://homepages.hs-bremen.de/~renegat/amavislogsumm Source2: rc.amavisd +Patch0: amavisd.patch # build information Prefix: %{l_prefix} @@ -75,12 +76,13 @@ %prep %setup -q -n amavisd-new-%{version} + %patch0 -p0 %{l_shtool} subst \ -e "s;'clamscan';'%{l_prefix}/bin/clamscan';g" \ -e "s;'uvscan';'%{l_prefix}/bin/uvscan';g" \ -e "s;'sweep';'%{l_prefix}/bin/sweep';g" \ -e "s;'f-prot';'%{l_prefix}/bin/f-prot';g" \ - -e 's;/var/amavis/clamd;%{l_prefix}/var/clamav/clamd.sock;g' \ + -e 's;/var/run/clamav/clamd;%{l_prefix}/var/clamav/clamd.sock;g' \ -e 's;/var/amavis;%{l_prefix}/var/amavisd;g' \ -e 's;/var/virusmails;%{l_prefix}/var/amavisd/virusmails;g' \ -e 's;/usr/bin/sendmail;%{l_prefix}/sbin/sendmail;g' \