From ed9e03b095fee6d6e96b61c6c5fe22628eb22293 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Mon, 20 Feb 2012 16:11:28 -0800 Subject: [PATCH] Correct FEDORA/REDHAT fiasco Signed-off-by: Tom Eastep --- Shorewall-core/install.sh | 15 ++++++++------- Shorewall-init/install.sh | 17 +++++------------ Shorewall-lite/install.sh | 10 +++------- Shorewall/install.sh | 10 +++------- 4 files changed, 19 insertions(+), 33 deletions(-) diff --git a/Shorewall-core/install.sh b/Shorewall-core/install.sh index 69b1d9d82..5065cc335 100755 --- a/Shorewall-core/install.sh +++ b/Shorewall-core/install.sh @@ -130,11 +130,7 @@ if [ -z "$BUILD" ]; then if [ -f /etc/debian_version ]; then BUILD=DEBIAN elif [ -f /etc/redhat-release ]; then - if [ -d /etc/sysconfig/network-scripts/ ]; then - BUILD=REDHAT - else - BUILD=FEDORA - fi + BUILD=REDHAT elif [ -f /etc/slackware-version ] ; then BUILD=SLACKWARE elif [ -f /etc/SuSE-release ]; then @@ -230,7 +226,7 @@ case "$HOST" in echo "Installing Debian-specific configuration..." SPARSE=yes ;; - FEDORA|REDHAT|SLACKWARE|ARCHLINUX|LINUX) + REDHAT|SLACKWARE|ARCHLINUX|LINUX) ;; *) echo "ERROR: Unknown HOST \"$HOST\"" >&2 @@ -258,7 +254,12 @@ echo "Installing Shorewall Core Version $VERSION" # Create /usr/share/shorewall # mkdir -p ${DESTDIR}${LIBEXEC}/shorewall -chmod 755 ${DESTDIR}/usr/share/shorewall +chmod 755 ${DESTDIR}${LIBEXEC}/shorewall + +if [ $LIBEXEC != /usr/shorewall/ ]; then + mkdir -p ${DESTDIR}/usr/share/shorewall + chmod 755 ${DESTDIR}/usr/share/shorewall +fi # # Install wait4ifup # diff --git a/Shorewall-init/install.sh b/Shorewall-init/install.sh index 09bcb3966..94a349a24 100755 --- a/Shorewall-init/install.sh +++ b/Shorewall-init/install.sh @@ -112,7 +112,8 @@ case "$LIBEXEC" in /*) ;; *) - LIBEXEC=/usr/${LIBEXEC} + echo "The LIBEXEC setting must be an absolute path name" >&2 + exit 1 ;; esac @@ -128,11 +129,7 @@ if [ -z "$BUILD" ]; then if [ -f /etc/debian_version ]; then BUILD=DEBIAN elif [ -f /etc/redhat-release ]; then - if [ -d /etc/sysconfig/network-scripts/ ]; then - BUILD=REDHAT - else - BUILD=FEDORA - fi + BUILD=REDHAT elif [ -f /etc/SuSE-release ]; then BUILD=SUSE elif [ -f /etc/slackware-version ] ; then @@ -178,12 +175,8 @@ case "$HOST" in echo "Installing Debian-specific configuration..." SPARSE=yes ;; - FEDORA) - echo "Installing Fedora-specific configuration..." - DEST=/etc/rc.d/init.d - ;; REDHAT) - echo "Installing Redhat-specific configuration..." + echo "Installing Redhat/Fedora-specific configuration..." DEST=/etc/rc.d/init.d ;; SLACKWARE) @@ -254,7 +247,7 @@ case $HOST in DEBIAN) install_file init.debian.sh ${DESTDIR}/etc/init.d/shorewall-init 0544 ;; - REDHAT|FEDORA) + REDHAT) install_file init.fedora.sh ${DESTDIR}/etc/init.d/shorewall-init 0544 ;; *) diff --git a/Shorewall-lite/install.sh b/Shorewall-lite/install.sh index 54c51933d..f320c6713 100755 --- a/Shorewall-lite/install.sh +++ b/Shorewall-lite/install.sh @@ -151,11 +151,7 @@ if [ -z "$BUILD" ]; then if [ -f /etc/debian_version ]; then BUILD=DEBIAN elif [ -f /etc/redhat-release ]; then - if [ -d /etc/sysconfig/network-scripts/ ]; then - BUILD=REDHAT - else - BUILD=FEDORA - fi + BUILD=REDHAT elif [ -f /etc/SuSE-release ]; then BUILD=SUSE elif [ -f /etc/slackware-version ] ; then @@ -212,7 +208,7 @@ case "$HOST" in echo "Installing Debian-specific configuration..." SPARSE=yes ;; - FEDORA|REDHAT) + REDHAT) echo "Installing Redhat/Fedora-specific configuration..." DEST=/etc/rc.d/init.d ;; @@ -308,7 +304,7 @@ case $HOST in DEBIAN) install_file init.debian.sh ${DESTDIR}/etc/init.d/$PRODUCT 0544 ;; - FEDORA|REDHAT) + REDHAT) install_file init.fedora.sh ${DESTDIR}/etc/init.d/$PRODUCT 0544 ;; ARCHLINUX) diff --git a/Shorewall/install.sh b/Shorewall/install.sh index 011fc9522..460da1dad 100755 --- a/Shorewall/install.sh +++ b/Shorewall/install.sh @@ -145,11 +145,7 @@ if [ -z "$BUILD" ]; then if [ -f /etc/debian_version ]; then BUILD=DEBIAN elif [ -f /etc/redhat-release ]; then - if [ -d /etc/sysconfig/network-scripts/ ]; then - BUILD=REDHAT - else - BUILD=FEDORA - fi + BUILD=REDHAT elif [ -f /etc/slackware-version ] ; then BUILD=SLACKWARE elif [ -f /etc/SuSE-release ]; then @@ -268,7 +264,7 @@ case "$HOST" in echo "Installing Debian-specific configuration..." SPARSE=yes ;; - FEDORA|REDHAT) + REDHAT) echo "Installing Redhat/Fedora-specific configuration..." DEST="/etc/rc.d/init.d" ;; @@ -353,7 +349,7 @@ case $HOST in DEBIAN) install_file init.debian.sh ${DESTDIR}/etc/init.d/$PRODUCT 0544 ;; - FEDORA|REDHAT) + REDHAT) install_file init.fedora.sh ${DESTDIR}${DEST}/$PRODUCT 0544 ;; ARCHLINUX)