Rename PREFIX->DESTDIR

If DESTDIR is not supplied, look for PREFIX

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2010-06-01 06:42:11 -07:00
parent 0553f232b5
commit fe55fa0f31
5 changed files with 623 additions and 613 deletions

View File

@ -86,6 +86,8 @@ install_file() # $1 = source $2 = target $3 = mode
run_install $T $OWNERSHIP -m $3 $1 ${2} run_install $T $OWNERSHIP -m $3 $1 ${2}
} }
[ -n "$DESTDIR" ] || DESTDIR="$PREFIX"
# #
# Parse the run line # Parse the run line
# #
@ -145,13 +147,13 @@ esac
OWNERSHIP="-o $OWNER -g $GROUP" OWNERSHIP="-o $OWNER -g $GROUP"
if [ -n "$PREFIX" ]; 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."
OWNERSHIP="" OWNERSHIP=""
fi fi
install -d $OWNERSHIP -m 755 ${PREFIX}${DEST} install -d $OWNERSHIP -m 755 ${DESTDIR}${DEST}
elif [ -f /etc/debian_version ]; then elif [ -f /etc/debian_version ]; then
DEBIAN=yes DEBIAN=yes
elif [ -f /etc/SuSE-release ]; then elif [ -f /etc/SuSE-release ]; then
@ -187,7 +189,7 @@ echo "Installing Shorewall Init Version $VERSION"
# #
# Check for /usr/share/shorewall-init/version # Check for /usr/share/shorewall-init/version
# #
if [ -f ${PREFIX}/usr/share/shorewall-init/version ]; then if [ -f ${DESTDIR}/usr/share/shorewall-init/version ]; then
first_install="" first_install=""
else else
first_install="Yes" first_install="Yes"
@ -197,64 +199,64 @@ fi
# Install the Init Script # Install the Init Script
# #
if [ -n "$DEBIAN" ]; then if [ -n "$DEBIAN" ]; then
install_file init.debian.sh ${PREFIX}/etc/init.d/shorewall-init 0544 install_file init.debian.sh ${DESTDIR}/etc/init.d/shorewall-init 0544
#elif [ -n "$ARCHLINUX" ]; then #elif [ -n "$ARCHLINUX" ]; then
# install_file init.archlinux.sh ${PREFIX}${DEST}/$INIT 0544 # install_file init.archlinux.sh ${DESTDIR}${DEST}/$INIT 0544
else else
install_file init.sh ${PREFIX}${DEST}/$INIT 0544 install_file init.sh ${DESTDIR}${DEST}/$INIT 0544
fi fi
echo "Shorewall Init script installed in ${PREFIX}${DEST}/$INIT" echo "Shorewall Init script installed in ${DESTDIR}${DEST}/$INIT"
# #
# Create /usr/share/shorewall-init if needed # Create /usr/share/shorewall-init if needed
# #
mkdir -p ${PREFIX}/usr/share/shorewall-init mkdir -p ${DESTDIR}/usr/share/shorewall-init
chmod 755 ${PREFIX}/usr/share/shorewall-init chmod 755 ${DESTDIR}/usr/share/shorewall-init
# #
# Create the version file # Create the version file
# #
echo "$VERSION" > ${PREFIX}/usr/share/shorewall-init/version echo "$VERSION" > ${DESTDIR}/usr/share/shorewall-init/version
chmod 644 ${PREFIX}/usr/share/shorewall-init/version chmod 644 ${DESTDIR}/usr/share/shorewall-init/version
# #
# Remove and create the symbolic link to the init script # Remove and create the symbolic link to the init script
# #
if [ -z "$PREFIX" ]; then if [ -z "$DESTDIR" ]; then
rm -f /usr/share/shorewall-init/init rm -f /usr/share/shorewall-init/init
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 [ -n "$DEBIAN" ]; then
if [ -n "${PREFIX}" ]; then if [ -n "${DESTDIR}" ]; then
mkdir -p ${PREFIX}/etc/network/if-up.d/ mkdir -p ${DESTDIR}/etc/network/if-up.d/
mkdir -p ${PREFIX}/etc/network/if-post-down.d/ mkdir -p ${DESTDIR}/etc/network/if-post-down.d/
fi fi
if [ ! -f ${PREFIX}/etc/default/shorewall-init ]; then if [ ! -f ${DESTDIR}/etc/default/shorewall-init ]; then
if [ -n "${PREFIX}" ]; then if [ -n "${DESTDIR}" ]; then
mkdir ${PREFIX}/etc/default mkdir ${DESTDIR}/etc/default
fi fi
install_file sysconfig ${PREFIX}/etc/default/shorewall-init 0644 install_file sysconfig ${DESTDIR}/etc/default/shorewall-init 0644
fi fi
else else
if [ -n "$PREFIX" ]; then if [ -n "$DESTDIR" ]; then
mkdir -p ${PREFIX}/etc/sysconfig mkdir -p ${DESTDIR}/etc/sysconfig
if [ -z "$RPM" ]; then if [ -z "$RPM" ]; then
if [ -n "$SUSE" ]; then if [ -n "$SUSE" ]; then
mkdir -p ${PREFIX}/etc/sysconfig/network/if-up.d mkdir -p ${DESTDIR}/etc/sysconfig/network/if-up.d
mkdir -p ${PREFIX}/etc/sysconfig/network/if-down.d mkdir -p ${DESTDIR}/etc/sysconfig/network/if-down.d
else else
mkdir -p ${PREFIX}/etc/NetworkManager/dispatcher.d mkdir -p ${DESTDIR}/etc/NetworkManager/dispatcher.d
fi fi
fi fi
fi fi
if [ -d ${PREFIX}/etc/sysconfig -a ! -f ${PREFIX}/etc/sysconfig/shorewall-init ]; then if [ -d ${DESTDIR}/etc/sysconfig -a ! -f ${DESTDIR}/etc/sysconfig/shorewall-init ]; then
install_file sysconfig ${PREFIX}/etc/sysconfig/shorewall-init 0644 install_file sysconfig ${DESTDIR}/etc/sysconfig/shorewall-init 0644
fi fi
fi fi
@ -262,30 +264,30 @@ fi
# Install the ifupdown script # Install the ifupdown script
# #
mkdir -p ${PREFIX}/usr/share/shorewall-init mkdir -p ${DESTDIR}/usr/share/shorewall-init
install_file ifupdown.sh ${PREFIX}/usr/share/shorewall-init/ifupdown 0544 install_file ifupdown.sh ${DESTDIR}/usr/share/shorewall-init/ifupdown 0544
if [ -d ${PREFIX}/etc/NetworkManager ]; then if [ -d ${DESTDIR}/etc/NetworkManager ]; then
install_file ifupdown.sh ${PREFIX}/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 if [ -n "$DEBIAN" ]; then
install_file ifupdown.sh ${PREFIX}/etc/network/if-up.d/shorewall 0544 install_file ifupdown.sh ${DESTDIR}/etc/network/if-up.d/shorewall 0544
install_file ifupdown.sh ${PREFIX}/etc/network/if-post-down.d/shorewall 0544 install_file ifupdown.sh ${DESTDIR}/etc/network/if-post-down.d/shorewall 0544
elif [ -n "$SUSE" ]; then elif [ -n "$SUSE" ]; then
install_file ifupdown.sh ${PREFIX}/etc/sysconfig/network/if-up.d/shorewall 0544 install_file ifupdown.sh ${DESTDIR}/etc/sysconfig/network/if-up.d/shorewall 0544
install_file ifupdown.sh ${PREFIX}/etc/sysconfig/network/if-down.d/shorewall 0544 install_file ifupdown.sh ${DESTDIR}/etc/sysconfig/network/if-down.d/shorewall 0544
elif [ -n "$REDHAT" ]; then elif [ -n "$REDHAT" ]; then
if [ -f ${PREFIX}/sbin/ifup-local -o -f ${PREFIX}/sbin/ifdown-local ]; then if [ -f ${DESTDIR}/sbin/ifup-local -o -f ${DESTDIR}/sbin/ifdown-local ]; then
echo "WARNING: /sbin/ifup-local and/or /sbin/ifdown-local already exist; up/down events will not be handled" echo "WARNING: /sbin/ifup-local and/or /sbin/ifdown-local already exist; up/down events will not be handled"
else else
install_file ifupdown.sh ${PREFIX}/sbin/ifup-local 0544 install_file ifupdown.sh ${DESTDIR}/sbin/ifup-local 0544
install_file ifupdown.sh ${PREFIX}/sbin/ifdown-local 0544 install_file ifupdown.sh ${DESTDIR}/sbin/ifdown-local 0544
fi fi
fi fi
if [ -z "$PREFIX" ]; then if [ -z "$DESTDIR" ]; then
if [ -n "$first_install" ]; then if [ -n "$first_install" ]; then
if [ -n "$DEBIAN" ]; then if [ -n "$DEBIAN" ]; then
ln -sf ../init.d/shorewall-init /etc/rcS.d/S38shorewall-init ln -sf ../init.d/shorewall-init /etc/rcS.d/S38shorewall-init
@ -318,11 +320,11 @@ if [ -z "$PREFIX" ]; then
else else
if [ -n "$first_install" ]; then if [ -n "$first_install" ]; then
if [ -n "$DEBIAN" ]; then if [ -n "$DEBIAN" ]; then
if [ -n "${PREFIX}" ]; then if [ -n "${DESTDIR}" ]; then
mkdir -p ${PREFIX}/etc/rcS.d mkdir -p ${DESTDIR}/etc/rcS.d
fi fi
ln -sf ../init.d/shorewall-init ${PREFIX}/etc/rcS.d/S38shorewall-init ln -sf ../init.d/shorewall-init ${DESTDIR}/etc/rcS.d/S38shorewall-init
echo "Shorewall Init will start automatically at boot" echo "Shorewall Init will start automatically at boot"
fi fi
fi fi

View File

@ -85,6 +85,8 @@ install_file() # $1 = source $2 = target $3 = mode
run_install $T $OWNERSHIP -m $3 $1 ${2} run_install $T $OWNERSHIP -m $3 $1 ${2}
} }
[ -n "$DESTDIR" ] || DESTDIR="$PREFIX"
# #
# Parse the run line # Parse the run line
# #
@ -136,7 +138,7 @@ T='-T'
case $(uname) in case $(uname) in
CYGWIN*) CYGWIN*)
if [ -z "$PREFIX" ]; then if [ -z "$DESTDIR" ]; then
DEST= DEST=
INIT= INIT=
fi fi
@ -156,14 +158,14 @@ esac
OWNERSHIP="-o $OWNER -g $GROUP" OWNERSHIP="-o $OWNER -g $GROUP"
if [ -n "$PREFIX" ]; 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."
OWNERSHIP="" OWNERSHIP=""
fi fi
install -d $OWNERSHIP -m 755 ${PREFIX}/sbin install -d $OWNERSHIP -m 755 ${DESTDIR}/sbin
install -d $OWNERSHIP -m 755 ${PREFIX}${DEST} install -d $OWNERSHIP -m 755 ${DESTDIR}${DEST}
elif [ -d /etc/apt -a -e /usr/bin/dpkg ]; then elif [ -d /etc/apt -a -e /usr/bin/dpkg ]; then
DEBIAN=yes DEBIAN=yes
elif [ -f /etc/slackware-version ] ; then elif [ -f /etc/slackware-version ] ; then
@ -185,29 +187,29 @@ echo "Installing Shorewall Lite Version $VERSION"
# #
# Check for /etc/shorewall-lite # Check for /etc/shorewall-lite
# #
if [ -z "$PREFIX" -a -d /etc/shorewall-lite ]; then if [ -z "$DESTDIR" -a -d /etc/shorewall-lite ]; then
[ -f /etc/shorewall-lite/shorewall.conf ] && \ [ -f /etc/shorewall-lite/shorewall.conf ] && \
mv -f /etc/shorewall-lite/shorewall.conf /etc/shorewall-lite/shorewall-lite.conf mv -f /etc/shorewall-lite/shorewall.conf /etc/shorewall-lite/shorewall-lite.conf
else else
rm -rf ${PREFIX}/etc/shorewall-lite rm -rf ${DESTDIR}/etc/shorewall-lite
rm -rf ${PREFIX}/usr/share/shorewall-lite rm -rf ${DESTDIR}/usr/share/shorewall-lite
rm -rf ${PREFIX}/var/lib/shorewall-lite rm -rf ${DESTDIR}/var/lib/shorewall-lite
fi fi
# #
# Check for /sbin/shorewall-lite # Check for /sbin/shorewall-lite
# #
if [ -f ${PREFIX}/sbin/shorewall-lite ]; then if [ -f ${DESTDIR}/sbin/shorewall-lite ]; then
first_install="" first_install=""
else else
first_install="Yes" first_install="Yes"
fi fi
delete_file ${PREFIX}/usr/share/shorewall-lite/xmodules delete_file ${DESTDIR}/usr/share/shorewall-lite/xmodules
install_file shorewall-lite ${PREFIX}/sbin/shorewall-lite 0544 install_file shorewall-lite ${DESTDIR}/sbin/shorewall-lite 0544
echo "Shorewall Lite control program installed in ${PREFIX}/sbin/shorewall-lite" echo "Shorewall Lite control program installed in ${DESTDIR}/sbin/shorewall-lite"
# #
# Install the Firewall Script # Install the Firewall Script
@ -215,85 +217,85 @@ echo "Shorewall Lite control program installed in ${PREFIX}/sbin/shorewall-lite"
if [ -n "$DEBIAN" ]; then if [ -n "$DEBIAN" ]; then
install_file init.debian.sh /etc/init.d/shorewall-lite 0544 install_file init.debian.sh /etc/init.d/shorewall-lite 0544
elif [ -n "$ARCHLINUX" ]; then elif [ -n "$ARCHLINUX" ]; then
install_file init.archlinux.sh ${PREFIX}${DEST}/$INIT 0544 install_file init.archlinux.sh ${DESTDIR}${DEST}/$INIT 0544
else else
install_file init.sh ${PREFIX}${DEST}/$INIT 0544 install_file init.sh ${DESTDIR}${DEST}/$INIT 0544
fi fi
echo "Shorewall Lite script installed in ${PREFIX}${DEST}/$INIT" echo "Shorewall Lite script installed in ${DESTDIR}${DEST}/$INIT"
# #
# Create /etc/shorewall-lite, /usr/share/shorewall-lite and /var/lib/shorewall-lite if needed # Create /etc/shorewall-lite, /usr/share/shorewall-lite and /var/lib/shorewall-lite if needed
# #
mkdir -p ${PREFIX}/etc/shorewall-lite mkdir -p ${DESTDIR}/etc/shorewall-lite
mkdir -p ${PREFIX}/usr/share/shorewall-lite mkdir -p ${DESTDIR}/usr/share/shorewall-lite
mkdir -p ${PREFIX}/var/lib/shorewall-lite mkdir -p ${DESTDIR}/var/lib/shorewall-lite
chmod 755 ${PREFIX}/etc/shorewall-lite chmod 755 ${DESTDIR}/etc/shorewall-lite
chmod 755 ${PREFIX}/usr/share/shorewall-lite chmod 755 ${DESTDIR}/usr/share/shorewall-lite
if [ -n "$PREFIX" ]; then if [ -n "$DESTDIR" ]; then
mkdir -p ${PREFIX}/etc/logrotate.d mkdir -p ${DESTDIR}/etc/logrotate.d
chmod 755 ${PREFIX}/etc/logrotate.d chmod 755 ${DESTDIR}/etc/logrotate.d
fi fi
# #
# Install the config file # Install the config file
# #
if [ ! -f ${PREFIX}/etc/shorewall-lite/shorewall-lite.conf ]; then if [ ! -f ${DESTDIR}/etc/shorewall-lite/shorewall-lite.conf ]; then
run_install $OWNERSHIP -m 0744 shorewall-lite.conf ${PREFIX}/etc/shorewall-lite run_install $OWNERSHIP -m 0744 shorewall-lite.conf ${DESTDIR}/etc/shorewall-lite
echo "Config file installed as ${PREFIX}/etc/shorewall-lite/shorewall-lite.conf" echo "Config file installed as ${DESTDIR}/etc/shorewall-lite/shorewall-lite.conf"
fi fi
if [ -n "$ARCHLINUX" ] ; then if [ -n "$ARCHLINUX" ] ; then
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${PREFIX}/etc/shorewall-lite/shorewall.conf sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}/etc/shorewall-lite/shorewall.conf
fi fi
# #
# Install the Makefile # Install the Makefile
# #
run_install $OWNERSHIP -m 0600 Makefile ${PREFIX}/etc/shorewall-lite run_install $OWNERSHIP -m 0600 Makefile ${DESTDIR}/etc/shorewall-lite
echo "Makefile installed as ${PREFIX}/etc/shorewall-lite/Makefile" echo "Makefile installed as ${DESTDIR}/etc/shorewall-lite/Makefile"
# #
# Install the default config path file # Install the default config path file
# #
install_file configpath ${PREFIX}/usr/share/shorewall-lite/configpath 0644 install_file configpath ${DESTDIR}/usr/share/shorewall-lite/configpath 0644
echo "Default config path file installed as ${PREFIX}/usr/share/shorewall-lite/configpath" echo "Default config path file installed as ${DESTDIR}/usr/share/shorewall-lite/configpath"
# #
# Install the libraries # Install the libraries
# #
for f in lib.* ; do for f in lib.* ; do
if [ -f $f ]; then if [ -f $f ]; then
install_file $f ${PREFIX}/usr/share/shorewall-lite/$f 0644 install_file $f ${DESTDIR}/usr/share/shorewall-lite/$f 0644
echo "Library ${f#*.} file installed as ${PREFIX}/usr/share/shorewall-lite/$f" echo "Library ${f#*.} file installed as ${DESTDIR}/usr/share/shorewall-lite/$f"
fi fi
done done
ln -sf lib.base ${PREFIX}/usr/share/shorewall-lite/functions ln -sf lib.base ${DESTDIR}/usr/share/shorewall-lite/functions
echo "Common functions linked through ${PREFIX}/usr/share/shorewall-lite/functions" echo "Common functions linked through ${DESTDIR}/usr/share/shorewall-lite/functions"
# #
# Install Shorecap # Install Shorecap
# #
install_file shorecap ${PREFIX}/usr/share/shorewall-lite/shorecap 0755 install_file shorecap ${DESTDIR}/usr/share/shorewall-lite/shorecap 0755
echo echo
echo "Capability file builder installed in ${PREFIX}/usr/share/shorewall-lite/shorecap" echo "Capability file builder installed in ${DESTDIR}/usr/share/shorewall-lite/shorecap"
# #
# Install wait4ifup # Install wait4ifup
# #
if [ -f wait4ifup ]; then if [ -f wait4ifup ]; then
install_file wait4ifup ${PREFIX}/usr/share/shorewall-lite/wait4ifup 0755 install_file wait4ifup ${DESTDIR}/usr/share/shorewall-lite/wait4ifup 0755
echo echo
echo "wait4ifup installed in ${PREFIX}/usr/share/shorewall-lite/wait4ifup" echo "wait4ifup installed in ${DESTDIR}/usr/share/shorewall-lite/wait4ifup"
fi fi
# #
@ -301,8 +303,8 @@ fi
# #
if [ -f modules ]; then if [ -f modules ]; then
run_install $OWNERSHIP -m 0600 modules ${PREFIX}/usr/share/shorewall-lite run_install $OWNERSHIP -m 0600 modules ${DESTDIR}/usr/share/shorewall-lite
echo "Modules file installed as ${PREFIX}/usr/share/shorewall-lite/modules" echo "Modules file installed as ${DESTDIR}/usr/share/shorewall-lite/modules"
fi fi
# #
@ -312,18 +314,18 @@ fi
if [ -d manpages ]; then if [ -d manpages ]; then
cd manpages cd manpages
[ -n "$INSTALLD" ] || mkdir -p ${PREFIX}/usr/share/man/man5/ ${PREFIX}/usr/share/man/man8/ [ -n "$INSTALLD" ] || mkdir -p ${DESTDIR}/usr/share/man/man5/ ${DESTDIR}/usr/share/man/man8/
for f in *.5; do for f in *.5; do
gzip -c $f > $f.gz gzip -c $f > $f.gz
run_install $T $INSTALLD $OWNERSHIP -m 0644 $f.gz ${PREFIX}/usr/share/man/man5/$f.gz run_install $T $INSTALLD $OWNERSHIP -m 0644 $f.gz ${DESTDIR}/usr/share/man/man5/$f.gz
echo "Man page $f.gz installed to ${PREFIX}/usr/share/man/man5/$f.gz" echo "Man page $f.gz installed to ${DESTDIR}/usr/share/man/man5/$f.gz"
done done
for f in *.8; do for f in *.8; do
gzip -c $f > $f.gz gzip -c $f > $f.gz
run_install $T $INSTALLD $OWNERSHIP -m 0644 $f.gz ${PREFIX}/usr/share/man/man8/$f.gz run_install $T $INSTALLD $OWNERSHIP -m 0644 $f.gz ${DESTDIR}/usr/share/man/man8/$f.gz
echo "Man page $f.gz installed to ${PREFIX}/usr/share/man/man8/$f.gz" echo "Man page $f.gz installed to ${DESTDIR}/usr/share/man/man8/$f.gz"
done done
cd .. cd ..
@ -331,27 +333,27 @@ if [ -d manpages ]; then
echo "Man Pages Installed" echo "Man Pages Installed"
fi fi
if [ -d ${PREFIX}/etc/logrotate.d ]; then if [ -d ${DESTDIR}/etc/logrotate.d ]; then
run_install $OWNERSHIP -m 0644 logrotate ${PREFIX}/etc/logrotate.d/shorewall-lite run_install $OWNERSHIP -m 0644 logrotate ${DESTDIR}/etc/logrotate.d/shorewall-lite
echo "Logrotate file installed as ${PREFIX}/etc/logrotate.d/shorewall-lite" echo "Logrotate file installed as ${DESTDIR}/etc/logrotate.d/shorewall-lite"
fi fi
# #
# Create the version file # Create the version file
# #
echo "$VERSION" > ${PREFIX}/usr/share/shorewall-lite/version echo "$VERSION" > ${DESTDIR}/usr/share/shorewall-lite/version
chmod 644 ${PREFIX}/usr/share/shorewall-lite/version chmod 644 ${DESTDIR}/usr/share/shorewall-lite/version
# #
# Remove and create the symbolic link to the init script # Remove and create the symbolic link to the init script
# #
if [ -z "$PREFIX" ]; then if [ -z "$DESTDIR" ]; then
rm -f /usr/share/shorewall-lite/init rm -f /usr/share/shorewall-lite/init
ln -s ${DEST}/${INIT} /usr/share/shorewall-lite/init ln -s ${DEST}/${INIT} /usr/share/shorewall-lite/init
fi fi
if [ -z "$PREFIX" ]; then if [ -z "$DESTDIR" ]; then
touch /var/log/shorewall-lite-init.log touch /var/log/shorewall-lite-init.log
if [ -n "$first_install" ]; then if [ -n "$first_install" ]; then

View File

@ -85,6 +85,8 @@ install_file() # $1 = source $2 = target $3 = mode
run_install $T $OWNERSHIP -m $3 $1 ${2} run_install $T $OWNERSHIP -m $3 $1 ${2}
} }
[ -n "$DESTDIR" ] || DESTDIR="$PREFIX"
# #
# Parse the run line # Parse the run line
# #
@ -114,7 +116,7 @@ INSTALLD='-D'
case $(uname) in case $(uname) in
CYGWIN*) CYGWIN*)
if [ -z "$PREFIX" ]; then if [ -z "$DESTDIR" ]; then
DEST= DEST=
INIT= INIT=
fi fi
@ -125,7 +127,7 @@ case $(uname) in
SPARSE=Yes SPARSE=Yes
;; ;;
Darwin) Darwin)
if [ -z "$PREFIX" ]; then if [ -z "$DESTDIR" ]; then
DEST= DEST=
INIT= INIT=
SPARSE=Yes SPARSE=Yes
@ -171,7 +173,7 @@ 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 [ -n "$PREFIX" ]; then if [ -n "$DESTDIR" ]; then
if [ -z "$CYGWIN" ]; then if [ -z "$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."
@ -179,8 +181,8 @@ if [ -n "$PREFIX" ]; then
fi fi
fi fi
install -d $OWNERSHIP -m 755 ${PREFIX}/sbin install -d $OWNERSHIP -m 755 ${DESTDIR}/sbin
install -d $OWNERSHIP -m 755 ${PREFIX}${DEST} install -d $OWNERSHIP -m 755 ${DESTDIR}${DEST}
CYGWIN= CYGWIN=
MAC= MAC=
@ -227,539 +229,539 @@ echo "Installing Shorewall Version $VERSION"
# #
# Check for /sbin/shorewall # Check for /sbin/shorewall
# #
if [ -f ${PREFIX}/sbin/shorewall ]; then if [ -f ${DESTDIR}/sbin/shorewall ]; then
first_install="" first_install=""
else else
first_install="Yes" first_install="Yes"
fi fi
if [ -z "$CYGWIN" ]; then if [ -z "$CYGWIN" ]; then
install_file shorewall ${PREFIX}/sbin/shorewall 0755 install_file shorewall ${DESTDIR}/sbin/shorewall 0755
echo "shorewall control program installed in ${PREFIX}/sbin/shorewall" echo "shorewall control program installed in ${DESTDIR}/sbin/shorewall"
else else
install_file shorewall ${PREFIX}/bin/shorewall 0755 install_file shorewall ${DESTDIR}/bin/shorewall 0755
echo "shorewall control program installed in ${PREFIX}/bin/shorewall" echo "shorewall control program installed in ${DESTDIR}/bin/shorewall"
fi fi
# #
# Install the Firewall Script # Install the Firewall Script
# #
if [ -n "$DEBIAN" ]; then if [ -n "$DEBIAN" ]; then
install_file init.debian.sh ${PREFIX}/etc/init.d/shorewall 0544 install_file init.debian.sh ${DESTDIR}/etc/init.d/shorewall 0544
elif [ -n "$ARCHLINUX" ]; then elif [ -n "$ARCHLINUX" ]; then
install_file init.archlinux.sh ${PREFIX}${DEST}/$INIT 0544 install_file init.archlinux.sh ${DESTDIR}${DEST}/$INIT 0544
elif [ -n "$SLACKWARE" ]; then elif [ -n "$SLACKWARE" ]; then
install_file init.slackware.firewall.sh ${PREFIX}${DEST}/rc.firewall 0644 install_file init.slackware.firewall.sh ${DESTDIR}${DEST}/rc.firewall 0644
install_file init.slackware.shorewall.sh ${PREFIX}${DEST}/rc.shorewall 0644 install_file init.slackware.shorewall.sh ${DESTDIR}${DEST}/rc.shorewall 0644
elif [ -n "$INIT" ]; then elif [ -n "$INIT" ]; then
install_file init.sh ${PREFIX}${DEST}/$INIT 0544 install_file init.sh ${DESTDIR}${DEST}/$INIT 0544
fi fi
[ -n "$INIT" ] && echo "Shorewall script installed in ${PREFIX}${DEST}/$INIT" [ -n "$INIT" ] && echo "Shorewall script installed in ${DESTDIR}${DEST}/$INIT"
# #
# Create /etc/shorewall, /usr/share/shorewall and /var/shorewall if needed # Create /etc/shorewall, /usr/share/shorewall and /var/shorewall if needed
# #
mkdir -p ${PREFIX}/etc/shorewall mkdir -p ${DESTDIR}/etc/shorewall
mkdir -p ${PREFIX}/usr/share/shorewall mkdir -p ${DESTDIR}/usr/share/shorewall
mkdir -p ${PREFIX}/usr/share/shorewall/configfiles mkdir -p ${DESTDIR}/usr/share/shorewall/configfiles
mkdir -p ${PREFIX}/var/lib/shorewall mkdir -p ${DESTDIR}/var/lib/shorewall
chmod 755 ${PREFIX}/etc/shorewall chmod 755 ${DESTDIR}/etc/shorewall
chmod 755 ${PREFIX}/usr/share/shorewall chmod 755 ${DESTDIR}/usr/share/shorewall
chmod 755 ${PREFIX}/usr/share/shorewall/configfiles chmod 755 ${DESTDIR}/usr/share/shorewall/configfiles
if [ -n "$PREFIX" ]; then if [ -n "$DESTDIR" ]; then
mkdir -p ${PREFIX}/etc/logrotate.d mkdir -p ${DESTDIR}/etc/logrotate.d
chmod 755 ${PREFIX}/etc/logrotate.d chmod 755 ${DESTDIR}/etc/logrotate.d
fi fi
# #
# Install the config file # Install the config file
# #
run_install $OWNERSHIP -m 0644 configfiles/shorewall.conf ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/shorewall.conf ${DESTDIR}/usr/share/shorewall/configfiles
perl -p -w -i -e 's|^CONFIG_PATH=.*|CONFIG_PATH=/usr/share/shorewall/configfiles:/usr/share/shorewall|;' ${PREFIX}/usr/share/shorewall/configfiles/shorewall.conf perl -p -w -i -e 's|^CONFIG_PATH=.*|CONFIG_PATH=/usr/share/shorewall/configfiles:/usr/share/shorewall|;' ${DESTDIR}/usr/share/shorewall/configfiles/shorewall.conf
perl -p -w -i -e 's|^STARTUP_LOG=.*|STARTUP_LOG=/var/log/shorewall-lite-init.log|;' ${PREFIX}/usr/share/shorewall/configfiles/shorewall.conf perl -p -w -i -e 's|^STARTUP_LOG=.*|STARTUP_LOG=/var/log/shorewall-lite-init.log|;' ${DESTDIR}/usr/share/shorewall/configfiles/shorewall.conf
if [ ! -f ${PREFIX}/etc/shorewall/shorewall.conf ]; then if [ ! -f ${DESTDIR}/etc/shorewall/shorewall.conf ]; then
run_install $OWNERSHIP -m 0644 configfiles/shorewall.conf ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0644 configfiles/shorewall.conf ${DESTDIR}/etc/shorewall
if [ -n "$DEBIAN" ]; then if [ -n "$DEBIAN" ]; then
# #
# Make a Debian-like shorewall.conf # Make a Debian-like shorewall.conf
# #
perl -p -w -i -e 's|^STARTUP_ENABLED=.*|STARTUP_ENABLED=Yes|;' ${PREFIX}/etc/shorewall/shorewall.conf perl -p -w -i -e 's|^STARTUP_ENABLED=.*|STARTUP_ENABLED=Yes|;' ${DESTDIR}/etc/shorewall/shorewall.conf
fi fi
echo "Config file installed as ${PREFIX}/etc/shorewall/shorewall.conf" echo "Config file installed as ${DESTDIR}/etc/shorewall/shorewall.conf"
fi fi
if [ -n "$ARCHLINUX" ] ; then if [ -n "$ARCHLINUX" ] ; then
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${PREFIX}/etc/shorewall/shorewall.conf sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}/etc/shorewall/shorewall.conf
fi fi
# #
# Install the zones file # Install the zones file
# #
run_install $OWNERSHIP -m 0644 configfiles/zones ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/zones ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/zones ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/zones ]; then
run_install $OWNERSHIP -m 0744 configfiles/zones ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0744 configfiles/zones ${DESTDIR}/etc/shorewall
echo "Zones file installed as ${PREFIX}/etc/shorewall/zones" echo "Zones file installed as ${DESTDIR}/etc/shorewall/zones"
fi fi
delete_file ${PREFIX}/usr/share/shorewall/compiler delete_file ${DESTDIR}/usr/share/shorewall/compiler
delete_file ${PREFIX}/usr/share/shorewall/lib.accounting delete_file ${DESTDIR}/usr/share/shorewall/lib.accounting
delete_file ${PREFIX}/usr/share/shorewall/lib.actions delete_file ${DESTDIR}/usr/share/shorewall/lib.actions
delete_file ${PREFIX}/usr/share/shorewall/lib.dynamiczones delete_file ${DESTDIR}/usr/share/shorewall/lib.dynamiczones
delete_file ${PREFIX}/usr/share/shorewall/lib.maclist delete_file ${DESTDIR}/usr/share/shorewall/lib.maclist
delete_file ${PREFIX}/usr/share/shorewall/lib.nat delete_file ${DESTDIR}/usr/share/shorewall/lib.nat
delete_file ${PREFIX}/usr/share/shorewall/lib.providers delete_file ${DESTDIR}/usr/share/shorewall/lib.providers
delete_file ${PREFIX}/usr/share/shorewall/lib.proxyarp delete_file ${DESTDIR}/usr/share/shorewall/lib.proxyarp
delete_file ${PREFIX}/usr/share/shorewall/lib.tc delete_file ${DESTDIR}/usr/share/shorewall/lib.tc
delete_file ${PREFIX}/usr/share/shorewall/lib.tcrules delete_file ${DESTDIR}/usr/share/shorewall/lib.tcrules
delete_file ${PREFIX}/usr/share/shorewall/lib.tunnels delete_file ${DESTDIR}/usr/share/shorewall/lib.tunnels
delete_file ${PREFIX}/usr/share/shorewall/prog.header delete_file ${DESTDIR}/usr/share/shorewall/prog.header
delete_file ${PREFIX}/usr/share/shorewall/prog.footer delete_file ${DESTDIR}/usr/share/shorewall/prog.footer
# #
# Install wait4ifup # Install wait4ifup
# #
install_file wait4ifup ${PREFIX}/usr/share/shorewall/wait4ifup 0755 install_file wait4ifup ${DESTDIR}/usr/share/shorewall/wait4ifup 0755
echo echo
echo "wait4ifup installed in ${PREFIX}/usr/share/shorewall/wait4ifup" echo "wait4ifup installed in ${DESTDIR}/usr/share/shorewall/wait4ifup"
# #
# Install the policy file # Install the policy file
# #
install_file configfiles/policy ${PREFIX}/usr/share/shorewall/configfiles/policy 0644 install_file configfiles/policy ${DESTDIR}/usr/share/shorewall/configfiles/policy 0644
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/policy ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/policy ]; then
run_install $OWNERSHIP -m 0600 configfiles/policy ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/policy ${DESTDIR}/etc/shorewall
echo "Policy file installed as ${PREFIX}/etc/shorewall/policy" echo "Policy file installed as ${DESTDIR}/etc/shorewall/policy"
fi fi
# #
# Install the interfaces file # Install the interfaces file
# #
run_install $OWNERSHIP -m 0644 configfiles/interfaces ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/interfaces ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/interfaces ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/interfaces ]; then
run_install $OWNERSHIP -m 0600 configfiles/interfaces ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/interfaces ${DESTDIR}/etc/shorewall
echo "Interfaces file installed as ${PREFIX}/etc/shorewall/interfaces" echo "Interfaces file installed as ${DESTDIR}/etc/shorewall/interfaces"
fi fi
# #
# Install the hosts file # Install the hosts file
# #
run_install $OWNERSHIP -m 0644 configfiles/hosts ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/hosts ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/hosts ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/hosts ]; then
run_install $OWNERSHIP -m 0600 configfiles/hosts ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/hosts ${DESTDIR}/etc/shorewall
echo "Hosts file installed as ${PREFIX}/etc/shorewall/hosts" echo "Hosts file installed as ${DESTDIR}/etc/shorewall/hosts"
fi fi
# #
# Install the rules file # Install the rules file
# #
run_install $OWNERSHIP -m 0644 configfiles/rules ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/rules ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/rules ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/rules ]; then
run_install $OWNERSHIP -m 0600 configfiles/rules ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/rules ${DESTDIR}/etc/shorewall
echo "Rules file installed as ${PREFIX}/etc/shorewall/rules" echo "Rules file installed as ${DESTDIR}/etc/shorewall/rules"
fi fi
# #
# Install the NAT file # Install the NAT file
# #
run_install $OWNERSHIP -m 0644 configfiles/nat ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/nat ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/nat ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/nat ]; then
run_install $OWNERSHIP -m 0600 configfiles/nat ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/nat ${DESTDIR}/etc/shorewall
echo "NAT file installed as ${PREFIX}/etc/shorewall/nat" echo "NAT file installed as ${DESTDIR}/etc/shorewall/nat"
fi fi
# #
# Install the NETMAP file # Install the NETMAP file
# #
run_install $OWNERSHIP -m 0644 configfiles/netmap ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/netmap ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/netmap ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/netmap ]; then
run_install $OWNERSHIP -m 0600 configfiles/netmap ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/netmap ${DESTDIR}/etc/shorewall
echo "NETMAP file installed as ${PREFIX}/etc/shorewall/netmap" echo "NETMAP file installed as ${DESTDIR}/etc/shorewall/netmap"
fi fi
# #
# Install the Parameters file # Install the Parameters file
# #
run_install $OWNERSHIP -m 0644 configfiles/params ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/params ${DESTDIR}/usr/share/shorewall/configfiles
if [ -f ${PREFIX}/etc/shorewall/params ]; then if [ -f ${DESTDIR}/etc/shorewall/params ]; then
chmod 0644 ${PREFIX}/etc/shorewall/params chmod 0644 ${DESTDIR}/etc/shorewall/params
else else
run_install $OWNERSHIP -m 0644 configfiles/params ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0644 configfiles/params ${DESTDIR}/etc/shorewall
echo "Parameter file installed as ${PREFIX}/etc/shorewall/params" echo "Parameter file installed as ${DESTDIR}/etc/shorewall/params"
fi fi
# #
# Install the proxy ARP file # Install the proxy ARP file
# #
run_install $OWNERSHIP -m 0644 configfiles/proxyarp ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/proxyarp ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/proxyarp ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/proxyarp ]; then
run_install $OWNERSHIP -m 0600 configfiles/proxyarp ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/proxyarp ${DESTDIR}/etc/shorewall
echo "Proxy ARP file installed as ${PREFIX}/etc/shorewall/proxyarp" echo "Proxy ARP file installed as ${DESTDIR}/etc/shorewall/proxyarp"
fi fi
# #
# Install the Stopped Routing file # Install the Stopped Routing file
# #
run_install $OWNERSHIP -m 0644 configfiles/routestopped ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/routestopped ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/routestopped ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/routestopped ]; then
run_install $OWNERSHIP -m 0600 configfiles/routestopped ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/routestopped ${DESTDIR}/etc/shorewall
echo "Stopped Routing file installed as ${PREFIX}/etc/shorewall/routestopped" echo "Stopped Routing file installed as ${DESTDIR}/etc/shorewall/routestopped"
fi fi
# #
# Install the Mac List file # Install the Mac List file
# #
run_install $OWNERSHIP -m 0644 configfiles/maclist ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/maclist ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/maclist ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/maclist ]; then
run_install $OWNERSHIP -m 0600 configfiles/maclist ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/maclist ${DESTDIR}/etc/shorewall
echo "MAC list file installed as ${PREFIX}/etc/shorewall/maclist" echo "MAC list file installed as ${DESTDIR}/etc/shorewall/maclist"
fi fi
# #
# Install the Masq file # Install the Masq file
# #
run_install $OWNERSHIP -m 0644 configfiles/masq ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/masq ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/masq ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/masq ]; then
run_install $OWNERSHIP -m 0600 configfiles/masq ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/masq ${DESTDIR}/etc/shorewall
echo "Masquerade file installed as ${PREFIX}/etc/shorewall/masq" echo "Masquerade file installed as ${DESTDIR}/etc/shorewall/masq"
fi fi
# #
# Install the Notrack file # Install the Notrack file
# #
run_install $OWNERSHIP -m 0644 configfiles/notrack ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/notrack ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/notrack ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/notrack ]; then
run_install $OWNERSHIP -m 0600 configfiles/notrack ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/notrack ${DESTDIR}/etc/shorewall
echo "Notrack file installed as ${PREFIX}/etc/shorewall/notrack" echo "Notrack file installed as ${DESTDIR}/etc/shorewall/notrack"
fi fi
# #
# Install the Modules file # Install the Modules file
# #
run_install $OWNERSHIP -m 0600 modules ${PREFIX}/usr/share/shorewall run_install $OWNERSHIP -m 0600 modules ${DESTDIR}/usr/share/shorewall
echo "Modules file installed as ${PREFIX}/usr/share/shorewall/modules" echo "Modules file installed as ${DESTDIR}/usr/share/shorewall/modules"
# #
# Install the Module Helpers file # Install the Module Helpers file
# #
run_install $OWNERSHIP -m 0600 helpers ${PREFIX}/usr/share/shorewall run_install $OWNERSHIP -m 0600 helpers ${DESTDIR}/usr/share/shorewall
echo "Helper modules file installed as ${PREFIX}/usr/share/shorewall/helpers" echo "Helper modules file installed as ${DESTDIR}/usr/share/shorewall/helpers"
# #
# Install the TC Rules file # Install the TC Rules file
# #
run_install $OWNERSHIP -m 0644 configfiles/tcrules ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/tcrules ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/tcrules ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/tcrules ]; then
run_install $OWNERSHIP -m 0600 configfiles/tcrules ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/tcrules ${DESTDIR}/etc/shorewall
echo "TC Rules file installed as ${PREFIX}/etc/shorewall/tcrules" echo "TC Rules file installed as ${DESTDIR}/etc/shorewall/tcrules"
fi fi
# #
# Install the TC Interfaces file # Install the TC Interfaces file
# #
run_install $OWNERSHIP -m 0644 configfiles/tcinterfaces ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/tcinterfaces ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/tcinterfaces ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/tcinterfaces ]; then
run_install $OWNERSHIP -m 0600 configfiles/tcinterfaces ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/tcinterfaces ${DESTDIR}/etc/shorewall
echo "TC Interfaces file installed as ${PREFIX}/etc/shorewall/tcinterfaces" echo "TC Interfaces file installed as ${DESTDIR}/etc/shorewall/tcinterfaces"
fi fi
# #
# Install the TC Priority file # Install the TC Priority file
# #
run_install $OWNERSHIP -m 0644 configfiles/tcpri ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/tcpri ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/tcpri ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/tcpri ]; then
run_install $OWNERSHIP -m 0600 configfiles/tcpri ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/tcpri ${DESTDIR}/etc/shorewall
echo "TC Priority file installed as ${PREFIX}/etc/shorewall/tcpri" echo "TC Priority file installed as ${DESTDIR}/etc/shorewall/tcpri"
fi fi
# #
# Install the TOS file # Install the TOS file
# #
run_install $OWNERSHIP -m 0644 configfiles/tos ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/tos ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/tos ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/tos ]; then
run_install $OWNERSHIP -m 0600 configfiles/tos ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/tos ${DESTDIR}/etc/shorewall
echo "TOS file installed as ${PREFIX}/etc/shorewall/tos" echo "TOS file installed as ${DESTDIR}/etc/shorewall/tos"
fi fi
# #
# Install the Tunnels file # Install the Tunnels file
# #
run_install $OWNERSHIP -m 0644 configfiles/tunnels ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/tunnels ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/tunnels ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/tunnels ]; then
run_install $OWNERSHIP -m 0600 configfiles/tunnels ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/tunnels ${DESTDIR}/etc/shorewall
echo "Tunnels file installed as ${PREFIX}/etc/shorewall/tunnels" echo "Tunnels file installed as ${DESTDIR}/etc/shorewall/tunnels"
fi fi
# #
# Install the blacklist file # Install the blacklist file
# #
run_install $OWNERSHIP -m 0644 configfiles/blacklist ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/blacklist ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/blacklist ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/blacklist ]; then
run_install $OWNERSHIP -m 0600 configfiles/blacklist ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/blacklist ${DESTDIR}/etc/shorewall
echo "Blacklist file installed as ${PREFIX}/etc/shorewall/blacklist" echo "Blacklist file installed as ${DESTDIR}/etc/shorewall/blacklist"
fi fi
# #
# Install the findgw file # Install the findgw file
# #
run_install $OWNERSHIP -m 0644 configfiles/findgw ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/findgw ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/findgw ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/findgw ]; then
run_install $OWNERSHIP -m 0600 configfiles/findgw ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/findgw ${DESTDIR}/etc/shorewall
echo "Find GW file installed as ${PREFIX}/etc/shorewall/findgw" echo "Find GW file installed as ${DESTDIR}/etc/shorewall/findgw"
fi fi
# #
# Delete the Routes file # Delete the Routes file
# #
delete_file ${PREFIX}/etc/shorewall/routes delete_file ${DESTDIR}/etc/shorewall/routes
# #
# Delete the tcstart file # Delete the tcstart file
# #
delete_file ${PREFIX}/usr/share/shorewall/tcstart delete_file ${DESTDIR}/usr/share/shorewall/tcstart
# #
# Delete the Limits Files # Delete the Limits Files
# #
delete_file ${PREFIX}/usr/share/shorewall/action.Limit delete_file ${DESTDIR}/usr/share/shorewall/action.Limit
delete_file ${PREFIX}/usr/share/shorewall/Limit delete_file ${DESTDIR}/usr/share/shorewall/Limit
# #
# Delete the xmodules file # Delete the xmodules file
# #
delete_file ${PREFIX}/usr/share/shorewall/xmodules delete_file ${DESTDIR}/usr/share/shorewall/xmodules
# #
# Install the Providers file # Install the Providers file
# #
run_install $OWNERSHIP -m 0644 configfiles/providers ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/providers ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/providers ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/providers ]; then
run_install $OWNERSHIP -m 0600 configfiles/providers ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/providers ${DESTDIR}/etc/shorewall
echo "Providers file installed as ${PREFIX}/etc/shorewall/providers" echo "Providers file installed as ${DESTDIR}/etc/shorewall/providers"
fi fi
# #
# Install the Route Rules file # Install the Route Rules file
# #
run_install $OWNERSHIP -m 0644 configfiles/route_rules ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/route_rules ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/route_rules ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/route_rules ]; then
run_install $OWNERSHIP -m 0600 configfiles/route_rules ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/route_rules ${DESTDIR}/etc/shorewall
echo "Routing rules file installed as ${PREFIX}/etc/shorewall/route_rules" echo "Routing rules file installed as ${DESTDIR}/etc/shorewall/route_rules"
fi fi
# #
# Install the tcclasses file # Install the tcclasses file
# #
run_install $OWNERSHIP -m 0644 configfiles/tcclasses ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/tcclasses ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/tcclasses ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/tcclasses ]; then
run_install $OWNERSHIP -m 0600 configfiles/tcclasses ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/tcclasses ${DESTDIR}/etc/shorewall
echo "TC Classes file installed as ${PREFIX}/etc/shorewall/tcclasses" echo "TC Classes file installed as ${DESTDIR}/etc/shorewall/tcclasses"
fi fi
# #
# Install the tcdevices file # Install the tcdevices file
# #
run_install $OWNERSHIP -m 0644 configfiles/tcdevices ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/tcdevices ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/tcdevices ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/tcdevices ]; then
run_install $OWNERSHIP -m 0600 configfiles/tcdevices ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/tcdevices ${DESTDIR}/etc/shorewall
echo "TC Devices file installed as ${PREFIX}/etc/shorewall/tcdevices" echo "TC Devices file installed as ${DESTDIR}/etc/shorewall/tcdevices"
fi fi
# #
# Install the tcfilters file # Install the tcfilters file
# #
run_install $OWNERSHIP -m 0644 configfiles/tcfilters ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/tcfilters ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/tcfilters ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/tcfilters ]; then
run_install $OWNERSHIP -m 0600 configfiles/tcfilters ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/tcfilters ${DESTDIR}/etc/shorewall
echo "TC Filters file installed as ${PREFIX}/etc/shorewall/tcfilters" echo "TC Filters file installed as ${DESTDIR}/etc/shorewall/tcfilters"
fi fi
# #
# Install the default config path file # Install the default config path file
# #
install_file configpath ${PREFIX}/usr/share/shorewall/configpath 0644 install_file configpath ${DESTDIR}/usr/share/shorewall/configpath 0644
echo "Default config path file installed as ${PREFIX}/usr/share/shorewall/configpath" echo "Default config path file installed as ${DESTDIR}/usr/share/shorewall/configpath"
# #
# Install the init file # Install the init file
# #
run_install $OWNERSHIP -m 0644 configfiles/init ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/init ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/init ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/init ]; then
run_install $OWNERSHIP -m 0600 configfiles/init ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/init ${DESTDIR}/etc/shorewall
echo "Init file installed as ${PREFIX}/etc/shorewall/init" echo "Init file installed as ${DESTDIR}/etc/shorewall/init"
fi fi
# #
# Install the initdone file # Install the initdone file
# #
run_install $OWNERSHIP -m 0644 configfiles/initdone ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/initdone ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/initdone ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/initdone ]; then
run_install $OWNERSHIP -m 0600 configfiles/initdone ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/initdone ${DESTDIR}/etc/shorewall
echo "Initdone file installed as ${PREFIX}/etc/shorewall/initdone" echo "Initdone file installed as ${DESTDIR}/etc/shorewall/initdone"
fi fi
# #
# Install the start file # Install the start file
# #
run_install $OWNERSHIP -m 0644 configfiles/start ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/start ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/start ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/start ]; then
run_install $OWNERSHIP -m 0600 configfiles/start ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/start ${DESTDIR}/etc/shorewall
echo "Start file installed as ${PREFIX}/etc/shorewall/start" echo "Start file installed as ${DESTDIR}/etc/shorewall/start"
fi fi
# #
# Install the stop file # Install the stop file
# #
run_install $OWNERSHIP -m 0644 configfiles/stop ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/stop ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/stop ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/stop ]; then
run_install $OWNERSHIP -m 0600 configfiles/stop ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/stop ${DESTDIR}/etc/shorewall
echo "Stop file installed as ${PREFIX}/etc/shorewall/stop" echo "Stop file installed as ${DESTDIR}/etc/shorewall/stop"
fi fi
# #
# Install the stopped file # Install the stopped file
# #
run_install $OWNERSHIP -m 0644 configfiles/stopped ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/stopped ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/stopped ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/stopped ]; then
run_install $OWNERSHIP -m 0600 configfiles/stopped ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/stopped ${DESTDIR}/etc/shorewall
echo "Stopped file installed as ${PREFIX}/etc/shorewall/stopped" echo "Stopped file installed as ${DESTDIR}/etc/shorewall/stopped"
fi fi
# #
# Install the ECN file # Install the ECN file
# #
run_install $OWNERSHIP -m 0644 configfiles/ecn ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/ecn ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/ecn ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/ecn ]; then
run_install $OWNERSHIP -m 0600 configfiles/ecn ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/ecn ${DESTDIR}/etc/shorewall
echo "ECN file installed as ${PREFIX}/etc/shorewall/ecn" echo "ECN file installed as ${DESTDIR}/etc/shorewall/ecn"
fi fi
# #
# Install the Accounting file # Install the Accounting file
# #
run_install $OWNERSHIP -m 0644 configfiles/accounting ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/accounting ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/accounting ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/accounting ]; then
run_install $OWNERSHIP -m 0600 configfiles/accounting ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/accounting ${DESTDIR}/etc/shorewall
echo "Accounting file installed as ${PREFIX}/etc/shorewall/accounting" echo "Accounting file installed as ${DESTDIR}/etc/shorewall/accounting"
fi fi
# #
# Install the private library file # Install the private library file
# #
run_install $OWNERSHIP -m 0644 configfiles/lib.private ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/lib.private ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/lib.private ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/lib.private ]; then
run_install $OWNERSHIP -m 0600 configfiles/lib.private ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/lib.private ${DESTDIR}/etc/shorewall
echo "Private library file installed as ${PREFIX}/etc/shorewall/lib.private" echo "Private library file installed as ${DESTDIR}/etc/shorewall/lib.private"
fi fi
# #
# Install the Started file # Install the Started file
# #
run_install $OWNERSHIP -m 0644 configfiles/started ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/started ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/started ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/started ]; then
run_install $OWNERSHIP -m 0600 configfiles/started ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/started ${DESTDIR}/etc/shorewall
echo "Started file installed as ${PREFIX}/etc/shorewall/started" echo "Started file installed as ${DESTDIR}/etc/shorewall/started"
fi fi
# #
# Install the Restored file # Install the Restored file
# #
run_install $OWNERSHIP -m 0644 configfiles/restored ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/restored ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/restored ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/restored ]; then
run_install $OWNERSHIP -m 0600 configfiles/restored ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/restored ${DESTDIR}/etc/shorewall
echo "Restored file installed as ${PREFIX}/etc/shorewall/restored" echo "Restored file installed as ${DESTDIR}/etc/shorewall/restored"
fi fi
# #
# Install the Clear file # Install the Clear file
# #
run_install $OWNERSHIP -m 0644 configfiles/clear ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/clear ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/clear ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/clear ]; then
run_install $OWNERSHIP -m 0600 configfiles/clear ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/clear ${DESTDIR}/etc/shorewall
echo "Clear file installed as ${PREFIX}/etc/shorewall/clear" echo "Clear file installed as ${DESTDIR}/etc/shorewall/clear"
fi fi
# #
# Install the Isusable file # Install the Isusable file
# #
run_install $OWNERSHIP -m 0644 configfiles/isusable ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/isusable ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/isusable ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/isusable ]; then
run_install $OWNERSHIP -m 0600 configfiles/isusable ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/isusable ${DESTDIR}/etc/shorewall
echo "Isusable file installed as ${PREFIX}/etc/shorewall/isusable" echo "Isusable file installed as ${DESTDIR}/etc/shorewall/isusable"
fi fi
# #
# Install the Refresh file # Install the Refresh file
# #
run_install $OWNERSHIP -m 0644 configfiles/refresh ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/refresh ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/refresh ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/refresh ]; then
run_install $OWNERSHIP -m 0600 configfiles/refresh ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/refresh ${DESTDIR}/etc/shorewall
echo "Refresh file installed as ${PREFIX}/etc/shorewall/refresh" echo "Refresh file installed as ${DESTDIR}/etc/shorewall/refresh"
fi fi
# #
# Install the Refreshed file # Install the Refreshed file
# #
run_install $OWNERSHIP -m 0644 configfiles/refreshed ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/refreshed ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/refreshed ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/refreshed ]; then
run_install $OWNERSHIP -m 0600 configfiles/refreshed ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/refreshed ${DESTDIR}/etc/shorewall
echo "Refreshed file installed as ${PREFIX}/etc/shorewall/refreshed" echo "Refreshed file installed as ${DESTDIR}/etc/shorewall/refreshed"
fi fi
# #
# Install the Tcclear file # Install the Tcclear file
# #
run_install $OWNERSHIP -m 0644 configfiles/tcclear ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/tcclear ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/tcclear ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/tcclear ]; then
run_install $OWNERSHIP -m 0600 configfiles/tcclear ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 configfiles/tcclear ${DESTDIR}/etc/shorewall
echo "Tcclear file installed as ${PREFIX}/etc/shorewall/tcclear" echo "Tcclear file installed as ${DESTDIR}/etc/shorewall/tcclear"
fi fi
# #
# Install the Standard Actions file # Install the Standard Actions file
# #
install_file actions.std ${PREFIX}/usr/share/shorewall/actions.std 0644 install_file actions.std ${DESTDIR}/usr/share/shorewall/actions.std 0644
echo "Standard actions file installed as ${PREFIX}/usr/shared/shorewall/actions.std" echo "Standard actions file installed as ${DESTDIR}/usr/shared/shorewall/actions.std"
# #
# Install the Actions file # Install the Actions file
# #
run_install $OWNERSHIP -m 0644 configfiles/actions ${PREFIX}/usr/share/shorewall/configfiles run_install $OWNERSHIP -m 0644 configfiles/actions ${DESTDIR}/usr/share/shorewall/configfiles
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/actions ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/actions ]; then
run_install $OWNERSHIP -m 0644 configfiles/actions ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0644 configfiles/actions ${DESTDIR}/etc/shorewall
echo "Actions file installed as ${PREFIX}/etc/shorewall/actions" echo "Actions file installed as ${DESTDIR}/etc/shorewall/actions"
fi fi
# #
# Install the Makefiles # Install the Makefiles
# #
install-file Makefile-lite ${PREFIX}/usr/share/shorewall/configfiles/Makefile 0644 install-file Makefile-lite ${DESTDIR}/usr/share/shorewall/configfiles/Makefile 0644
if [ -z "$SPARSE" ]; then if [ -z "$SPARSE" ]; then
run_install $OWNERSHIP -m 0600 Makefile ${PREFIX}/etc/shorewall run_install $OWNERSHIP -m 0600 Makefile ${DESTDIR}/etc/shorewall
echo "Makefile installed as ${PREFIX}/etc/shorewall/Makefile" echo "Makefile installed as ${DESTDIR}/etc/shorewall/Makefile"
fi fi
# #
# Install the Action files # Install the Action files
# #
for f in action.* ; do for f in action.* ; do
install_file $f ${PREFIX}/usr/share/shorewall/$f 0644 install_file $f ${DESTDIR}/usr/share/shorewall/$f 0644
echo "Action ${f#*.} file installed as ${PREFIX}/usr/share/shorewall/$f" echo "Action ${f#*.} file installed as ${DESTDIR}/usr/share/shorewall/$f"
done done
# Install the Macro files # Install the Macro files
@ -767,8 +769,8 @@ done
cd Macros cd Macros
for f in macro.* ; do for f in macro.* ; do
install_file $f ${PREFIX}/usr/share/shorewall/$f 0644 install_file $f ${DESTDIR}/usr/share/shorewall/$f 0644
echo "Macro ${f#*.} file installed as ${PREFIX}/usr/share/shorewall/$f" echo "Macro ${f#*.} file installed as ${DESTDIR}/usr/share/shorewall/$f"
done done
cd .. cd ..
@ -777,54 +779,54 @@ cd ..
# #
for f in lib.* ; do for f in lib.* ; do
if [ -f $f ]; then if [ -f $f ]; then
install_file $f ${PREFIX}/usr/share/shorewall/$f 0644 install_file $f ${DESTDIR}/usr/share/shorewall/$f 0644
echo "Library ${f#*.} file installed as ${PREFIX}/usr/share/shorewall/$f" echo "Library ${f#*.} file installed as ${DESTDIR}/usr/share/shorewall/$f"
fi fi
done done
# #
# Symbolically link 'functions' to lib.base # Symbolically link 'functions' to lib.base
# #
ln -sf lib.base ${PREFIX}/usr/share/shorewall/functions ln -sf lib.base ${DESTDIR}/usr/share/shorewall/functions
# #
# /usr/share/shorewall/Shorewall if needed # /usr/share/shorewall/Shorewall if needed
# #
mkdir -p ${PREFIX}/usr/share/shorewall/Shorewall mkdir -p ${DESTDIR}/usr/share/shorewall/Shorewall
chmod 755 ${PREFIX}/usr/share/shorewall/Shorewall chmod 755 ${DESTDIR}/usr/share/shorewall/Shorewall
# #
# Install the Compiler # Install the Compiler
# #
cd Perl cd Perl
install_file compiler.pl ${PREFIX}/usr/share/shorewall/compiler.pl 0755 install_file compiler.pl ${DESTDIR}/usr/share/shorewall/compiler.pl 0755
echo echo
echo "Compiler installed in ${PREFIX}/usr/share/shorewall/compiler.pl" echo "Compiler installed in ${DESTDIR}/usr/share/shorewall/compiler.pl"
# #
# Install the libraries # Install the libraries
# #
for f in Shorewall/*.pm ; do for f in Shorewall/*.pm ; do
install_file $f ${PREFIX}/usr/share/shorewall/$f 0644 install_file $f ${DESTDIR}/usr/share/shorewall/$f 0644
echo "Module ${f%.*} installed as ${PREFIX}/usr/share/shorewall/$f" echo "Module ${f%.*} installed as ${DESTDIR}/usr/share/shorewall/$f"
done done
# #
# Install the program skeleton files # Install the program skeleton files
# #
for f in prog.* ; do for f in prog.* ; do
install_file $f ${PREFIX}/usr/share/shorewall/$f 0644 install_file $f ${DESTDIR}/usr/share/shorewall/$f 0644
echo "Program skeleton file ${f#*.} installed as ${PREFIX}/usr/share/shorewall/$f" echo "Program skeleton file ${f#*.} installed as ${DESTDIR}/usr/share/shorewall/$f"
done done
cd .. cd ..
# #
# Create the version file # Create the version file
# #
echo "$VERSION" > ${PREFIX}/usr/share/shorewall/version echo "$VERSION" > ${DESTDIR}/usr/share/shorewall/version
chmod 644 ${PREFIX}/usr/share/shorewall/version chmod 644 ${DESTDIR}/usr/share/shorewall/version
# #
# Remove and create the symbolic link to the init script # Remove and create the symbolic link to the init script
# #
if [ -z "$PREFIX" ]; then if [ -z "$DESTDIR" ]; then
rm -f /usr/share/shorewall/init rm -f /usr/share/shorewall/init
ln -s ${DEST}/${INIT} /usr/share/shorewall/init ln -s ${DEST}/${INIT} /usr/share/shorewall/init
fi fi
@ -837,18 +839,18 @@ if [ -d manpages ]; then
cd manpages cd manpages
[ -n "$INSTALLD" ] || mkdir -p ${PREFIX}${MANDIR}/man5/ ${PREFIX}${MANDIR}/man8/ [ -n "$INSTALLD" ] || mkdir -p ${DESTDIR}${MANDIR}/man5/ ${DESTDIR}${MANDIR}/man8/
for f in *.5; do for f in *.5; do
gzip -c $f > $f.gz gzip -c $f > $f.gz
run_install $INSTALLD -m 0644 $f.gz ${PREFIX}${MANDIR}/man5/$f.gz run_install $INSTALLD -m 0644 $f.gz ${DESTDIR}${MANDIR}/man5/$f.gz
echo "Man page $f.gz installed to ${PREFIX}${MANDIR}/man5/$f.gz" echo "Man page $f.gz installed to ${DESTDIR}${MANDIR}/man5/$f.gz"
done done
for f in *.8; do for f in *.8; do
gzip -c $f > $f.gz gzip -c $f > $f.gz
run_install $INSTALLD -m 0644 $f.gz ${PREFIX}${MANDIR}/man8/$f.gz run_install $INSTALLD -m 0644 $f.gz ${DESTDIR}${MANDIR}/man8/$f.gz
echo "Man page $f.gz installed to ${PREFIX}${MANDIR}/man8/$f.gz" echo "Man page $f.gz installed to ${DESTDIR}${MANDIR}/man8/$f.gz"
done done
cd .. cd ..
@ -857,17 +859,17 @@ if [ -d manpages ]; then
fi fi
if [ -d ${PREFIX}/etc/logrotate.d ]; then if [ -d ${DESTDIR}/etc/logrotate.d ]; then
install_file logrotate ${PREFIX}/etc/logrotate.d/shorewall 0644 install_file logrotate ${DESTDIR}/etc/logrotate.d/shorewall 0644
echo "Logrotate file installed as ${PREFIX}/etc/logrotate.d/shorewall" echo "Logrotate file installed as ${DESTDIR}/etc/logrotate.d/shorewall"
fi fi
if [ -z "$PREFIX" ]; then if [ -z "$DESTDIR" ]; then
rm -rf /usr/share/shorewall-perl rm -rf /usr/share/shorewall-perl
rm -rf /usr/share/shorewall-shell rm -rf /usr/share/shorewall-shell
fi fi
if [ -z "$PREFIX" -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 [ -n "$DEBIAN" ]; then
install_file default.debian /etc/default/shorewall 0644 install_file default.debian /etc/default/shorewall 0644
ln -s ../init.d/shorewall /etc/rcS.d/S40shorewall ln -s ../init.d/shorewall /etc/rcS.d/S40shorewall

View File

@ -85,6 +85,8 @@ install_file() # $1 = source $2 = target $3 = mode
run_install $T $OWNERSHIP -m $3 $1 ${2} run_install $T $OWNERSHIP -m $3 $1 ${2}
} }
[ -n "$DESTDIR" ] || DESTDIR="$PREFIX"
# #
# Parse the run line # Parse the run line
# #
@ -134,7 +136,7 @@ T='-T'
case $(uname) in case $(uname) in
CYGWIN*) CYGWIN*)
if [ -z "$PREFIX" ]; then if [ -z "$DESTDIR" ]; then
DEST= DEST=
INIT= INIT=
fi fi
@ -154,14 +156,14 @@ esac
OWNERSHIP="-o $OWNER -g $GROUP" OWNERSHIP="-o $OWNER -g $GROUP"
if [ -n "$PREFIX" ]; 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."
OWNERSHIP="" OWNERSHIP=""
fi fi
install -d $OWNERSHIP -m 755 ${PREFIX}/sbin install -d $OWNERSHIP -m 755 ${DESTDIR}/sbin
install -d $OWNERSHIP -m 755 ${PREFIX}${DEST} install -d $OWNERSHIP -m 755 ${DESTDIR}${DEST}
elif [ -d /etc/apt -a -e /usr/bin/dpkg ]; then elif [ -d /etc/apt -a -e /usr/bin/dpkg ]; then
DEBIAN=yes DEBIAN=yes
elif [ -f /etc/slackware-version ] ; then elif [ -f /etc/slackware-version ] ; then
@ -183,123 +185,123 @@ echo "Installing Shorewall6 Lite Version $VERSION"
# #
# Check for /etc/shorewall6-lite # Check for /etc/shorewall6-lite
# #
if [ -z "$PREFIX" -a -d /etc/shorewall6-lite ]; then if [ -z "$DESTDIR" -a -d /etc/shorewall6-lite ]; then
[ -f /etc/shorewall6-lite/shorewall.conf ] && \ [ -f /etc/shorewall6-lite/shorewall.conf ] && \
mv -f /etc/shorewall6-lite/shorewall.conf /etc/shorewall6-lite/shorewall6-lite.conf mv -f /etc/shorewall6-lite/shorewall.conf /etc/shorewall6-lite/shorewall6-lite.conf
else else
rm -rf ${PREFIX}/etc/shorewall6-lite rm -rf ${DESTDIR}/etc/shorewall6-lite
rm -rf ${PREFIX}/usr/share/shorewall6-lite rm -rf ${DESTDIR}/usr/share/shorewall6-lite
rm -rf ${PREFIX}/var/lib/shorewall6-lite rm -rf ${DESTDIR}/var/lib/shorewall6-lite
fi fi
# #
# Check for /sbin/shorewall6-lite # Check for /sbin/shorewall6-lite
# #
if [ -f ${PREFIX}/sbin/shorewall6-lite ]; then if [ -f ${DESTDIR}/sbin/shorewall6-lite ]; then
first_install="" first_install=""
else else
first_install="Yes" first_install="Yes"
fi fi
delete_file ${PREFIX}/usr/share/shorewall6-lite/xmodules delete_file ${DESTDIR}/usr/share/shorewall6-lite/xmodules
install_file shorewall6-lite ${PREFIX}/sbin/shorewall6-lite 0544 install_file shorewall6-lite ${DESTDIR}/sbin/shorewall6-lite 0544
echo "Shorewall6 Lite control program installed in ${PREFIX}/sbin/shorewall6-lite" echo "Shorewall6 Lite control program installed in ${DESTDIR}/sbin/shorewall6-lite"
# #
# Install the Firewall Script # Install the Firewall Script
# #
if [ -n "$DEBIAN" ]; then if [ -n "$DEBIAN" ]; then
install_file init.debian.sh ${PREFIX}/etc/init.d/shorewall6-lite 0544 install_file init.debian.sh ${DESTDIR}/etc/init.d/shorewall6-lite 0544
elif [ -n "$ARCHLINUX" ]; then elif [ -n "$ARCHLINUX" ]; then
install_file init.archlinux.sh ${PREFIX}${DEST}/$INIT 0544 install_file init.archlinux.sh ${DESTDIR}${DEST}/$INIT 0544
else else
install_file init.sh ${PREFIX}${DEST}/$INIT 0544 install_file init.sh ${DESTDIR}${DEST}/$INIT 0544
fi fi
echo "Shorewall6 Lite script installed in ${PREFIX}${DEST}/$INIT" echo "Shorewall6 Lite script installed in ${DESTDIR}${DEST}/$INIT"
# #
# Create /etc/shorewall6-lite, /usr/share/shorewall6-lite and /var/lib/shorewall6-lite if needed # Create /etc/shorewall6-lite, /usr/share/shorewall6-lite and /var/lib/shorewall6-lite if needed
# #
mkdir -p ${PREFIX}/etc/shorewall6-lite mkdir -p ${DESTDIR}/etc/shorewall6-lite
mkdir -p ${PREFIX}/usr/share/shorewall6-lite mkdir -p ${DESTDIR}/usr/share/shorewall6-lite
mkdir -p ${PREFIX}/var/lib/shorewall6-lite mkdir -p ${DESTDIR}/var/lib/shorewall6-lite
chmod 755 ${PREFIX}/etc/shorewall6-lite chmod 755 ${DESTDIR}/etc/shorewall6-lite
chmod 755 ${PREFIX}/usr/share/shorewall6-lite chmod 755 ${DESTDIR}/usr/share/shorewall6-lite
if [ -n "$PREFIX" ]; then if [ -n "$DESTDIR" ]; then
mkdir -p ${PREFIX}/etc/logrotate.d mkdir -p ${DESTDIR}/etc/logrotate.d
chmod 755 ${PREFIX}/etc/logrotate.d chmod 755 ${DESTDIR}/etc/logrotate.d
fi fi
# #
# Install the config file # Install the config file
# #
if [ ! -f ${PREFIX}/etc/shorewall6-lite/shorewall6-lite.conf ]; then if [ ! -f ${DESTDIR}/etc/shorewall6-lite/shorewall6-lite.conf ]; then
install_file shorewall6-lite.conf ${PREFIX}/etc/shorewall6-lite/shorewall6-lite.conf 0744 install_file shorewall6-lite.conf ${DESTDIR}/etc/shorewall6-lite/shorewall6-lite.conf 0744
echo "Config file installed as ${PREFIX}/etc/shorewall6-lite/shorewall6-lite.conf" echo "Config file installed as ${DESTDIR}/etc/shorewall6-lite/shorewall6-lite.conf"
fi fi
if [ -n "$ARCHLINUX" ] ; then if [ -n "$ARCHLINUX" ] ; then
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${PREFIX}/etc/shorewall6-lite/shorewall.conf sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}/etc/shorewall6-lite/shorewall.conf
fi fi
# #
# Install the Makefile # Install the Makefile
# #
run_install $OWNERSHIP -m 0600 Makefile ${PREFIX}/etc/shorewall6-lite run_install $OWNERSHIP -m 0600 Makefile ${DESTDIR}/etc/shorewall6-lite
echo "Makefile installed as ${PREFIX}/etc/shorewall6-lite/Makefile" echo "Makefile installed as ${DESTDIR}/etc/shorewall6-lite/Makefile"
# #
# Install the default config path file # Install the default config path file
# #
install_file configpath ${PREFIX}/usr/share/shorewall6-lite/configpath 0644 install_file configpath ${DESTDIR}/usr/share/shorewall6-lite/configpath 0644
echo "Default config path file installed as ${PREFIX}/usr/share/shorewall6-lite/configpath" echo "Default config path file installed as ${DESTDIR}/usr/share/shorewall6-lite/configpath"
# #
# Install the libraries # Install the libraries
# #
for f in lib.* ; do for f in lib.* ; do
if [ -f $f ]; then if [ -f $f ]; then
install_file $f ${PREFIX}/usr/share/shorewall6-lite/$f 0644 install_file $f ${DESTDIR}/usr/share/shorewall6-lite/$f 0644
echo "Library ${f#*.} file installed as ${PREFIX}/usr/share/shorewall6-lite/$f" echo "Library ${f#*.} file installed as ${DESTDIR}/usr/share/shorewall6-lite/$f"
fi fi
done done
ln -sf lib.base ${PREFIX}/usr/share/shorewall6-lite/functions ln -sf lib.base ${DESTDIR}/usr/share/shorewall6-lite/functions
echo "Common functions linked through ${PREFIX}/usr/share/shorewall6-lite/functions" echo "Common functions linked through ${DESTDIR}/usr/share/shorewall6-lite/functions"
# #
# Install Shorecap # Install Shorecap
# #
install_file shorecap ${PREFIX}/usr/share/shorewall6-lite/shorecap 0755 install_file shorecap ${DESTDIR}/usr/share/shorewall6-lite/shorecap 0755
echo echo
echo "Capability file builder installed in ${PREFIX}/usr/share/shorewall6-lite/shorecap" echo "Capability file builder installed in ${DESTDIR}/usr/share/shorewall6-lite/shorecap"
# #
# Install wait4ifup # Install wait4ifup
# #
if [ -f wait4ifup ]; then if [ -f wait4ifup ]; then
install_file wait4ifup ${PREFIX}/usr/share/shorewall6-lite/wait4ifup 0755 install_file wait4ifup ${DESTDIR}/usr/share/shorewall6-lite/wait4ifup 0755
echo echo
echo "wait4ifup installed in ${PREFIX}/usr/share/shorewall6-lite/wait4ifup" echo "wait4ifup installed in ${DESTDIR}/usr/share/shorewall6-lite/wait4ifup"
fi fi
if [ -f modules ]; then if [ -f modules ]; then
# #
# Install the Modules file # Install the Modules file
# #
run_install $OWNERSHIP -m 0600 modules ${PREFIX}/usr/share/shorewall6-lite run_install $OWNERSHIP -m 0600 modules ${DESTDIR}/usr/share/shorewall6-lite
echo "Modules file installed as ${PREFIX}/usr/share/shorewall6-lite/modules" echo "Modules file installed as ${DESTDIR}/usr/share/shorewall6-lite/modules"
fi fi
if [ -d manpages ]; then if [ -d manpages ]; then
@ -309,18 +311,18 @@ if [ -d manpages ]; then
cd manpages cd manpages
[ -n "$INSTALLD" ] || mkdir -p ${PREFIX}/usr/share/man/man5/ ${PREFIX}/usr/share/man/man8/ [ -n "$INSTALLD" ] || mkdir -p ${DESTDIR}/usr/share/man/man5/ ${DESTDIR}/usr/share/man/man8/
for f in *.5; do for f in *.5; do
gzip -c $f > $f.gz gzip -c $f > $f.gz
run_install $INSTALLD -m 644 $f.gz ${PREFIX}/usr/share/man/man5/$f.gz run_install $INSTALLD -m 644 $f.gz ${DESTDIR}/usr/share/man/man5/$f.gz
echo "Man page $f.gz installed to ${PREFIX}/usr/share/man/man5/$f.gz" echo "Man page $f.gz installed to ${DESTDIR}/usr/share/man/man5/$f.gz"
done done
for f in *.8; do for f in *.8; do
gzip -c $f > $f.gz gzip -c $f > $f.gz
run_install $INSTALLD -m 644 $f.gz ${PREFIX}/usr/share/man/man8/$f.gz run_install $INSTALLD -m 644 $f.gz ${DESTDIR}/usr/share/man/man8/$f.gz
echo "Man page $f.gz installed to ${PREFIX}/usr/share/man/man8/$f.gz" echo "Man page $f.gz installed to ${DESTDIR}/usr/share/man/man8/$f.gz"
done done
cd .. cd ..
@ -328,26 +330,26 @@ if [ -d manpages ]; then
echo "Man Pages Installed" echo "Man Pages Installed"
fi fi
if [ -d ${PREFIX}/etc/logrotate.d ]; then if [ -d ${DESTDIR}/etc/logrotate.d ]; then
run_install $OWNERSHIP -m 0644 logrotate ${PREFIX}/etc/logrotate.d/shorewall6-lite run_install $OWNERSHIP -m 0644 logrotate ${DESTDIR}/etc/logrotate.d/shorewall6-lite
echo "Logrotate file installed as ${PREFIX}/etc/logrotate.d/shorewall6-lite" echo "Logrotate file installed as ${DESTDIR}/etc/logrotate.d/shorewall6-lite"
fi fi
# #
# Create the version file # Create the version file
# #
echo "$VERSION" > ${PREFIX}/usr/share/shorewall6-lite/version echo "$VERSION" > ${DESTDIR}/usr/share/shorewall6-lite/version
chmod 644 ${PREFIX}/usr/share/shorewall6-lite/version chmod 644 ${DESTDIR}/usr/share/shorewall6-lite/version
# #
# Remove and create the symbolic link to the init script # Remove and create the symbolic link to the init script
# #
if [ -z "$PREFIX" ]; then if [ -z "$DESTDIR" ]; then
rm -f /usr/share/shorewall6-lite/init rm -f /usr/share/shorewall6-lite/init
ln -s ${DEST}/${INIT} /usr/share/shorewall6-lite/init ln -s ${DEST}/${INIT} /usr/share/shorewall6-lite/init
fi fi
if [ -z "$PREFIX" ]; then if [ -z "$DESTDIR" ]; then
touch /var/log/shorewall6-lite-init.log touch /var/log/shorewall6-lite-init.log
if [ -n "$first_install" ]; then if [ -n "$first_install" ]; then

View File

@ -85,6 +85,8 @@ install_file() # $1 = source $2 = target $3 = mode
run_install $OWNERSHIP -m $3 $1 ${2} run_install $OWNERSHIP -m $3 $1 ${2}
} }
[ -n "$DESTDIR" ] || DESTDIR="$PREFIX"
# #
# Parse the run line # Parse the run line
# #
@ -116,7 +118,7 @@ INSTALLD='-D'
case $(uname) in case $(uname) in
CYGWIN*) CYGWIN*)
if [ -z "$PREFIX" ]; then if [ -z "$DESTDIR" ]; then
DEST= DEST=
INIT= INIT=
fi fi
@ -127,7 +129,7 @@ case $(uname) in
SPARSE=Yes SPARSE=Yes
;; ;;
Darwin) Darwin)
if [ -z "$PREFIX" ]; then if [ -z "$DESTDIR" ]; then
DEST= DEST=
INIT= INIT=
SPARSE=Yes SPARSE=Yes
@ -172,7 +174,7 @@ 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 [ -n "$PREFIX" ]; then if [ -n "$DESTDIR" ]; then
if [ -z "$CYGWIN" ]; then if [ -z "$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."
@ -180,8 +182,8 @@ if [ -n "$PREFIX" ]; then
fi fi
fi fi
install -d $OWNERSHIP -m 755 ${PREFIX}/sbin install -d $OWNERSHIP -m 755 ${DESTDIR}/sbin
install -d $OWNERSHIP -m 755 ${PREFIX}${DEST} install -d $OWNERSHIP -m 755 ${DESTDIR}${DEST}
CYGWIN= CYGWIN=
MAC= MAC=
@ -221,18 +223,18 @@ echo "Installing Shorewall6 Version $VERSION"
# #
# Check for /sbin/shorewall6 # Check for /sbin/shorewall6
# #
if [ -f ${PREFIX}/sbin/shorewall6 ]; then if [ -f ${DESTDIR}/sbin/shorewall6 ]; then
first_install="" first_install=""
else else
first_install="Yes" first_install="Yes"
fi fi
if [ -z "$CYGWIN" ]; then if [ -z "$CYGWIN" ]; then
install_file shorewall6 ${PREFIX}/sbin/shorewall6 0755 ${PREFIX}/var/lib/shorewall6-${VERSION}.bkout install_file shorewall6 ${DESTDIR}/sbin/shorewall6 0755 ${DESTDIR}/var/lib/shorewall6-${VERSION}.bkout
echo "shorewall6 control program installed in ${PREFIX}/sbin/shorewall6" echo "shorewall6 control program installed in ${DESTDIR}/sbin/shorewall6"
else else
install_file shorewall6 ${PREFIX}/bin/shorewall6 0755 ${PREFIX}/var/lib/shorewall6-${VERSION}.bkout install_file shorewall6 ${DESTDIR}/bin/shorewall6 0755 ${DESTDIR}/var/lib/shorewall6-${VERSION}.bkout
echo "shorewall6 control program installed in ${PREFIX}/bin/shorewall6" echo "shorewall6 control program installed in ${DESTDIR}/bin/shorewall6"
fi fi
@ -240,451 +242,451 @@ fi
# Install the Firewall Script # Install the Firewall Script
# #
if [ -n "$DEBIAN" ]; then if [ -n "$DEBIAN" ]; then
install_file init.debian.sh /etc/init.d/shorewall6 0544 ${PREFIX}/usr/share/shorewall6-${VERSION}.bkout install_file init.debian.sh /etc/init.d/shorewall6 0544 ${DESTDIR}/usr/share/shorewall6-${VERSION}.bkout
elif [ -n "$SLACKWARE" ]; then elif [ -n "$SLACKWARE" ]; then
install_file init.slackware.shorewall6.sh ${PREFIX}${DEST}/rc.shorewall6 0544 ${PREFIX}/usr/share/shorewall6-${VERSION}.bkout install_file init.slackware.shorewall6.sh ${DESTDIR}${DEST}/rc.shorewall6 0544 ${DESTDIR}/usr/share/shorewall6-${VERSION}.bkout
elif [ -n "$ARCHLINUX" ]; then elif [ -n "$ARCHLINUX" ]; then
install_file init.archlinux.sh ${PREFIX}${DEST}/$INIT 0544 ${PREFIX}/usr/share/shorewall6-${VERSION}.bkout install_file init.archlinux.sh ${DESTDIR}${DEST}/$INIT 0544 ${DESTDIR}/usr/share/shorewall6-${VERSION}.bkout
elif [ -n "$INIT" ]; then elif [ -n "$INIT" ]; then
install_file init.sh ${PREFIX}${DEST}/$INIT 0544 ${PREFIX}/usr/share/shorewall6-${VERSION}.bkout install_file init.sh ${DESTDIR}${DEST}/$INIT 0544 ${DESTDIR}/usr/share/shorewall6-${VERSION}.bkout
fi fi
[ -n "$INIT" ] && echo "Shorewall6 script installed in ${PREFIX}${DEST}/$INIT" [ -n "$INIT" ] && echo "Shorewall6 script installed in ${DESTDIR}${DEST}/$INIT"
# #
# Create /etc/shorewall, /usr/share/shorewall and /var/shorewall if needed # Create /etc/shorewall, /usr/share/shorewall and /var/shorewall if needed
# #
mkdir -p ${PREFIX}/etc/shorewall6 mkdir -p ${DESTDIR}/etc/shorewall6
mkdir -p ${PREFIX}/usr/share/shorewall6 mkdir -p ${DESTDIR}/usr/share/shorewall6
mkdir -p ${PREFIX}/usr/share/shorewall6/configfiles mkdir -p ${DESTDIR}/usr/share/shorewall6/configfiles
mkdir -p ${PREFIX}/var/lib/shorewall6 mkdir -p ${DESTDIR}/var/lib/shorewall6
chmod 755 ${PREFIX}/etc/shorewall6 chmod 755 ${DESTDIR}/etc/shorewall6
chmod 755 ${PREFIX}/usr/share/shorewall6 chmod 755 ${DESTDIR}/usr/share/shorewall6
chmod 755 ${PREFIX}/usr/share/shorewall6/configfiles chmod 755 ${DESTDIR}/usr/share/shorewall6/configfiles
if [ -n "$PREFIX" ]; then if [ -n "$DESTDIR" ]; then
mkdir -p ${PREFIX}/etc/logrotate.d mkdir -p ${DESTDIR}/etc/logrotate.d
chmod 755 ${PREFIX}/etc/logrotate.d chmod 755 ${DESTDIR}/etc/logrotate.d
fi fi
# #
# Install the config file # Install the config file
# #
run_install $OWNERSHIP -m 0644 shorewall6.conf ${PREFIX}/usr/share/shorewall6/configfiles/shorewall6.conf run_install $OWNERSHIP -m 0644 shorewall6.conf ${DESTDIR}/usr/share/shorewall6/configfiles/shorewall6.conf
perl -p -w -i -e 's|^CONFIG_PATH=.*|CONFIG_PATH=/usr/share/shorewall6/configfiles:/usr/share/shorewall6|;' ${PREFIX}/usr/share/shorewall6/configfiles/shorewall6.conf perl -p -w -i -e 's|^CONFIG_PATH=.*|CONFIG_PATH=/usr/share/shorewall6/configfiles:/usr/share/shorewall6|;' ${DESTDIR}/usr/share/shorewall6/configfiles/shorewall6.conf
perl -p -w -i -e 's|^STARTUP_LOG=.*|STARTUP_LOG=/var/log/shorewall6-lite-init.log|;' ${PREFIX}/usr/share/shorewall6/configfiles/shorewall6.conf perl -p -w -i -e 's|^STARTUP_LOG=.*|STARTUP_LOG=/var/log/shorewall6-lite-init.log|;' ${DESTDIR}/usr/share/shorewall6/configfiles/shorewall6.conf
if [ ! -f ${PREFIX}/etc/shorewall6/shorewall6.conf ]; then if [ ! -f ${DESTDIR}/etc/shorewall6/shorewall6.conf ]; then
run_install $OWNERSHIP -m 0644 shorewall6.conf ${PREFIX}/etc/shorewall6/shorewall6.conf run_install $OWNERSHIP -m 0644 shorewall6.conf ${DESTDIR}/etc/shorewall6/shorewall6.conf
if [ -n "$DEBIAN" ] && mywhich perl; then if [ -n "$DEBIAN" ] && mywhich perl; then
# #
# Make a Debian-like shorewall6.conf # Make a Debian-like shorewall6.conf
# #
perl -p -w -i -e 's|^STARTUP_ENABLED=.*|STARTUP_ENABLED=Yes|;' ${PREFIX}/etc/shorewall6/shorewall6.conf perl -p -w -i -e 's|^STARTUP_ENABLED=.*|STARTUP_ENABLED=Yes|;' ${DESTDIR}/etc/shorewall6/shorewall6.conf
fi fi
echo "Config file installed as ${PREFIX}/etc/shorewall6/shorewall6.conf" echo "Config file installed as ${DESTDIR}/etc/shorewall6/shorewall6.conf"
fi fi
if [ -n "$ARCHLINUX" ] ; then if [ -n "$ARCHLINUX" ] ; then
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${PREFIX}/etc/shorewall6/shorewall6.conf sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}/etc/shorewall6/shorewall6.conf
fi fi
# #
# Install the zones file # Install the zones file
# #
run_install $OWNERSHIP -m 0644 zones ${PREFIX}/usr/share/shorewall6/configfiles/zones run_install $OWNERSHIP -m 0644 zones ${DESTDIR}/usr/share/shorewall6/configfiles/zones
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/zones ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/zones ]; then
run_install $OWNERSHIP -m 0744 zones ${PREFIX}/etc/shorewall6/zones run_install $OWNERSHIP -m 0744 zones ${DESTDIR}/etc/shorewall6/zones
echo "Zones file installed as ${PREFIX}/etc/shorewall6/zones" echo "Zones file installed as ${DESTDIR}/etc/shorewall6/zones"
fi fi
delete_file ${PREFIX}/usr/share/shorewall6/compiler delete_file ${DESTDIR}/usr/share/shorewall6/compiler
delete_file ${PREFIX}/usr/share/shorewall6/lib.accounting delete_file ${DESTDIR}/usr/share/shorewall6/lib.accounting
delete_file ${PREFIX}/usr/share/shorewall6/lib.actions delete_file ${DESTDIR}/usr/share/shorewall6/lib.actions
delete_file ${PREFIX}/usr/share/shorewall6/lib.dynamiczones delete_file ${DESTDIR}/usr/share/shorewall6/lib.dynamiczones
delete_file ${PREFIX}/usr/share/shorewall6/lib.maclist delete_file ${DESTDIR}/usr/share/shorewall6/lib.maclist
delete_file ${PREFIX}/usr/share/shorewall6/lib.nat delete_file ${DESTDIR}/usr/share/shorewall6/lib.nat
delete_file ${PREFIX}/usr/share/shorewall6/lib.providers delete_file ${DESTDIR}/usr/share/shorewall6/lib.providers
delete_file ${PREFIX}/usr/share/shorewall6/lib.proxyarp delete_file ${DESTDIR}/usr/share/shorewall6/lib.proxyarp
delete_file ${PREFIX}/usr/share/shorewall6/lib.tc delete_file ${DESTDIR}/usr/share/shorewall6/lib.tc
delete_file ${PREFIX}/usr/share/shorewall6/lib.tcrules delete_file ${DESTDIR}/usr/share/shorewall6/lib.tcrules
delete_file ${PREFIX}/usr/share/shorewall6/lib.tunnels delete_file ${DESTDIR}/usr/share/shorewall6/lib.tunnels
delete_file ${PREFIX}/usr/share/shorewall6/prog.header delete_file ${DESTDIR}/usr/share/shorewall6/prog.header
delete_file ${PREFIX}/usr/share/shorewall6/prog.footer delete_file ${DESTDIR}/usr/share/shorewall6/prog.footer
# #
# Install wait4ifup # Install wait4ifup
# #
install_file wait4ifup ${PREFIX}/usr/share/shorewall6/wait4ifup 0755 install_file wait4ifup ${DESTDIR}/usr/share/shorewall6/wait4ifup 0755
echo echo
echo "wait4ifup installed in ${PREFIX}/usr/share/shorewall6/wait4ifup" echo "wait4ifup installed in ${DESTDIR}/usr/share/shorewall6/wait4ifup"
# #
# Install the policy file # Install the policy file
# #
run_install $OWNERSHIP -m 0644 policy ${PREFIX}/usr/share/shorewall6/configfiles/policy run_install $OWNERSHIP -m 0644 policy ${DESTDIR}/usr/share/shorewall6/configfiles/policy
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/policy ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/policy ]; then
run_install $OWNERSHIP -m 0600 policy ${PREFIX}/etc/shorewall6/policy run_install $OWNERSHIP -m 0600 policy ${DESTDIR}/etc/shorewall6/policy
echo "Policy file installed as ${PREFIX}/etc/shorewall6/policy" echo "Policy file installed as ${DESTDIR}/etc/shorewall6/policy"
fi fi
# #
# Install the interfaces file # Install the interfaces file
# #
run_install $OWNERSHIP -m 0644 interfaces ${PREFIX}/usr/share/shorewall6/configfiles/interfaces run_install $OWNERSHIP -m 0644 interfaces ${DESTDIR}/usr/share/shorewall6/configfiles/interfaces
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/interfaces ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/interfaces ]; then
run_install $OWNERSHIP -m 0600 interfaces ${PREFIX}/etc/shorewall6/interfaces run_install $OWNERSHIP -m 0600 interfaces ${DESTDIR}/etc/shorewall6/interfaces
echo "Interfaces file installed as ${PREFIX}/etc/shorewall6/interfaces" echo "Interfaces file installed as ${DESTDIR}/etc/shorewall6/interfaces"
fi fi
# #
# Install the hosts file # Install the hosts file
# #
run_install $OWNERSHIP -m 0644 hosts ${PREFIX}/usr/share/shorewall6/configfiles/hosts run_install $OWNERSHIP -m 0644 hosts ${DESTDIR}/usr/share/shorewall6/configfiles/hosts
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/hosts ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/hosts ]; then
run_install $OWNERSHIP -m 0600 hosts ${PREFIX}/etc/shorewall6/hosts run_install $OWNERSHIP -m 0600 hosts ${DESTDIR}/etc/shorewall6/hosts
echo "Hosts file installed as ${PREFIX}/etc/shorewall6/hosts" echo "Hosts file installed as ${DESTDIR}/etc/shorewall6/hosts"
fi fi
# #
# Install the rules file # Install the rules file
# #
run_install $OWNERSHIP -m 0644 rules ${PREFIX}/usr/share/shorewall6/configfiles/rules run_install $OWNERSHIP -m 0644 rules ${DESTDIR}/usr/share/shorewall6/configfiles/rules
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/rules ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/rules ]; then
run_install $OWNERSHIP -m 0600 rules ${PREFIX}/etc/shorewall6/rules run_install $OWNERSHIP -m 0600 rules ${DESTDIR}/etc/shorewall6/rules
echo "Rules file installed as ${PREFIX}/etc/shorewall6/rules" echo "Rules file installed as ${DESTDIR}/etc/shorewall6/rules"
fi fi
# #
# Install the Parameters file # Install the Parameters file
# #
run_install $OWNERSHIP -m 0644 params ${PREFIX}/usr/share/shorewall6/configfiles/params run_install $OWNERSHIP -m 0644 params ${DESTDIR}/usr/share/shorewall6/configfiles/params
if [ -f ${PREFIX}/etc/shorewall6/params ]; then if [ -f ${DESTDIR}/etc/shorewall6/params ]; then
chmod 0644 ${PREFIX}/etc/shorewall6/params chmod 0644 ${DESTDIR}/etc/shorewall6/params
else else
run_install $OWNERSHIP -m 0644 params ${PREFIX}/etc/shorewall6/params run_install $OWNERSHIP -m 0644 params ${DESTDIR}/etc/shorewall6/params
echo "Parameter file installed as ${PREFIX}/etc/shorewall6/params" echo "Parameter file installed as ${DESTDIR}/etc/shorewall6/params"
fi fi
# #
# Install the Stopped Routing file # Install the Stopped Routing file
# #
run_install $OWNERSHIP -m 0644 routestopped ${PREFIX}/usr/share/shorewall6/configfiles/routestopped run_install $OWNERSHIP -m 0644 routestopped ${DESTDIR}/usr/share/shorewall6/configfiles/routestopped
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/routestopped ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/routestopped ]; then
run_install $OWNERSHIP -m 0600 routestopped ${PREFIX}/etc/shorewall6/routestopped run_install $OWNERSHIP -m 0600 routestopped ${DESTDIR}/etc/shorewall6/routestopped
echo "Stopped Routing file installed as ${PREFIX}/etc/shorewall6/routestopped" echo "Stopped Routing file installed as ${DESTDIR}/etc/shorewall6/routestopped"
fi fi
# #
# Install the Mac List file # Install the Mac List file
# #
run_install $OWNERSHIP -m 0644 maclist ${PREFIX}/usr/share/shorewall6/configfiles/maclist run_install $OWNERSHIP -m 0644 maclist ${DESTDIR}/usr/share/shorewall6/configfiles/maclist
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/maclist ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/maclist ]; then
run_install $OWNERSHIP -m 0600 maclist ${PREFIX}/etc/shorewall6/maclist run_install $OWNERSHIP -m 0600 maclist ${DESTDIR}/etc/shorewall6/maclist
echo "MAC list file installed as ${PREFIX}/etc/shorewall6/maclist" echo "MAC list file installed as ${DESTDIR}/etc/shorewall6/maclist"
fi fi
# #
# Install the Modules file # Install the Modules file
# #
run_install $OWNERSHIP -m 0600 modules ${PREFIX}/usr/share/shorewall6/modules run_install $OWNERSHIP -m 0600 modules ${DESTDIR}/usr/share/shorewall6/modules
echo "Modules file installed as ${PREFIX}/usr/share/shorewall6/modules" echo "Modules file installed as ${DESTDIR}/usr/share/shorewall6/modules"
# #
# Install the Module Helpers file # Install the Module Helpers file
# #
run_install $OWNERSHIP -m 0600 helpers ${PREFIX}/usr/share/shorewall6/helpers run_install $OWNERSHIP -m 0600 helpers ${DESTDIR}/usr/share/shorewall6/helpers
echo "Helper modules file installed as ${PREFIX}/usr/share/shorewall6/helpers" echo "Helper modules file installed as ${DESTDIR}/usr/share/shorewall6/helpers"
# #
# Install the TC Rules file # Install the TC Rules file
# #
run_install $OWNERSHIP -m 0644 tcrules ${PREFIX}/usr/share/shorewall6/configfiles/tcrules run_install $OWNERSHIP -m 0644 tcrules ${DESTDIR}/usr/share/shorewall6/configfiles/tcrules
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/tcrules ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/tcrules ]; then
run_install $OWNERSHIP -m 0600 tcrules ${PREFIX}/etc/shorewall6/tcrules run_install $OWNERSHIP -m 0600 tcrules ${DESTDIR}/etc/shorewall6/tcrules
echo "TC Rules file installed as ${PREFIX}/etc/shorewall6/tcrules" echo "TC Rules file installed as ${DESTDIR}/etc/shorewall6/tcrules"
fi fi
# #
# Install the TC Interfaces file # Install the TC Interfaces file
# #
run_install $OWNERSHIP -m 0644 tcinterfaces ${PREFIX}/usr/share/shorewall6/configfiles/tcinterfaces run_install $OWNERSHIP -m 0644 tcinterfaces ${DESTDIR}/usr/share/shorewall6/configfiles/tcinterfaces
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/tcinterfaces ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/tcinterfaces ]; then
run_install $OWNERSHIP -m 0600 tcinterfaces ${PREFIX}/etc/shorewall6/tcinterfaces run_install $OWNERSHIP -m 0600 tcinterfaces ${DESTDIR}/etc/shorewall6/tcinterfaces
echo "TC Interfaces file installed as ${PREFIX}/etc/shorewall6/tcinterfaces" echo "TC Interfaces file installed as ${DESTDIR}/etc/shorewall6/tcinterfaces"
fi fi
# #
# Install the TC Priority file # Install the TC Priority file
# #
run_install $OWNERSHIP -m 0644 tcpri ${PREFIX}/usr/share/shorewall6/configfiles/tcpri run_install $OWNERSHIP -m 0644 tcpri ${DESTDIR}/usr/share/shorewall6/configfiles/tcpri
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/tcpri ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/tcpri ]; then
run_install $OWNERSHIP -m 0600 tcpri ${PREFIX}/etc/shorewall6/tcpri run_install $OWNERSHIP -m 0600 tcpri ${DESTDIR}/etc/shorewall6/tcpri
echo "TC Priority file installed as ${PREFIX}/etc/shorewall6/tcpri" echo "TC Priority file installed as ${DESTDIR}/etc/shorewall6/tcpri"
fi fi
# #
# Install the TOS file # Install the TOS file
# #
run_install $OWNERSHIP -m 0644 tos ${PREFIX}/usr/share/shorewall6/configfiles/tos run_install $OWNERSHIP -m 0644 tos ${DESTDIR}/usr/share/shorewall6/configfiles/tos
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/tos ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/tos ]; then
run_install $OWNERSHIP -m 0600 tos ${PREFIX}/etc/shorewall6/tos run_install $OWNERSHIP -m 0600 tos ${DESTDIR}/etc/shorewall6/tos
echo "TOS file installed as ${PREFIX}/etc/shorewall6/tos" echo "TOS file installed as ${DESTDIR}/etc/shorewall6/tos"
fi fi
# #
# Install the Tunnels file # Install the Tunnels file
# #
run_install $OWNERSHIP -m 0644 tunnels ${PREFIX}/usr/share/shorewall6/configfiles/tunnels run_install $OWNERSHIP -m 0644 tunnels ${DESTDIR}/usr/share/shorewall6/configfiles/tunnels
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/tunnels ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/tunnels ]; then
run_install $OWNERSHIP -m 0600 tunnels ${PREFIX}/etc/shorewall6/tunnels run_install $OWNERSHIP -m 0600 tunnels ${DESTDIR}/etc/shorewall6/tunnels
echo "Tunnels file installed as ${PREFIX}/etc/shorewall6/tunnels" echo "Tunnels file installed as ${DESTDIR}/etc/shorewall6/tunnels"
fi fi
# #
# Install the blacklist file # Install the blacklist file
# #
run_install $OWNERSHIP -m 0644 blacklist ${PREFIX}/usr/share/shorewall6/configfiles/blacklist run_install $OWNERSHIP -m 0644 blacklist ${DESTDIR}/usr/share/shorewall6/configfiles/blacklist
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/blacklist ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/blacklist ]; then
run_install $OWNERSHIP -m 0600 blacklist ${PREFIX}/etc/shorewall6/blacklist run_install $OWNERSHIP -m 0600 blacklist ${DESTDIR}/etc/shorewall6/blacklist
echo "Blacklist file installed as ${PREFIX}/etc/shorewall6/blacklist" echo "Blacklist file installed as ${DESTDIR}/etc/shorewall6/blacklist"
fi fi
# #
# Install the Providers file # Install the Providers file
# #
run_install $OWNERSHIP -m 0644 providers ${PREFIX}/usr/share/shorewall6/configfiles/providers run_install $OWNERSHIP -m 0644 providers ${DESTDIR}/usr/share/shorewall6/configfiles/providers
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/providers ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/providers ]; then
run_install $OWNERSHIP -m 0600 providers ${PREFIX}/etc/shorewall6/providers run_install $OWNERSHIP -m 0600 providers ${DESTDIR}/etc/shorewall6/providers
echo "Providers file installed as ${PREFIX}/etc/shorewall6/providers" echo "Providers file installed as ${DESTDIR}/etc/shorewall6/providers"
fi fi
# #
# Install the Route Rules file # Install the Route Rules file
# #
run_install $OWNERSHIP -m 0644 route_rules ${PREFIX}/usr/share/shorewall6/configfiles/route_rules run_install $OWNERSHIP -m 0644 route_rules ${DESTDIR}/usr/share/shorewall6/configfiles/route_rules
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/route_rules ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/route_rules ]; then
run_install $OWNERSHIP -m 0600 route_rules ${PREFIX}/etc/shorewall6/route_rules run_install $OWNERSHIP -m 0600 route_rules ${DESTDIR}/etc/shorewall6/route_rules
echo "Routing rules file installed as ${PREFIX}/etc/shorewall6/route_rules" echo "Routing rules file installed as ${DESTDIR}/etc/shorewall6/route_rules"
fi fi
# #
# Install the tcclasses file # Install the tcclasses file
# #
run_install $OWNERSHIP -m 0644 tcclasses ${PREFIX}/usr/share/shorewall6/configfiles/tcclasses run_install $OWNERSHIP -m 0644 tcclasses ${DESTDIR}/usr/share/shorewall6/configfiles/tcclasses
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/tcclasses ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/tcclasses ]; then
run_install $OWNERSHIP -m 0600 tcclasses ${PREFIX}/etc/shorewall6/tcclasses run_install $OWNERSHIP -m 0600 tcclasses ${DESTDIR}/etc/shorewall6/tcclasses
echo "TC Classes file installed as ${PREFIX}/etc/shorewall6/tcclasses" echo "TC Classes file installed as ${DESTDIR}/etc/shorewall6/tcclasses"
fi fi
# #
# Install the tcdevices file # Install the tcdevices file
# #
run_install $OWNERSHIP -m 0644 tcdevices ${PREFIX}/usr/share/shorewall6/configfiles/tcdevices run_install $OWNERSHIP -m 0644 tcdevices ${DESTDIR}/usr/share/shorewall6/configfiles/tcdevices
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/tcdevices ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/tcdevices ]; then
run_install $OWNERSHIP -m 0600 tcdevices ${PREFIX}/etc/shorewall6/tcdevices run_install $OWNERSHIP -m 0600 tcdevices ${DESTDIR}/etc/shorewall6/tcdevices
echo "TC Devices file installed as ${PREFIX}/etc/shorewall6/tcdevices" echo "TC Devices file installed as ${DESTDIR}/etc/shorewall6/tcdevices"
fi fi
# #
# Install the Notrack file # Install the Notrack file
# #
run_install $OWNERSHIP -m 0644 notrack ${PREFIX}/usr/share/shorewall6/configfiles/notrack run_install $OWNERSHIP -m 0644 notrack ${DESTDIR}/usr/share/shorewall6/configfiles/notrack
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/notrack ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/notrack ]; then
run_install $OWNERSHIP -m 0600 notrack ${PREFIX}/etc/shorewall6/notrack run_install $OWNERSHIP -m 0600 notrack ${DESTDIR}/etc/shorewall6/notrack
echo "Notrack file installed as ${PREFIX}/etc/shorewall6/notrack" echo "Notrack file installed as ${DESTDIR}/etc/shorewall6/notrack"
fi fi
# #
# Install the default config path file # Install the default config path file
# #
install_file configpath ${PREFIX}/usr/share/shorewall6/configpath 0644 install_file configpath ${DESTDIR}/usr/share/shorewall6/configpath 0644
echo "Default config path file installed as ${PREFIX}/usr/share/shorewall6/configpath" echo "Default config path file installed as ${DESTDIR}/usr/share/shorewall6/configpath"
# #
# Install the init file # Install the init file
# #
run_install $OWNERSHIP -m 0644 init ${PREFIX}/usr/share/shorewall6/configfiles/init run_install $OWNERSHIP -m 0644 init ${DESTDIR}/usr/share/shorewall6/configfiles/init
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/init ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/init ]; then
run_install $OWNERSHIP -m 0600 init ${PREFIX}/etc/shorewall6/init run_install $OWNERSHIP -m 0600 init ${DESTDIR}/etc/shorewall6/init
echo "Init file installed as ${PREFIX}/etc/shorewall6/init" echo "Init file installed as ${DESTDIR}/etc/shorewall6/init"
fi fi
# #
# Install the start file # Install the start file
# #
run_install $OWNERSHIP -m 0644 start ${PREFIX}/usr/share/shorewall6/configfiles/start run_install $OWNERSHIP -m 0644 start ${DESTDIR}/usr/share/shorewall6/configfiles/start
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/start ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/start ]; then
run_install $OWNERSHIP -m 0600 start ${PREFIX}/etc/shorewall6/start run_install $OWNERSHIP -m 0600 start ${DESTDIR}/etc/shorewall6/start
echo "Start file installed as ${PREFIX}/etc/shorewall6/start" echo "Start file installed as ${DESTDIR}/etc/shorewall6/start"
fi fi
# #
# Install the stop file # Install the stop file
# #
run_install $OWNERSHIP -m 0644 stop ${PREFIX}/usr/share/shorewall6/configfiles/stop run_install $OWNERSHIP -m 0644 stop ${DESTDIR}/usr/share/shorewall6/configfiles/stop
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/stop ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/stop ]; then
run_install $OWNERSHIP -m 0600 stop ${PREFIX}/etc/shorewall6/stop run_install $OWNERSHIP -m 0600 stop ${DESTDIR}/etc/shorewall6/stop
echo "Stop file installed as ${PREFIX}/etc/shorewall6/stop" echo "Stop file installed as ${DESTDIR}/etc/shorewall6/stop"
fi fi
# #
# Install the stopped file # Install the stopped file
# #
run_install $OWNERSHIP -m 0644 stopped ${PREFIX}/usr/share/shorewall6/configfiles/stopped run_install $OWNERSHIP -m 0644 stopped ${DESTDIR}/usr/share/shorewall6/configfiles/stopped
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/stopped ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/stopped ]; then
run_install $OWNERSHIP -m 0600 stopped ${PREFIX}/etc/shorewall6/stopped run_install $OWNERSHIP -m 0600 stopped ${DESTDIR}/etc/shorewall6/stopped
echo "Stopped file installed as ${PREFIX}/etc/shorewall6/stopped" echo "Stopped file installed as ${DESTDIR}/etc/shorewall6/stopped"
fi fi
# #
# Install the Accounting file # Install the Accounting file
# #
run_install $OWNERSHIP -m 0644 accounting ${PREFIX}/usr/share/shorewall6/configfiles/accounting run_install $OWNERSHIP -m 0644 accounting ${DESTDIR}/usr/share/shorewall6/configfiles/accounting
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/accounting ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/accounting ]; then
run_install $OWNERSHIP -m 0600 accounting ${PREFIX}/etc/shorewall6/accounting run_install $OWNERSHIP -m 0600 accounting ${DESTDIR}/etc/shorewall6/accounting
echo "Accounting file installed as ${PREFIX}/etc/shorewall6/accounting" echo "Accounting file installed as ${DESTDIR}/etc/shorewall6/accounting"
fi fi
# #
# Install the Started file # Install the Started file
# #
run_install $OWNERSHIP -m 0644 started ${PREFIX}/usr/share/shorewall6/configfiles/started run_install $OWNERSHIP -m 0644 started ${DESTDIR}/usr/share/shorewall6/configfiles/started
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/started ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/started ]; then
run_install $OWNERSHIP -m 0600 started ${PREFIX}/etc/shorewall6/started run_install $OWNERSHIP -m 0600 started ${DESTDIR}/etc/shorewall6/started
echo "Started file installed as ${PREFIX}/etc/shorewall6/started" echo "Started file installed as ${DESTDIR}/etc/shorewall6/started"
fi fi
# #
# Install the Restored file # Install the Restored file
# #
run_install $OWNERSHIP -m 0644 restored ${PREFIX}/usr/share/shorewall6/configfiles/restored run_install $OWNERSHIP -m 0644 restored ${DESTDIR}/usr/share/shorewall6/configfiles/restored
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/restored ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/restored ]; then
run_install $OWNERSHIP -m 0600 restored ${PREFIX}/etc/shorewall6/restored run_install $OWNERSHIP -m 0600 restored ${DESTDIR}/etc/shorewall6/restored
echo "Restored file installed as ${PREFIX}/etc/shorewall6/restored" echo "Restored file installed as ${DESTDIR}/etc/shorewall6/restored"
fi fi
# #
# Install the Clear file # Install the Clear file
# #
run_install $OWNERSHIP -m 0644 clear ${PREFIX}/usr/share/shorewall6/configfiles/clear run_install $OWNERSHIP -m 0644 clear ${DESTDIR}/usr/share/shorewall6/configfiles/clear
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/clear ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/clear ]; then
run_install $OWNERSHIP -m 0600 clear ${PREFIX}/etc/shorewall6/clear run_install $OWNERSHIP -m 0600 clear ${DESTDIR}/etc/shorewall6/clear
echo "Clear file installed as ${PREFIX}/etc/shorewall6/clear" echo "Clear file installed as ${DESTDIR}/etc/shorewall6/clear"
fi fi
# #
# Install the Isusable file # Install the Isusable file
# #
run_install $OWNERSHIP -m 0644 isusable ${PREFIX}/usr/share/shorewall6/configfiles/isusable run_install $OWNERSHIP -m 0644 isusable ${DESTDIR}/usr/share/shorewall6/configfiles/isusable
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/isusable ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/isusable ]; then
run_install $OWNERSHIP -m 0600 isusable ${PREFIX}/etc/shorewall6/isusable run_install $OWNERSHIP -m 0600 isusable ${DESTDIR}/etc/shorewall6/isusable
echo "Isusable file installed as ${PREFIX}/etc/shorewall/isusable" echo "Isusable file installed as ${DESTDIR}/etc/shorewall/isusable"
fi fi
# #
# Install the Refresh file # Install the Refresh file
# #
run_install $OWNERSHIP -m 0644 refresh ${PREFIX}/usr/share/shorewall6/configfiles/refresh run_install $OWNERSHIP -m 0644 refresh ${DESTDIR}/usr/share/shorewall6/configfiles/refresh
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/refresh ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/refresh ]; then
run_install $OWNERSHIP -m 0600 refresh ${PREFIX}/etc/shorewall6/refresh run_install $OWNERSHIP -m 0600 refresh ${DESTDIR}/etc/shorewall6/refresh
echo "Refresh file installed as ${PREFIX}/etc/shorewall6/refresh" echo "Refresh file installed as ${DESTDIR}/etc/shorewall6/refresh"
fi fi
# #
# Install the Refreshed file # Install the Refreshed file
# #
run_install $OWNERSHIP -m 0644 refreshed ${PREFIX}/usr/share/shorewall6/configfiles/refreshed run_install $OWNERSHIP -m 0644 refreshed ${DESTDIR}/usr/share/shorewall6/configfiles/refreshed
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/refreshed ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/refreshed ]; then
run_install $OWNERSHIP -m 0600 refreshed ${PREFIX}/etc/shorewall6/refreshed run_install $OWNERSHIP -m 0600 refreshed ${DESTDIR}/etc/shorewall6/refreshed
echo "Refreshed file installed as ${PREFIX}/etc/shorewall6/refreshed" echo "Refreshed file installed as ${DESTDIR}/etc/shorewall6/refreshed"
fi fi
# #
# Install the Tcclear file # Install the Tcclear file
# #
run_install $OWNERSHIP -m 0644 tcclear ${PREFIX}/usr/share/shorewall6/configfiles/tcclear run_install $OWNERSHIP -m 0644 tcclear ${DESTDIR}/usr/share/shorewall6/configfiles/tcclear
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/tcclear ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/tcclear ]; then
run_install $OWNERSHIP -m 0600 tcclear ${PREFIX}/etc/shorewall6/tcclear run_install $OWNERSHIP -m 0600 tcclear ${DESTDIR}/etc/shorewall6/tcclear
echo "Tcclear file installed as ${PREFIX}/etc/shorewall6/tcclear" echo "Tcclear file installed as ${DESTDIR}/etc/shorewall6/tcclear"
fi fi
# #
# Install the Standard Actions file # Install the Standard Actions file
# #
install_file actions.std ${PREFIX}/usr/share/shorewall6/actions.std 0644 install_file actions.std ${DESTDIR}/usr/share/shorewall6/actions.std 0644
echo "Standard actions file installed as ${PREFIX}/usr/shared/shorewall6/actions.std" echo "Standard actions file installed as ${DESTDIR}/usr/shared/shorewall6/actions.std"
# #
# Install the Actions file # Install the Actions file
# #
run_install $OWNERSHIP -m 0644 actions ${PREFIX}/usr/share/shorewall6/configfiles/actions run_install $OWNERSHIP -m 0644 actions ${DESTDIR}/usr/share/shorewall6/configfiles/actions
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall6/actions ]; then if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/actions ]; then
run_install $OWNERSHIP -m 0644 actions ${PREFIX}/etc/shorewall6/actions run_install $OWNERSHIP -m 0644 actions ${DESTDIR}/etc/shorewall6/actions
echo "Actions file installed as ${PREFIX}/etc/shorewall6/actions" echo "Actions file installed as ${DESTDIR}/etc/shorewall6/actions"
fi fi
# #
# Install the Makefiles # Install the Makefiles
# #
run_install $OWNERSHIP -m 0644 Makefile-lite ${PREFIX}/usr/share/shorewall6/configfiles/Makefile run_install $OWNERSHIP -m 0644 Makefile-lite ${DESTDIR}/usr/share/shorewall6/configfiles/Makefile
if [ -z "$SPARSE" ]; then if [ -z "$SPARSE" ]; then
run_install $OWNERSHIP -m 0600 Makefile ${PREFIX}/etc/shorewall6/Makefile run_install $OWNERSHIP -m 0600 Makefile ${DESTDIR}/etc/shorewall6/Makefile
echo "Makefile installed as ${PREFIX}/etc/shorewall6/Makefile" echo "Makefile installed as ${DESTDIR}/etc/shorewall6/Makefile"
fi fi
# #
# Install the Action files # Install the Action files
# #
for f in action.* ; do for f in action.* ; do
install_file $f ${PREFIX}/usr/share/shorewall6/$f 0644 install_file $f ${DESTDIR}/usr/share/shorewall6/$f 0644
echo "Action ${f#*.} file installed as ${PREFIX}/usr/share/shorewall6/$f" echo "Action ${f#*.} file installed as ${DESTDIR}/usr/share/shorewall6/$f"
done done
# Install the Macro files # Install the Macro files
# #
for f in macro.* ; do for f in macro.* ; do
install_file $f ${PREFIX}/usr/share/shorewall6/$f 0644 install_file $f ${DESTDIR}/usr/share/shorewall6/$f 0644
echo "Macro ${f#*.} file installed as ${PREFIX}/usr/share/shorewall6/$f" echo "Macro ${f#*.} file installed as ${DESTDIR}/usr/share/shorewall6/$f"
done done
# #
# Install the libraries # Install the libraries
# #
for f in lib.* ; do for f in lib.* ; do
if [ -f $f ]; then if [ -f $f ]; then
install_file $f ${PREFIX}/usr/share/shorewall6/$f 0644 install_file $f ${DESTDIR}/usr/share/shorewall6/$f 0644
echo "Library ${f#*.} file installed as ${PREFIX}/usr/share/shorewall6/$f" echo "Library ${f#*.} file installed as ${DESTDIR}/usr/share/shorewall6/$f"
fi fi
done done
# #
# Symbolically link 'functions' to lib.base # Symbolically link 'functions' to lib.base
# #
ln -sf lib.base ${PREFIX}/usr/share/shorewall6/functions ln -sf lib.base ${DESTDIR}/usr/share/shorewall6/functions
# #
# Create the version file # Create the version file
# #
echo "$VERSION" > ${PREFIX}/usr/share/shorewall6/version echo "$VERSION" > ${DESTDIR}/usr/share/shorewall6/version
chmod 644 ${PREFIX}/usr/share/shorewall6/version chmod 644 ${DESTDIR}/usr/share/shorewall6/version
# #
# Remove and create the symbolic link to the init script # Remove and create the symbolic link to the init script
# #
if [ -z "$PREFIX" ]; then if [ -z "$DESTDIR" ]; then
rm -f /usr/share/shorewall6/init rm -f /usr/share/shorewall6/init
ln -s ${DEST}/${INIT} /usr/share/shorewall6/init ln -s ${DEST}/${INIT} /usr/share/shorewall6/init
fi fi
@ -695,30 +697,30 @@ fi
cd manpages cd manpages
[ -n "$INSTALLD" ] || mkdir -p ${PREFIX}${MANDIR}/man5/ ${PREFIX}${MANDIR}/man8/ [ -n "$INSTALLD" ] || mkdir -p ${DESTDIR}${MANDIR}/man5/ ${DESTDIR}${MANDIR}/man8/
for f in *.5; do for f in *.5; do
gzip -c $f > $f.gz gzip -c $f > $f.gz
run_install $INSTALLD -m 0644 $f.gz ${PREFIX}${MANDIR}/man5/$f.gz run_install $INSTALLD -m 0644 $f.gz ${DESTDIR}${MANDIR}/man5/$f.gz
echo "Man page $f.gz installed to ${PREFIX}${MANDIR}/man5/$f.gz" echo "Man page $f.gz installed to ${DESTDIR}${MANDIR}/man5/$f.gz"
done done
for f in *.8; do for f in *.8; do
gzip -c $f > $f.gz gzip -c $f > $f.gz
run_install $INSTALLD -m 0644 $f.gz ${PREFIX}${MANDIR}/man8/$f.gz run_install $INSTALLD -m 0644 $f.gz ${DESTDIR}${MANDIR}/man8/$f.gz
echo "Man page $f.gz installed to ${PREFIX}${MANDIR}/man8/$f.gz" echo "Man page $f.gz installed to ${DESTDIR}${MANDIR}/man8/$f.gz"
done done
cd .. cd ..
echo "Man Pages Installed" echo "Man Pages Installed"
if [ -d ${PREFIX}/etc/logrotate.d ]; then if [ -d ${DESTDIR}/etc/logrotate.d ]; then
run_install $OWNERSHIP -m 0644 logrotate ${PREFIX}/etc/logrotate.d/shorewall6 run_install $OWNERSHIP -m 0644 logrotate ${DESTDIR}/etc/logrotate.d/shorewall6
echo "Logrotate file installed as ${PREFIX}/etc/logrotate.d/shorewall6" echo "Logrotate file installed as ${DESTDIR}/etc/logrotate.d/shorewall6"
fi fi
if [ -z "$PREFIX" -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 [ -n "$DEBIAN" ]; then
run_install $OWNERSHIP -m 0644 default.debian /etc/default/shorewall6 run_install $OWNERSHIP -m 0644 default.debian /etc/default/shorewall6
ln -s ../init.d/shorewall6 /etc/rcS.d/S40shorewall6 ln -s ../init.d/shorewall6 /etc/rcS.d/S40shorewall6