wok rev 1104
Up: clamav (0.93.3) Antivirus
author | Paul Issott <paul@slitaz.org> |
---|---|
date | Fri Jul 18 22:38:32 2008 +0000 (2008-07-18) |
parents | 4817034d9f94 |
children | 501432acf1ae |
files | clamav/receipt clamav/stuff/daemon-clamd |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/clamav/receipt Fri Jul 18 22:38:32 2008 +0000 1.3 @@ -0,0 +1,76 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="clamav" 1.7 +VERSION="0.93.3" 1.8 +CATEGORY="security" 1.9 +SHORT_DESC="Antivirus" 1.10 +MAINTAINER="paul@slitaz.org" 1.11 +DEPENDS="" 1.12 +TARBALL="$PACKAGE-$VERSION.tar.gz" 1.13 +WEB_SITE="http://www.clamav.net/" 1.14 +WGET_URL="http://downloads.sourceforge.net/clamav/$TARBALL" 1.15 + 1.16 +# Rules to configure and make the package. 1.17 +compile_rules() 1.18 +{ 1.19 + # Have to create clamav user/group to be able to compile 1.20 + adduser clamav -s /bin/false -H -D -S 1.21 + 1.22 + cd $src 1.23 + ./configure \ 1.24 + --prefix=/usr \ 1.25 + --sysconfdir=/etc/clamav \ 1.26 + --infodir=/usr/share/info \ 1.27 + --mandir=/usr/share/man \ 1.28 + $CONFIGURE_ARGS 1.29 + make 1.30 + make DESTDIR=$PWD/_pkg install 1.31 +} 1.32 + 1.33 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.34 +genpkg_rules() 1.35 +{ 1.36 + mkdir -p $fs/usr/lib $fs/usr/share $fs/etc/init.d 1.37 + cp -a $_pkg/usr/bin $fs/usr 1.38 + cp -a $_pkg/usr/sbin $fs/usr 1.39 + cp -a $_pkg/etc $fs 1.40 + # Copy only shared lib (.so) 1.41 + cp -a $_pkg/usr/lib/*.so* $fs/usr/lib 1.42 + cp -a $_pkg/usr/share/clamav $fs/usr/share 1.43 + # Copy daemon from /stuff 1.44 + cp stuff/daemon-clamd $fs/etc/init.d/clamd 1.45 +} 1.46 + 1.47 +post_install() 1.48 +{ 1.49 + echo "Processing post-install commands..." 1.50 + 1.51 + # Enable freshclam update 1.52 + echo -n "Enabling freshclam update..." 1.53 + cd /etc/clamav 1.54 + sed 's/^Example/#Example/' < freshclam.conf > temp.file 1.55 + mv temp.file freshclam.conf 1.56 + status 1.57 + 1.58 + # Enable clamd configuration 1.59 + echo -n "Enabling clamd daemon..." 1.60 + cd /etc/clamav 1.61 + sed 's/^Example/#Example/; s/^#PidFile/PidFile/' < clamd.conf > temp.file 1.62 + mv temp.file clamd.conf 1.63 + status 1.64 + 1.65 + 1.66 + # adduser clamav if needed 1.67 + if ! grep -q clamav /etc/passwd; then 1.68 + echo "Adding user clamav..." 1.69 + adduser clamav -s /bin/false -H -D -S 1.70 + status 1.71 + fi 1.72 +} 1.73 + 1.74 +# Del user clamav when pkg is removed. 1.75 +post_remove() 1.76 +{ 1.77 + deluser clamav 1.78 +} 1.79 +
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/clamav/stuff/daemon-clamd Fri Jul 18 22:38:32 2008 +0000 2.3 @@ -0,0 +1,57 @@ 2.4 +#!/bin/sh 2.5 +# /etc/init.d/daemon-name: Start, stop and restart daemon 2.6 +# on SliTaz, at boot time or with the command line. 2.7 +# 2.8 +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS 2.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf. 2.10 +# 2.11 +. /etc/init.d/rc.functions 2.12 +. /etc/daemons.conf 2.13 + 2.14 +NAME=Clamd 2.15 +DESC="clamav daemon" 2.16 +DAEMON=/usr/sbin/clamd 2.17 +OPTIONS=$CLAMD_OPTIONS 2.18 +PIDFILE=/var/run/clamd.pid 2.19 + 2.20 +case "$1" in 2.21 + start) 2.22 + if [ -f $PIDFILE ] ; then 2.23 + echo "$NAME already running." 2.24 + exit 1 2.25 + fi 2.26 + echo -n "Starting $DESC: $NAME... " 2.27 + $DAEMON $OPTIONS 2.28 + status 2.29 + ;; 2.30 + stop) 2.31 + if [ ! -f $PIDFILE ] ; then 2.32 + echo "$NAME is not running." 2.33 + exit 1 2.34 + fi 2.35 + echo -n "Stopping $DESC: $NAME... " 2.36 + kill `cat $PIDFILE` 2.37 + rm $PIDFILE 2.38 + status 2.39 + ;; 2.40 + restart) 2.41 + if [ ! -f $PIDFILE ] ; then 2.42 + echo "$NAME is not running." 2.43 + exit 1 2.44 + fi 2.45 + echo -n "Restarting $DESC: $NAME... " 2.46 + kill `cat $PIDFILE` 2.47 + rm $PIDFILE 2.48 + sleep 2 2.49 + $DAEMON $OPTIONS 2.50 + status 2.51 + ;; 2.52 + *) 2.53 + echo "" 2.54 + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" 2.55 + echo "" 2.56 + exit 1 2.57 + ;; 2.58 +esac 2.59 + 2.60 +exit 0