rpms/clamav/EL-5 clamav-0.92-private.patch, NONE, 1.1 clamav-0.95-cliopts.patch, NONE, 1.1 clamav-0.95rc1-umask.patch, NONE, 1.1 clamav-milter.sysv, NONE, 1.1 .cvsignore, 1.13, 1.14 clamav.spec, 1.55, 1.56 clamd-wrapper, 1.1, 1.2 sources, 1.29, 1.30 clamav-0.90rc3-private.patch, 1.1, NONE clamav-0.93.1-path.patch, 1.1, NONE clamav-0.93.3-initoff.patch, 1.1, NONE clamav-0.93.3-pid.patch, 1.1, NONE

Robert Scheck robert at fedoraproject.org
Fri Apr 10 21:10:35 UTC 2009


Author: robert

Update of /cvs/pkgs/rpms/clamav/EL-5
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv28876/EL-5

Modified Files:
	.cvsignore clamav.spec clamd-wrapper sources 
Added Files:
	clamav-0.92-private.patch clamav-0.95-cliopts.patch 
	clamav-0.95rc1-umask.patch clamav-milter.sysv 
Removed Files:
	clamav-0.90rc3-private.patch clamav-0.93.1-path.patch 
	clamav-0.93.3-initoff.patch clamav-0.93.3-pid.patch 
Log Message:
- Upgrade to 0.95.1 (#495036, #495039) and enabled IPv6 support
- Fixed typo in SysV initscript which removes 'touch' file (#473513)
- Added build requirement to ncurses-devel for clamdtop


clamav-0.92-private.patch:

--- NEW FILE clamav-0.92-private.patch ---
--- clamav-0.92/libclamav.pc.in.private
+++ clamav-0.92/libclamav.pc.in
@@ -6,6 +6,6 @@ includedir=@includedir@
 Name: libclamav
 Description: A GPL virus scanner
 Version: @LIBCLAMAV_VERSION@
-Libs: -L${libdir} -lclamav @LIBCLAMAV_LIBS@
-Cflags: -I${includedir} @CFLAGS@
-
+Libs: -L${libdir} -lclamav
+Libs.private: -L${libdir} -lclamav @LIBCLAMAV_LIBS@
+Cflags: -I${includedir}
--- clamav-0.92/clamav-config.in.private
+++ clamav-0.92/clamav-config.in
@@ -54,12 +54,8 @@ while test $# -gt 0; do
 	usage 0
 	;;
 
-    --cflags)
-       	echo -I at includedir@ @CFLAGS@
-       	;;
-
-    --libs)
-       	echo -L at libdir@ @LIBCLAMAV_LIBS@
+    (--cflags|--libs)
+       	${PKG_CONFIG:-pkg-config} "$1" libclamav
        	;;
 
     *)

clamav-0.95-cliopts.patch:

--- NEW FILE clamav-0.95-cliopts.patch ---
Index: clamav-0.95rc1/shared/optparser.c
===================================================================
--- clamav-0.95rc1.orig/shared/optparser.c
+++ clamav-0.95rc1/shared/optparser.c
@@ -211,7 +211,7 @@ const struct clam_option clam_options[] 
 
     { "ExitOnOOM", NULL, 0, TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD, "Stop the daemon when libclamav reports an out of memory condition.", "yes" },
 
-    { "Foreground", NULL, 0, TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_FRESHCLAM | OPT_MILTER, "Don't fork into background.", "no" },
+    { "Foreground", "nofork", 0, TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_FRESHCLAM | OPT_MILTER, "Don't fork into background.", "no" },
 
     { "Debug", NULL, 0, TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_FRESHCLAM, "Enable debug messages in libclamav.", "no" },
 

clamav-0.95rc1-umask.patch:

--- NEW FILE clamav-0.95rc1-umask.patch ---
Index: clamav-0.95rc1/clamav-milter/clamav-milter.c
===================================================================
--- clamav-0.95rc1.orig/clamav-milter/clamav-milter.c
+++ clamav-0.95rc1/clamav-milter/clamav-milter.c
@@ -287,7 +287,7 @@ int main(int argc, char **argv) {
 
     if((opt = optget(opts, "PidFile"))->enabled) {
 	FILE *fd;
-	mode_t old_umask = umask(0006);
+	mode_t old_umask = umask(0022);
 
 	if((fd = fopen(opt->strarg, "w")) == NULL) {
 	    logg("!Can't save PID in file %s\n", opt->strarg);
Index: clamav-0.95rc1/shared/output.c
===================================================================
--- clamav-0.95rc1.orig/shared/output.c
+++ clamav-0.95rc1/shared/output.c
@@ -250,7 +250,7 @@ int logg(const char *str, ...)
 #endif
     if(logg_file) {
 	if(!logg_fp) {
-	    old_umask = umask(0037);
+	    old_umask = umask(0077);
 	    if((logg_fp = fopen(logg_file, "at")) == NULL) {
 		umask(old_umask);
 #ifdef CL_THREAD_SAFE
Index: clamav-0.95rc1/freshclam/freshclam.c
===================================================================
--- clamav-0.95rc1.orig/freshclam/freshclam.c
+++ clamav-0.95rc1/freshclam/freshclam.c
@@ -102,7 +102,7 @@ static void writepid(const char *pidfile
 {
 	FILE *fd;
 	int old_umask;
-    old_umask = umask(0006);
+    old_umask = umask(0022);
     if((fd = fopen(pidfile, "w")) == NULL) {
 	logg("!Can't save PID to file %s: %s\n", pidfile, strerror(errno));
     } else {


--- NEW FILE clamav-milter.sysv ---
#!/bin/sh
#
# clamav-milter This script starts and stops the clamav-milter daemon
#
# chkconfig: - 79 40
#
# description: clamav-milter is a daemon which hooks into sendmail and routes \
#              email messages for virus scanning with ClamAV
# processname: clamav-milter
# pidfile: /var/lock/subsys/clamav-milter

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Local clamav-milter config
CLAMAV_FLAGS=
test -f /etc/sysconfig/clamav-milter && . /etc/sysconfig/clamav-milter

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

PATH=$PATH:/usr/bin:/usr/local/sbin:/usr/local/bin

RETVAL=0

# Clamav-milter must have write access to the pid file, /var/run is not suitable
default_pidfile=
[ -d /var/run/clamav-milter ] && default_pidfile=/var/run/clamav-milter/clamav-milter.pid
[ -d /var/clamav ] && default_pidfile=/var/clamav/clamav-milter.pid
pidfile=${PIDFILE:-$default_pidfile}

lockfile=/var/lock/subsys/clamav-milter

start() {
        echo -n "Starting clamav-milter: "
	# Don't allow files larger than 25M to be created, to limit DoS
	# Needs to be large enough to extract the signature files
	ulimit -f 25600
	if [ ! -z $pidfile ]; then
		CLAMAV_PID=--pidfile=${pidfile}
		PID=`pidofproc -p ${pidfile} clamav-milter`
	else
		CLAMAV_PID=
		PID=`pidofproc clamav-milter`
	fi
	[ -n "$PID" ] && echo " already running!" && return 1
        LANG= daemon clamav-milter $CLAMAV_PID ${CLAMAV_FLAGS}
        RETVAL=$?
	[ ! -z $pidfile -a -f $pidfile ] && sed -i -e 's/-//' $pidfile
        echo
	test $RETVAL -eq 0 && touch ${lockfile}
	return $RETVAL
}

stop() {
        echo -n "Shutting down clamav-milter: "
	if [ ! -z $pidfile ]; then
	        killproc -p ${pidfile} clamav-milter
	else
		killproc clamav-milter
	fi
        RETVAL=$?
        echo
	test $RETVAL -eq 0 && rm -f ${lockfile} ${pidfile}
}

restart() {
	stop
	start
}

# See how we were called.
case "$1" in
  start)
        # Start daemon.
	start
        ;;
  stop)
        # Stop daemon.
	stop
        ;;
  restart|reload)
	restart
        ;;
  condrestart)
	test -f ${lockfile} && restart || :
        ;;
  status)
	if [ ! -z $pidfile ]; then
	        status -p ${pidfile} clamav-milter
	else
		status clamav-milter
	fi
        ;;
  *)
        echo "Usage: $0 {start|stop|reload|restart|condrestart|status}"
        exit 1
esac

exit $?


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/clamav/EL-5/.cvsignore,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- .cvsignore	2 Dec 2008 22:26:30 -0000	1.13
+++ .cvsignore	10 Apr 2009 21:10:04 -0000	1.14
@@ -1 +1 @@
-clamav-0.94.2-norar.tar.bz2
+clamav-0.95.1-norar.tar.bz2


Index: clamav.spec
===================================================================
RCS file: /cvs/pkgs/rpms/clamav/EL-5/clamav.spec,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- clamav.spec	2 Dec 2008 22:26:31 -0000	1.55
+++ clamav.spec	10 Apr 2009 21:10:04 -0000	1.56
@@ -15,7 +15,7 @@
 
 Summary:	End-user tools for the Clam Antivirus scanner
 Name:		clamav
-Version:	0.94.2
+Version:	0.95.1
 Release:	%release_func 1
 
 License:	GPLv2
@@ -25,7 +25,7 @@
 # incompatible unrar from RARlabs. We have to pull this code out.
 # tarball was created by
 #   make clean-sources [TARBALL=<original-tarball>] [VERSION=<version>]
-Source0:	clamav-%{version}-norar.tar.bz2
+Source0:	%name-%version-norar.tar.bz2
 # Source0:	http://download.sourceforge.net/sourceforge/clamav/%name-%version.tar.gz
 # No sense in using this file for the time being.
 # Source999:	http://download.sourceforge.net/sourceforge/clamav/%name-%version.tar.gz.sig
@@ -36,15 +36,15 @@
 Source6:	clamav-update.logrotate
 Source7:	clamd.SERVICE.init
 Source8:	clamav-notify-servers
-Patch21:	clamav-0.93.1-path.patch
-Patch22:	clamav-0.93.3-initoff.patch
-Patch24:	clamav-0.90rc3-private.patch
+Patch24:	clamav-0.92-private.patch
 Patch25:	clamav-0.92-open.patch
-Patch26:	clamav-0.93.3-pid.patch
+Patch26:	clamav-0.95-cliopts.patch
+Patch27:	clamav-0.95rc1-umask.patch
 BuildRoot:	%_tmppath/%name-%version-%release-root
 Requires:	clamav-lib = %version-%release
 Requires:	data(clamav)
 BuildRequires:	zlib-devel bzip2-devel gmp-devel curl-devel
+BuildRequires:	ncurses-devel
 BuildRequires:	%_includedir/tcpd.h
 BuildRequires:	bc
 
@@ -71,6 +71,7 @@
 Requires:	clamav-lib        = %version-%release
 Requires:	clamav-filesystem = %version-%release
 Requires(pre):	%_libdir/pkgconfig
+Requires:	pkgconfig
 
 %package data
 Summary:	Virus signature data for the Clam Antivirus scanner
@@ -131,6 +132,7 @@
 %package milter-sysv
 Summary:	SysV initscripts for the clamav sendmail-milter
 Group:		System Environment/Daemons
+Source320:	clamav-milter.sysv
 Provides:	init(clamav-milter) = sysv
 Requires:	clamav-milter = %version-%release
 Requires(post):		user(%milteruser) clamav-milter
@@ -229,23 +231,24 @@
 %prep
 %setup -q
 
-%patch21 -p1 -b .path
-%patch22 -p1 -b .initoff
 %patch24 -p1 -b .private
 %patch25 -p1 -b .open
-%patch26 -p1 -b .pid
+%patch26 -p1 -b .cliopts
+%patch27 -p1 -b .umask
 
 mkdir -p libclamunrar{,_iface}
 touch libclamunrar/{Makefile.in,all,install}
 
-perl -pi -e 's!^(#?LogFile ).*!\1/var/log/clamd.<SERVICE>!g;
-	     s!^#?(LocalSocket ).*!\1/var/run/clamd.<SERVICE>/clamd.sock!g;
-	     s!^#?(PidFile ).*!\1/var/run/clamd.<SERVICE>/clamd.pid!g;
-	     s!^#?(User ).*!\1<USER>!g;
-             s! /usr/local/share/clamav,! %homedir,!g;
-            ' etc/clamd.conf
+sed -ri \
+    -e 's!^(#?LogFile ).*!\1/var/log/clamd.<SERVICE>!g' \
+    -e 's!^(#?LocalSocket ).*!\1/var/run/clamd.<SERVICE>/clamd.sock!g' \
+    -e 's!^(#?PidFile ).*!\1/var/run/clamd.<SERVICE>/clamd.pid!g' \
+    -e 's!^#?(User ).*!\1<USER>!g' \
+    -e 's!^#?(AllowSupplementaryGroups|LogSyslog).*!\1 yes!g' \
+    -e 's! /usr/local/share/clamav,! %homedir,!g' \
+    etc/clamd.conf
 
-perl -pi -e 's!^#(UpdateLogFile )!\1!g;' etc/freshclam.conf
+sed -ri -e 's!^#(UpdateLogFile )!\1!g;' etc/freshclam.conf
 
 
 ## ------------------------------------------------------------
@@ -255,12 +258,17 @@
 export LDFLAGS='-Wl,--as-needed'
 # HACK: remove me, when configure uses $LIBS instead of $LDFLAGS for milter check
 export LIBS='-lmilter -lpthread'
-%configure --disable-clamav --with-dbdir=/var/lib/clamav \
-	   --enable-milter --disable-static --disable-unrar
-sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool
-# No rpath
-sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
-sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
+# IPv6 check is buggy and does not work when there are no IPv6 interface on build machine
+export have_cv_ipv6=yes
+%configure --disable-clamav --with-dbdir=/var/lib/clamav	\
+	--enable-milter --disable-static			\
+	--disable-rpath --disable-unrar
+
+# build with --as-needed and disable rpath
+sed -i \
+	-e 's! -shared ! -Wl,--as-needed\0!g' 					\
+	-e '/sys_lib_dlsearch_path_spec=\"\/lib \/usr\/lib /s!\"\/lib \/usr\/lib !/\"/%_lib /usr/%_lib !g'	\
+	libtool
 
 
 make %{?_smp_mflags}
@@ -297,6 +305,7 @@
 rm -f	${RPM_BUILD_ROOT}%_sysconfdir/clamd.conf \
 	${RPM_BUILD_ROOT}%_libdir/*.la
 
+
 touch ${RPM_BUILD_ROOT}%homedir/daily.cld
 touch ${RPM_BUILD_ROOT}%homedir/main.cld
 
@@ -348,7 +357,8 @@
 CLAMAV_FLAGS='-lo -c /etc/clamd.d/milter.conf local:%milterstatedir/clamav.sock'
 EOF
 
-install -p -m755 contrib/init/RedHat/clamav-milter $RPM_BUILD_ROOT%_initrddir/clamav-milter
+install -p -m 755 %SOURCE320 $RPM_BUILD_ROOT%_initrddir/clamav-milter
+rm -f $RPM_BUILD_ROOT%_sysconfdir/clamav-milter.conf
 touch $RPM_BUILD_ROOT%milterstatedir/clamav.sock $RPM_BUILD_ROOT%milterlog
 
 
@@ -455,6 +465,7 @@
 %defattr(-,%username,%username,-)
 %ghost %attr(0664,%username,%username) %homedir/*.cvd
 
+
 ## -----------------------
 
 %files update
@@ -468,7 +479,6 @@
 %config(noreplace) %_sysconfdir/sysconfig/freshclam
 
 %ghost %attr(0664,root,%username) %verify(not size md5 mtime) %freshclamlog
-
 %ghost %attr(0664,%username,%username) %homedir/*.cld
 
 
@@ -495,13 +505,12 @@
 
 %files milter
 %defattr(-,root,root,-)
-%doc clamav-milter/INSTALL
 %_sbindir/*milter*
 %_mandir/man8/clamav-milter*
 %config(noreplace) %verify(not mtime) %_sysconfdir/clamd.d/milter.conf
-%attr(0700,%milteruser,%milteruser) %dir %milterstatedir
-%ghost %milterstatedir/*
 %ghost %attr(0620,root,%milteruser) %verify(not size md5 mtime) %milterlog
+%attr(0710,%milteruser,%milteruser) %dir %milterstatedir
+%ghost %milterstatedir/*
 
 
 %files milter-sysv
@@ -511,6 +520,11 @@
 
 
 %changelog
+* Fri Apr 10 2009 Robert Scheck <robert at fedoraproject.org> - 0.95.1-1
+- Upgrade to 0.95.1 (#495036, #495039) and enabled IPv6 support
+- Fixed typo in SysV initscript which removes 'touch' file (#473513)
+- Added build requirement to ncurses-devel for clamdtop
+
 * Tue Dec 02 2008 Robert Scheck <robert at fedoraproject.org> - 0.94.2-1
 - Upgrade to 0.94.2 (#474002)
 


Index: clamd-wrapper
===================================================================
RCS file: /cvs/pkgs/rpms/clamav/EL-5/clamd-wrapper,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- clamd-wrapper	8 Nov 2004 04:10:52 -0000	1.1
+++ clamd-wrapper	10 Apr 2009 21:10:04 -0000	1.2
@@ -28,7 +28,7 @@
 CLAMD_OPTIONS=
 ## backward-compatibility check...
 for i in /var/run/clamd.${CLAMD_SERVICE}/clamd.sock \
-         /var/run/clamav.${CLAMD_SERVICE}/clamd.sock; do
+	 /var/run/clamav.${CLAMD_SERVICE}/clamd.sock; do
   CLAMD_SOCKET=$i
   test ! -e "$i" || break
 done
@@ -52,7 +52,7 @@
 	killproc $procname
 	RETVAL=$?
 	echo
-	[ $RETVAL -eq 0 ] && rm -f touch $lockfile
+	[ $RETVAL -eq 0 ] && rm -f $lockfile
 	return $RETVAL
 }
 


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/clamav/EL-5/sources,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- sources	2 Dec 2008 22:26:31 -0000	1.29
+++ sources	10 Apr 2009 21:10:04 -0000	1.30
@@ -1 +1 @@
-9b04d010c17c607ace4ed5e9318104d4  clamav-0.94.2-norar.tar.bz2
+0ddd9f341dd0299a6bc5398ee26f4ebf  clamav-0.95.1-norar.tar.bz2


--- clamav-0.90rc3-private.patch DELETED ---


--- clamav-0.93.1-path.patch DELETED ---


--- clamav-0.93.3-initoff.patch DELETED ---


--- clamav-0.93.3-pid.patch DELETED ---




More information about the scm-commits mailing list