X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=stage5%2Fpkg%2Fclamav;h=d97016327f6cb3b8997767cc440c71d87968fb02;hb=d0e5edd198015a62b0e89c7bfe2a4c60f68db44c;hp=afdaec3ac52eb121c5eb30d01ea620ccdb259c1a;hpb=3dae4c554ec18f465eb6ee5e6efdbdbe8557e13c;p=hvlinux.git diff --git a/stage5/pkg/clamav b/stage5/pkg/clamav index afdaec3..d970163 100644 --- a/stage5/pkg/clamav +++ b/stage5/pkg/clamav @@ -1,40 +1,37 @@ -#!/bin/sh -set -o errexit - -# First argument of this script is the package name - -# Reading system configuration informations, functions and package versions. -source ../sysinfos -source ../functions -source ../packages-list - -# Applying patches (if any) -apply_patches ${1} - -groupadd -f clamav -hv_useradd -g clamav -s /bin/false -c Clam-AntiVirus clamav - -cd ${LFS_TMP}/${1} -SENDMAIL="/usr/sbin/sendmail" ./configure \ - --prefix=/usr \ - --sysconfdir=/etc \ - --with-dbdir=/srv/clamav \ - --enable-milter -make -make install -touch /var/log/clamd.log -chmod 600 /var/log/clamd.log -chown clamav /var/log/clamd.log -touch /var/log/freshclam.log -chmod 600 /var/log/freshclam.log -chown clamav /var/log/freshclam.log - -# Addition to /etc/fcron/fcrontab to update virus database -string_add "Update the Clam AV database every hour" /etc/fcron/fcrontab -string_add "&mail(false) 0 * * * * /usr/bin/freshclam --quiet" /etc/fcron/fcrontab - -# Configuration file -cat > /etc/clamd.conf << "EOF" +#!/bin/bash + +hvconfig_pre() +{ + groupadd -f clamav + hv_useradd -g clamav -s /bin/false -c Clam-AntiVirus clamav + + # Is this really necessary? + export SENDMAIL="/usr/sbin/sendmail" + + CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ + --with-dbdir=/srv/clamav \ + --enable-milter" +} + +hvconfig_post() +{ + unset SENDMAIL +} + +hvbuild_post() +{ + install -m644 ${SCRDIR}/misc/freshclam /etc/fcron/fcron.d + + touch /var/log/clamd.log + chmod 600 /var/log/clamd.log + chown clamav /var/log/clamd.log + touch /var/log/freshclam.log + chmod 600 /var/log/freshclam.log + chown clamav /var/log/freshclam.log + + # Configuration file + cat > /etc/clamd.conf << "EOF" # clamd.conf # Configuration file for the Clam AV daemon @@ -148,9 +145,8 @@ MaxRecursion 100 MaxFiles 0 EOF - -# Freshclam configuration file -cat > /etc/freshclam.conf << "EOF" + # Freshclam configuration file + cat > /etc/freshclam.conf << "EOF" # freshclam.conf # Configuration file for Freshclam @@ -194,20 +190,19 @@ DatabaseMirror database.clamav.net #OnErrorExecute command EOF -# Create the DB directory -mkdir -p /srv/clamav -chown clamav:clamav /srv/clamav -chmod 755 /srv/clamav - -# Create the run directory -mkdir -p /var/run/clamav -chown clamav:clamav /var/run/clamav -chmod 755 /var/run/clamav + # Create the DB directory + mkdir -p /srv/clamav + chown clamav:clamav /srv/clamav + chmod 755 /srv/clamav -# Bootscript -install -v -m740 ${SCRDIR}/bootscripts/clamav /etc/rc.d/init.d + # Create the run directory + mkdir -p /var/run/clamav + chown clamav:clamav /var/run/clamav + chmod 755 /var/run/clamav -# script-name start stop -bootscript_add_rc3 clamav 55 35 + # Bootscript + install -v -m740 ${SCRDIR}/bootscripts/clamav /etc/rc.d/init.d -exit $? + # script-name start stop + bootscript_add_rc3 clamav 55 35 +}