diff options
author | Robby Workman <rworkman@slackbuilds.org> | 2017-06-08 10:21:36 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2017-06-10 10:47:40 +0700 |
commit | 480f6c050a0f87c53c970def4159a234707ad479 (patch) | |
tree | 480c58ec7a1482a71c8aaa12a799f5339a0b9884 | |
parent | 4b321577fd243c5fb8b0d9d7997caa58b7999d8a (diff) | |
download | slackbuilds-480f6c050a0f87c53c970def4159a234707ad479.tar.gz |
network/firewalld: Added (dynamically managed firewall gui).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
-rw-r--r-- | network/firewalld/README | 6 | ||||
-rw-r--r-- | network/firewalld/doinst.sh | 46 | ||||
-rw-r--r-- | network/firewalld/firewalld.SlackBuild | 115 | ||||
-rw-r--r-- | network/firewalld/firewalld.info | 10 | ||||
-rw-r--r-- | network/firewalld/rc.FireWallD | 56 | ||||
-rw-r--r-- | network/firewalld/slack-desc | 19 |
6 files changed, 252 insertions, 0 deletions
diff --git a/network/firewalld/README b/network/firewalld/README new file mode 100644 index 0000000000..75d957740a --- /dev/null +++ b/network/firewalld/README @@ -0,0 +1,6 @@ +firewalld provides a dynamically managed firewall with support for +network or firewall zones to define the trust level of network +connections or interfaces. It has support for IPv4, IPv6 firewall +settings and for ethernet bridges and a separation of runtime and +permanent configuration options. It also provides an interface for +services or applications to add ip*tables and ebtables rules directly. diff --git a/network/firewalld/doinst.sh b/network/firewalld/doinst.sh new file mode 100644 index 0000000000..92f91a8538 --- /dev/null +++ b/network/firewalld/doinst.sh @@ -0,0 +1,46 @@ +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 +} + +config etc/dbus-1/system.d/FirewallD.conf.new +config etc/firewall/applet.conf.new +config etc/firewalld/firewalld.conf.new +config etc/sysconfig/firewalld.new +preserve_perms etc/rc.d/rc.FireWallD.new + +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +fi + +if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then + if [ -x /usr/bin/gtk-update-icon-cache ]; then + /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1 + fi +fi + +if [ -e usr/share/glib-2.0/schemas ]; then + if [ -x /usr/bin/glib-compile-schemas ]; then + /usr/bin/glib-compile-schemas usr/share/glib-2.0/schemas >/dev/null 2>&1 + fi +fi + diff --git a/network/firewalld/firewalld.SlackBuild b/network/firewalld/firewalld.SlackBuild new file mode 100644 index 0000000000..d27dd716cf --- /dev/null +++ b/network/firewalld/firewalld.SlackBuild @@ -0,0 +1,115 @@ +#!/bin/sh + +# Slackware build script for firewalld + +# Copyright 2017 Robby Workman, Tuscaloosa, Alabama, 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=firewalld +VERSION=${VERSION:-0.4.4.5} +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 [ "$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 \ + --mandir=/usr/man \ + --docdir=/usr/doc/$PRGNAM-$VERSION \ + --build=$ARCH-slackware-linux + +make +make install DESTDIR=$PKG + +mv $PKG/etc/dbus-1/system.d/FirewallD.conf $PKG/etc/dbus-1/system.d/FirewallD.conf.new +mv $PKG/etc/firewall/applet.conf $PKG/etc/firewall/applet.conf.new +mv $PKG/etc/firewalld/firewalld.conf $PKG/etc/firewalld/firewalld.conf.new +mv $PKG/etc/sysconfig/firewalld $PKG/etc/sysconfig/firewalld.new + +mkdir -p $PKG/etc/rc.d +cat $CWD/rc.FireWallD > $PKG/etc/rc.d/rc.FireWallD.new + +rm -rf $PKG/usr/lib/systemd + +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 README TODO doc/html \ + $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} diff --git a/network/firewalld/firewalld.info b/network/firewalld/firewalld.info new file mode 100644 index 0000000000..2a778268c5 --- /dev/null +++ b/network/firewalld/firewalld.info @@ -0,0 +1,10 @@ +PRGNAM="firewalld" +VERSION="0.4.4.5" +HOMEPAGE="https://github.com/t-woerner/firewalld/" +DOWNLOAD="https://github.com/t-woerner/firewalld/archive/v0.4.4.5.tar.gz#/firewalld-0.4.4.5.tar.gz" +MD5SUM="22959cecc70cb5a241069c3dfc775303" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="python-slip decorator" +MAINTAINER="Robby Workman" +EMAIL="rworkman@slackbuilds.org" diff --git a/network/firewalld/rc.FireWallD b/network/firewalld/rc.FireWallD new file mode 100644 index 0000000000..84d981f8ea --- /dev/null +++ b/network/firewalld/rc.FireWallD @@ -0,0 +1,56 @@ +#!/bin/sh +# Start/stop/restart firewalld. + +# Start firewalld: +firewalld_start() { + [ -r /etc/sysconfig/firewalld ] && source /etc/sysconfig/firewalld + echo -n "Starting FireWallD daemon: /usr/sbin/firewalld " + /usr/sbin/firewalld $FIREWALLD_ARGS + echo +} + +# Stop firewalld: +firewalld_stop() { + echo -n "Stopping FireWallD daemon..." + if [ -r /var/run/firewalld.pid ]; then + kill -HUP $(cat /var/run/firewalld.pid) + rm -f /var/run/firewalld.pid + else + killall -HUP -q firewalld + fi + echo +} + +# Restart firewalld: +firewalld_restart() { + firewalld_stop + sleep 1 + firewalld_start +} + +# Check if firewalld is running +firewalld_status() { + if [ -e /var/run/firewalld.pid ]; then + echo "firewalld is running as pid $(cat /var/run/firewalld.pid)." + else + echo "firewalld is stopped." + exit 1 + fi +} + +case "$1" in +'start') + firewalld_start + ;; +'stop') + firewalld_stop + ;; +'restart') + firewalld_restart + ;; +'status') + firewalld_status + ;; +*) + echo "usage $0 start|stop|restart|status" +esac diff --git a/network/firewalld/slack-desc b/network/firewalld/slack-desc new file mode 100644 index 0000000000..8291689aad --- /dev/null +++ b/network/firewalld/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------------------------------------------------------| +firewalld: firewalld (dynamically managed firewall gui) +firewalld: +firewalld: firewalld provides a dynamically managed firewall with support for +firewalld: network or firewall zones to define the trust level of network +firewalld: connections or interfaces. It has support for IPv4, IPv6 firewall +firewalld: settings and for ethernet bridges and a separation of runtime and +firewalld: permanent configuration options. It also provides an interface for +firewalld: services or applications to add ip*tables and ebtables rules directly. +firewalld: +firewalld: Homepage: https://github.com/t-woerner/firewalld.git +firewalld: |