# DansGuardian and DGVirus

## Mit

Just wondering if anyone had been successful using the above pair (DansGuardian and DGVirus) as i would like to protect my network with virus scanning (using ClamAV - works very well for my virtual mail server)

I tried to do it manually, but couldn't get it working successfully, wondering if anyone else had tried.

----------

## Mit

Anyone? :/

----------

## pharoh

the 2.8 tree has been released with clamav viruscode builtin   :Very Happy: 

http://www.harvest.com.br/asp/afn/dg.nsf    have fun!

----------

## Mit

Excellent, cheers for that pharoh, now i wish i could write an ebuild for it... will try the changing name trick when i get home.

I'd actually given up trying to get it working until a few days ago when somehow Netsky-P managed to get onto one of the networked pcs  :Rolling Eyes: 

Damn Virus writers... wish they'd stop  :Shocked: . heh, i can only hope.

----------

## pharoh

I took the 2.7 ebuild and modified it but forgot to save it and on the next sync it was deleted.   :Evil or Very Mad:  I think it only took like 20 mins.  I emerged the 2.7.1 ebuild and then unpacked the 2.8 source and did ./configure && make && make install worked good 4 me on our customer machines.  (Like i said i did not protect my ebuild   :Embarassed:  )

----------

## pharoh

forgot to mention that I emerged the 2.7.1 just for the init scripts and such

----------

## drdebian

I'm interested in using DG with ClamAV as well. Can anyone point me to instructions on how to create an ebuild for 2.8 using the vanilla source from the website?

----------

## Mit

look at my last reply on https://forums.gentoo.org/viewtopic.php?t=54022&highlight=dg

----------

## smouge

Made an ebuild for dansguardian 2.7.1-0 to work with the antivuris patch at www.pcxperience.org

Unfortunately this is not the latest dansguardian code and it needs some manual steps as well, but at least it is working and might be a startpoint for furhter ebuilds?

```

# Copyright 1999-2004 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: /var/cvsroot/gentoo-x86/www-proxy/dansguardian/dansguardian-2.7.1-r1.ebuild,v 1.2 2004/08/15 23:38:42 cyfred Exp $

# patched version from 2.71 to include the Antivirus patch

# this is an unofficial ebuild

inherit eutils

MY_P="DansGuardian-${PV}"

S="${WORKDIR}/${MY_P}"

DESCRIPTION="Web content filtering via proxy"

HOMEPAGE="http://dansguardian.org"

SRC_URI="http://mirror.dansguardian.org/downloads/2/Alpha/${MY_P}-0.source.tar.gz"

LICENSE="GPL-2"

SLOT="0"

KEYWORDS="x86"

IUSE=""

DEPEND="www-proxy/squid"

#einfo "This modified ebuild has been created to include the anti-virus plugin from"

#einfo "http://www.pcxperience.org/dgvirus/patches/DG2.7/archive/DansGuardian-2.7.1-0-AntiVirus-4.1.patch.gz"

#einfo " "

#einfo " "

#einfo "To install do the following:"

#einfo " "

#einfo "copy this ebuild file to /usr/portage/www-proxy/dansguardian/dansguardian-2.7.1-r1.ebuild"

#einfo " "

#einfo " "

#einfo "# cd /usr/portage/www-proxy/dansguardian/files"

#einfo "# wget http://www.pcxperience.org/dgvirus/patches/DG2.7/archive/DansGuardian-2.7.1-0-AntiVirus-4.1.patch.gz"

#einfo " "

#einfo "# mv DansGuardian-2.7.1-0-AntiVirus-4.1.patch.gz DansGuardian-2.7.1-0-AntiVirus-4.1.diff"

#einfo "# cd .."

#einfo "# ebuild dansguardian-2.7.1-r1.ebuild digest"

#einfo "# emerge dansguardian"

#einfo " "

#einfo "After emerge carry out the following: "

#einfo "Install Mail::Sender "

#einfo "# perl -MCPAN -e shell "

#einfo " "

#einfo "We will also need the virus wrapper scripts "

#einfo "# cd /usr/portage/www-proxy/dansguardian/files"

#einfo "# wget http://www.pcxperience.org/dgvirus/patches/support/DansGuardian-Virus-Scripts-1.05.tgz"

#einfo "# tar xzvf DansGuardian-Virus-Scripts-1.05.tgz"

#einfo "# mv DansGuardian-Virus-Scripts-1.05/usr/lib/DGVirus/ /usr/lib"

#einfo "# rm -r DansGuardian-Virus-Scripts-1.05"

#einfo "set "Mail Domain" in /etc/dansguardian/virrusscanner.conf"

#einfo "# mkdir -p /var/www/html/dgvirus/quarantine

#einfo " "

#einfo "Ready ? "

#einfo "# /etc/init.d/squid restart "

src_unpack() {

   unpack ${A}

   cd ${S}

   epatch ${FILESDIR}/DansGuardian-2.7.1-0-AntiVirus-4.1.patch.gz

}

src_compile() {

   ./configure \

      --prefix= \

      --installprefix=${D} \

      --mandir=/usr/share/man/ || die "./configure failed"

   emake || die "emake failed"

}

src_install() {

   if [ -d "/etc/logrotate.d" ]; then mkdir -p ${D}/etc/logrotate.d; fi

   make install || die "make install failed"

   dodir /etc/init.d

   cp ${FILESDIR}/dansguardian.init ${D}/etc/init.d/dansguardian

   rm -rf ${D}/etc/rc.d

   einfo "Fixing location of initscript"

   sed 's/rc.d\///' ${D}/etc/dansguardian/logrotation > ${D}/etc/dansguardian/logrotation.fixed

   mv -f ${D}/etc/dansguardian/logrotation.fixed ${D}/etc/dansguardian/logrotation

   dodoc INSTALL README LICENSE

}

```

----------

## smouge

Found out that there was even a newer patch out for version 2.8.0.3

Therefore pls find here my latest patched ebuild for dansguardian 2.8.0.3 with anti-virus plugin.

Notice the added  dependency for libesmtp. 

```

# Copyright 1999-2004 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: /var/cvsroot/gentoo-x86/www-proxy/dansguardian/dansguardian-2.8.0.3-r.ebuild,v 1.2 2004/08/15 23:38:42 cyfred Exp $

# patched version from 2.8.0 to include the Antivirus patch

# this is an unofficial ebuild

inherit eutils

MY_P="dansguardian-${PV}"

S="${WORKDIR}/${MY_P}"

DESCRIPTION="Web content filtering via proxy"

HOMEPAGE="http://dansguardian.org"

SRC_URI="http://mirror.dansguardian.org/downloads/2/Stable/${MY_P}.source.tar.gz"

LICENSE="GPL-2"

SLOT="0"

KEYWORDS="x86"

IUSE=""

DEPEND="www-proxy/squid

        net-libs/libesmtp"

#einfo "This modified ebuild has been created to include the anti-virus plugin from"

#einfo "http://sourceforge.net/project/showfiles.php?group_id=99063&package_id=106174&release_id=277430"

#einfo " "

#einfo "Filename of patch is"

#einfo "http://prdownloads.sourceforge.net/dgav/dansguardian-2.8.0.3-antivirus-6.3.6.patch.gz"

#einfo " "

#einfo " "

#einfo "To install do the following:"

#einfo " "

#einfo "copy this ebuild file to /usr/portage/www-proxy/dansguardian/dansguardian-2.8.0.3-r.ebuild"

#einfo "copy patch file to /usr/portage/www-proxy/dansguardian/files/dansguardian-2.8.0.3-antivirus-6.3.6.patch.gz"

#einfo " "

#einfo "# cd /usr/portage/www-proxy/dansguardian/files"

#einfo "# ebuild dansguardian-2.7.1-r1.ebuild digest"

#einfo "# emerge dansguardian"

#einfo " "

#einfo "We will also need the virus wrapper scripts "

#einfo "# cd /usr/portage/www-proxy/dansguardian/files"

#einfo "# wget http://www.pcxperience.org/dgvirus/patches/support/DansGuardian-Virus-Scripts-1.05.tgz"

#einfo "# tar xzvf DansGuardian-Virus-Scripts-1.05.tgz"

#einfo "# mv DansGuardian-Virus-Scripts-1.05/usr/lib/DGVirus/ /usr/lib"

#einfo "# rm -r DansGuardian-Virus-Scripts-1.05"

#einfo "set "Mail Domain" in /etc/dansguardian/virrusscanner.conf"

#einfo "# mkdir -p /var/www/html/dgvirus/quarantine

#einfo " "

#einfo "Ready ? "

#einfo "# /etc/init.d/squid restart "

src_unpack() {

   unpack ${A}

   cd ${S}

   epatch ${FILESDIR}/dansguardian-2.8.0.3-antivirus-6.3.6.patch.gz

}

src_compile() {

   ./configure \

      --prefix= \

      --installprefix=${D} \

      --mandir=/usr/share/man/ \

      --cgidir=/var/www/localhost/cgi-bin/ || die "./configure failed"

   emake || die "emake failed"

}

src_install() {

   if [ -d "/etc/logrotate.d" ]; then mkdir -p ${D}/etc/logrotate.d; fi

   make install || die "make install failed"

   dodir /etc/init.d

   cp ${FILESDIR}/dansguardian.init ${D}/etc/init.d/dansguardian

   rm -rf ${D}/etc/rc.d

   einfo "Fixing location of initscript"

   sed 's/rc.d\///' ${D}/etc/dansguardian/logrotation > ${D}/etc/dansguardian/logrotation.fixed

   mv -f ${D}/etc/dansguardian/logrotation.fixed ${D}/etc/dansguardian/logrotation

   dodoc INSTALL README LICENSE

}

```

----------

