summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlin Năstac <mrness@gentoo.org>2009-02-17 23:04:06 +0000
committerAlin Năstac <mrness@gentoo.org>2009-02-17 23:04:06 +0000
commit8b4c308049954735658f94cba0d7acaaaecfd169 (patch)
tree1b0df5dc29b49415d3161f56ae566c6408245ddf /net-proxy/dansguardian/dansguardian-2.10.0.3.ebuild
parentFix buffer overflow, thanks to emerald <dirk at liji-und-dirk dot de> (#259272). (diff)
downloadhistorical-8b4c308049954735658f94cba0d7acaaaecfd169.tar.gz
historical-8b4c308049954735658f94cba0d7acaaaecfd169.tar.bz2
historical-8b4c308049954735658f94cba0d7acaaaecfd169.zip
Version bump (#258524). Remove obsolete versions.
Package-Manager: portage-2.1.6.4/cvs/Linux 2.6.25-gentoo-r6 x86_64
Diffstat (limited to 'net-proxy/dansguardian/dansguardian-2.10.0.3.ebuild')
-rw-r--r--net-proxy/dansguardian/dansguardian-2.10.0.3.ebuild103
1 files changed, 103 insertions, 0 deletions
diff --git a/net-proxy/dansguardian/dansguardian-2.10.0.3.ebuild b/net-proxy/dansguardian/dansguardian-2.10.0.3.ebuild
new file mode 100644
index 000000000000..34f8ec6ed04b
--- /dev/null
+++ b/net-proxy/dansguardian/dansguardian-2.10.0.3.ebuild
@@ -0,0 +1,103 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-proxy/dansguardian/dansguardian-2.10.0.3.ebuild,v 1.1 2009/02/17 23:04:05 mrness Exp $
+
+DESCRIPTION="Web content filtering via proxy"
+HOMEPAGE="http://dansguardian.org"
+SRC_URI="http://dansguardian.org/downloads/2/Stable/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="clamav kaspersky debug ntlm pcre"
+
+RDEPEND="sys-libs/zlib
+ pcre? ( dev-libs/libpcre )
+ clamav? ( >=app-antivirus/clamav-0.93 )"
+DEPEND="${RDEPEND}
+ dev-util/pkgconfig"
+
+pkg_setup() {
+ if has_version "<${CATEGORY}/${PN}-2.9" ; then
+ ewarn "This version introduces brand new USE flags:"
+ ewarn " clamav kaspersky ntlm pcre"
+ echo
+
+ local f="${ROOT}/etc/dansguardian"
+ f=${f//\/\///}
+ if [ -d "${f}" ] ; then
+ eerror "The structure of ${f} has changed in this version!"
+ eerror "For avoiding confusion, you must either move or delete the old ${f},"
+ eerror "then continue with the upgrade:"
+ eerror " mv '${f}' '${f}.old'"
+ eerror " emerge --resume"
+ die "Obsolete config files detected"
+ fi
+ fi
+}
+
+src_compile() {
+ local myconf="--with-logdir=/var/log/dansguardian
+ --with-piddir=/var/run
+ --docdir=/usr/share/doc/${PF}
+ --htmldir=/usr/share/doc/${PF}/html
+ $(use_enable pcre)
+ $(use_enable ntlm)
+ --enable-fancydm
+ --enable-email"
+ if use clamav; then
+ myconf="${myconf} --enable-clamd --enable-clamav
+ --with-proxyuser=clamav
+ --with-proxygroup=clamav"
+ fi
+ if use kaspersky; then
+ myconf="${myconf} --enable-kavd"
+ fi
+ if use debug; then
+ myconf="${myconf} --with-dgdebug=on"
+ fi
+
+ econf ${myconf} || die "configure failed"
+
+ emake OPTIMISE="${CFLAGS}" || die "emake failed"
+}
+
+src_install() {
+ make "DESTDIR=${D}" install || die "make install failed"
+
+ # Move html documents to html dir
+ mkdir "${D}"/usr/share/doc/${PF}/html \
+ && mv "${D}"/usr/share/doc/${PF}/*.html "${D}"/usr/share/doc/${PF}/html \
+ || die "no html docs found in docdir"
+
+ # Copying init script
+ newinitd "${FILESDIR}/dansguardian.init" dansguardian
+
+ if use clamav; then
+ sed -r -i -e 's/[ \t]+use dns/& clamd/' "${D}/etc/init.d/dansguardian"
+ sed -r -i -e 's/^#( *contentscanner *=.*clamdscan[.]conf.*)/\1/' "${D}/etc/dansguardian/dansguardian.conf"
+ sed -r -i -e 's/^#( *clamdudsfile *=.*)/\1/' "${D}/etc/dansguardian/contentscanners/clamdscan.conf"
+ elif use kaspersky; then
+ sed -r -i -e 's/^#( *contentscanner *=.*kavdscan[.]conf.*)/\1/' "${D}/etc/dansguardian/dansguardian.conf"
+ fi
+
+ # Copying logrotation file
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/dansguardian.logrotate" dansguardian
+
+ keepdir /var/log/dansguardian
+ fperms o-rwx /var/log/dansguardian
+}
+
+pkg_postinst() {
+ local runas="nobody:nobody"
+ if use clamav ; then
+ runas="clamav:clamav"
+ fi
+ einfo "The dansguardian daemon will run by default as ${runas}"
+
+ if [ -d "${ROOT}/var/log/dansguardian" ] ; then
+ chown -R ${runas} "${ROOT}/var/log/dansguardian"
+ chmod o-rwx "${ROOT}/var/log/dansguardian"
+ fi
+}