#!/bin/sh
+set -o errexit
+
# First argument of this script is the package name
# Reading system configuration informations, functions and package versions.
source ../functions
source ../packages-list
-CUR_DIR=$(pwd)
-
# Applying patches (if any)
-apply_patches ${1} &&
+apply_patches ${1}
-hv_groupadd clamav &&
-hv_useradd -g clamav -s /bin/false -c Clam-AntiVirus clamav &&
+hv_groupadd clamav
+hv_useradd -g clamav -s /bin/false -c Clam-AntiVirus clamav
-cd ${LFS_TMP}/${1} &&
+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 &&
+ --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 &&
+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" &&
+cat > /etc/clamd.conf << "EOF"
# clamd.conf
# Configuration file for the Clam AV daemon
# Freshclam configuration file
-cat > /etc/freshclam.conf << "EOF" &&
+cat > /etc/freshclam.conf << "EOF"
# freshclam.conf
# Configuration file for Freshclam
EOF
# Create the DB directory
-mkdir -p /srv/clamav &&
-chown clamav:clamav /srv/clamav &&
-chmod 755 /srv/clamav &&
+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 &&
+mkdir -p /var/run/clamav
+chown clamav:clamav /var/run/clamav
+chmod 755 /var/run/clamav
# Bootscript
-install -v -m740 ${CUR_DIR}/bootscripts/clamav /etc/rc.d/init.d &&
+install -v -m740 ${SCRDIR}/bootscripts/clamav /etc/rc.d/init.d
# script-name start stop
bootscript_add_rc3 clamav 55 35
-# Return last error
exit $?