From bf01b31812c5b464f18c9344aca6a6cc5988bf35 Mon Sep 17 00:00:00 2001 From: ArTourter Date: Wed, 25 Jul 2012 17:42:37 -0500 Subject: network/shorewall-core: Added (core shorewall components) Signed-off-by: Robby Workman --- network/shorewall-core/README | 15 +++++ network/shorewall-core/doinst.sh | 28 ++++++++ network/shorewall-core/shorewall-core.SlackBuild | 83 ++++++++++++++++++++++++ network/shorewall-core/shorewall-core.info | 10 +++ network/shorewall-core/slack-desc | 19 ++++++ 5 files changed, 155 insertions(+) create mode 100644 network/shorewall-core/README create mode 100644 network/shorewall-core/doinst.sh create mode 100644 network/shorewall-core/shorewall-core.SlackBuild create mode 100644 network/shorewall-core/shorewall-core.info create mode 100644 network/shorewall-core/slack-desc (limited to 'network') diff --git a/network/shorewall-core/README b/network/shorewall-core/README new file mode 100644 index 0000000000..e1734632c1 --- /dev/null +++ b/network/shorewall-core/README @@ -0,0 +1,15 @@ +Shorewall-core (Iptables Made Easy) + +The Shoreline Firewall, more commonly known as "Shorewall", is a Netfilter +(iptables) based firewall that can be used on a dedicated firewall system, a +multi-function gateway/router/server or on a standalone GNU/Linux system. + +As of version 4.5, shorewall consists of 3 packages: +* shorewall-core, containing the common elements to both IPv4 and IPv6 components +* shorewall, the IPv4 component +* shorewall6, the IPv6 component + +The shorewall-core package is needed for both but now you can install the IPv6 +packages without needing the IPv4 one if you are on aIV6 network only. + +This requires xtables-addons to use the new per-IP accounting feature. diff --git a/network/shorewall-core/doinst.sh b/network/shorewall-core/doinst.sh new file mode 100644 index 0000000000..b97f70f822 --- /dev/null +++ b/network/shorewall-core/doinst.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# vim: et ts=2 sw=2 + +config() { + NEW="$1" + OLD="${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.firewall.new + diff --git a/network/shorewall-core/shorewall-core.SlackBuild b/network/shorewall-core/shorewall-core.SlackBuild new file mode 100644 index 0000000000..a5451aaa97 --- /dev/null +++ b/network/shorewall-core/shorewall-core.SlackBuild @@ -0,0 +1,83 @@ +#!/bin/sh +# vim: et ts=2 sw=2 + +# Slackware build script for shorewall-common + +# Copyright (c) 2008-2009 Gregory J.L. Tourte (artourter@gmail.com) +# 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=shorewall-core +VERSION=${VERSION:-4.5.6} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +BASEVERS=4.5.6 + +ARCH=noarch + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +set -e # Exit on most errors + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$BASEVERS +tar xvf $CWD/$PRGNAM-$BASEVERS.tar.bz2 +cd $TMP/$PRGNAM-$BASEVERS +chown -R root:root . + +# Patch the base against all the patchlevel patches in order if present +if [ $(ls $CWD/patch-core-$BASEVERS.* 2>/dev/null | wc -l) -gt 0 ]; then + for PATCH in $CWD/patch-core-$BASEVERS.* ; do + patch -p1 < $PATCH + done +fi + +./configure + +DESTDIR=$PKG \ + ./install.sh + +( cd $PKG/etc/rc.d/ + mv rc.firewall rc.firewall.new +) + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + COPYING INSTALL changelog.txt releasenotes.txt known_problems.txt \ + $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 + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} + +# Clean up the extra stuff: +if [ "$1" = "--cleanup" ]; then + rm -rf $TMP/$PRGNAM-$BASEVERS + rm -rf $PKG +fi diff --git a/network/shorewall-core/shorewall-core.info b/network/shorewall-core/shorewall-core.info new file mode 100644 index 0000000000..34805db914 --- /dev/null +++ b/network/shorewall-core/shorewall-core.info @@ -0,0 +1,10 @@ +PRGNAM="shorewall-core" +VERSION="4.5.6" +HOMEPAGE="http://www.shorewall.net" +DOWNLOAD="http://www.shorewall.net/pub/shorewall/4.5/shorewall-4.5.6/base/shorewall-core-4.5.6.tar.bz2" +MD5SUM="505ef8ade37ce27b9a564fd15243b0e7" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +MAINTAINER="ArTourter" +EMAIL="artourter@gmail.com" +APPROVED="rworkman" diff --git a/network/shorewall-core/slack-desc b/network/shorewall-core/slack-desc new file mode 100644 index 0000000000..7cc4159d68 --- /dev/null +++ b/network/shorewall-core/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 ':'. + + |-----handy-ruler---------------------------------------------| +shorewall-core: Shorewall-core (Iptables Made Easy) +shorewall-core: +shorewall-core: The Shoreline Firewall, more commonly known as "Shorewall", +shorewall-core: is a Netfilter (iptables) based firewall that can be used on +shorewall-core: a dedicated firewall system, a multi-function gateway / +shorewall-core: router / server, or on a standalone GNU/Linux system. +shorewall-core: This package contains common files required by both the +shorewall-core: shorewall and shorewall6 components of Shorewall. +shorewall-core: +shorewall-core: http://www.shorewall.net +shorewall-core: -- cgit v1.2.3