aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--network/dansguardian/dansguardian-2.10.1.1-gcc44.patch55
-rw-r--r--network/dansguardian/dansguardian.SlackBuild86
-rw-r--r--network/dansguardian/dansguardian.info6
-rw-r--r--network/dansguardian/dg.maxuploadsize.patch36
-rw-r--r--network/dansguardian/doinst.sh26
5 files changed, 73 insertions, 136 deletions
diff --git a/network/dansguardian/dansguardian-2.10.1.1-gcc44.patch b/network/dansguardian/dansguardian-2.10.1.1-gcc44.patch
deleted file mode 100644
index 3cdef6e487e0d..0000000000000
--- a/network/dansguardian/dansguardian-2.10.1.1-gcc44.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-diff -ruN dansguardian-2.10.1.1.orig/src/ConnectionHandler.cpp dansguardian-2.10.1.1/src/ConnectionHandler.cpp
---- dansguardian-2.10.1.1.orig/src/ConnectionHandler.cpp 2009-02-25 12:36:22.000000000 +0100
-+++ dansguardian-2.10.1.1/src/ConnectionHandler.cpp 2009-07-15 12:02:09.801533048 +0200
-@@ -45,6 +45,7 @@
-
- #ifdef ENABLE_ORIG_IP
- #include <linux/types.h>
-+#include <limits.h>
- #include <linux/netfilter_ipv4.h>
- #endif
-
-diff -ruN dansguardian-2.10.1.1.orig/src/contentscanners/clamav.cpp dansguardian-2.10.1.1/src/contentscanners/clamav.cpp
---- dansguardian-2.10.1.1.orig/src/contentscanners/clamav.cpp 2008-11-18 12:27:04.000000000 +0100
-+++ dansguardian-2.10.1.1/src/contentscanners/clamav.cpp 2009-07-15 11:59:12.316495912 +0200
-@@ -26,6 +26,7 @@
- #include "../ContentScanner.hpp"
- #include "../OptionContainer.hpp"
-
-+#include <cstdio>
- #include <syslog.h>
- #include <sys/time.h>
- #include <sys/types.h>
-diff -ruN dansguardian-2.10.1.1.orig/src/contentscanners/commandlinescan.cpp dansguardian-2.10.1.1/src/contentscanners/commandlinescan.cpp
---- dansguardian-2.10.1.1.orig/src/contentscanners/commandlinescan.cpp 2008-11-18 12:27:04.000000000 +0100
-+++ dansguardian-2.10.1.1/src/contentscanners/commandlinescan.cpp 2009-07-15 11:59:12.317495697 +0200
-@@ -28,6 +28,7 @@
- #include "../OptionContainer.hpp"
- #include "../RegExp.hpp"
-
-+#include <cstdio>
- #include <syslog.h>
- #include <sys/time.h>
- #include <sys/types.h>
-diff -ruN dansguardian-2.10.1.1.orig/src/contentscanners/icapscan.cpp dansguardian-2.10.1.1/src/contentscanners/icapscan.cpp
---- dansguardian-2.10.1.1.orig/src/contentscanners/icapscan.cpp 2008-11-18 12:27:04.000000000 +0100
-+++ dansguardian-2.10.1.1/src/contentscanners/icapscan.cpp 2009-07-15 11:59:12.318495062 +0200
-@@ -29,6 +29,7 @@
- #include "../ContentScanner.hpp"
- #include "../OptionContainer.hpp"
-
-+#include <cstdio>
- #include <syslog.h>
- #include <sys/time.h>
- #include <sys/types.h>
-diff -ruN dansguardian-2.10.1.1.orig/src/downloadmanagers/fancy.cpp dansguardian-2.10.1.1/src/downloadmanagers/fancy.cpp
---- dansguardian-2.10.1.1.orig/src/downloadmanagers/fancy.cpp 2008-11-18 12:27:04.000000000 +0100
-+++ dansguardian-2.10.1.1/src/downloadmanagers/fancy.cpp 2009-07-15 11:59:12.319495964 +0200
-@@ -26,6 +26,7 @@
- #include "../HTMLTemplate.hpp"
- #include "../ConnectionHandler.hpp"
-
-+#include <cstdio>
- #include <syslog.h>
- #include <sys/time.h>
- #include <sys/types.h>
diff --git a/network/dansguardian/dansguardian.SlackBuild b/network/dansguardian/dansguardian.SlackBuild
index ef609f3ee036e..526735b47d1c6 100644
--- a/network/dansguardian/dansguardian.SlackBuild
+++ b/network/dansguardian/dansguardian.SlackBuild
@@ -3,33 +3,7 @@
# Slackware build script for dansguardian
# http://dansguardian.org
#
-# Parts of this SlackBuild are directly copied from
-# http://www.slackware.com/~alien/slackbuilds/dansguardian/
-# and are:
-#
-# Copyright (c) 2006-2008 Eric Hameleers <alien@slackware.com>
-# All rights reserved.
-#
-# Permission to use, copy, modify, and distribute this software for
-# any purpose with or without fee is hereby granted, provided that
-# the above copyright notice and this permission notice appear in all
-# copies.
-#
-# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-#
-# All other are
-# Copyright 2006-2010 David Somero (dsomero@hotmail.com) Athens,TN USA
+# Copyright 2006-2013 David Somero (dsomero@hotmail.com) Athens,TN USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -50,16 +24,14 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=dansguardian
-VERSION=${VERSION:-2.10.1.1}
+VERSION=${VERSION:-2.12.0.3}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
-# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
- # Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$( uname -m ) ;;
esac
fi
@@ -98,13 +70,13 @@ else
LIBDIRSUFFIX=""
fi
-set -e
+set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
cd $PRGNAM-$VERSION
chown -R root:root .
find . \
@@ -113,8 +85,8 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-# Fix building with gcc4.4.
-patch -p1 < $CWD/dansguardian-2.10.1.1-gcc44.patch
+# http://sourceforge.net/p/dansguardian/patches/12/
+patch -p3 < $CWD/dg.maxuploadsize.patch
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
@@ -138,59 +110,29 @@ CXXFLAGS="$SLKCFLAGS" \
make
make install DESTDIR=$PKG
-find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
-( cd $PKG/usr/man
- find . -type f -exec gzip -9 {} \;
- for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
-)
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a COPYING INSTALL README $PKG/usr/doc/$PRGNAM-$VERSION
-
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
-mkdir -p $PKG/install
-cat $CWD/slack-desc > $PKG/install/slack-desc
-cat $CWD/doinst.sh > $PKG/install/doinst.sh
-
mkdir -p $PKG/etc/{rc.d,logrotate.d}
cat $PKG/usr/share/dansguardian/scripts/systemv-init > $PKG/etc/rc.d/rc.dansguardian
-# Note that the .new file left hanging around in /etc/logrotate.d/ will
-# probably/surely make cron'd logrotations fail, but not installing it
-# as .new here will clobber a potentially custom file. Therefore, the
-# choice is either *we* do bad things, or the *user* screws up.
-# This one's easy ;-) --rworkman
cat $PKG/usr/share/dansguardian/scripts/dansguardian \
> $PKG/etc/logrotate.d/dansguardian
chown ${PROXY_USR}:${PROXY_GRP} $PKG/var/log/dansguardian
# Find config files and add the .new.
-# Used by the next block of code.
-get_config_files() {
- for i in $(ls -1 $1); do
- if [ -d "$1/$i" ]; then
- get_config_files "$1/$i"
- else
- echo -n "$1/$i.new " | sed -e "s/^$(echo $PKG | sed -e 's/\//\\\//g')\///g"
- mv "$1/$i" "$1/$i.new"
- fi
- done
-}
-
-# Finish the doinst.sh by adding the .new file list and config loop
-if [ -e $PKG/etc ]; then
- etc_files=$(get_config_files $PKG/etc)
-
-cat <<DOINST >> $PKG/install/doinst.sh
-for FILE in $etc_files
-do
- config \$FILE
-done
-DOINST
-fi
+for FILE in $(find $PKG/etc -type f); do mv $FILE $FILE.new; done
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/network/dansguardian/dansguardian.info b/network/dansguardian/dansguardian.info
index 38775d43e7246..6e84499c702ac 100644
--- a/network/dansguardian/dansguardian.info
+++ b/network/dansguardian/dansguardian.info
@@ -1,8 +1,8 @@
PRGNAM="dansguardian"
-VERSION="2.10.1.1"
+VERSION="2.12.0.3"
HOMEPAGE="http://dansguardian.org/"
-DOWNLOAD="http://dansguardian.org/downloads/2/Stable/dansguardian-2.10.1.1.tar.gz"
-MD5SUM="0987a1c9bfbdf398118386f10279611a"
+DOWNLOAD="http://downloads.sourceforge.net/project/dansguardian/dansguardian-2.12.0.3.tar.bz2"
+MD5SUM="2a88d0392cd28eaec02b7ee727b2e253"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
diff --git a/network/dansguardian/dg.maxuploadsize.patch b/network/dansguardian/dg.maxuploadsize.patch
new file mode 100644
index 0000000000000..80fad02296ab8
--- /dev/null
+++ b/network/dansguardian/dg.maxuploadsize.patch
@@ -0,0 +1,36 @@
+diff -rub ../dist/dansguardian-2.12.0.3/src/FOptionContainer.cpp dansguardian-2.12.0.3/src/FOptionContainer.cpp
+--- ../dist/dansguardian-2.12.0.3/src/FOptionContainer.cpp Sat Sep 29 22:06:45 2012
++++ dansguardian-2.12.0.3/src/FOptionContainer.cpp Wed Nov 28 20:05:20 2012
+@@ -304,13 +304,6 @@
+ violationbody="";
+
+ threshold = findoptionI("threshold");
+- // TODO: Implement a "findoptionO" and a version of
+- // reality check which uses off_t, for large file support?
+- max_upload_size = findoptionI("maxuploadsize");
+- if (!realitycheck(max_upload_size, -1, 0, "maxuploadsize")) {
+- return false;
+- } // check its a reasonable value
+- max_upload_size *= 1024;
+
+ avadmin = findoptionS("avadmin");
+ if (avadmin.length()==0) {
+diff -rub ../dist/dansguardian-2.12.0.3/src/OptionContainer.cpp dansguardian-2.12.0.3/src/OptionContainer.cpp
+--- ../dist/dansguardian-2.12.0.3/src/OptionContainer.cpp Sat Sep 29 22:06:45 2012
++++ dansguardian-2.12.0.3/src/OptionContainer.cpp Wed Nov 28 20:09:32 2012
+@@ -236,6 +236,15 @@
+ mailer = findoptionS("mailer");
+ #endif
+
++ // TODO: Implement a "findoptionO" and a version of
++ // reality check which uses off_t, for large file support?
++ max_upload_size = findoptionI("maxuploadsize");
++ if (!realitycheck(max_upload_size, -1, 0, "maxuploadsize")) {
++ return false;
++ } // check its a reasonable value
++ if (max_upload_size > 0)
++ max_upload_size *= 1024;
++
+ // the dansguardian.conf and pics files get amalgamated into one
+ // deque. They are only seperate files for clarity.
+
diff --git a/network/dansguardian/doinst.sh b/network/dansguardian/doinst.sh
index 70cb2a098cfb6..9f153fd0d5e54 100644
--- a/network/dansguardian/doinst.sh
+++ b/network/dansguardian/doinst.sh
@@ -1,17 +1,31 @@
config() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
rm $NEW
fi
+ # Otherwise, we leave the .new copy for the admin to consider...
}
-# Keep same perms on rc.dansguardian.new:
-if [ -e etc/rc.d/rc.dansguardian ]; then
- cp -a etc/rc.d/rc.dansguardian etc/rc.d/rc.dansguardian.new.incoming
- cat etc/rc.d/rc.dansguardian.new > etc/rc.d/rc.dansguardian.new.incoming
- mv etc/rc.d/rc.dansguardian.new.incoming etc/rc.d/rc.dansguardian.new
-fi
+preserve_perms() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ -e $OLD ]; then
+ cp -a $OLD ${NEW}.incoming
+ cat $NEW > ${NEW}.incoming
+ mv ${NEW}.incoming $NEW
+ fi
+ config $NEW
+}
+
+preserve_perms etc/rc.d/rc.dansguardian.new
+preserve_perms etc/logrotate.d/dansguardian.new
+
+for FILE in $(find etc/dansguardian -name '*.new'); do
+ preserve_perms $FILE
+done