Hi,

these patches are created against the shorewall*-4.5.21-Beta1 packages
and tested on Gentoo.

Some of them contain fixes I already reported today in a separate mail.

The patches are bigger than actual needed, because I have corrected the
line indentation for all the code blocks I had to touch for adding
support for Gentoo, too. If this is not wanted I can provide patches
with just the needed modifications (but I would wait for Beta2, before I
would re-create these patches).

Are theses patches OK or would you prefer that I submit the patches
against GIT [1]?


See also:
=========
[1] git://git.code.sf.net/p/shorewall/code


-Thomas
--- install.sh.old      2013-09-09 16:08:23.649253017 +0200
+++ install.sh  2013-09-09 16:10:22.142096411 +0200
@@ -194,46 +194,52 @@
 T='-T'
 
 if [ -z "$BUILD" ]; then
-    case $(uname) in
-       cygwin*)
-           BUILD=cygwin
-           ;;
-       Darwin)
-           BUILD=apple
-           ;;
-       *)
-           if [ -f /etc/os-release ]; then
-               eval $(cat /etc/os-release | grep ^ID)
-
-               case $ID in
-                   fedora)
-                       BUILD=redhat
-                       ;;
-                   debian)
-                       BUILD=debian
+       case $(uname) in
+               cygwin*)
+                       BUILD=cygwin
                        ;;
-                   opensuse)
-                       BUILD=suse
+               Darwin)
+                       BUILD=apple
                        ;;
-                   *)
-                       BUILD="$ID"
+               *)
+                       if [ -f /etc/os-release ]; then
+                               eval $(cat /etc/os-release | grep ^ID)
+                               
+                               case $ID in
+                                       debian)
+                                               BUILD=debian
+                                               ;;
+                                       fedora)
+                                               BUILD=redhat
+                                               ;;
+                                       gentoo)
+                                               BUILD=gentoo
+                                               ;;
+                                       opensuse)
+                                               BUILD=suse
+                                               ;;
+                                       *)
+                                               BUILD="$ID"
+                                               ;;
+                               esac
+                       
+                       elif [ -f /etc/arch-release ]; then
+                               BUILD=archlinux
+                       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
+                               BUILD=slackware
+                       elif [ -f /etc/SuSE-release ]; then
+                               BUILD=suse
+                       else
+                               BUILD=linux
+                       fi
                        ;;
-               esac
-           elif [ -f ${CONFDIR}/debian_version ]; then
-               BUILD=debian
-           elif [ -f ${CONFDIR}/redhat-release ]; then
-               BUILD=redhat
-           elif [ -f ${CONFDIR}/SuSE-release ]; then
-               BUILD=suse
-           elif [ -f ${CONFDIR}/slackware-version ] ; then
-               BUILD=slackware
-           elif [ -f ${CONFDIR}/arch-release ] ; then
-               BUILD=archlinux
-           else
-               BUILD=linux
-           fi
-           ;;
-    esac
+       esac
 fi
 
 case $BUILD in
@@ -258,35 +264,38 @@
 [ -n "$HOST" ] || HOST=$BUILD
 
 case "$HOST" in
-    cygwin)
-       echo "$PRODUCT is not supported on Cygwin" >&2
-       exit 1
-       ;;
-    apple)
-       echo "$PRODUCT is not supported on OS X" >&2
-       exit 1
-       ;;
-    debian)
-       echo "Installing Debian-specific configuration..."
-       ;;
-    redhat)
-       echo "Installing Redhat/Fedora-specific configuration..."
-       ;;
-    slackware)
-       echo "Installing Slackware-specific configuration..."
-       ;;
-    archlinux)
-       echo "Installing ArchLinux-specific configuration..."
-       ;;
-    suse)
-       echo "Installing Suse-specific configuration..."
-       ;;
-    linux)
-       ;;
-    *)
-       echo "ERROR: Unknown HOST \"$HOST\"" >&2
-       exit 1;
-       ;;
+       apple)
+               echo "$PRODUCT is not supported on OS X" >&2
+               exit 1
+               ;;
+       archlinux)
+               echo "Installing ArchLinux-specific configuration..."
+               ;;
+       cygwin)
+               echo "$PRODUCT is not supported on Cygwin" >&2
+               exit 1
+               ;;
+       debian)
+               echo "Installing Debian-specific configuration..."
+               ;;
+       gentoo)
+               echo "Installing Gentoo-specific configuration..."
+               ;;
+       redhat)
+               echo "Installing Redhat/Fedora-specific configuration..."
+               ;;
+       slackware)
+               echo "Installing Slackware-specific configuration..."
+               ;;
+       suse)
+               echo "Installing Suse-specific configuration..."
+               ;;
+       linux)
+               ;;
+       *)
+               echo "ERROR: Unknown HOST \"$HOST\"" >&2
+               exit 1;
+               ;;
 esac
 
 [ -z "$INITDIR" ] && INITDIR="${CONFDIR}/init.d"
@@ -387,8 +396,11 @@
    echo "Config file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf"
 fi
 
-if [ $HOST = archlinux ] ; then
-   sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i 
${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
+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
 
 #
--- install.sh.old      2013-09-09 17:20:34.062519915 +0200
+++ install.sh  2013-09-09 17:21:54.885090125 +0200
@@ -174,61 +174,67 @@
 PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
 
 if [ -z "$BUILD" ]; then
-    case $(uname) in
-       cygwin*)
-           BUILD=cygwin
-           ;;
-       Darwin)
-           BUILD=apple
-           ;;
-       *)
-           if [ -f /etc/os-release ]; then
-               eval $(cat /etc/os-release | grep ^ID)
-
-               case $ID in
-                   fedora)
-                       BUILD=redhat
+       case $(uname) in
+               cygwin*)
+                       BUILD=cygwin
                        ;;
-                   debian)
-                       BUILD=debian
+               Darwin)
+                       BUILD=apple
                        ;;
-                   opensuse)
-                       BUILD=suse
+               *)
+                       if [ -f /etc/os-release ]; then
+                               eval $(cat /etc/os-release | grep ^ID)
+                               
+                               case $ID in
+                                       debian)
+                                               BUILD=debian
+                                               ;;
+                                       fedora)
+                                               BUILD=redhat
+                                               ;;
+                                       gentoo)
+                                               BUILD=gentoo
+                                               ;;
+                                       opensuse)
+                                               BUILD=suse
+                                               ;;
+                                       *)
+                                               BUILD="$ID"
+                                               ;;
+                               esac
+                       
+                       elif [ -f /etc/arch-release ]; then
+                               BUILD=archlinux
+                       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
+                               BUILD=slackware
+                       elif [ -f /etc/SuSE-release ]; then
+                               BUILD=suse
+                       else
+                               BUILD=linux
+                       fi
                        ;;
-                   *)
-                       BUILD="$ID"
-                       ;;
-               esac
-           elif [ -f /etc/debian_version ]; then
-               BUILD=debian
-           elif [ -f /etc/redhat-release ]; then
-               BUILD=redhat
-           elif [ -f /etc/SuSE-release ]; then
-               BUILD=suse
-           elif [ -f /etc/slackware-version ] ; then
-               BUILD=slackware
-           elif [ -f /etc/arch-release ] ; then
-               BUILD=archlinux
-           else
-               BUILD=linux
-           fi
-           ;;
-    esac
+       esac
 fi
 
 [ -n "$OWNER" ] || OWNER=$(id -un)
 [ -n "$GROUP" ] || GROUP=$(id -gn)
 
 case $BUILD in
-    apple)
-       T=
-       ;;
-    debian|redhat|suse|slackware|archlinux)
-       ;;
-    *)
-       [ -n "$BUILD" ] && echo "ERROR: Unknown BUILD environment ($BUILD)" >&2 
|| echo "ERROR: Unknown BUILD environment"
-       exit 1
-       ;;
+       apple|gentoo)
+               T=
+               ;;
+       archlinux|debian|redhat|slackware|suse)
+               ;;
+       *)
+               [ -n "$BUILD" ] && echo "ERROR: Unknown BUILD environment 
($BUILD)" >&2 || echo "ERROR: Unknown BUILD environment"
+               exit 1
+               ;;
 esac
 
 OWNERSHIP="-o $OWNER -g $GROUP"
@@ -236,30 +242,33 @@
 [ -n "$HOST" ] || HOST=$BUILD
 
 case "$HOST" in
-    debian)
-       echo "Installing Debian-specific configuration..."
-       ;;
-    redhat)
-       echo "Installing Redhat/Fedora-specific configuration..."
-       ;;
-    slackware)
-       echo "Shorewall-init is currently not supported on Slackware" >&2
-       exit 1
-       ;;
-    archlinux)
-       echo "Shorewall-init is currently not supported on Arch Linux" >&2
-       exit 1
-       ;;
-    suse)
-       echo "Installing SuSE-specific configuration..."
-       ;;
-    linux)
-       echo "ERROR: Shorewall-init is not supported on this system" >&2
-       ;;
-    *)
-       echo "ERROR: Unsupported HOST distribution: \"$HOST\"" >&2
-       exit 1;
-       ;;
+       archlinux)
+               echo "Shorewall-init is currently not supported on Arch Linux" 
>&2
+               exit 1
+               ;;
+       debian)
+               echo "Installing Debian-specific configuration..."
+               ;;
+       gentoo)
+               echo "Installing Gentoo-specific configuration..."
+               ;;
+       redhat)
+               echo "Installing Redhat/Fedora-specific configuration..."
+               ;;
+       slackware)
+               echo "Shorewall-init is currently not supported on Slackware" 
>&2
+               exit 1
+               ;;
+       suse)
+               echo "Installing SuSE-specific configuration..."
+               ;;
+       linux)
+               echo "ERROR: Shorewall-init is not supported on this system" >&2
+               ;;
+       *)
+               echo "ERROR: Unsupported HOST distribution: \"$HOST\"" >&2
+               exit 1;
+               ;;
 esac
 
 [ -z "$TARGET" ] && TARGET=$HOST
@@ -349,39 +358,44 @@
 fi
 
 if [ $HOST = debian ]; then
-    if [ -n "${DESTDIR}" ]; then
-       mkdir -p ${DESTDIR}/etc/network/if-up.d/
-       mkdir -p ${DESTDIR}/etc/network/if-down.d/
-    fi
-
-    if [ ! -f ${DESTDIR}/etc/default/shorewall-init ]; then
        if [ -n "${DESTDIR}" ]; then
-           mkdir ${DESTDIR}/etc/default
+               mkdir -p ${DESTDIR}/etc/network/if-up.d/
+               mkdir -p ${DESTDIR}/etc/network/if-down.d/
        fi
-
-       install_file sysconfig ${DESTDIR}/etc/default/shorewall-init 0644
-    fi
-
-    IFUPDOWN=ifupdown.debian.sh
+       
+       if [ ! -f ${DESTDIR}/etc/default/shorewall-init ]; then
+               if [ -n "${DESTDIR}" ]; then
+                       mkdir ${DESTDIR}/etc/default
+               fi
+               
+               install_file sysconfig ${DESTDIR}/etc/default/shorewall-init 
0644
+       fi
+       
+       IFUPDOWN=ifupdown.debian.sh
 else
-    if [ -n "$DESTDIR" ]; then
-       mkdir -p ${DESTDIR}${SYSCONFDIR}
+       if [ -n "$DESTDIR" ]; then
+               mkdir -p ${DESTDIR}${SYSCONFDIR}
 
-       if [ -z "$RPM" ]; then
-           if [ $HOST = suse ]; then
-               mkdir -p ${DESTDIR}/etc/sysconfig/network/if-up.d
-               mkdir -p ${DESTDIR}${SYSCONFDIR}/network/if-down.d
-           else
-               mkdir -p ${DESTDIR}/etc/NetworkManager/dispatcher.d
-           fi
+               if [ -z "$RPM" ]; then
+                       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
+                               # Please read the README file from Gentoo for 
more information
+                               return
+                       else
+                               mkdir -p 
${DESTDIR}/etc/NetworkManager/dispatcher.d
+                       fi
+               fi
        fi
-    fi
-
-    if [ -d ${DESTDIR}${SYSCONFDIR} -a ! -f 
${DESTDIR}${SYSCONFDIR}/shorewall-init ]; then
-       install_file sysconfig ${DESTDIR}${SYSCONFDIR}/shorewall-init 0644
-    fi
-
-    [ $HOST = suse ] && IFUPDOWN=ifupdown.suse.sh || 
IFUPDOWN=ifupdown.fedora.sh
+       
+       if [ -n "$SYSCONFFILE" -a ! -f ${DESTDIR}${SYSCONFDIR}/${PRODUCT} ]; 
then
+               run_install $OWNERSHIP -m 0644 ${SYSCONFFILE} 
${DESTDIR}${SYSCONFDIR}/$PRODUCT
+               echo "$SYSCONFFILE installed in 
${DESTDIR}${SYSCONFDIR}/${PRODUCT}"
+       fi
+       
+       [ $HOST = suse ] && IFUPDOWN=ifupdown.suse.sh || 
IFUPDOWN=ifupdown.fedora.sh
 fi
 
 #
@@ -435,52 +449,54 @@
 esac
 
 if [ -z "$DESTDIR" ]; then
-    if [ -n "$first_install" ]; then
-       if [ $HOST = debian ]; then
-           
-           update-rc.d shorewall-init enable
-
-           echo "Shorewall Init will start automatically at boot"
-       else
-           if [ -n "$SYSTEMD" ]; then
-               if systemctl enable shorewall-init.service; then
-                   echo "Shorewall Init will start automatically at boot"
-               fi
-           elif [ -x ${SBINDIR}/insserv -o -x /usr${SBINDIR}/insserv ]; then
-               if insserv ${INITDIR}/shorewall-init ; then
-                   echo "Shorewall Init will start automatically at boot"
-               else
-                   cant_autostart
-               fi
-           elif [ -x ${SBINDIR}/chkconfig -o -x /usr${SBINDIR}/chkconfig ]; 
then
-               if chkconfig --add shorewall-init ; then
-                   echo "Shorewall Init will start automatically in run levels 
as follows:"
-                   chkconfig --list shorewall-init
+       if [ -n "$first_install" ]; then
+               if [ $HOST = debian ]; 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
-                   cant_autostart
+                       if [ -n "$SYSTEMD" ]; then
+                               if systemctl enable shorewall-init.service; then
+                               echo "Shorewall Init will start automatically 
at boot"
+                       fi
+                       elif [ -x ${SBINDIR}/insserv -o -x 
/usr${SBINDIR}/insserv ]; then
+                               if insserv ${INITDIR}/shorewall-init ; then
+                                       echo "Shorewall Init will start 
automatically at boot"
+                               else
+                                       cant_autostart
+                               fi
+                       elif [ -x ${SBINDIR}/chkconfig -o -x 
/usr${SBINDIR}/chkconfig ]; then
+                               if chkconfig --add shorewall-init ; then
+                                       echo "Shorewall Init will start 
automatically in run levels as follows:"
+                                       chkconfig --list shorewall-init
+                               else
+                                       cant_autostart
+                               fi
+                       elif [ -x ${SBINDIR}/rc-update ]; then
+                               if rc-update add shorewall-init default; then
+                                       echo "Shorewall Init will start 
automatically at boot"
+                               else
+                                       cant_autostart
+                               fi
+                       else
+                               cant_autostart
+                       fi
                fi
-           elif [ -x ${SBINDIR}/rc-update ]; then
-               if rc-update add shorewall-init default; then
-                   echo "Shorewall Init will start automatically at boot"
-               else
-                   cant_autostart
-               fi
-           else
-               cant_autostart
-           fi
        fi
-    fi
 else
-    if [ -n "$first_install" ]; then
-       if [ $HOST = debian ]; then
-           if [ -n "${DESTDIR}" ]; then
-               mkdir -p ${DESTDIR}/etc/rcS.d
-           fi
-
-           ln -sf ../init.d/shorewall-init 
${DESTDIR}${CONFDIR}/rcS.d/S38shorewall-init
-           echo "Shorewall Init will start automatically at boot"
+       if [ -n "$first_install" ]; then
+               if [ $HOST = debian ]; then
+                       if [ -n "${DESTDIR}" ]; then
+                               mkdir -p ${DESTDIR}/etc/rcS.d
+                       fi
+                       
+                       ln -sf ../init.d/shorewall-init 
${DESTDIR}${CONFDIR}/rcS.d/S38shorewall-init
+                       echo "Shorewall Init will start automatically at boot"
+               fi
        fi
-    fi
 fi
 
 [ -z "${DESTDIR}" ] && [ ! -f ~/.shorewallrc ] && cp 
${SHAREDIR}/shorewall/shorewallrc .
--- install.sh.old      2013-09-09 16:51:03.892699898 +0200
+++ install.sh  2013-09-09 16:52:24.959281632 +0200
@@ -186,46 +186,52 @@
 INSTALLD='-D'
 
 if [ -z "$BUILD" ]; then
-    case $(uname) in
-       cygwin*)
-           BUILD=cygwin
-           ;;
-       Darwin)
-           BUILD=apple
-           ;;
-       *)
-           if [ -f /etc/os-release ]; then
-               eval $(cat /etc/os-release | grep ^ID)
-
-               case $ID in
-                   fedora)
-                       BUILD=redhat
-                       ;;
-                   debian)
-                       BUILD=debian
+       case $(uname) in
+               cygwin*)
+                       BUILD=cygwin
                        ;;
-                   opensuse)
-                       BUILD=suse
+               Darwin)
+                       BUILD=apple
                        ;;
-                   *)
-                       BUILD="$ID"
+               *)
+                       if [ -f /etc/os-release ]; then
+                               eval $(cat /etc/os-release | grep ^ID)
+                               
+                               case $ID in
+                                       debian)
+                                               BUILD=debian
+                                               ;;
+                                       fedora)
+                                               BUILD=redhat
+                                               ;;
+                                       gentoo)
+                                               BUILD=gentoo
+                                               ;;
+                                       opensuse)
+                                               BUILD=suse
+                                               ;;
+                                       *)
+                                               BUILD="$ID"
+                                               ;;
+                               esac
+                       
+                       elif [ -f /etc/arch-release ]; then
+                               BUILD=archlinux
+                       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
+                               BUILD=slackware
+                       elif [ -f /etc/SuSE-release ]; then
+                               BUILD=suse
+                       else
+                               BUILD=linux
+                       fi
                        ;;
-               esac
-           elif [ -f /etc/debian_version ]; then
-               BUILD=debian
-           elif [ -f /etc/redhat-release ]; then
-               BUILD=redhat
-           elif [ -f /etc/slackware-version ] ; then
-               BUILD=slackware
-           elif [ -f /etc/SuSE-release ]; then
-               BUILD=suse
-           elif [ -f /etc/arch-release ] ; then
-               BUILD=archlinux
-           else
-               BUILD=linux
-           fi
-           ;;
-    esac
+       esac
 fi
 
 case $BUILD in
@@ -265,18 +271,18 @@
 [ -n "$HOST" ] || HOST=$BUILD
 
 case "$HOST" in
-    cygwin)
-       echo "Installing Cygwin-specific configuration..."
-       ;;
-    apple)
-       echo "Installing Mac-specific configuration...";
-       ;;
-    debian|redhat|slackware|archlinux|linux|suse)
-       ;;
-    *)
-       echo "ERROR: Unknown HOST \"$HOST\"" >&2
-       exit 1;
-       ;;
+       apple)
+               echo "Installing Mac-specific configuration...";
+               ;;
+       cygwin)
+               echo "Installing Cygwin-specific configuration..."
+               ;;
+       archlinux|debian|gentoo|linux|redhat|slackware|suse)
+               ;;
+       *)
+               echo "ERROR: Unknown HOST \"$HOST\"" >&2
+               exit 1;
+               ;;
 esac
 
 if [ -z "$file" ]; then
--- install.sh.old      2013-09-09 16:22:11.286164903 +0200
+++ install.sh  2013-09-09 16:23:41.899824082 +0200
@@ -204,46 +204,52 @@
 [ -n "${INITFILE}" ] && require INITSOURCE && require INITDIR
 
 if [ -z "$BUILD" ]; then
-    case $(uname) in
-       cygwin*)
-           BUILD=cygwin
-           ;;
-       Darwin)
-           BUILD=apple
-           ;;
-       *)
-           if [ -f /etc/os-release ]; then
-               eval $(cat /etc/os-release | grep ^ID)
-
-               case $ID in
-                   fedora)
-                       BUILD=redhat
-                       ;;
-                   debian)
-                       BUILD=debian
+       case $(uname) in
+               cygwin*)
+                       BUILD=cygwin
                        ;;
-                   opensuse)
-                       BUILD=suse
+               Darwin)
+                       BUILD=apple
                        ;;
-                   *)
-                       BUILD="$ID"
+               *)
+                       if [ -f /etc/os-release ]; then
+                               eval $(cat /etc/os-release | grep ^ID)
+                               
+                               case $ID in
+                                       debian)
+                                               BUILD=debian
+                                               ;;
+                                       fedora)
+                                               BUILD=redhat
+                                               ;;
+                                       gentoo)
+                                               BUILD=gentoo
+                                               ;;
+                                       opensuse)
+                                               BUILD=suse
+                                               ;;
+                                       *)
+                                               BUILD="$ID"
+                                               ;;
+                               esac
+                       
+                       elif [ -f /etc/arch-release ]; then
+                               BUILD=archlinux
+                       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
+                               BUILD=slackware
+                       elif [ -f /etc/SuSE-release ]; then
+                               BUILD=suse
+                       else
+                               BUILD=linux
+                       fi
                        ;;
-               esac
-           elif [ -f /etc/debian_version ]; then
-               BUILD=debian
-           elif [ -f /etc/redhat-release ]; then
-               BUILD=redhat
-           elif [ -f /etc/slackware-version ] ; then
-               BUILD=slackware
-           elif [ -f /etc/SuSE-release ]; then
-               BUILD=suse
-           elif [ -f /etc/arch-release ] ; then
-               BUILD=archlinux
-           else
-               BUILD=linux
-           fi
-           ;;
-    esac
+       esac
 fi
 
 case $BUILD in
@@ -266,33 +272,36 @@
 OWNERSHIP="-o $OWNER -g $GROUP"
 
 case "$HOST" in
-    cygwin)
-       echo "Installing Cygwin-specific configuration..."
-       ;;
-    apple)
-       echo "Installing Mac-specific configuration...";
-       ;;
-    debian)
-       echo "Installing Debian-specific configuration..."
-       ;;
-    redhat)
-       echo "Installing Redhat/Fedora-specific configuration..."
-       ;;
-    suse)
-       echo "Installing SuSE-specific configuration...";
-       ;;
-    slackware)
-       echo "Installing Slackware-specific configuration..."
-       ;;
-    archlinux)
-       echo "Installing ArchLinux-specific configuration..."
-       ;;
-    linux)
-       ;;
-    *)
-       echo "ERROR: Unknown HOST \"$HOST\"" >&2
-       exit 1;
-       ;;
+       apple)
+               echo "Installing Mac-specific configuration...";
+               ;;
+       archlinux)
+               echo "Installing ArchLinux-specific configuration..."
+               ;;
+       cygwin)
+               echo "Installing Cygwin-specific configuration..."
+               ;;
+       debian)
+               echo "Installing Debian-specific configuration..."
+               ;;
+       gentoo)
+               echo "Installing Gentoo-specific configuration..."
+               ;;
+       redhat)
+               echo "Installing Redhat/Fedora-specific configuration..."
+               ;;
+       slackware)
+               echo "Installing Slackware-specific configuration..."
+               ;;
+       suse)
+               echo "Installing SuSE-specific configuration...";
+               ;;
+       linux)
+               ;;
+       *)
+               echo "ERROR: Unknown HOST \"$HOST\"" >&2
+               exit 1;
+               ;;
 esac
 
 if [ $PRODUCT = shorewall ]; then
@@ -485,23 +494,26 @@
 run_install $OWNERSHIP -m 0644 $PRODUCT.conf.annotated 
${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
 
 if [ ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf ]; then
-    run_install $OWNERSHIP -m 0644 ${PRODUCT}.conf${suffix} 
${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
-
-    if [ "$SHAREDIR" != /usr/share -o "$CONFDIR" != /etc ]; then
-       if [ $PRODUCT = shorewall ]; then
-           perl -p -w -i -e 
"s|^CONFIG_PATH=.*|CONFIG_PATH=${CONFDIR}/shorewall:${SHAREDIR}/shorewall|;" 
${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
-       else
-           perl -p -w -i -e 
"s|^CONFIG_PATH=.*|CONFIG_PATH=${CONFDIR}/shorewall:${SHAREDIR}/shorewall6:${SHAREDIR}/shorewall|;"
 ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
+       run_install $OWNERSHIP -m 0644 ${PRODUCT}.conf${suffix} 
${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
+       
+       if [ "$SHAREDIR" != /usr/share -o "$CONFDIR" != /etc ]; then
+               if [ $PRODUCT = shorewall ]; then
+                       perl -p -w -i -e 
"s|^CONFIG_PATH=.*|CONFIG_PATH=${CONFDIR}/shorewall:${SHAREDIR}/shorewall|;" 
${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
+               else
+                       perl -p -w -i -e 
"s|^CONFIG_PATH=.*|CONFIG_PATH=${CONFDIR}/shorewall:${SHAREDIR}/shorewall6:${SHAREDIR}/shorewall|;"
 ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
+               fi
+       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 = 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
-    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 = debian ]; then
-       perl -p -w -i -e 's|^STARTUP_ENABLED=.*|STARTUP_ENABLED=Yes|;' 
${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf${suffix}
-    fi
 
-    echo "Config file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf"
+       echo "Config file installed as 
${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf"
 fi
 
 #
--- install.sh.old      2013-09-09 16:12:59.510214756 +0200
+++ install.sh  2013-09-09 16:15:45.017389362 +0200
@@ -194,46 +194,52 @@
 T='-T'
 
 if [ -z "$BUILD" ]; then
-    case $(uname) in
-       cygwin*)
-           BUILD=cygwin
-           ;;
-       Darwin)
-           BUILD=apple
-           ;;
-       *)
-           if [ -f /etc/os-release ]; then
-               eval $(cat /etc/os-release | grep ^ID)
-
-               case $ID in
-                   fedora)
-                       BUILD=redhat
-                       ;;
-                   debian)
-                       BUILD=debian
+       case $(uname) in
+               cygwin*)
+                       BUILD=cygwin
                        ;;
-                   opensuse)
-                       BUILD=suse
+               Darwin)
+                       BUILD=apple
                        ;;
-                   *)
-                       BUILD="$ID"
+               *)
+                       if [ -f /etc/os-release ]; then
+                               eval $(cat /etc/os-release | grep ^ID)
+                               
+                               case $ID in
+                                       debian)
+                                               BUILD=debian
+                                               ;;
+                                       fedora)
+                                               BUILD=redhat
+                                               ;;
+                                       gentoo)
+                                               BUILD=gentoo
+                                               ;;
+                                       opensuse)
+                                               BUILD=suse
+                                               ;;
+                                       *)
+                                               BUILD="$ID"
+                                               ;;
+                               esac
+                       
+                       elif [ -f /etc/arch-release ]; then
+                               BUILD=archlinux
+                       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
+                               BUILD=slackware
+                       elif [ -f /etc/SuSE-release ]; then
+                               BUILD=suse
+                       else
+                               BUILD=linux
+                       fi
                        ;;
-               esac
-           elif [ -f ${CONFDIR}/debian_version ]; then
-               BUILD=debian
-           elif [ -f ${CONFDIR}/redhat-release ]; then
-               BUILD=redhat
-           elif [ -f ${CONFDIR}/SuSE-release ]; then
-               BUILD=suse
-           elif [ -f ${CONFDIR}/slackware-version ] ; then
-               BUILD=slackware
-           elif [ -f ${CONFDIR}/arch-release ] ; then
-               BUILD=archlinux
-           else
-               BUILD=linux
-           fi
-           ;;
-    esac
+       esac
 fi
 
 case $BUILD in
@@ -258,35 +264,38 @@
 [ -n "$HOST" ] || HOST=$BUILD
 
 case "$HOST" in
-    cygwin)
-       echo "$PRODUCT is not supported on Cygwin" >&2
-       exit 1
-       ;;
-    apple)
-       echo "$PRODUCT is not supported on OS X" >&2
-       exit 1
-       ;;
-    debian)
-       echo "Installing Debian-specific configuration..."
-       ;;
-    redhat)
-       echo "Installing Redhat/Fedora-specific configuration..."
-       ;;
-    slackware)
-       echo "Installing Slackware-specific configuration..."
-       ;;
-    archlinux)
-       echo "Installing ArchLinux-specific configuration..."
-       ;;
-    suse)
-       echo "Installing Suse-specific configuration..."
-       ;;
-    linux)
-       ;;
-    *)
-       echo "ERROR: Unknown HOST \"$HOST\"" >&2
-       exit 1;
-       ;;
+       apple)
+               echo "$PRODUCT is not supported on OS X" >&2
+               exit 1
+               ;;
+       archlinux)
+               echo "Installing ArchLinux-specific configuration..."
+               ;;
+       cygwin)
+               echo "$PRODUCT is not supported on Cygwin" >&2
+               exit 1
+               ;;
+       debian)
+               echo "Installing Debian-specific configuration..."
+               ;;
+       gentoo)
+               echo "Installing Gentoo-specific configuration..."
+               ;;
+       redhat)
+               echo "Installing Redhat/Fedora-specific configuration..."
+               ;;
+       slackware)
+               echo "Installing Slackware-specific configuration..."
+               ;;
+       suse)
+               echo "Installing Suse-specific configuration..."
+               ;;
+       linux)
+               ;;
+       *)
+               echo "ERROR: Unknown HOST \"$HOST\"" >&2
+               exit 1;
+               ;;
 esac
 
 [ -z "$INITDIR" ] && INITDIR="${CONFDIR}/init.d"
@@ -388,7 +397,10 @@
 fi
 
 if [ $HOST = archlinux ] ; then
-   sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i 
${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
+       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
 
 #
--- install.sh.old      2013-09-09 15:02:45.394910480 +0200
+++ install.sh  2013-09-09 15:08:33.573458437 +0200
@@ -204,95 +204,111 @@
 [ -n "${INITFILE}" ] && require INITSOURCE && require INITDIR
 
 if [ -z "$BUILD" ]; then
-    case $(uname) in
-       cygwin*)
-           BUILD=cygwin
-           ;;
-       Darwin)
-           BUILD=apple
-           ;;
-       *)
-           if [ -f /etc/os-release ]; then
-               eval $(cat /etc/os-release | grep ^ID)
-
-               case $ID in
-                   fedora)
-                       BUILD=redhat
-                       ;;
-                   debian)
-                       BUILD=debian
+       case $(uname) in
+               cygwin*)
+                       BUILD=cygwin
                        ;;
-                   opensuse)
-                       BUILD=suse
+               Darwin)
+                       BUILD=apple
                        ;;
-                   *)
-                       BUILD="$ID"
+               *)
+                       if [ -f /etc/os-release ]; then
+                               eval $(cat /etc/os-release | grep ^ID)
+                               
+                               case $ID in
+                                       debian)
+                                               BUILD=debian
+                                               ;;
+                                       fedora)
+                                               BUILD=redhat
+                                               ;;
+                                       gentoo)
+                                               BUILD=gentoo
+                                               ;;
+                                       opensuse)
+                                               BUILD=suse
+                                               ;;
+                                       *)
+                                               BUILD="$ID"
+                                               ;;
+                               esac
+                       
+                       elif [ -f /etc/arch-release ]; then
+                               BUILD=archlinux
+                       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
+                               BUILD=slackware
+                       elif [ -f /etc/SuSE-release ]; then
+                               BUILD=suse
+                       else
+                               BUILD=linux
+                       fi
                        ;;
-               esac
-           elif [ -f /etc/debian_version ]; then
-               BUILD=debian
-           elif [ -f /etc/redhat-release ]; then
-               BUILD=redhat
-           elif [ -f /etc/slackware-version ] ; then
-               BUILD=slackware
-           elif [ -f /etc/SuSE-release ]; then
-               BUILD=suse
-           elif [ -f /etc/arch-release ] ; then
-               BUILD=archlinux
-           else
-               BUILD=linux
-           fi
-           ;;
-    esac
+       esac
 fi
 
 case $BUILD in
-    cygwin*)
-       OWNER=$(id -un)
-       GROUP=$(id -gn)
-       ;;
-    apple)
-       [ -z "$OWNER" ] && OWNER=root
-       [ -z "$GROUP" ] && GROUP=wheel
-       INSTALLD=
-       T=
-       ;;
-    *)
-       [ -z "$OWNER" ] && OWNER=root
-       [ -z "$GROUP" ] && GROUP=root
-       ;;
+       apple)
+               [ -z "$OWNER" ] && OWNER=root
+               [ -z "$GROUP" ] && GROUP=wheel
+               INSTALLD=
+               T=
+               ;;
+       cygwin*)
+               OWNER=$(id -un)
+               GROUP=$(id -gn)
+               ;;
+       gentoo)
+               # $T was already set by portage, so we need to unset $T
+               T=
+               
+               [ -z "$OWNER" ] && OWNER=root
+               [ -z "$GROUP" ] && GROUP=root
+               ;;
+       *)
+               [ -z "$OWNER" ] && OWNER=root
+               [ -z "$GROUP" ] && GROUP=root
+               ;;
 esac
 
 OWNERSHIP="-o $OWNER -g $GROUP"
 
 case "$HOST" in
-    cygwin)
-       echo "Installing Cygwin-specific configuration..."
-       ;;
-    apple)
-       echo "Installing Mac-specific configuration...";
-       ;;
-    debian)
-       echo "Installing Debian-specific configuration..."
-       ;;
-    redhat)
-       echo "Installing Redhat/Fedora-specific configuration..."
-       ;;
-    suse)
-       echo "Installing SuSE-specific configuration...";
-       ;;
-    slackware)
-       echo "Installing Slackware-specific configuration..."
-       ;;
-    archlinux)
-       echo "Installing ArchLinux-specific configuration..."
-       ;;
-    linux)
-       ;;
-    *)
-       echo "ERROR: Unknown HOST \"$HOST\"" >&2
-       exit 1;
-       ;;
+       apple)
+               echo "Installing Mac-specific configuration...";
+               ;;
+       archlinux)
+               echo "Installing ArchLinux-specific configuration..."
+               ;;
+       cygwin)
+               echo "Installing Cygwin-specific configuration..."
+               ;;
+       debian)
+               echo "Installing Debian-specific configuration..."
+               ;;
+       gentoo)
+               echo "Installing Gentoo-specific configuration..."
+               ;;
+       redhat)
+               echo "Installing Redhat/Fedora-specific configuration..."
+               ;;
+       slackware)
+               echo "Installing Slackware-specific configuration..."
+               ;;
+       suse)
+               echo "Installing SuSE-specific configuration...";
+               ;;
+       linux)
+               ;;
+       *)
+               echo "ERROR: Unknown HOST \"$HOST\"" >&2
+               exit 1;
+               ;;
 esac
 
 if [ $PRODUCT = shorewall ]; then
@@ -485,23 +501,26 @@
 run_install $OWNERSHIP -m 0644 $PRODUCT.conf.annotated 
${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
 
 if [ ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf ]; then
-    run_install $OWNERSHIP -m 0644 ${PRODUCT}.conf${suffix} 
${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
-
-    if [ "$SHAREDIR" != /usr/share -o "$CONFDIR" != /etc ]; then
-       if [ $PRODUCT = shorewall ]; then
-           perl -p -w -i -e 
"s|^CONFIG_PATH=.*|CONFIG_PATH=${CONFDIR}/shorewall:${SHAREDIR}/shorewall|;" 
${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
-       else
-           perl -p -w -i -e 
"s|^CONFIG_PATH=.*|CONFIG_PATH=${CONFDIR}/shorewall:${SHAREDIR}/shorewall6:${SHAREDIR}/shorewall|;"
 ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
+       run_install $OWNERSHIP -m 0644 ${PRODUCT}.conf${suffix} 
${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
+       
+       if [ "$SHAREDIR" != /usr/share -o "$CONFDIR" != /etc ]; then
+               if [ $PRODUCT = shorewall ]; then
+                       perl -p -w -i -e 
"s|^CONFIG_PATH=.*|CONFIG_PATH=${CONFDIR}/shorewall:${SHAREDIR}/shorewall|;" 
${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
+               else
+                       perl -p -w -i -e 
"s|^CONFIG_PATH=.*|CONFIG_PATH=${CONFDIR}/shorewall:${SHAREDIR}/shorewall6:${SHAREDIR}/shorewall|;"
 ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
+               fi
        fi
-    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 = debian ]; then
-       perl -p -w -i -e 's|^STARTUP_ENABLED=.*|STARTUP_ENABLED=Yes|;' 
${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf${suffix}
-    fi
-
-    echo "Config file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf"
+       
+       if [ $HOST = archlinux ]; 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"
 fi
 
 #
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
Shorewall-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-devel

Reply via email to