#Maintainer: Juhana 'rexroom' Uuttu #Former Maintainer(s): Son|c , Polesz pkgname=clamav pkgver=0.95.3 pkgrel=1 zenver=64 arch=i486 docs=("authors" "bugs" "copying" "changelog" "faq" "install" "news" "readme" "todo" "upgrade" "clamav-mirror-howto.pdf" "clamdoc.pdf" "phishsigs_howto.pdf" "signatures.pdf") url=http://www.clamav.net/ source=("http://downloads.sourceforge.net/project/clamav/clamav/$pkgver/clamav-$pkgver.tar.gz" "rc.clamd") sourcetemplate=http://cthulhu.daug.net/zenwalk/$pkgname/ options=('noautodotnew') dotnew=('etc/clamav/clamd.conf' 'etc/clamav/freshclam.conf' 'etc/clamav/clamav-milter.conf') slackdesc=\ ( #|-----mind-the-gap-----------------------------------------------------| "$pkgname - a GPL virus scanner" "Clam AntiVirus is a GPL anti-virus toolkit for UNIX. The main purpose" "of this software is the integration with the mail servers (attachment" "scanning). The package provides a flexible and scalable multi-threaded" "daemon, a command line scanner, and a tool for automatic updating via" "Internet. The programs are based on a shared library distributed with" "the Clam AntiVirus package, which you can use with your own software." ) doinst() { # Post-install procedures # Define minimum values for UID and GID MUID=43 MGID=43 USERNAME=clamav GROUPNAME=clamav COMMENT=ClamAV HOMEDIR=/var/lib/clamav ( if ! grep -qe "^$GROUPNAME:" etc/group; then NEXTGID="$(MGID=$MGID awk -F: '{uid[$3]=1} END { for (i=ENVIRON["MGID"];i in uid;i++);print i}' etc/group)" chroot . /usr/sbin/groupadd -g $NEXTGID $GROUPNAME fi ) ( if ! grep -qe "^$USERNAME:" etc/passwd; then NEXTUID="$(MUID=$MUID awk -F: '{uid[$3]=1} END { for (i=ENVIRON["MUID"];i in uid;i++);print i}' etc/passwd)" chroot . /usr/sbin/useradd -g $GROUPNAME -u $NEXTUID -d $HOMEDIR -c $COMMENT -s /bin/false $USERNAME fi ) chown -R ${USERNAME}:${GROUPNAME} var/lib/clamav # Create logs with right accesses out of convenience if [ ! -e /var/log/freshclam.log ]; then echo -n >> /var/log/freshclam.log chown ${USERNAME}:${GROUPNAME} /var/log/freshclam.log fi if [ ! -e /var/log/clamd.log ]; then echo -n >> /var/log/clamd.log chown ${USERNAME}:${GROUPNAME} /var/log/clamd.log fi # And we are done END } build() { cd $startdir/src/$pkgname-$pkgver ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc/clamav \ --mandir=/usr/man \ --disable-clamav \ --enable-milter \ --with-zlib=/usr \ --with-user=clamav \ --with-group=clamav \ --with-dbdir=/var/lib/clamav \ --program-prefix="" \ --program-suffix="" make || return 1 make install DESTDIR=$startdir/pkg ### Post-build tweaking cd $startdir/pkg # Set some config parameters sed -i 's/\#TemporaryDirectory\ \/var\/tmp/\#TemporaryDirectory\ \/tmp/' etc/clamav/clamd.conf sed -i 's/\#TemporaryDirectory\ \/var\/tmp/\#TemporaryDirectory\ \/tmp/' etc/clamav/clamav-milter.conf sed -i 's/tmp\/clamd.log/var\/log\/clamd.log/' etc/clamav/clamd.conf sed -i 's/path\/to/etc\/clamav/' etc/clamav/freshclam.conf mkdir -p etc/rc.d/desc.d install -m0644 $startdir/src/rc.clamd etc/rc.d/ echo "clamd:The ClamAV antivirus daemon:clamd" > etc/rc.d/desc.d/clamd.txt echo "*** NOW PACKAGING ***" }