# HG changeset patch # User Paul Issott # Date 1216420712 0 # Node ID 91f518880067d4d6e03682eda8f7c12c6a62a36f # Parent 4817034d9f94afb2cd7950d4c6efbf48537a309e Up: clamav (0.93.3) Antivirus diff -r 4817034d9f94 -r 91f518880067 clamav/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clamav/receipt Fri Jul 18 22:38:32 2008 +0000 @@ -0,0 +1,76 @@ +# SliTaz package receipt. + +PACKAGE="clamav" +VERSION="0.93.3" +CATEGORY="security" +SHORT_DESC="Antivirus" +MAINTAINER="paul@slitaz.org" +DEPENDS="" +TARBALL="$PACKAGE-$VERSION.tar.gz" +WEB_SITE="http://www.clamav.net/" +WGET_URL="http://downloads.sourceforge.net/clamav/$TARBALL" + +# Rules to configure and make the package. +compile_rules() +{ + # Have to create clamav user/group to be able to compile + adduser clamav -s /bin/false -H -D -S + + cd $src + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc/clamav \ + --infodir=/usr/share/info \ + --mandir=/usr/share/man \ + $CONFIGURE_ARGS + make + make DESTDIR=$PWD/_pkg install +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/lib $fs/usr/share $fs/etc/init.d + cp -a $_pkg/usr/bin $fs/usr + cp -a $_pkg/usr/sbin $fs/usr + cp -a $_pkg/etc $fs + # Copy only shared lib (.so) + cp -a $_pkg/usr/lib/*.so* $fs/usr/lib + cp -a $_pkg/usr/share/clamav $fs/usr/share + # Copy daemon from /stuff + cp stuff/daemon-clamd $fs/etc/init.d/clamd +} + +post_install() +{ + echo "Processing post-install commands..." + + # Enable freshclam update + echo -n "Enabling freshclam update..." + cd /etc/clamav + sed 's/^Example/#Example/' < freshclam.conf > temp.file + mv temp.file freshclam.conf + status + + # Enable clamd configuration + echo -n "Enabling clamd daemon..." + cd /etc/clamav + sed 's/^Example/#Example/; s/^#PidFile/PidFile/' < clamd.conf > temp.file + mv temp.file clamd.conf + status + + + # adduser clamav if needed + if ! grep -q clamav /etc/passwd; then + echo "Adding user clamav..." + adduser clamav -s /bin/false -H -D -S + status + fi +} + +# Del user clamav when pkg is removed. +post_remove() +{ + deluser clamav +} + diff -r 4817034d9f94 -r 91f518880067 clamav/stuff/daemon-clamd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clamav/stuff/daemon-clamd Fri Jul 18 22:38:32 2008 +0000 @@ -0,0 +1,57 @@ +#!/bin/sh +# /etc/init.d/daemon-name: Start, stop and restart daemon +# on SliTaz, at boot time or with the command line. +# +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf. +# +. /etc/init.d/rc.functions +. /etc/daemons.conf + +NAME=Clamd +DESC="clamav daemon" +DAEMON=/usr/sbin/clamd +OPTIONS=$CLAMD_OPTIONS +PIDFILE=/var/run/clamd.pid + +case "$1" in + start) + if [ -f $PIDFILE ] ; then + echo "$NAME already running." + exit 1 + fi + echo -n "Starting $DESC: $NAME... " + $DAEMON $OPTIONS + status + ;; + stop) + if [ ! -f $PIDFILE ] ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Stopping $DESC: $NAME... " + kill `cat $PIDFILE` + rm $PIDFILE + status + ;; + restart) + if [ ! -f $PIDFILE ] ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Restarting $DESC: $NAME... " + kill `cat $PIDFILE` + rm $PIDFILE + sleep 2 + $DAEMON $OPTIONS + status + ;; + *) + echo "" + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" + echo "" + exit 1 + ;; +esac + +exit 0