Merge branch '4.5.0'

This commit is contained in:
Tom Eastep 2012-02-17 13:39:22 -08:00
commit 8a3f1f7111
5 changed files with 349 additions and 204 deletions

View File

@ -263,6 +263,15 @@ for f in lib.* ; do
install_file $f ${DESTDIR}/usr/share/shorewall/$f 0644 install_file $f ${DESTDIR}/usr/share/shorewall/$f 0644
echo "Library ${f#*.} file installed as ${DESTDIR}/usr/share/shorewall/$f" echo "Library ${f#*.} file installed as ${DESTDIR}/usr/share/shorewall/$f"
done done
if [ -z "$MACHOST" ]; then
eval sed -i \'s\|g_libexec=.\*\|g_libexec=$LIBEXEC\|\' ${DESTDIR}/usr/share/shorewall/lib.cli
eval sed -i \'s\|g_perllib=.\*\|g_perllib=$PERLLIB\|\' ${DESTDIR}/usr/share/shorewall/lib.cli
else
eval sed -i \'\' -e \'s\|g_libexec=.\*\|g_libexec=$LIBEXEC\|\' ${DESTDIR}/usr/share/shorewall/lib.cli
eval sed -i \'\' -e \'s\|g_perllib=.\*\|g_perllib=$PERLLIB\|\' ${DESTDIR}/usr/share/shorewall/lib.cli
fi
# #
# Symbolically link 'functions' to lib.base # Symbolically link 'functions' to lib.base
# #

View File

@ -131,14 +131,49 @@ case "$LIBEXEC" in
;; ;;
esac esac
# if [ -n "INSTALLSYS" ]; then
# Determine where to install the firewall script case $(uname) in
# CYGWIN*)
INSTALLSYS=CYGWIN
;;
Darwin)
INSTALLSYS=MAC
;;
*)
if [ -f /etc/debian_version ]; then
INSTALLSYS=DEBIAN
elif [ -f /etc/redhat-release ]; then
if [ -d /etc/sysconfig/network-scripts/ ]; then
INSTALLSYS=REDHAT
else
INSTALLSYS=FEDORA
fi
elif [ -f /etc/slackware-version ] ; then
INSTALLSYS=SLACKWARE
elif [ -f /etc/arch-release ] ; then
INSTALLSYS=ARCHLINUX
else
INSTALLSYS=
fi
;;
esac
fi
case $INSTALLSYS in
CYGWIN*)
OWNER=$(id -un)
GROUP=$(id -gn)
;;
MAC)
if [ -z "$DESTDIR" ]; then
DEST=
INIT=
SPARSE=Yes
fi
case $(uname) in
Darwin)
[ -z "$OWNER" ] && OWNER=root [ -z "$OWNER" ] && OWNER=root
[ -z "$GROUP" ] && GROUP=wheel [ -z "$GROUP" ] && GROUP=wheel
INSTALLD=
T= T=
;; ;;
*) *)
@ -149,6 +184,39 @@ esac
OWNERSHIP="-o $OWNER -g $GROUP" OWNERSHIP="-o $OWNER -g $GROUP"
[ -n "$TARGET" ] || TARGET=$INSTALLSYS
case "$TARGET" in
DEBIAN)
echo "Installing Debian-specific configuration..."
SPARSE=yes
;;
FEDORA)
echo "Installing Fedora-specific configuration..."
;;
REDHAT)
echo "Installing Redhat-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 TARGET distribution: \"$TARGET\"" >&2
exit 1;
;;
esac
if [ -n "$DESTDIR" ]; then if [ -n "$DESTDIR" ]; then
if [ `id -u` != 0 ] ; then if [ `id -u` != 0 ] ; then
echo "Not setting file owner/group permissions, not running as root." echo "Not setting file owner/group permissions, not running as root."
@ -156,31 +224,6 @@ if [ -n "$DESTDIR" ]; then
fi fi
install -d $OWNERSHIP -m 755 ${DESTDIR}${DEST} install -d $OWNERSHIP -m 755 ${DESTDIR}${DEST}
elif [ -f /etc/debian_version ]; then
DEBIAN=yes
elif [ -f /etc/SuSE-release ]; then
SUSE=Yes
elif [ -f /etc/redhat-release ]; then
FEDORA=Yes
elif [ -f /etc/slackware-version ] ; then
echo "Shorewall-init is currently not supported on Slackware" >&2
exit 1
# DEST="/etc/rc.d"
# INIT="rc.firewall"
elif [ -f /etc/arch-release ] ; then
echo "Shorewall-init is currently not supported on Arch Linux" >&2
exit 1
# DEST="/etc/rc.d"
# INIT="shorewall-init"
# ARCHLINUX=yes
elif [ -d /etc/sysconfig/network-scripts/ ]; then
#
# Assume RedHat-based
#
REDHAT=Yes
else
echo "Unknown distribution: Shorewall-init support is not available" >&2
exit 1
fi fi
if [ -z "$DESTDIR" ]; then if [ -z "$DESTDIR" ]; then
@ -210,15 +253,17 @@ fi
# #
# Install the Init Script # Install the Init Script
# #
if [ -n "$DEBIAN" ]; then case $TARGET in
install_file init.debian.sh ${DESTDIR}/etc/init.d/shorewall-init 0544 DEBIAN)
elif [ -n "$FEDORA" ]; then install_file init.debian.sh ${DESTDIR}/etc/init.d/shorewall-init 0544
install_file init.debian.sh ${DESTDIR}/etc/init.d/shorewall-init 0544 ;;
#elif [ -n "$ARCHLINUX" ]; then REDHAT|FEDORA)
# install_file init.archlinux.sh ${DESTDIR}${DEST}/$INIT 0544 install_file init.fedora.sh ${DESTDIR}/etc/init.d/shorewall-init 0544
else ;;
install_file init.sh ${DESTDIR}${DEST}/$INIT 0544 *)
fi install_file init.sh ${DESTDIR}${DEST}/$INIT 0544
;;
esac
echo "Shorewall Init script installed in ${DESTDIR}${DEST}/$INIT" echo "Shorewall Init script installed in ${DESTDIR}${DEST}/$INIT"
@ -250,7 +295,7 @@ if [ -z "$DESTDIR" ]; then
ln -s ${DEST}/${INIT} /usr/share/shorewall-init/init ln -s ${DEST}/${INIT} /usr/share/shorewall-init/init
fi fi
if [ -n "$DEBIAN" ]; then if [ $TARGET = DEBIAN ]; then
if [ -n "${DESTDIR}" ]; then if [ -n "${DESTDIR}" ]; then
mkdir -p ${DESTDIR}/etc/network/if-up.d/ mkdir -p ${DESTDIR}/etc/network/if-up.d/
mkdir -p ${DESTDIR}/etc/network/if-post-down.d/ mkdir -p ${DESTDIR}/etc/network/if-post-down.d/
@ -268,7 +313,7 @@ else
mkdir -p ${DESTDIR}/etc/sysconfig mkdir -p ${DESTDIR}/etc/sysconfig
if [ -z "$RPM" ]; then if [ -z "$RPM" ]; then
if [ -n "$SUSE" ]; then if [ $TARGET = SUSE ]; then
mkdir -p ${DESTDIR}/etc/sysconfig/network/if-up.d mkdir -p ${DESTDIR}/etc/sysconfig/network/if-up.d
mkdir -p ${DESTDIR}/etc/sysconfig/network/if-down.d mkdir -p ${DESTDIR}/etc/sysconfig/network/if-down.d
else else
@ -294,24 +339,30 @@ if [ -d ${DESTDIR}/etc/NetworkManager ]; then
install_file ifupdown.sh ${DESTDIR}/etc/NetworkManager/dispatcher.d/01-shorewall 0544 install_file ifupdown.sh ${DESTDIR}/etc/NetworkManager/dispatcher.d/01-shorewall 0544
fi fi
if [ -n "$DEBIAN" ]; then case $TARGET in
install_file ifupdown.sh ${DESTDIR}/etc/network/if-up.d/shorewall 0544 DEBIAN)
install_file ifupdown.sh ${DESTDIR}/etc/network/if-post-down.d/shorewall 0544 install_file ifupdown.sh ${DESTDIR}/etc/network/if-up.d/shorewall 0544
elif [ -n "$SUSE" ]; then install_file ifupdown.sh ${DESTDIR}/etc/network/if-post-down.d/shorewall 0544
install_file ifupdown.sh ${DESTDIR}/etc/sysconfig/network/if-up.d/shorewall 0544 ;;
install_file ifupdown.sh ${DESTDIR}/etc/sysconfig/network/if-down.d/shorewall 0544 SUSE)
elif [ -n "$REDHAT" ]; then if [ -z "$RPM" ]; then
if [ -f ${DESTDIR}/sbin/ifup-local -o -f ${DESTDIR}/sbin/ifdown-local ]; then install_file ifupdown.sh ${DESTDIR}/etc/sysconfig/network/if-up.d/shorewall 0544
echo "WARNING: /sbin/ifup-local and/or /sbin/ifdown-local already exist; up/down events will not be handled" install_file ifupdown.sh ${DESTDIR}/etc/sysconfig/network/if-down.d/shorewall 0544
else fi
install_file ifupdown.sh ${DESTDIR}/sbin/ifup-local 0544 ;;
install_file ifupdown.sh ${DESTDIR}/sbin/ifdown-local 0544 REDHAT)
fi if [ -f ${DESTDIR}/sbin/ifup-local -o -f ${DESTDIR}/sbin/ifdown-local ]; then
fi echo "WARNING: /sbin/ifup-local and/or /sbin/ifdown-local already exist; up/down events will not be handled"
else
install_file ifupdown.sh ${DESTDIR}/sbin/ifup-local 0544
install_file ifupdown.sh ${DESTDIR}/sbin/ifdown-local 0544
fi
;;
esac
if [ -z "$DESTDIR" ]; then if [ -z "$DESTDIR" ]; then
if [ -n "$first_install" ]; then if [ -n "$first_install" ]; then
if [ -n "$DEBIAN" ]; then if [ $TARGET = DEBIAN ]; then
update-rc.d shorewall-init defaults update-rc.d shorewall-init defaults
@ -348,7 +399,7 @@ if [ -z "$DESTDIR" ]; then
fi fi
else else
if [ -n "$first_install" ]; then if [ -n "$first_install" ]; then
if [ -n "$DEBIAN" ]; then if [ $TARGET = DEBIAN ]; then
if [ -n "${DESTDIR}" ]; then if [ -n "${DESTDIR}" ]; then
mkdir -p ${DESTDIR}/etc/rcS.d mkdir -p ${DESTDIR}/etc/rcS.d
fi fi
@ -360,31 +411,33 @@ else
fi fi
if [ -f ${DESTDIR}/etc/ppp ]; then if [ -f ${DESTDIR}/etc/ppp ]; then
if [ -n "$DEBIAN" ] -o -n "$SUSE" ]; then case $TARGET in
for directory in ip-up.d ip-down.d ipv6-up.d ipv6-down.d; do DEBIAN|SUSE)
mkdir -p ${DESTDIR}/etc/ppp/$directory #SuSE doesn't create the IPv6 directories for directory in ip-up.d ip-down.d ipv6-up.d ipv6-down.d; do
cp -fp ${DESTDIR}${LIBEXEC}/shorewall-init/ifupdown ${DESTDIR}/etc/ppp/$directory/shorewall mkdir -p ${DESTDIR}/etc/ppp/$directory #SuSE doesn't create the IPv6 directories
done cp -fp ${DESTDIR}${LIBEXEC}/shorewall-init/ifupdown ${DESTDIR}/etc/ppp/$directory/shorewall
elif [ -n "$REDHAT" ]; then done
# ;;
# Must use the dreaded ip_xxx.local file REDHAT)
# #
for file in ip-up.local ip-down.local; do # Must use the dreaded ip_xxx.local file
FILE=${DESTDIR}/etc/ppp/$file #
if [ -f $FILE ]; then for file in ip-up.local ip-down.local; do
if fgrep -q Shorewall-based $FILE ; then FILE=${DESTDIR}/etc/ppp/$file
cp -fp ${DESTDIR}${LIBEXEC}/shorewall-init/ifupdown $FILE if [ -f $FILE ]; then
if fgrep -q Shorewall-based $FILE ; then
cp -fp ${DESTDIR}${LIBEXEC}/shorewall-init/ifupdown $FILE
else
echo "$FILE already exists -- ppp devices will not be handled"
break
fi
else else
echo "$FILE already exists -- ppp devices will not be handled" cp -fp ${DESTDIR}${LIBEXEC}/shorewall-init/ifupdown $FILE
break
fi fi
else done
cp -fp ${DESTDIR}${LIBEXEC}/shorewall-init/ifupdown $FILE ;;
fi esac
done
fi
fi fi
# #
# Report Success # Report Success
# #

View File

@ -149,7 +149,31 @@ CYGWIN=
INSTALLD='-D' INSTALLD='-D'
T='-T' T='-T'
case $(uname) in if [ -n "INSTALLSYS" ]; then
case $(uname) in
CYGWIN*)
INSTALLSYS=CYGWIN
;;
Darwin)
INSTALLSYS=MAC
;;
*)
if [ -f /etc/debian_version ]; then
INSTALLSYS=DEBIAN
elif [ -f /etc/redhat-release ]; then
INSTALLSYS=FEDORA
elif [ -f /etc/slackware-version ] ; then
INSTALLSYS=SLACKWARE
elif [ -f /etc/arch-release ] ; then
INSTALLSYS=ARCHLINUX
else
INSTALLSYS=LINUX
fi
;;
esac
fi
case $INSTALLSYS in
CYGWIN*) CYGWIN*)
if [ -z "$DESTDIR" ]; then if [ -z "$DESTDIR" ]; then
DEST= DEST=
@ -159,7 +183,15 @@ case $(uname) in
OWNER=$(id -un) OWNER=$(id -un)
GROUP=$(id -gn) GROUP=$(id -gn)
;; ;;
Darwin) MAC)
if [ -z "$DESTDIR" ]; then
DEST=
INIT=
SPARSE=Yes
fi
[ -z "$OWNER" ] && OWNER=root
[ -z "$GROUP" ] && GROUP=wheel
INSTALLD= INSTALLD=
T= T=
;; ;;
@ -171,6 +203,41 @@ esac
OWNERSHIP="-o $OWNER -g $GROUP" OWNERSHIP="-o $OWNER -g $GROUP"
[ -n "$TARGET" ] || TARGET=$INSTALLSYS
case "$TARGET" in
CYGWIN)
echo "Installing Cygwin-specific configuration..."
;;
MAC)
echo "Installing Mac-specific configuration...";
;;
DEBIAN)
echo "Installing Debian-specific configuration..."
SPARSE=yes
;;
FEDORA)
echo "Installing Redhat/Fedora-specific configuration..."
;;
SLACKWARE)
echo "Installing Slackware-specific configuration..."
DEST="/etc/rc.d"
MANDIR="/usr/man"
INIT="rc.firewall"
;;
ARCHLINUX)
echo "Installing ArchLinux-specific configuration..."
DEST="/etc/rc.d"
INIT="$PRODUCT"
;;
LINUX)
;;
*)
echo "ERROR: Unknown TARGET \"$TARGET\"" >&2
exit 1;
;;
esac
if [ -n "$DESTDIR" ]; then if [ -n "$DESTDIR" ]; then
if [ `id -u` != 0 ] ; then if [ `id -u` != 0 ] ; then
echo "Not setting file owner/group permissions, not running as root." echo "Not setting file owner/group permissions, not running as root."
@ -179,20 +246,11 @@ if [ -n "$DESTDIR" ]; then
install -d $OWNERSHIP -m 755 ${DESTDIR}/sbin install -d $OWNERSHIP -m 755 ${DESTDIR}/sbin
install -d $OWNERSHIP -m 755 ${DESTDIR}${DEST} install -d $OWNERSHIP -m 755 ${DESTDIR}${DEST}
elif [ -d /etc/apt -a -e /usr/bin/dpkg ]; then
DEBIAN=yes
elif [ -f /etc/redhat-release ]; then
FEDORA=yes
elif [ -f /etc/slackware-version ] ; then
DEST="/etc/rc.d"
INIT="rc.firewall"
elif [ -f /etc/arch-release ] ; then
DEST="/etc/rc.d"
INIT="$PRODUCT"
ARCHLINUX=yes
fi
if [ -z "$DESTDIR" ]; then if [ -n "$SYSTEMD" ]; then
mkdir -p ${DESTDIR}/lib/systemd/system
fi
else
if [ ! -f /usr/share/shorewall/coreversion ]; then if [ ! -f /usr/share/shorewall/coreversion ]; then
echo "$PRODUCT $VERSION requires Shorewall Core which does not appear to be installed" >&2 echo "$PRODUCT $VERSION requires Shorewall Core which does not appear to be installed" >&2
exit 1 exit 1
@ -201,8 +259,6 @@ if [ -z "$DESTDIR" ]; then
if [ -f /lib/systemd/system ]; then if [ -f /lib/systemd/system ]; then
SYSTEMD=Yes SYSTEMD=Yes
fi fi
elif [ -n "$SYSTEMD" ]; then
mkdir -p ${DESTDIR}/lib/systemd/system
fi fi
echo "Installing $Product Version $VERSION" echo "Installing $Product Version $VERSION"
@ -238,22 +294,25 @@ delete_file ${DESTDIR}/usr/share/$PRODUCT/xmodules
install_file $PRODUCT ${DESTDIR}/sbin/$PRODUCT 0544 install_file $PRODUCT ${DESTDIR}/sbin/$PRODUCT 0544
eval sed -i \'``s\|g_libexec=.\*\|g_libexec=$LIBEXEC\|\' ${DESTDIR}/sbin/$PRODUCT
echo "$Product control program installed in ${DESTDIR}/sbin/$PRODUCT" echo "$Product control program installed in ${DESTDIR}/sbin/$PRODUCT"
# #
# Install the Firewall Script # Install the Firewall Script
# #
if [ -n "$DEBIAN" ]; then case $TARGET in
install_file init.debian.sh ${DESTDIR}/etc/init.d/$PRODUCT 0544 DEBIAN)
elif [ -n "$FEDORA" ]; then install_file init.debian.sh ${DESTDIR}/etc/init.d/$PRODUCT 0544
install_file init.fedora.sh ${DESTDIR}/etc/init.d/$PRODUCT 0544 ;;
elif [ -n "$ARCHLINUX" ]; then FEDORA)
install_file init.archlinux.sh ${DESTDIR}/${DEST}/$INIT 0544 install_file init.fedora.sh ${DESTDIR}/etc/init.d/$PRODUCT 0544
else ;;
install_file init.sh ${DESTDIR}/${DEST}/$INIT 0544 ARCHLINUX)
fi install_file init.archlinux.sh ${DESTDIR}/${DEST}/$INIT 0544
;;
*)
install_file init.sh ${DESTDIR}/${DEST}/$INIT 0544
;;
esac
echo "$Product script installed in ${DESTDIR}${DEST}/$INIT" echo "$Product script installed in ${DESTDIR}${DEST}/$INIT"
@ -289,7 +348,7 @@ if [ ! -f ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf ]; then
echo "Config file installed as ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf" echo "Config file installed as ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf"
fi fi
if [ -n "$ARCHLINUX" ] ; then if [ $TARGET = ARCHLINUX ] ; then
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf
fi fi
@ -400,7 +459,7 @@ if [ -z "$DESTDIR" ]; then
touch /var/log/$PRODUCT-init.log touch /var/log/$PRODUCT-init.log
if [ -n "$first_install" ]; then if [ -n "$first_install" ]; then
if [ -n "$DEBIAN" ]; then if [ $TARGET = DEBIAN ]; then
run_install $OWNERSHIP -m 0644 default.debian /etc/default/$PRODUCT run_install $OWNERSHIP -m 0644 default.debian /etc/default/$PRODUCT
update-rc.d $PRODUCT defaults update-rc.d $PRODUCT defaults

View File

@ -119,9 +119,6 @@ if [ -z "$INIT" ] ; then
fi fi
ANNOTATED= ANNOTATED=
CYGWIN=
MAC=
MACHOST=
MANDIR=${MANDIR:-"/usr/share/man"} MANDIR=${MANDIR:-"/usr/share/man"}
SPARSE= SPARSE=
INSTALLD='-D' INSTALLD='-D'
@ -144,7 +141,31 @@ case "$PERLLIB" in
;; ;;
esac esac
case $(uname) in if [ -n "INSTALLSYS" ]; then
case $(uname) in
CYGWIN*)
INSTALLSYS=CYGWIN
;;
Darwin)
INSTALLSYS=MAC
;;
*)
if [ -f /etc/debian_version ]; then
INSTALLSYS=DEBIAN
elif [ -f /etc/redhat-release ]; then
INSTALLSYS=FEDORA
elif [ -f /etc/slackware-version ] ; then
INSTALLSYS=SLACKWARE
elif [ -f /etc/arch-release ] ; then
INSTALLSYS=ARCHLINUX
else
INSTALLSYS=LINUX
fi
;;
esac
fi
case $INSTALLSYS in
CYGWIN*) CYGWIN*)
if [ -z "$DESTDIR" ]; then if [ -z "$DESTDIR" ]; then
DEST= DEST=
@ -153,10 +174,8 @@ case $(uname) in
OWNER=$(id -un) OWNER=$(id -un)
GROUP=$(id -gn) GROUP=$(id -gn)
CYGWIN=Yes
SPARSE=Yes
;; ;;
Darwin) MAC)
if [ -z "$DESTDIR" ]; then if [ -z "$DESTDIR" ]; then
DEST= DEST=
INIT= INIT=
@ -165,8 +184,6 @@ case $(uname) in
[ -z "$OWNER" ] && OWNER=root [ -z "$OWNER" ] && OWNER=root
[ -z "$GROUP" ] && GROUP=wheel [ -z "$GROUP" ] && GROUP=wheel
MAC=Yes
MACHOST=Yes
INSTALLD= INSTALLD=
T= T=
;; ;;
@ -229,8 +246,54 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
# Determine where to install the firewall script # Determine where to install the firewall script
# #
if [ $PRODUCT = shorewall ]; then
#
# Verify that Perl is installed
#
if ! perl -c Perl/compiler.pl; then
echo "ERROR: $Product $VERSION requires Perl which either is not installed or is not able to compile the $Product perl code" >&2
echo " Try perl -c $PWD/Perl/compiler.pl" >&2
exit 1
fi
fi
[ -n "$TARGET" ] || TARGET=$INSTALLSYS
case "$TARGET" in
CYGWIN)
echo "Installing Cygwin-specific configuration..."
;;
MAC)
echo "Installing Mac-specific configuration...";
;;
DEBIAN)
echo "Installing Debian-specific configuration..."
SPARSE=yes
;;
FEDORA)
echo "Installing Redhat/Fedora-specific configuration..."
;;
SLACKWARE)
echo "Installing Slackware-specific configuration..."
DEST="/etc/rc.d"
MANDIR="/usr/man"
INIT="rc.firewall"
;;
ARCHLINUX)
echo "Installing ArchLinux-specific configuration..."
DEST="/etc/rc.d"
INIT="$PRODUCT"
;;
LINUX)
;;
*)
echo "ERROR: Unknown TARGET \"$TARGET\"" >&2
exit 1;
;;
esac
if [ -n "$DESTDIR" ]; then if [ -n "$DESTDIR" ]; then
if [ -z "$CYGWIN" ]; then if [ $INSTALLSYS != CYGWIN ]; then
if [ `id -u` != 0 ] ; then if [ `id -u` != 0 ] ; then
echo "Not setting file owner/group permissions, not running as root." echo "Not setting file owner/group permissions, not running as root."
OWNERSHIP="" OWNERSHIP=""
@ -239,49 +302,9 @@ if [ -n "$DESTDIR" ]; then
install -d $OWNERSHIP -m 755 ${DESTDIR}/sbin install -d $OWNERSHIP -m 755 ${DESTDIR}/sbin
install -d $OWNERSHIP -m 755 ${DESTDIR}${DEST} install -d $OWNERSHIP -m 755 ${DESTDIR}${DEST}
elif [ -z "$DESTDIR" ]; then
CYGWIN= [ -x /usr/share/shorewall/compiler.pl ] || \
MAC= { echo " ERROR: Shorewall >= 4.3.5 is not installed" >&2; exit 1; }
else
if [ $PRODUCT = shorewall ]; then
#
# Verify that Perl is installed
#
if ! perl -c Perl/compiler.pl; then
echo "ERROR: $Product $VERSION requires Perl which either is not installed or is not able to compile the $Product perl code" >&2
echo " Try perl -c $PWD/Perl/compiler.pl" >&2
exit 1
fi
else
[ -x /usr/share/shorewall/compiler.pl ] || \
{ echo " ERROR: Shorewall >= 4.3.5 is not installed" >&2; exit 1; }
fi
if [ -n "$CYGWIN" ]; then
echo "Installing Cygwin-specific configuration..."
elif [ -n "$MAC" ]; then
echo "Installing Mac-specific configuration..."
else
if [ -f /etc/debian_version ]; then
echo "Installing Debian-specific configuration..."
DEBIAN=yes
SPARSE=yes
elif [ -f /etc/redhat-release ]; then
echo "Installing Redhat/Fedora-specific configuration..."
FEDORA=yes
elif [ -f /etc/slackware-version ] ; then
echo "Installing Slackware-specific configuration..."
DEST="/etc/rc.d"
MANDIR="/usr/man"
SLACKWARE=yes
INIT="rc.firewall"
elif [ -f /etc/arch-release ] ; then
echo "Installing ArchLinux-specific configuration..."
DEST="/etc/rc.d"
INIT="$PRODUCT"
ARCHLINUX=yes
fi
fi
fi fi
if [ -z "$DESTDIR" ]; then if [ -z "$DESTDIR" ]; then
@ -308,38 +331,39 @@ if [ -z "${DESTDIR}" -a $PRODUCT = shorewall -a ! -f /usr/share/$PRODUCT/corever
exit 1 exit 1
fi fi
if [ -z "$CYGWIN" ]; then if [ $TARGET != CYGWIN ]; then
install_file $PRODUCT ${DESTDIR}/sbin/$PRODUCT 0755 install_file $PRODUCT ${DESTDIR}/sbin/$PRODUCT 0755
if [ -z "$MACHOST" ]; then
eval sed -i \'s\|g_libexec=.\*\|g_libexec=$LIBEXEC\|\' ${DESTDIR}/sbin/$PRODUCT
eval sed -i \'s\|g_perllib=.\*\|g_perllib=$PERLLIB\|\' ${DESTDIR}/sbin/$PRODUCT
else
eval sed -i \'\' -e \'s\|g_libexec=.\*\|g_libexec=$LIBEXEC\|\' ${DESTDIR}/sbin/$PRODUCT
eval sed -i \'\' -e \'s\|g_perllib=.\*\|g_perllib=$PERLLIB\|\' ${DESTDIR}/sbin/$PRODUCT
fi
echo "$PRODUCT control program installed in ${DESTDIR}/sbin/$PRODUCT" echo "$PRODUCT control program installed in ${DESTDIR}/sbin/$PRODUCT"
else else
install_file $PRODUCT ${DESTDIR}/bin/$PRODUCT 0755 install_file $PRODUCT ${DESTDIR}/bin/$PRODUCT 0755
eval sed -i \'s\|g_libexec=.\*\|g_libexec=$LIBEXEC\|\' ${DESTDIR}/bin/$PRODUCT
eval sed -i \'s\|g_perllib=.\*\|g_perllib=$PERLLIB\|\' ${DESTDIR}/bin/$PRODUCT
echo "$PRODUCT control program installed in ${DESTDIR}/bin/$PRODUCT" echo "$PRODUCT control program installed in ${DESTDIR}/bin/$PRODUCT"
fi fi
# #
# Install the Firewall Script # Install the Firewall Script
# #
if [ -n "$DEBIAN" ]; then case $TARGET in
install_file init.debian.sh ${DESTDIR}/etc/init.d/$PRODUCT 0544 DEBIAN)
elif [ -n "$FEDORA" ]; then install_file init.debian.sh ${DESTDIR}/etc/init.d/$PRODUCT 0544
install_file init.fedora.sh ${DESTDIR}/etc/init.d/$PRODUCT 0544 ;;
elif [ -n "$ARCHLINUX" ]; then FEDORA)
install_file init.archlinux.sh ${DESTDIR}${DEST}/$INIT 0544 install_file init.fedora.sh ${DESTDIR}/etc/init.d/$PRODUCT 0544
elif [ -n "$SLACKWARE" -a $PRODUCT = shorewall ]; then ;;
install_file init.slackware.firewall.sh ${DESTDIR}${DEST}/rc.firewall 0644 ARCHLINUX)
install_file init.slackware.$PRODUCT.sh ${DESTDIR}${DEST}/rc.$PRODUCT 0644 install_file init.archlinux.sh ${DESTDIR}${DEST}/$INIT 0544
elif [ -n "$INIT" ]; then ;;
install_file init.sh ${DESTDIR}${DEST}/$INIT 0544 SLACKWARE)
fi if [ $PRODUCT = shorewall ]; then
install_file init.slackware.firewall.sh ${DESTDIR}${DEST}/rc.firewall 0644
install_file init.slackware.$PRODUCT.sh ${DESTDIR}${DEST}/rc.$PRODUCT 0644
fi
;;
*)
if [ -n "$INIT" ]; then
install_file init.sh ${DESTDIR}${DEST}/$INIT 0544
fi
;;
esac
[ -n "$INIT" ] && echo "$Product script installed in ${DESTDIR}${DEST}/$INIT" [ -n "$INIT" ] && echo "$Product script installed in ${DESTDIR}${DEST}/$INIT"
@ -436,7 +460,7 @@ run_install $OWNERSHIP -m 0644 $PRODUCT.conf.annotated ${DESTDIR}/usr/share/$PRO
if [ ! -f ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf ]; then if [ ! -f ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf ]; then
run_install $OWNERSHIP -m 0644 $PRODUCT.conf${suffix} ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf run_install $OWNERSHIP -m 0644 $PRODUCT.conf${suffix} ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf
if [ -n "$DEBIAN" ] && mywhich perl; then if [ $TARGET = DEBIAN ] && mywhich perl; then
# #
# Make a Debian-like $PRODUCT.conf # Make a Debian-like $PRODUCT.conf
# #
@ -447,7 +471,7 @@ if [ ! -f ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf ]; then
fi fi
if [ -n "$ARCHLINUX" ] ; then if [ $TARGET = ARCHLINUX ] ; then
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf
fi fi
@ -1090,7 +1114,7 @@ if [ -d ${DESTDIR}/etc/logrotate.d ]; then
fi fi
if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${CYGWIN}${MAC}" ]; then if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${CYGWIN}${MAC}" ]; then
if [ -n "$DEBIAN" ]; then if [ $TARGET = DEBIAN ]; then
run_install $OWNERSHIP -m 0644 default.debian /etc/default/$PRODUCT run_install $OWNERSHIP -m 0644 default.debian /etc/default/$PRODUCT
update-rc.d $PRODUCT defaults update-rc.d $PRODUCT defaults
@ -1126,7 +1150,7 @@ if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${CYGWIN}${MAC}" ]; then
else else
cant_autostart cant_autostart
fi fi
elif [ "$INIT" != rc.firewall ]; then #Slackware starts this automatically elif [ "$INIT" != rc.f ]; then #Slackware starts this automatically
cant_autostart cant_autostart
fi fi
fi fi

View File

@ -5,7 +5,7 @@
<!--/$Id$--> <!--/$Id$-->
<articleinfo> <articleinfo>
<title>Shorewall 4.5 Documentation</title> <title>Shorewall 4.4/4.5 Documentation</title>
<authorgroup> <authorgroup>
<author> <author>
@ -55,7 +55,7 @@
<tgroup align="left" cols="3"> <tgroup align="left" cols="3">
<tbody> <tbody>
<row> <row>
<entry></entry> <entry/>
<entry><ulink url="LXC.html">Linux Containers <entry><ulink url="LXC.html">Linux Containers
(LXC)</ulink></entry> (LXC)</ulink></entry>
@ -285,7 +285,7 @@
<entry><ulink url="ports.htm">Port Information</ulink></entry> <entry><ulink url="ports.htm">Port Information</ulink></entry>
<entry></entry> <entry/>
</row> </row>
<row> <row>
@ -294,7 +294,7 @@
<entry><ulink url="PortKnocking.html">Port Knocking and Other Uses <entry><ulink url="PortKnocking.html">Port Knocking and Other Uses
of the 'Recent Match'</ulink></entry> of the 'Recent Match'</ulink></entry>
<entry></entry> <entry/>
</row> </row>
<row> <row>
@ -303,7 +303,7 @@
<entry><ulink url="PPTP.htm">PPTP</ulink></entry> <entry><ulink url="PPTP.htm">PPTP</ulink></entry>
<entry></entry> <entry/>
</row> </row>
<row> <row>
@ -312,7 +312,7 @@
<entry><ulink url="ProxyARP.htm">Proxy ARP</ulink></entry> <entry><ulink url="ProxyARP.htm">Proxy ARP</ulink></entry>
<entry></entry> <entry/>
</row> </row>
<row> <row>
@ -322,7 +322,7 @@
<entry><ulink url="shorewall_quickstart_guide.htm">QuickStart <entry><ulink url="shorewall_quickstart_guide.htm">QuickStart
Guides</ulink></entry> Guides</ulink></entry>
<entry></entry> <entry/>
</row> </row>
<row> <row>
@ -330,7 +330,7 @@
<entry><ulink url="NewRelease.html">Release Model</ulink></entry> <entry><ulink url="NewRelease.html">Release Model</ulink></entry>
<entry></entry> <entry/>
</row> </row>
<row> <row>
@ -339,7 +339,7 @@
<entry><ulink <entry><ulink
url="shorewall_prerequisites.htm">Requirements</ulink></entry> url="shorewall_prerequisites.htm">Requirements</ulink></entry>
<entry></entry> <entry/>
</row> </row>
<row> <row>
@ -348,7 +348,7 @@
<entry><ulink url="Shorewall_and_Routing.html">Routing and <entry><ulink url="Shorewall_and_Routing.html">Routing and
Shorewall</ulink></entry> Shorewall</ulink></entry>
<entry></entry> <entry/>
</row> </row>
<row> <row>
@ -357,7 +357,7 @@
<entry><ulink url="Multiple_Zones.html">Routing on One <entry><ulink url="Multiple_Zones.html">Routing on One
Interface</ulink></entry> Interface</ulink></entry>
<entry></entry> <entry/>
</row> </row>
<row> <row>
@ -366,7 +366,7 @@
<entry><ulink url="samba.htm">Samba</ulink></entry> <entry><ulink url="samba.htm">Samba</ulink></entry>
<entry></entry> <entry/>
</row> </row>
<row> <row>
@ -376,7 +376,7 @@
<entry><ulink url="Shorewall-init.html">Shorewall <entry><ulink url="Shorewall-init.html">Shorewall
Init</ulink></entry> Init</ulink></entry>
<entry></entry> <entry/>
</row> </row>
<row> <row>
@ -386,7 +386,7 @@
<entry><ulink url="Shorewall-Lite.html">Shorewall <entry><ulink url="Shorewall-Lite.html">Shorewall
Lite</ulink></entry> Lite</ulink></entry>
<entry></entry> <entry/>
</row> </row>
</tbody> </tbody>
</tgroup> </tgroup>