summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Jensen <hjensen@mailbox.org>2017-08-23 16:03:08 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-08-26 07:19:57 +0700
commit4d395cb6f08660043db01edf568b228e1aa62b24 (patch)
tree4b6fa89a0e3b2609cd66b064c227f5846f9d8504
parentda59d089927df37d8a56f9e6be42c59237c68ef8 (diff)
downloadslackbuilds-4d395cb6f08660043db01edf568b228e1aa62b24.tar.gz
network/e2guardian: Added (web content filter).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--network/e2guardian/README10
-rw-r--r--network/e2guardian/doinst.sh30
-rw-r--r--network/e2guardian/e2guardian.SlackBuild140
-rw-r--r--network/e2guardian/e2guardian.info10
-rw-r--r--network/e2guardian/slack-desc19
5 files changed, 209 insertions, 0 deletions
diff --git a/network/e2guardian/README b/network/e2guardian/README
new file mode 100644
index 0000000000..f5b5fc1cd0
--- /dev/null
+++ b/network/e2guardian/README
@@ -0,0 +1,10 @@
+e2guardian is a web content filter and a fork of DansGuardian.
+It filters the actual content of pages based on many methods
+including phrase matching, PICS filtering and URL filtering.
+It does not purely filter based on a banned list of sites
+like lesser totally commercial filters. e2guardian is designed
+to be completely flexible and allows you to tailor the
+filtering to your exact needs.
+
+This requires a proxy server so squid is a recommended
+optional dependency.
diff --git a/network/e2guardian/doinst.sh b/network/e2guardian/doinst.sh
new file mode 100644
index 0000000000..5e66a53dc8
--- /dev/null
+++ b/network/e2guardian/doinst.sh
@@ -0,0 +1,30 @@
+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...
+}
+
+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.e2guardian.new
+preserve_perms etc/logrotate.d/e2guardian.new
+
+for FILE in $(find etc/e2guardian -name '*.new'); do
+ preserve_perms $FILE
+done
diff --git a/network/e2guardian/e2guardian.SlackBuild b/network/e2guardian/e2guardian.SlackBuild
new file mode 100644
index 0000000000..ac8b04ce29
--- /dev/null
+++ b/network/e2guardian/e2guardian.SlackBuild
@@ -0,0 +1,140 @@
+#!/bin/sh
+
+# Slackware build script for e2guardian
+# http://e2guardian.org
+#
+# Copyright 2017 Henry Jensen (hjensen@mailbox.org)
+# based on dansguardian.SlackBuild
+# 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
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS 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 AUTHOR 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.
+
+PRGNAM=e2guardian
+VERSION=${VERSION:-4.1.2}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+# If these user accounts do not exist on the target system, you will have
+# to create them before you install the resulting package!
+PROXY_USR=${PROXY_USR:-nobody}
+PROXY_GRP=${PROXY_GRP:-nobody}
+
+if ! grep -q ^$PROXY_USR: /etc/passwd ; then
+ echo " You must have a $PROXY_USR user to run this script."
+ exit 1
+fi
+
+if ! grep -q ^$PROXY_GRP: /etc/group ; then
+ echo " You must have a $PROXY_GRP group to run this script."
+ exit 1
+fi
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+./autogen.sh
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --bindir=/usr/sbin \
+ --mandir=/usr/man \
+ --docdir=/usr/doc/$PRGNAM-$VERSION \
+ --with-logdir=/var/log/e2guardian \
+ --with-proxyuser=${PROXY_USR} \
+ --with-proxygroup=${PROXY_GRP} \
+ --with-piddir=/var/run \
+ --enable-pcre \
+ --enable-commandline \
+ --enable-email \
+ --build=${ARCH}-slackware-linux
+
+make
+make install DESTDIR=$PKG
+
+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
+
+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
+mv $PKG/usr/share/doc/e2guardian/* $PKG/usr/doc/$PRGNAM-$VERSION
+rm -rf $PKG/usr/share/doc/
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/etc/{rc.d,logrotate.d}
+cat $PKG/usr/share/e2guardian/scripts/systemv-init > $PKG/etc/rc.d/rc.e2guardian
+
+cat $PKG/usr/share/e2guardian/scripts/e2guardian \
+ > $PKG/etc/logrotate.d/e2guardian
+chown ${PROXY_USR}:${PROXY_GRP} $PKG/var/log/e2guardian
+
+# Find config files and add the .new.
+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/e2guardian/e2guardian.info b/network/e2guardian/e2guardian.info
new file mode 100644
index 0000000000..529779e0ce
--- /dev/null
+++ b/network/e2guardian/e2guardian.info
@@ -0,0 +1,10 @@
+PRGNAM="e2guardian"
+VERSION="4.1.2"
+HOMEPAGE="http://e2guardian.org/"
+DOWNLOAD="https://github.com/e2guardian/e2guardian/archive/v4.1.2/e2guardian-4.1.2.tar.gz"
+MD5SUM="b64b9c242a2de821f2cc8a49e5edf333"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="Henry Jensen"
+EMAIL="hjensen@mailbox.org"
diff --git a/network/e2guardian/slack-desc b/network/e2guardian/slack-desc
new file mode 100644
index 0000000000..16bbcfbd61
--- /dev/null
+++ b/network/e2guardian/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+e2guardian: e2guardian (web content filter)
+e2guardian:
+e2guardian: e2guardian is a web content filter. It filters the actual
+e2guardian: content of pages based on many methods including phrase matching,
+e2guardian: PICS filtering and URL filtering. It does not purely filter
+e2guardian: based on a banned list of sites like lesser totally commercial
+e2guardian: filters. e2guardian is designed to be completely flexible and
+e2guardian: allows you to tailor the filtering to your exact needs.
+e2guardian:
+e2guardian: e2guardian home: http://e2guardian.org/
+e2guardian: