pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mail/clamav Add clamd rc start script.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e8f42931a065
branches:  trunk
changeset: 467504:e8f42931a065
user:      recht <recht%pkgsrc.org@localhost>
date:      Mon Feb 02 00:00:48 2004 +0000

description:
Add clamd rc start script.
Somewhat based upon PR 24294 by Eric Schnoebelen.

While at it also fix configure to always install the example config file
to "examples".
Bump PKGREVISION to 1.

diffstat:

 mail/clamav/Makefile         |   4 ++-
 mail/clamav/PLIST            |   3 +-
 mail/clamav/distinfo         |   4 +-
 mail/clamav/files/clamd.sh   |  52 ++++++++++++++++++++++++++++++++++++++++++++
 mail/clamav/patches/patch-aa |  19 +++++++++++----
 5 files changed, 73 insertions(+), 9 deletions(-)

diffs (138 lines):

diff -r 9e4501769dca -r e8f42931a065 mail/clamav/Makefile
--- a/mail/clamav/Makefile      Sun Feb 01 22:37:18 2004 +0000
+++ b/mail/clamav/Makefile      Mon Feb 02 00:00:48 2004 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.8 2004/01/29 17:14:16 cube Exp $
+# $NetBSD: Makefile,v 1.9 2004/02/02 00:00:48 recht Exp $
 
 DISTNAME=      clamav-0.65
+PKGREVISION=   1
 CATEGORIES=    mail
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=clamav/}
 
@@ -22,6 +23,7 @@
 
 BUILD_DEFS+=   CLAMAV_USER CLAMAV_GROUP USE_MILTER
 
+RCD_SCRIPTS=   clamd
 PKG_GROUPS+=    ${CLAMAV_GROUP}
 PKG_USERS+=     ${CLAMAV_USER}:${CLAMAV_GROUP}::Clamav\\ User
 
diff -r 9e4501769dca -r e8f42931a065 mail/clamav/PLIST
--- a/mail/clamav/PLIST Sun Feb 01 22:37:18 2004 +0000
+++ b/mail/clamav/PLIST Mon Feb 02 00:00:48 2004 +0000
@@ -1,8 +1,9 @@
-@comment $NetBSD: PLIST,v 1.5 2004/01/29 17:14:16 cube Exp $
+@comment $NetBSD: PLIST,v 1.6 2004/02/02 00:00:48 recht Exp $
 bin/clamdscan
 bin/clamscan
 bin/freshclam
 bin/sigtool
+etc/rc.d/clamd
 include/clamav.h
 lib/libclamav.a
 lib/libclamav.la
diff -r 9e4501769dca -r e8f42931a065 mail/clamav/distinfo
--- a/mail/clamav/distinfo      Sun Feb 01 22:37:18 2004 +0000
+++ b/mail/clamav/distinfo      Mon Feb 02 00:00:48 2004 +0000
@@ -1,8 +1,8 @@
-$NetBSD: distinfo,v 1.5 2004/01/29 17:14:16 cube Exp $
+$NetBSD: distinfo,v 1.6 2004/02/02 00:00:48 recht Exp $
 
 SHA1 (clamav-0.65.tar.gz) = 15cfd1f736d01d3039de87eaf1167b119b100bf0
 Size (clamav-0.65.tar.gz) = 1438425 bytes
-SHA1 (patch-aa) = fb71cea4fde55a39744acd57a9ddac343a436871
+SHA1 (patch-aa) = b13503c4073df21532d9ce64924d88123b116c3f
 SHA1 (patch-ab) = 0d1ef00c0c1c64642461e353f7e4ed7f81e3a042
 SHA1 (patch-ac) = 920297ccb7659c7e70e9ae1b657059066b962310
 SHA1 (patch-ad) = eb593a2ab4d587e62e61e88ab9a6ca64799afea6
diff -r 9e4501769dca -r e8f42931a065 mail/clamav/files/clamd.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/clamav/files/clamd.sh        Mon Feb 02 00:00:48 2004 +0000
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# $NetBSD: clamd.sh,v 1.1 2004/02/02 00:00:48 recht Exp $
+#
+# clamd does anti-virus checking.
+#
+## only for NetBSD
+# PROVIDE: clamd
+# REQUIRE: LOGIN
+##     only because it might be used by mimedefang
+# BEFORE: mail
+# KEYWORD: shutdown
+##
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:@PREFIX@/sbin:@PREFIX@/bin
+export PATH
+
+if [ -f /etc/rc.subr ]
+then
+       . /etc/rc.subr
+fi
+
+name="clamd"
+rcvar=$name
+required_files="@PKG_SYSCONFDIR@/clamav.conf"
+command="@PREFIX@/sbin/${name}"
+pidfile=$(@AWK@ '/^#/ {next}; /PidFile/ {print $2}' ${required_files})
+socket=$(@AWK@ '/^#/ {next}; /LocalSocket/ {print $2}' ${required_files})
+clamd_user=$(@AWK@ '/^#/ {next}; /User/ {print $2}' ${required_files})
+
+start_precmd="clamd_precmd"
+stop_postcmd="clamd_postcmd"
+
+clamd_precmd()
+{
+    @TOUCH@ ${pidfile}
+    @CHOWN@ ${clamd_user} ${pidfile}
+}
+
+clamd_postcmd()
+{
+    if [ -f "${pidfile}" ]; then
+        @RM@ -f ${pidfile}
+    fi
+    
+    if [ -e "${socket}" ]; then
+        @RM@ -f ${socket}
+    fi
+}
+                                                                                     
+load_rc_config $name
+run_rc_command "$1"
diff -r 9e4501769dca -r e8f42931a065 mail/clamav/patches/patch-aa
--- a/mail/clamav/patches/patch-aa      Sun Feb 01 22:37:18 2004 +0000
+++ b/mail/clamav/patches/patch-aa      Mon Feb 02 00:00:48 2004 +0000
@@ -1,8 +1,8 @@
-$NetBSD: patch-aa,v 1.5 2004/01/29 17:14:16 cube Exp $
+$NetBSD: patch-aa,v 1.6 2004/02/02 00:00:48 recht Exp $
 
---- configure.in.orig  Wed Nov 12 02:27:29 2003
-+++ configure.in
-@@ -74,12 +74,15 @@ then
+--- configure.in.orig  2003-11-12 02:27:29.000000000 +0100
++++ configure.in       2004-02-02 00:03:11.000000000 +0100
+@@ -74,12 +74,15 @@
      AC_CHECK_LIB(bz2, bzReadOpen, AC_DEFINE(NOBZ2PREFIX),)
  fi
  
@@ -22,7 +22,16 @@
  
  want_dsig="yes"
  AC_ARG_ENABLE(dsig,
-@@ -271,8 +274,12 @@ openbsd*)
+@@ -193,7 +196,7 @@
+ AC_DEFINE_UNQUOTED(CONFDIR,"$cfg_dir",)
+ 
+ dnl Do not overwrite the current config file
+-AM_CONDITIONAL(INSTALL_CONF, test ! -r "$cfg_dir/clamav.conf")
++AM_CONDITIONAL(INSTALL_CONF, test "yes" = "yes")
+ 
+ if test "$test_urandom" = "yes"
+ then
+@@ -271,8 +274,12 @@
      AC_DEFINE(C_BSD)
      ;;
  netbsd*)



Home | Main Index | Thread Index | Old Index