[csw-devel] SF.net SVN: gar:[2513] csw/mgar/pkg/clamav/trunk

bonivart at users.sourceforge.net bonivart at users.sourceforge.net
Wed Dec 10 21:10:11 CET 2008


Revision: 2513
          http://gar.svn.sourceforge.net/gar/?rev=2513&view=rev
Author:   bonivart
Date:     2008-12-10 20:10:10 +0000 (Wed, 10 Dec 2008)

Log Message:
-----------
clamav: even more fixes

Modified Paths:
--------------
    csw/mgar/pkg/clamav/trunk/Makefile
    csw/mgar/pkg/clamav/trunk/checksums
    csw/mgar/pkg/clamav/trunk/files/CSWclamav.checkinstall
    csw/mgar/pkg/clamav/trunk/files/CSWclamav.cswclamd
    csw/mgar/pkg/clamav/trunk/files/CSWclamav.gspec
    csw/mgar/pkg/clamav/trunk/files/CSWclamav.postinstall
    csw/mgar/pkg/clamav/trunk/files/CSWclamav.preinstall
    csw/mgar/pkg/clamav/trunk/files/CSWlibclamav.gspec

Removed Paths:
-------------
    csw/mgar/pkg/clamav/trunk/files/CSWclamav.preremove

Modified: csw/mgar/pkg/clamav/trunk/Makefile
===================================================================
--- csw/mgar/pkg/clamav/trunk/Makefile	2008-12-10 19:51:28 UTC (rev 2512)
+++ csw/mgar/pkg/clamav/trunk/Makefile	2008-12-10 20:10:10 UTC (rev 2513)
@@ -1,18 +1,7 @@
 # clamav, Peter Bonivart
 
-# files outside /opt/csw are not included, need to fix gspec and cswproto
-# put libs in lib/32?
-# add rc/smf support. cswclassutils?
-# add pre/post scripts
-# add etc/clamav-milter?
-# add etc/clamd?
+# build with "ENABLE_CHECK=0 gmake package"
 # check mantis bugs
-# + add doc/README.CSW, INSTALL.clamav-milter.CSW
-# + split into multiple packages: clamav, libclamav
-# + add re for update notification
-# + add contrib
-# + add html docs and some pdf:s
-# + remove *.a, *.la from libs
 
 GARNAME = clamav
 GARVERSION = 0.94.2
@@ -29,9 +18,8 @@
 
 SF_PROJ = clamav
 MASTER_SITES = $(SF_MIRRORS)
-#MASTER_SITES = http://freshmeat.net/redir/clamav/29355/url_tgz/
 DISTFILES  = $(GARNAME)-$(GARVERSION).tar.gz
-DISTFILES += $(call admfiles,CSWclamav,checkinstall preinstall postinstall preremove)
+DISTFILES += $(call admfiles,CSWclamav,checkinstall preinstall postinstall)
 DISTFILES += $(call admfiles,CSWlibclamav,)
 
 SPKG_DESC_CSWclamav = Clam AntiVirus
@@ -43,13 +31,9 @@
 # We define upstream file regex so we can be notifed of new upstream software release
 UFILES_REGEX = $(GARNAME)-(\d+(?:\.\d+)*).tar.gz
 
-SPKG_CLASSES = none cswinitsmf
+SPKG_CLASSES = none cswcpsampleconf cswinitsmf
 
-#GARCOMPILER = GCC3
-
 CONFIGURE_ARGS  = $(DIRPATHS)
-#CONFIGURE_ARGS += --with-user=nobody
-#CONFIGURE_ARGS += --with-group=nobody
 CONFIGURE_ARGS += --disable-clamav
 CONFIGURE_ARGS += --enable-milter
 CONFIGURE_ARGS += --with-sendmail=$(libdir)/sendmail
@@ -61,6 +45,8 @@
 PKGFILES_CSWlibclamav  = $(libdir)/.*
 PKGFILES_CSWlibclamav += $(includedir)/.*
 
+PROTOTYPE_FILTER  = awk '$$$$3 ~ /\/init.d\/cswclamd$$$$/ { $$$$2 = "cswinitsmf" } $$$$3 ~ /\/init.d\/cswclamav-milter$$$$/ { $$$$2 = "cswinitsmf" } $$$$3 ~ /\/clamd.conf.CSW$$$$/ { $$$$2 = "cswcpsampleconf" } $$$$3 ~ /\/freshclam.conf.CSW$$$$/ { $$$$2 = "cswcpsampleconf" } { print }'
+
 SPKG_SOURCEURL = http://www.clamav.net/
 
 include gar/category.mk
@@ -75,9 +61,12 @@
 DOCDEST = $(DESTDIR)$(docdir)/$(GARNAME)
 
 post-install-modulated:
-	@echo " ==> Post-install for $(GARNAME)"
+	@echo " ==> Post-install for $(GARNAME) (custom)"
 	@ginstall -d $(DESTDIR)/etc/opt/csw/init.d
 	@ginstall -m 755 $(FILEDIR)/CSWclamav.cswclamd $(DESTDIR)/etc/opt/csw/init.d/cswclamd
+	@ginstall -m 755 $(FILEDIR)/CSWclamav.cswclamav-milter $(DESTDIR)/etc/opt/csw/init.d/cswclamav-milter
+	@mv $(DESTDIR)$(sysconfdir)/clamd.conf $(DESTDIR)$(sysconfdir)/clamd.conf.CSW
+	@mv $(DESTDIR)$(sysconfdir)/freshclam.conf $(DESTDIR)$(sysconfdir)/freshclam.conf.CSW
 	@ginstall -d $(DOCDEST)
 	@$(foreach DOC,$(DOCS),ginstall -m 644 $(WORKSRC)/$(DOC) $(DOCDEST);)
 	@ginstall -m 644 $(WORKSRC)/COPYING $(DOCDEST)/LICENSE

Modified: csw/mgar/pkg/clamav/trunk/checksums
===================================================================
--- csw/mgar/pkg/clamav/trunk/checksums	2008-12-10 19:51:28 UTC (rev 2512)
+++ csw/mgar/pkg/clamav/trunk/checksums	2008-12-10 20:10:10 UTC (rev 2513)
@@ -1,7 +1,6 @@
 1181e6d62341b84708f126cc353f7ebf  download/clamav-0.94.2.tar.gz
-7d36b4328fa73af2b109169b923bc127  download/CSWclamav.gspec
-751ed376aeccb1664694b772c4b9640d  download/CSWclamav.checkinstall
-e355168073277baaf456eea620ff2760  download/CSWclamav.preinstall
-a82b60e7ee99d6a4ac6e80351ce7bf81  download/CSWclamav.postinstall
-526d5979cca3a3ebdf88c6ed33b8ec8d  download/CSWclamav.preremove
-6edc8660bde0b27d3676699eacb51884  download/CSWlibclamav.gspec
+dbb021404195c40d44dd61e9b0206634  download/CSWclamav.gspec
+265f727008d1645114839cdbd9399be6  download/CSWclamav.checkinstall
+03e2a2aaf95b2cd8497ad6742b9fbb46  download/CSWclamav.preinstall
+574e50c4c06f22c928e1a48783490e26  download/CSWclamav.postinstall
+8f6b719b38608d0f08ced7e556461c12  download/CSWlibclamav.gspec

Modified: csw/mgar/pkg/clamav/trunk/files/CSWclamav.checkinstall
===================================================================
--- csw/mgar/pkg/clamav/trunk/files/CSWclamav.checkinstall	2008-12-10 19:51:28 UTC (rev 2512)
+++ csw/mgar/pkg/clamav/trunk/files/CSWclamav.checkinstall	2008-12-10 20:10:10 UTC (rev 2513)
@@ -1,6 +1,7 @@
 # checkinstall script for Clamav
 # Verify that group and user clamav exists
-#
+# 2008-12-10 Peter Bonivart
+
 ADDUSER=0
 ADDGROUP=0
 # Next, verify that group clamav exists.

Modified: csw/mgar/pkg/clamav/trunk/files/CSWclamav.cswclamd
===================================================================
--- csw/mgar/pkg/clamav/trunk/files/CSWclamav.cswclamd	2008-12-10 19:51:28 UTC (rev 2512)
+++ csw/mgar/pkg/clamav/trunk/files/CSWclamav.cswclamd	2008-12-10 20:10:10 UTC (rev 2513)
@@ -5,9 +5,9 @@
 # description: clamd is a standard UNIX program that scans for Viruses.
 # processname: clamd
 # config: /opt/csw/etc/clamd.conf
-# pidfile: /opt/csw/share/clamav/clamd.pid
+# pidfile: /var/opt/csw/clamav/clamd.pid
 # modified for CSW
-# 2007-02-16 Note that the pid file is now in /opt/csw/var/clamav. So, you
+# 2007-02-16 Note that the pid file is now in /var/opt/csw/clamav. So, you
 #   may need to fix permissions on that directory.
 #   The clamd file (used to send options to clamd) may now be in
 #   /etc/opt/csw/.  Using this file, you may specify a different location
@@ -16,9 +16,8 @@
 # 2007-04-14 PidFile name and User are obtained from clamd.conf.  If
 #   the directory does not exist, it is created by this script.
 # 2007-10-27 Fix restart script
+# 2008-12-10 Peter Bonivart
 
-. /lib/svc/share/smf_include.sh
-
 prog="clamd"
 progdir="/opt/csw/sbin"
 
@@ -30,57 +29,44 @@
     chown $clamuser $piddir
 fi
 
-OPTIONS_FILE="/etc/opt/csw/clamd"
+OPTIONS_FILE="/etc/opt/csw/clamd.conf"
 if [ ! -f $OPTIONS_FILE ] ; then
-	OPTIONS_FILE="/opt/csw/etc/clamd"
+	OPTIONS_FILE="/opt/csw/etc/clamd.conf"
 fi
 if [ ! -f "$OPTIONS_FILE" ]; then
     exit 0
 fi
 
-# Local clamd config
-if [ -f "$OPTIONS_FILE" ] ; then
-    CLAMD_FLAGS=`cat "$OPTIONS_FILE"`
-fi
-
 PATH=/usr/sbin:/usr/bin:/opt/csw/sbin:/opt/csw/bin
 
-start() {
-	echo "Starting $prog "
-	$progdir/$prog ${CLAMD_FLAGS}
-}
-
-stop() {
-	echo "Stopping $prog "
-	/usr/bin/kill `head -1 $pidfile`
-}
-
-restart() {
-	/usr/bin/kill `head -1 $pidfile`
-	start
-}
-
-reload() {
-	echo "Reloading clam daemon configuration: "
-	pkill -HUP $prog
-}
-
 case "$1" in
   start)
-	start
+        echo "Starting $prog "
+        $progdir/$prog &
 	;;
   stop)
-	stop
+        echo "Stopping $prog "
+        /usr/bin/pkill -x $prog
 	;;
   restart)
-	restart
+        $0 stop
+        echo "Waiting for $prog to stop.\c"
+        while ( /usr/bin/pgrep -x $prog > /dev/null )
+        do
+       		echo ".\c"
+		sleep 1
+        done
+        echo
+        sleep 1
+        $0 start
 	;;
-  reload)
-	reload
+  refresh|reload)
+        echo "Reloading clam daemon configuration: "
+        /usr/bin/pkill -x -HUP $prog
 	;;
   *)
-	echo $"Usage: $0 {start|stop|status|reload|restart}"
+	echo $"Usage: $0 { start|stop|refresh|reload|restart }"
 	exit 1
 esac
 
-exit $?
+exit 0

Modified: csw/mgar/pkg/clamav/trunk/files/CSWclamav.gspec
===================================================================
--- csw/mgar/pkg/clamav/trunk/files/CSWclamav.gspec	2008-12-10 19:51:28 UTC (rev 2512)
+++ csw/mgar/pkg/clamav/trunk/files/CSWclamav.gspec	2008-12-10 20:10:10 UTC (rev 2513)
@@ -1,9 +1,7 @@
 %var            bitname clamav
 %var            pkgname CSWclamav
 %include        url file://%{PKGLIB}/csw_dyndepend.gspec
-%prototype:merge
-f cswinitsmf    /etc/opt/csw/init.d/cswclamd 0755 root bin
 %copyright
 
-Please see /opt/csw/share/doc/clamav/copyright for license information.
+Please see /opt/csw/share/doc/clamav/LICENSE for license information.
 

Modified: csw/mgar/pkg/clamav/trunk/files/CSWclamav.postinstall
===================================================================
--- csw/mgar/pkg/clamav/trunk/files/CSWclamav.postinstall	2008-12-10 19:51:28 UTC (rev 2512)
+++ csw/mgar/pkg/clamav/trunk/files/CSWclamav.postinstall	2008-12-10 20:10:10 UTC (rev 2513)
@@ -1,74 +1,15 @@
 # Postinstall script for clamav
 # 2007-01-07 Add csw.conf support
-#   The specific daemon name is clamav
-#
+# 2008-12-10 Peter Bonivart
 
-# If /opt/csw/etc/clamav.conf exists, move it to /opt/csw/etc/clamd.conf
+# if /opt/csw/etc/clamav.conf exists, move it to /opt/csw/etc/clamd.conf
 if [ -f /opt/csw/etc/clamav.conf ]; then
         /usr/bin/mv /opt/csw/etc/clamav.conf /opt/csw/etc/clamd.conf
 	echo '  Moved /opt/csw/etc/clamav.conf to /opt/csw/etc/clamd.conf'
 fi
 
-# Determine whether or not clamd and clamav-milter is needed
-usingclamd=no
-usingclmilter=no
-if [ -f /opt/csw/etc/clamd ] -o [ -f /etc/opt/csw/clamd ] ; then usingclamd=yes ; fi
-if [ -f /opt/csw/etc/clamav-milter ] -o [ -f /etc/opt/csw/clamav-milter ] ; then usingclmilter=yes ; fi
+# assign user for /var/opt/csw/clamav directory
+chown -R clamav /var/opt/csw/clamav
 
-# Plug PKG_INSTALL_ROOT if not available
-if [ "$PKG_INSTALL_ROOT" = "" ] ; then PKG_INSTALL_ROOT=/ ; fi
-
-# If available, assign user for /opt/csw/share/clamav directory
-CONF_FILE="/etc/opt/csw/clamd.conf"
-if [ ! -f "$CONF_FILE" ] ; then
-        CONF_FILE="/opt/csw/etc/clamd.conf"
-        if [ ! -f "$CONF_FILE" ] ; then
-                CONF_FILE=""
-        fi
-fi
-if [ x"$CONF_FILE" != x ] ; then
-   clamuser=`grep '^User' "$CONF_FILE" |awk '{print $2;}'`
-   if [ x$clamuser != x ] ; then
-      chown $clamuser /opt/csw/share/clamav
-   fi
-fi
-
-# daemons are started by default
-enable_daemon=yes
-
-# Source csw.conf, if it exists
-if [ -f $PKG_INSTALL_ROOT/opt/csw/etc/csw.conf ] ; then
-  . $PKG_INSTALL_ROOT/opt/csw/etc/csw.conf
-fi
-if [ -f $PKG_INSTALL_ROOT/etc/opt/csw/csw.conf ] ; then
-  . $PKG_INSTALL_ROOT/etc/opt/csw/csw.conf
-fi
-
-# If defined, autoenable for the specific daemon name takes precedence
-if [ "$autoenable_clamav" = "no" ] ; then
-  enable_daemon=no
-elif [ "$autoenable_daemons" = "no" -a ! -n "$autoenable_clamav" ] ; then
-  enable_daemon=no
-fi
-
-# Start selected daemons
-if [ "$enable_daemon" = "yes" ] ; then
-
-  # clamd is first
-  if [ $usingclamd = yes ] ; then
-    if [ $smf = no ] ; then
-       /etc/init.d/cswclamd start 2>&1
-    else
-       /usr/sbin/svcadm enable svc:application/cswclamd 2>&1
-    fi
-  fi
-
-fi
-
-# Display message
-echo '***'
+# display message
 echo '*** See README.CSW in /opt/csw/share/doc/clamav for changes.**'
-echo '*** For first time version 0.90 installs - Please see README.CSW.""'
-echo '*** See http://www.blastwave.org/standards/csw.conf.html for'
-echo '    details on using csw.conf to enable/disable daemons.**'
-echo '***'

Modified: csw/mgar/pkg/clamav/trunk/files/CSWclamav.preinstall
===================================================================
--- csw/mgar/pkg/clamav/trunk/files/CSWclamav.preinstall	2008-12-10 19:51:28 UTC (rev 2512)
+++ csw/mgar/pkg/clamav/trunk/files/CSWclamav.preinstall	2008-12-10 20:10:10 UTC (rev 2513)
@@ -1,5 +1,6 @@
 # preinstall for clamav
 # Add the user and group clamav if told to by checkinstall script.
+# 2008-12-10 Peter Bonivart
 
 # If installing on a filesystem that is not running the OS, exit this script.
 if [ ! x"$PKG_INSTALL_ROOT" = x"" -a ! x"$PKG_INSTALL_ROOT" = x"/" ] ; then exit 0 ; fi

Deleted: csw/mgar/pkg/clamav/trunk/files/CSWclamav.preremove
===================================================================
--- csw/mgar/pkg/clamav/trunk/files/CSWclamav.preremove	2008-12-10 19:51:28 UTC (rev 2512)
+++ csw/mgar/pkg/clamav/trunk/files/CSWclamav.preremove	2008-12-10 20:10:10 UTC (rev 2513)
@@ -1,27 +0,0 @@
-# clamav - preremove script
-#
-# Stop clamav if it is running.
-
-# Determine whether or not clamd and clamav-milter is running
-haveclamd=no
-haveclmilter=no
-
-if [ -f /opt/csw/etc/clamd ] || [ -f /etc/opt/csw/clamd ] ; then haveclamd=yes ; fi
-if [ -f /opt/csw/etc/clamav-milter ] || [ -f /etc/opt/csw/clamav-milter ] ; then haveclmilter=yes ; fi
-
-# Determine whether or not SMF is available
-smf=no
-if [ -f /usr/sbin/svccfg -a -f /usr/sbin/svcadm ] ; then smf=yes ; fi
-
-  if [ $haveclamd=yes ] ; then
-    echo "Shutting down clamd"
-    if [ $smf = yes ]
-	then
-    	# Disable service
-	/usr/sbin/svcadm disable -s svc:application/cswclamd:default >/dev/null 2>&1
-    else
-	/etc/init.d/cswclamd stop >/dev/null 2>&1
-    fi
-  fi
-
-exit 0

Modified: csw/mgar/pkg/clamav/trunk/files/CSWlibclamav.gspec
===================================================================
--- csw/mgar/pkg/clamav/trunk/files/CSWlibclamav.gspec	2008-12-10 19:51:28 UTC (rev 2512)
+++ csw/mgar/pkg/clamav/trunk/files/CSWlibclamav.gspec	2008-12-10 20:10:10 UTC (rev 2513)
@@ -3,5 +3,5 @@
 %include        url file://%{PKGLIB}/csw_dyndepend.gspec
 %copyright
 
-Please see /opt/csw/share/doc/libclamav/copyright for license information.
+Please see /opt/csw/share/doc/libclamav/LICENSE for license information.
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list