Hi,

sorry for the delay.

I created the patch against Shorewall's git master branch.

Is the attached patch OK? Can you work with it or should I set up a
remote git repository where you can pull from?

Thanks!


-Thomas
>From d2e8b617903811507f7baa25a4283685ac036105 Mon Sep 17 00:00:00 2001
From: Thomas D <[email protected]>
Date: Tue, 17 Sep 2013 12:15:14 +0200
Subject: [PATCH] Add installer support for Gentoo

---
 Shorewall-core/install.sh |  7 ++++++-
 Shorewall-init/install.sh | 17 ++++++++++++++++-
 Shorewall-lite/install.sh | 11 +++++++++++
 Shorewall/install.sh      | 11 +++++++++++
 4 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/Shorewall-core/install.sh b/Shorewall-core/install.sh
index 81e97f8..665cf1d 100755
--- a/Shorewall-core/install.sh
+++ b/Shorewall-core/install.sh
@@ -204,6 +204,9 @@ if [ -z "$BUILD" ]; then
                    debian)
                        BUILD=debian
                        ;;
+                   gentoo)
+                       BUILD=gentoo
+                       ;;
                    opensuse)
                        BUILD=suse
                        ;;
@@ -213,6 +216,8 @@ if [ -z "$BUILD" ]; then
                esac
            elif [ -f /etc/debian_version ]; then
                BUILD=debian
+           elif [ -f /etc/gentoo-release ]; then
+               BUILD=gentoo
            elif [ -f /etc/redhat-release ]; then
                BUILD=redhat
            elif [ -f /etc/slackware-version ] ; then
@@ -271,7 +276,7 @@ case "$HOST" in
     apple)
        echo "Installing Mac-specific configuration...";
        ;;
-    debian|redhat|slackware|archlinux|linux|suse)
+    debian|gentoo|redhat|slackware|archlinux|linux|suse)
        ;;
     *)
        echo "ERROR: Unknown HOST \"$HOST\"" >&2
diff --git a/Shorewall-init/install.sh b/Shorewall-init/install.sh
index 259fb9e..4b659df 100755
--- a/Shorewall-init/install.sh
+++ b/Shorewall-init/install.sh
@@ -194,6 +194,9 @@ if [ -z "$BUILD" ]; then
                    debian)
                        BUILD=debian
                        ;;
+                   gentoo)
+                       BUILD=gentoo
+                       ;;
                    opensuse)
                        BUILD=suse
                        ;;
@@ -203,6 +206,8 @@ if [ -z "$BUILD" ]; then
                esac
            elif [ -f /etc/debian_version ]; then
                BUILD=debian
+           elif [ -f /etc/gentoo-release ]; then
+               BUILD=gentoo
            elif [ -f /etc/redhat-release ]; then
                BUILD=redhat
            elif [ -f /etc/SuSE-release ]; then
@@ -225,7 +230,7 @@ case $BUILD in
     apple)
        T=
        ;;
-    debian|redhat|suse|slackware|archlinux)
+    debian|gentoo|redhat|suse|slackware|archlinux)
        ;;
     *)
        [ -n "$BUILD" ] && echo "ERROR: Unknown BUILD environment ($BUILD)" >&2 
|| echo "ERROR: Unknown BUILD environment"
@@ -241,6 +246,9 @@ case "$HOST" in
     debian)
        echo "Installing Debian-specific configuration..."
        ;;
+    gentoo)
+       echo "Installing Gentoo-specific configuration..."
+       ;;
     redhat)
        echo "Installing Redhat/Fedora-specific configuration..."
        ;;
@@ -375,6 +383,9 @@ else
            if [ $HOST = suse ]; then
                mkdir -p ${DESTDIR}/etc/sysconfig/network/if-up.d
                mkdir -p ${DESTDIR}${SYSCONFDIR}/network/if-down.d
+           elif [ $HOST = gentoo ]; then
+               # Gentoo does not support if-{up,down}.d
+               return
            else
                mkdir -p ${DESTDIR}/etc/NetworkManager/dispatcher.d
            fi
@@ -446,6 +457,10 @@ if [ -z "$DESTDIR" ]; then
            update-rc.d shorewall-init enable
 
            echo "Shorewall Init will start automatically at boot"
+       elif [ $HOST = gentoo ]; then
+           # On Gentoo, a service must be enabled manually by the user,
+           # not by the installer
+           return
        else
            if [ -n "$SYSTEMD" ]; then
                if systemctl enable shorewall-init.service; then
diff --git a/Shorewall-lite/install.sh b/Shorewall-lite/install.sh
index 1e81d81..cab2bdf 100755
--- a/Shorewall-lite/install.sh
+++ b/Shorewall-lite/install.sh
@@ -212,6 +212,9 @@ if [ -z "$BUILD" ]; then
                    debian)
                        BUILD=debian
                        ;;
+                   gentoo)
+                       BUILD=gentoo
+                       ;;
                    opensuse)
                        BUILD=suse
                        ;;
@@ -221,6 +224,8 @@ if [ -z "$BUILD" ]; then
                esac
            elif [ -f ${CONFDIR}/debian_version ]; then
                BUILD=debian
+           elif [ -f /etc/gentoo-release ]; then
+               BUILD=gentoo
            elif [ -f ${CONFDIR}/redhat-release ]; then
                BUILD=redhat
            elif [ -f ${CONFDIR}/SuSE-release ]; then
@@ -269,6 +274,9 @@ case "$HOST" in
     debian)
        echo "Installing Debian-specific configuration..."
        ;;
+    gentoo)
+       echo "Installing Gentoo-specific configuration..."
+       ;;
     redhat)
        echo "Installing Redhat/Fedora-specific configuration..."
        ;;
@@ -389,6 +397,9 @@ fi
 
 if [ $HOST = archlinux ] ; then
    sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i 
${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
+elif [ $HOST = gentoo ]; then
+    # Adjust SUBSYSLOCK path (see 
https://bugs.gentoo.org/show_bug.cgi?id=459316)
+    perl -p -w -i -e "s|^SUBSYSLOCK=.*|SUBSYSLOCK=/run/lock/$PRODUCT|;" 
${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
 fi
 
 #
diff --git a/Shorewall/install.sh b/Shorewall/install.sh
index cd5347a..c322116 100755
--- a/Shorewall/install.sh
+++ b/Shorewall/install.sh
@@ -222,6 +222,9 @@ if [ -z "$BUILD" ]; then
                    debian)
                        BUILD=debian
                        ;;
+                   gentoo)
+                       BUILD=gentoo
+                       ;;
                    opensuse)
                        BUILD=suse
                        ;;
@@ -231,6 +234,8 @@ if [ -z "$BUILD" ]; then
                esac
            elif [ -f /etc/debian_version ]; then
                BUILD=debian
+           elif [ -f /etc/gentoo-release ]; then
+               BUILD=gentoo
            elif [ -f /etc/redhat-release ]; then
                BUILD=redhat
            elif [ -f /etc/slackware-version ] ; then
@@ -275,6 +280,9 @@ case "$HOST" in
     debian)
        echo "Installing Debian-specific configuration..."
        ;;
+    gentoo)
+       echo "Installing Gentoo-specific configuration..."
+       ;;
     redhat)
        echo "Installing Redhat/Fedora-specific configuration..."
        ;;
@@ -499,6 +507,9 @@ if [ ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf ]; 
then
        sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i 
${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
     elif [ $HOST = debian ]; then
        perl -p -w -i -e 's|^STARTUP_ENABLED=.*|STARTUP_ENABLED=Yes|;' 
${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf${suffix}
+    elif [ $HOST = gentoo ]; then
+       # Adjust SUBSYSLOCK path (see 
https://bugs.gentoo.org/show_bug.cgi?id=459316)
+       perl -p -w -i -e "s|^SUBSYSLOCK=.*|SUBSYSLOCK=/run/lock/$PRODUCT|;" 
${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf${suffix}
     fi
 
     echo "Config file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf"
-- 
1.8.3.2

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Shorewall-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-devel

Reply via email to