[oe-commits] org.oe.dev clamav: Add 0.90.2 version, remove older versions plus a number of other

lenehan commit openembedded-commits at lists.openembedded.org
Wed May 16 01:37:32 UTC 2007


clamav: Add 0.90.2 version, remove older versions plus a number of other
changes:
* Remove 0.88.6
* Added 0.90.2 
* Add a new clamav-conf package to hold clamd.conf. This is needed by
  both clamd and freshclam and previously you needed to install clamd
  even if you didn't want it just to get freshclam to work.
* Assume that /var/lib is non-volatile. Move the virus database there
  by default.
* Update configuration files for the new 0.9x syntax.
* Simplify the init scripts.
* Indicate the freshclam also provides clamav data, so if you install
  freshclam you don't need data.
* NOTE: There are incompatible changes to libclamav in this release,
  anything that links directly against the library will need to be  
  updated.

Author: lenehan at openembedded.org
Branch: org.openembedded.dev
Revision: 5ea2eafc3d630b24c984066924a83371fc0997a0
ViewMTN: http://monotone.openembedded.org/revision.psp?id=5ea2eafc3d630b24c984066924a83371fc0997a0
Files:
1
packages/clamav/clamav_0.88.6.bb
packages/clamav/files/clamav-daemon.default
packages/clamav/files/volatiles.02_clamav-data
packages/clamav/files/clamd.conf
packages/clamav/clamav-0.88.7/clamd.conf
packages/clamav/files/cross-compile-fix.patch
packages/clamav/clamav-0.88.7/cross-compile-fix.patch
packages/clamav/files/freshclam.conf
packages/clamav/clamav-0.88.7/freshclam.conf
packages/clamav/files/libtool-fix.patch
packages/clamav/clamav-0.88.7/libtool-fix.patch
packages/clamav/clamav-0.88.7
packages/clamav/clamav-0.90.2
packages/clamav/clamav-0.90.2/clamd.conf
packages/clamav/clamav-0.90.2/cross-compile-fix.patch
packages/clamav/clamav-0.90.2/freshclam.conf
packages/clamav/clamav_0.90.2.bb
packages/clamav/files/volatiles.03_clamav-data
packages/clamav/clamav.inc
packages/clamav/clamav_0.88.7.bb
packages/clamav/files/clamav-daemon.init
packages/clamav/files/clamav-freshclam.init
Diffs:

#
# mt diff -rb43a990c14ad8ab39c9290ff13c74413357d3365 -r5ea2eafc3d630b24c984066924a83371fc0997a0
#
# 
# 
# delete "packages/clamav/clamav_0.88.6.bb"
# 
# delete "packages/clamav/files/clamav-daemon.default"
# 
# delete "packages/clamav/files/volatiles.02_clamav-data"
# 
# rename "packages/clamav/files/clamd.conf"
#     to "packages/clamav/clamav-0.88.7/clamd.conf"
# 
# rename "packages/clamav/files/cross-compile-fix.patch"
#     to "packages/clamav/clamav-0.88.7/cross-compile-fix.patch"
# 
# rename "packages/clamav/files/freshclam.conf"
#     to "packages/clamav/clamav-0.88.7/freshclam.conf"
# 
# rename "packages/clamav/files/libtool-fix.patch"
#     to "packages/clamav/clamav-0.88.7/libtool-fix.patch"
# 
# add_dir "packages/clamav/clamav-0.88.7"
# 
# add_dir "packages/clamav/clamav-0.90.2"
# 
# add_file "packages/clamav/clamav-0.90.2/clamd.conf"
#  content [6b81b1d539d98cb390ef97a3701e8267d4286e83]
# 
# add_file "packages/clamav/clamav-0.90.2/cross-compile-fix.patch"
#  content [3de529e69e86692d62c94a4a2cf3f9571dc6d425]
# 
# add_file "packages/clamav/clamav-0.90.2/freshclam.conf"
#  content [497784dfa5258c55edaa8d4d9a46bb4177663f64]
# 
# add_file "packages/clamav/clamav_0.90.2.bb"
#  content [f7839d4729d7b325f3afdb317e831efae1be9a7f]
# 
# add_file "packages/clamav/files/volatiles.03_clamav-data"
#  content [febdf1c5a2af4c0689997192916a5fbb34ec0ca0]
# 
# patch "packages/clamav/clamav.inc"
#  from [26bcdd19ff335a304daa0992a48001c4517831d5]
#    to [000e4c159d4cdf2a2435530f3ff12dc7f584b788]
# 
# patch "packages/clamav/clamav_0.88.7.bb"
#  from [8b79a2eecd9cb5b4ec025d27710997610b1ac8c9]
#    to [d79456690c85eaa2cd4b604df5ad90edd7623ddf]
# 
# patch "packages/clamav/files/clamav-daemon.init"
#  from [7d3ea484a1b781569e72e1f8778b1b4b141ae28e]
#    to [7762102b6bc009f0200e6765cfc913d56a89a0ea]
# 
# patch "packages/clamav/files/clamav-freshclam.init"
#  from [d5a01b7f9ff51cb306cd6cad857d3ac7d7d8f465]
#    to [8c6c100c40e45de773b9ffc7c4fbf3b28f28d7e0]
# 
============================================================
--- packages/clamav/clamav-0.90.2/clamd.conf	6b81b1d539d98cb390ef97a3701e8267d4286e83
+++ packages/clamav/clamav-0.90.2/clamd.conf	6b81b1d539d98cb390ef97a3701e8267d4286e83
@@ -0,0 +1,27 @@
+## Please read the clamd.conf(5) manual before editing this file.
+LogFile /var/log/clamav/clamav.log
+LogFileMaxSize 0
+LogTime yes
+PidFile /var/run/clamav/clamd.pid
+DatabaseDirectory /var/lib/clamav
+LocalSocket /var/run/clamav/clamd.ctl
+FixStaleSocket yes
+MaxConnectionQueueLength 15
+MaxThreads 10
+ReadTimeout 180
+SelfCheck 1800
+User clamav
+AllowSupplementaryGroups yes
+ScanPE yes
+ScanELF yes
+DetectBrokenExecutables yes
+ScanOLE2 yes
+ScanMail yes
+PhishingSignatures yes
+ScanHTML yes
+ScanArchive yes
+ArchiveMaxRecursion 8
+ArchiveMaxFiles 1000
+ArchiveMaxFileSize 10M
+ArchiveMaxCompressionRatio 250
+ArchiveBlockMax yes
============================================================
--- packages/clamav/clamav-0.90.2/cross-compile-fix.patch	3de529e69e86692d62c94a4a2cf3f9571dc6d425
+++ packages/clamav/clamav-0.90.2/cross-compile-fix.patch	3de529e69e86692d62c94a4a2cf3f9571dc6d425
@@ -0,0 +1,68 @@
+Add some caching of values which can't be determined when
+cross-compiling. This lets us define the values via the site files.
+
+Index: clamav-0.90.2/configure.in
+===================================================================
+--- clamav-0.90.2.orig/configure.in	2007-04-13 09:10:37.000000000 +1000
++++ clamav-0.90.2/configure.in	2007-05-16 09:33:48.000000000 +1000
+@@ -60,19 +60,21 @@
+ 
+ dnl Check for broken snprintf (code by Phil Oleson <oz*nixil.net>)
+ if test "x$ac_cv_func_snprintf" = "xyes" ; then
+-        AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
++        AC_CACHE_CHECK([whether snprintf correctly terminates long strings],
++	[ac_cv_have_broken_snprintf], [
+         AC_TRY_RUN(
+                 [
+ #include <stdio.h>
+ int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
+                 ],
+-                [AC_MSG_RESULT(yes)],
+-                [
+-                        AC_MSG_RESULT(no)
+-                        AC_DEFINE(BROKEN_SNPRINTF,1,[Define if your snprintf is busted])
+-                        AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
+-                ]
+-        )
++		[ ac_cv_have_broken_snprintf="no" ],
++		[ ac_cv_have_broken_snprintf="yes" ]
++	)
++	])
++	if test "$ac_cv_have_broken_snprintf" = "yes"; then
++		AC_DEFINE(BROKEN_SNPRINTF,1,[Define if your snprintf is busted])
++                AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
++	fi
+ fi
+ 
+ have_pthreads=no
+@@ -370,18 +372,28 @@
+ AC_DEFINE_UNQUOTED(CONFDIR,"$cfg_dir",[where to look for the config file])
+ 
+ dnl check for in_port_t definition
++AC_CACHE_CHECK([for in_port_t], [clamav_av_have_in_port_t], [
+ AC_TRY_RUN([
+ #include <sys/types.h>
+ #include <netinet/in.h>
+ int main(int argc, char **argv) { in_port_t pt; pt = 0; return pt; }
+-], AC_DEFINE(HAVE_IN_PORT_T,1,[in_port_t is defined]), AC_MSG_RESULT(in_port_t is not defined))
++], [ clamav_av_have_in_port_t="yes" ], [ clamav_av_have_in_port_t="no" ])
++])
++if test "$clamav_av_have_in_port_t" = "yes"; then
++    AC_DEFINE(HAVE_IN_PORT_T,1,[in_port_t is defined])
++fi
+ 
+ dnl check for in_addr_t definition
++AC_CACHE_CHECK([for in_addr_t], [clamav_av_have_in_addr_t], [
+ AC_TRY_RUN([
+ #include <sys/types.h>
+ #include <netinet/in.h>
+ int main(int argc, char **argv) { in_addr_t pt; pt = 0; return pt; }
+-], AC_DEFINE(HAVE_IN_ADDR_T,1,[in_addr_t is defined]), AC_MSG_RESULT(in_addr_t is not defined))
++], [ clamav_av_have_in_addr_t="yes" ], [ clamav_av_have_in_addr_t="no" ])
++])
++if test "$clamav_av_have_in_addr_t" = "yes"; then
++    AC_DEFINE(HAVE_IN_ADDR_T,1,[in_addr_t is defined])
++fi
+ 
+ case "$target_os" in
+ linux*)
============================================================
--- packages/clamav/clamav-0.90.2/freshclam.conf	497784dfa5258c55edaa8d4d9a46bb4177663f64
+++ packages/clamav/clamav-0.90.2/freshclam.conf	497784dfa5258c55edaa8d4d9a46bb4177663f64
@@ -0,0 +1,21 @@
+## Please read the freshclam.conf(5) manual before editing this file.
+
+# Comment or remove the line below.
+Example
+
+# Uncomment the following line and replace XY with your country
+# code. See http://www.iana.org/cctld/cctld-whois.htm for the full list.
+# Default: There is no default, which results in an error when running freshclam
+#DatabaseMirror db.XY.clamav.net
+
+DatabaseMirror database.clamav.net
+
+DatabaseDirectory /var/lib/clamav/
+UpdateLogFile /var/log/clamav/freshclam.log
+PidFile /var/run/clamav/freshclam.pid
+DatabaseOwner clamav
+AllowSupplementaryGroups yes
+DNSDatabaseInfo current.cvd.clamav.net
+MaxAttempts 5
+Checks 24
+NotifyClamd /etc/clamd.conf
============================================================
--- packages/clamav/clamav_0.90.2.bb	f7839d4729d7b325f3afdb317e831efae1be9a7f
+++ packages/clamav/clamav_0.90.2.bb	f7839d4729d7b325f3afdb317e831efae1be9a7f
@@ -0,0 +1,16 @@
+require clamav.inc
+PR = "r0"
+
+# 0.9x requires curl for incremental database updates
+DEPENDS += "curl"
+
+# Don't check for clamav uid/gid - they don't exist on the host
+# Put virus definitions in /var/lib not /usr/lib
+EXTRA_OECONF = "--disable-clamav \
+                --with-zlib=${STAGING_DIR}/${HOST_SYS} \
+                --with-libcurl \
+                --with-dbdir=${localstatedir}/lib/clamav"
+
+# Package up configuration utility - new for 0.9x
+PACKAGES += "${PN}-clamconf"
+FILES_${PN}-clamconf = "${bindir}/clamconf"
============================================================
--- packages/clamav/files/volatiles.03_clamav-data	febdf1c5a2af4c0689997192916a5fbb34ec0ca0
+++ packages/clamav/files/volatiles.03_clamav-data	febdf1c5a2af4c0689997192916a5fbb34ec0ca0
@@ -0,0 +1,4 @@
+# <type> <owner> <group> <mode> <path> <linksource>
+d clamav clamav 0755 /var/lib/clamav none
+f clamav clamav 0644 /var/lib/clamav/main.cvd none
+f clamav clamav 0644 /var/lib/clamav/daily.cvd none
============================================================
--- packages/clamav/clamav.inc	26bcdd19ff335a304daa0992a48001c4517831d5
+++ packages/clamav/clamav.inc	000e4c159d4cdf2a2435530f3ff12dc7f584b788
@@ -12,19 +12,19 @@ RDEPENDS_${PN} = "${PN}-data"
 LICENSE = "GPL"
 DEPENDS = "zlib bzip2 gmp"
 RDEPENDS_${PN} = "${PN}-data"
-RDEPENDS_${PN}-daemon = "${PN}-data"
+RDEPENDS_${PN}-daemon = "${PN}-data ${PN}-conf"
+RDEPENDS_${PN}-freshclam = "${PN}-conf"
 RRECOMMENDS_${PN} = "${PN}-freshclam"
 RRECOMMENDS_${PN}-daemon = "${PN}-freshclam"
+RPROVIDES_${PN}-freshclam = "${PN}-data"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/clamav/clamav-${PV}.tar.gz \
           file://cross-compile-fix.patch;patch=1 \
-          file://libtool-fix.patch;patch=1 \
           file://clamav-daemon.init \
           file://clamav-freshclam.init \
-          file://clamav-daemon.default \
           file://clamd.conf \
           file://freshclam.conf \
-          file://volatiles.02_clamav-data \
+          file://volatiles.03_clamav-data \
           file://volatiles.03_clamav-daemon \
           file://volatiles.03_clamav-freshclam"
 
@@ -48,20 +48,13 @@ do_install_append() {
 
         # Install our config files and init scripts
         install -m 0755 ${WORKDIR}/freshclam.conf ${D}${sysconfdir}/freshclam.conf
-        install -m 0755 ${WORKDIR}/clamav-daemon.default ${D}${sysconfdir}/default/clamav-daemon
         install -m 0755 ${WORKDIR}/clamav-daemon.init ${D}${sysconfdir}/init.d/clamav-daemon
         install -m 0755 ${WORKDIR}/clamav-freshclam.init ${D}${sysconfdir}/init.d/clamav-freshclam
 
         # We need some /var directories
-        for i in 02_clamav-data 03_clamav-daemon 03_clamav-freshclam; do
+        for i in 03_clamav-daemon 03_clamav-freshclam 03_clamav-data; do
           install -m 0644 ${WORKDIR}/volatiles.$i ${D}${sysconfdir}/default/volatiles/$i
         done
-
-        # Move the clamav data to a non-volatile location, we'll symlink back
-        # If freshclam is running it'll break the link to this static data
-        # once it has succesfully downloaded an update
-        install -m 0755 -d ${D}${libdir}
-        mv ${D}${localstatedir}/lib/clamav ${D}${libdir}
 }
 do_stage () {
         oe_libinstall -a -so libclamav ${STAGING_LIBDIR}
@@ -69,22 +62,23 @@ do_stage () {
         install -m 0644 libclamav/clamav.h ${STAGING_INCDIR}
 }
 
-PACKAGES += "${PN}-freshclam ${PN}-daemon ${PN}-data ${PN}-lib"
+PACKAGES += "${PN}-freshclam ${PN}-daemon ${PN}-conf ${PN}-data ${PN}-lib"
 
-FILES_${PN} = "${bindir}/clamscan ${bindir}/sigtool ${bindir}/clamdscan"
+FILES_${PN} = "${bindir}/clamscan \
+               ${bindir}/sigtool \
+               ${bindir}/clamdscan"
 FILES_${PN}-lib = "${libdir}/libclamav.so.*"
+FILES_${PN}-conf = "${sysconfdir}/clamd.conf"
 FILES_${PN}-freshclam = "${bindir}/freshclam \
                          ${sysconfdir}/freshclam.conf \
                          ${sysconfdir}/init.d/clamav-freshclam \
                          ${sysconfdir}/default/volatiles/03_clamav-freshclam"
-FILES_${PN}-daemon = "${sysconfdir}/clamd.conf \
-                      ${sbindir}/clamd \
+FILES_${PN}-daemon = "${sbindir}/clamd \
                       ${sysconfdir}/init.d/clamav-daemon \
-                      ${sysconfdir}/default/clamav-daemon \
                       ${sysconfdir}/default/volatiles/03_clamav-daemon"
-FILES_${PN}-data = "${libdir}/clamav/main.cvd \
-                    ${libdir}/clamav/daily.cvd \
-                    ${sysconfdir}/default/volatiles/02_clamav-data"
+FILES_${PN}-data = "${localstatedir}/lib/clamav/main.cvd \
+                    ${localstatedir}/lib/clamav/daily.cvd \
+                    ${sysconfdir}/default/volatiles/03_clamav-data"
 FILES_${PN}-dev += "${bindir}/clamav-config"
 
 # Add clamav's user and groups
@@ -111,9 +105,10 @@ pkg_postinst_${PN}-data () {
 }
 
 # Indicate that the default files are configuration files
-CONFFILES_${PN}-daemon = "${sysconfdir}/clamd.conf \
-                          ${sysconfdir}/default/clamav-daemon"
+CONFFILES_${PN}-conf = "${sysconfdir}/clamd.conf"
 CONFFILES_${PN}-freshclam = "${sysconfdir}/freshclam.conf"
+CONFFILES_${PN}-data = "${localstatedir}/lib/clamav/main.cvd \
+                        ${localstatedir}/lib/clamav/daily.cvd"
 
 INITSCRIPT_PACKAGES = "${PN}-daemon ${PN}-freshclam"
 INITSCRIPT_NAME_${PN}-daemon = "clamav-daemon"
============================================================
--- packages/clamav/clamav_0.88.7.bb	8b79a2eecd9cb5b4ec025d27710997610b1ac8c9
+++ packages/clamav/clamav_0.88.7.bb	d79456690c85eaa2cd4b604df5ad90edd7623ddf
@@ -1,3 +1,5 @@ require clamav.inc
 require clamav.inc
 
+PR = "r1"
+
+SRC_URI_append += " file://libtool-fix.patch;patch=1"
-PR = "r0"
============================================================
--- packages/clamav/files/clamav-daemon.init	7d3ea484a1b781569e72e1f8778b1b4b141ae28e
+++ packages/clamav/files/clamav-daemon.init	7762102b6bc009f0200e6765cfc913d56a89a0ea
@@ -1,20 +1,22 @@ DESC="ClamAV daemon"
 #! /bin/sh
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 DAEMON=/usr/sbin/clamd
 NAME="clamd"
 DESC="ClamAV daemon"
-CLAMAVCONF=/etc/clamd.conf
+CLAMAV_CONF=/etc/clamd.conf
+PID=/var/run/clamav/clamd.pid
 
 set -e
 
-test -r /etc/default/clamav-daemon && . /etc/default/clamav-daemon
 test -x "$DAEMON" || exit 0
-test ! -r "$CLAMAVCONF" && exit 0
-if [ `grep -q "^Example" $CLAMAVCONF` ]; then
+if [ ! -r "$CLAMAV_CONF" ]; then
+  echo "ClamAV configuration file $CLAMAV_CONF not found. Exiting"
+  exit 0
+fi
+if [ `grep -q "^Example" $CLAMAV_CONF` ]; then
     echo "$DESC is not configured."
     exit 0
 fi
-pidfile="`grep ^PidFile $CLAMAVCONF | awk '{print $2}'`"
 
 case "$1" in
   start)
@@ -25,7 +27,7 @@ case "$1" in
 
   stop)
     echo -n "Stopping $DESC: "
-    start-stop-daemon -K -p $pidfile
+    start-stop-daemon -K -p $PID
     ;;
 
     restart|force-reload)
============================================================
--- packages/clamav/files/clamav-freshclam.init	d5a01b7f9ff51cb306cd6cad857d3ac7d7d8f465
+++ packages/clamav/files/clamav-freshclam.init	8c6c100c40e45de773b9ffc7c4fbf3b28f28d7e0
@@ -1,72 +1,40 @@ DESC="ClamAV virus database updater"
 #!/bin/sh
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 DAEMON=/usr/bin/freshclam
 NAME=freshclam
 DESC="ClamAV virus database updater"
-CLAMAV_CONF_FILE=/etc/clamd.conf
-FRESHCLAM_CONF_FILE=/etc/freshclam.conf
-pidfile=/var/run/clamav/freshclam.pid
+FRESHCLAM_CONF=/etc/freshclam.conf
+CLAMAV_CONF=/etc/clamd.conf
+PID=/var/run/clamav/freshclam.pid
 
 set -e
 
-test -r /etc/default/clamav-freshclam && . /etc/default/clamav-freshclam
 test -x "$DAEMON" || exit 0
-test ! -r "$CLAMAV_CONF_FILE" && exit 0
-
-slurp_config()
-{
-  CLAMAVCONF="$1"
-
-  if [ -e "$CLAMAVCONF" ]; then
-    for variable in `egrep -v '^[[:space:]]*(#|$)' "$CLAMAVCONF" | awk '{print $1}'`; do
-      if [ "$variable" = 'DatabaseMirror' ]; then
-        if [ -z "$DatabaseMirror" ]; then
-          for i in `grep ^$variable $CLAMAVCONF | awk '{print $2}'`; do
-            value="$i $value"
-          done
-        else
-          continue
-        fi
-      elif [ "$variable" = 'VirusEvent' -o "$variable" = 'OnUpdateExecute' -o "$variable" = 'OnErrorExecute' ]; then
-        value=`grep ^$variable $CLAMAVCONF | head -n1 | sed -e s/$variable\ //`
-      else
-        value=`grep ^$variable $CLAMAVCONF | head -n1 | awk '{print $2}'`
-      fi
-      if ! [ "$value" = "$variable" -o "$value" = "" ]; then
-        export "$variable"="$value"
-      else
-        export "$variable"="true"
-      fi
-      unset value
-    done
-  fi
-}
-
-slurp_config "$FRESHCLAM_CONF_FILE"
-
-[ -z "$UpdateLogFile" ] && UpdateLogFile=/var/log/clamav/freshclam.log
-
-if [ -z "$DatabaseDirectory" ]; then
-  [ -r "$CLAMAV_CONF_FILE" ] && DatabaseDirectory=$(grep 'DataDirectory' "$CLAMAV_CONF_FILE" | awk '{print $2}')
-  [ -z "$DatabaseDirectory" ] && DatabaseDirectory=/var/lib/clamav/
+if [ ! -r "$CLAMAV_CONF" ]; then
+  echo "ClamAV configuration file $CLAMAV_CONF not found. Exiting"
+  exit 0
 fi
+if [ ! -r "$FRESHCLAM_CONF" ]; then
+  echo "Freshclam configuration file $FRESHCLAM_CONF not found. Exiting"
+  exit 0
+fi
 
 
 case "$1" in
   no-daemon)
     echo "It takes freshclam ~3min to timeout and try the next mirror in the list"
-    freshclam -l "$UpdateLogFile" --datadir "$DatabaseDirectory"
+    freshclam
     ;;
 
   start)
     ech%s
>>> DIFF TRUNCATED @ 16K






More information about the Openembedded-commits mailing list