2008-12-07 19:17:26 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Script to install Shoreline Firewall
|
|
|
|
#
|
|
|
|
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
|
|
|
#
|
2011-05-23 19:06:56 +02:00
|
|
|
# (c) 2000-2011 - Tom Eastep (teastep@shorewall.net)
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Shorewall documentation is available at http://shorewall.net
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of Version 2 of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
#
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
VERSION=xxx #The Build script inserts the actual version
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
#
|
|
|
|
# Change to the directory containing this script
|
|
|
|
#
|
2008-12-07 19:17:26 +01:00
|
|
|
usage() # $1 = exit status
|
|
|
|
{
|
|
|
|
ME=$(basename $0)
|
|
|
|
echo "usage: $ME"
|
|
|
|
echo " $ME -v"
|
|
|
|
echo " $ME -h"
|
2011-05-30 17:15:59 +02:00
|
|
|
echo " $ME -s"
|
2012-01-04 01:35:41 +01:00
|
|
|
echo " $ME -a"
|
2008-12-07 19:17:26 +01:00
|
|
|
exit $1
|
|
|
|
}
|
|
|
|
|
|
|
|
split() {
|
|
|
|
local ifs
|
|
|
|
ifs=$IFS
|
|
|
|
IFS=:
|
|
|
|
set -- $1
|
|
|
|
echo $*
|
|
|
|
IFS=$ifs
|
|
|
|
}
|
|
|
|
|
|
|
|
qt()
|
|
|
|
{
|
|
|
|
"$@" >/dev/null 2>&1
|
|
|
|
}
|
|
|
|
|
|
|
|
mywhich() {
|
|
|
|
local dir
|
|
|
|
|
|
|
|
for dir in $(split $PATH); do
|
|
|
|
if [ -x $dir/$1 ]; then
|
|
|
|
echo $dir/$1
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
return 2
|
|
|
|
}
|
|
|
|
|
|
|
|
run_install()
|
|
|
|
{
|
|
|
|
if ! install $*; then
|
|
|
|
echo
|
|
|
|
echo "ERROR: Failed to install $*" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
cant_autostart()
|
|
|
|
{
|
|
|
|
echo
|
2012-01-04 01:35:41 +01:00
|
|
|
echo "WARNING: Unable to configure $PRODUCT to start automatically at boot" >&2
|
2008-12-07 19:17:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
delete_file() # $1 = file to delete
|
|
|
|
{
|
|
|
|
rm -f $1
|
|
|
|
}
|
|
|
|
|
|
|
|
install_file() # $1 = source $2 = target $3 = mode
|
|
|
|
{
|
2010-05-29 19:50:39 +02:00
|
|
|
run_install $T $OWNERSHIP -m $3 $1 ${2}
|
2008-12-07 19:17:26 +01:00
|
|
|
}
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
cd "$(dirname $0)"
|
|
|
|
|
|
|
|
if [ -f shorewall ]; then
|
|
|
|
PRODUCT=shorewall
|
|
|
|
Product=Shorewall
|
|
|
|
else
|
|
|
|
PRODUCT=shorewall6
|
|
|
|
Product=Shorewall6
|
|
|
|
fi
|
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
[ -n "$DESTDIR" ] || DESTDIR="$PREFIX"
|
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Parse the run line
|
|
|
|
#
|
|
|
|
# DEST is the SysVInit script directory
|
|
|
|
# INIT is the name of the script in the $DEST directory
|
|
|
|
#
|
2010-05-29 19:50:39 +02:00
|
|
|
T="-T"
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
if [ -z "$DEST" ] ; then
|
|
|
|
DEST="/etc/init.d"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$INIT" ] ; then
|
2012-01-04 01:35:41 +01:00
|
|
|
INIT="$PRODUCT"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2011-06-12 18:45:50 +02:00
|
|
|
ANNOTATED=
|
2012-01-04 01:35:41 +01:00
|
|
|
CYGWIN=
|
|
|
|
MAC=
|
|
|
|
MACHOST=
|
2009-02-22 18:19:19 +01:00
|
|
|
MANDIR=${MANDIR:-"/usr/share/man"}
|
2012-01-04 01:35:41 +01:00
|
|
|
SPARSE=
|
|
|
|
INSTALLD='-D'
|
2011-04-17 20:20:26 +02:00
|
|
|
[ -n "${LIBEXEC:=/usr/share}" ]
|
|
|
|
[ -n "${PERLLIB:=/usr/share/shorewall}" ]
|
2011-04-03 18:56:30 +02:00
|
|
|
|
2011-05-14 14:31:19 +02:00
|
|
|
case "$LIBEXEC" in
|
|
|
|
/*)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
LIBEXEC=/usr/${LIBEXEC}
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case "$PERLLIB" in
|
|
|
|
/*)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
PERLLIB=/usr/${PERLLIB}
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
case $(uname) in
|
|
|
|
CYGWIN*)
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$DESTDIR" ]; then
|
2009-07-25 16:44:53 +02:00
|
|
|
DEST=
|
|
|
|
INIT=
|
|
|
|
fi
|
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
OWNER=$(id -un)
|
|
|
|
GROUP=$(id -gn)
|
|
|
|
CYGWIN=Yes
|
2010-02-27 20:48:39 +01:00
|
|
|
SPARSE=Yes
|
2008-12-07 19:17:26 +01:00
|
|
|
;;
|
2010-05-06 17:17:17 +02:00
|
|
|
Darwin)
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$DESTDIR" ]; then
|
2010-05-06 17:17:17 +02:00
|
|
|
DEST=
|
|
|
|
INIT=
|
2010-05-09 01:32:03 +02:00
|
|
|
SPARSE=Yes
|
2010-05-06 17:17:17 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
[ -z "$OWNER" ] && OWNER=root
|
|
|
|
[ -z "$GROUP" ] && GROUP=wheel
|
|
|
|
MAC=Yes
|
2012-01-04 01:35:41 +01:00
|
|
|
MACHOST=Yes
|
2010-05-29 19:57:27 +02:00
|
|
|
INSTALLD=
|
2010-05-29 19:50:39 +02:00
|
|
|
T=
|
2010-06-07 18:16:56 +02:00
|
|
|
;;
|
2008-12-07 19:17:26 +01:00
|
|
|
*)
|
|
|
|
[ -z "$OWNER" ] && OWNER=root
|
|
|
|
[ -z "$GROUP" ] && GROUP=root
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
OWNERSHIP="-o $OWNER -g $GROUP"
|
|
|
|
|
2011-05-30 17:15:59 +02:00
|
|
|
finished=0
|
|
|
|
|
|
|
|
while [ $finished -eq 0 ]; do
|
|
|
|
option=$1
|
|
|
|
|
|
|
|
case "$option" in
|
|
|
|
-*)
|
|
|
|
option=${option#-}
|
|
|
|
|
|
|
|
while [ -n "$option" ]; do
|
|
|
|
case $option in
|
|
|
|
h)
|
|
|
|
usage 0
|
|
|
|
;;
|
|
|
|
v)
|
2012-01-04 01:35:41 +01:00
|
|
|
echo "$Product Firewall Installer Version $VERSION"
|
2011-05-30 17:15:59 +02:00
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
s*)
|
|
|
|
SPARSE=Yes
|
|
|
|
option=${option#s}
|
|
|
|
;;
|
2011-06-07 00:40:21 +02:00
|
|
|
a*)
|
2011-06-12 18:45:50 +02:00
|
|
|
ANNOTATED=Yes
|
2011-06-07 00:40:21 +02:00
|
|
|
option=${option#a}
|
|
|
|
;;
|
2011-05-30 17:15:59 +02:00
|
|
|
p*)
|
2011-06-12 18:45:50 +02:00
|
|
|
ANNOTATED=
|
2011-05-30 17:15:59 +02:00
|
|
|
option=${option#p}
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
usage 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
shift
|
2011-05-29 23:34:18 +02:00
|
|
|
;;
|
2008-12-07 19:17:26 +01:00
|
|
|
*)
|
2011-05-30 17:15:59 +02:00
|
|
|
[ -n "$option" ] && usage 1
|
|
|
|
finished=1
|
2008-12-07 19:17:26 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
|
|
|
|
|
|
|
|
#
|
|
|
|
# Determine where to install the firewall script
|
|
|
|
#
|
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -n "$DESTDIR" ]; then
|
2008-12-07 19:17:26 +01:00
|
|
|
if [ -z "$CYGWIN" ]; then
|
|
|
|
if [ `id -u` != 0 ] ; then
|
|
|
|
echo "Not setting file owner/group permissions, not running as root."
|
|
|
|
OWNERSHIP=""
|
2009-02-22 18:19:19 +01:00
|
|
|
fi
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
2009-07-25 16:30:08 +02:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
install -d $OWNERSHIP -m 755 ${DESTDIR}/sbin
|
|
|
|
install -d $OWNERSHIP -m 755 ${DESTDIR}${DEST}
|
2010-06-07 18:16:56 +02:00
|
|
|
|
2009-07-25 16:30:08 +02:00
|
|
|
CYGWIN=
|
2010-05-06 17:17:17 +02:00
|
|
|
MAC=
|
2008-12-07 19:17:26 +01:00
|
|
|
else
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ $PRODUCT = shorewall ]; then
|
|
|
|
#
|
|
|
|
# Verify that Perl is installed
|
|
|
|
#
|
|
|
|
if ! perl -c Perl/compiler.pl; then
|
|
|
|
echo "ERROR: $Product $VERSION requires Perl which either is not installed or is not able to compile the $Product perl code" >&2
|
|
|
|
echo " Try perl -c $PWD/Perl/compiler.pl" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
[ -x /usr/share/shorewall/compiler.pl ] || \
|
|
|
|
{ echo " ERROR: Shorewall >= 4.3.5 is not installed" >&2; exit 1; }
|
2009-08-09 17:33:22 +02:00
|
|
|
fi
|
|
|
|
|
2010-02-28 18:15:11 +01:00
|
|
|
if [ -n "$CYGWIN" ]; then
|
|
|
|
echo "Installing Cygwin-specific configuration..."
|
2010-05-06 17:17:17 +02:00
|
|
|
elif [ -n "$MAC" ]; then
|
2010-06-07 18:16:56 +02:00
|
|
|
echo "Installing Mac-specific configuration..."
|
2010-02-28 18:15:11 +01:00
|
|
|
else
|
2009-10-22 01:12:02 +02:00
|
|
|
if [ -f /etc/debian_version ]; then
|
2010-02-28 18:15:11 +01:00
|
|
|
echo "Installing Debian-specific configuration..."
|
2008-12-07 19:17:26 +01:00
|
|
|
DEBIAN=yes
|
2010-02-28 18:15:11 +01:00
|
|
|
SPARSE=yes
|
2011-08-23 23:07:44 +02:00
|
|
|
elif [ -f /etc/redhat-release ]; then
|
2011-08-22 18:05:40 +02:00
|
|
|
echo "Installing Redhat/Fedora-specific configuration..."
|
|
|
|
FEDORA=yes
|
2008-12-07 19:17:26 +01:00
|
|
|
elif [ -f /etc/slackware-version ] ; then
|
2010-02-28 18:15:11 +01:00
|
|
|
echo "Installing Slackware-specific configuration..."
|
2008-12-07 19:17:26 +01:00
|
|
|
DEST="/etc/rc.d"
|
2009-02-22 18:19:19 +01:00
|
|
|
MANDIR="/usr/man"
|
|
|
|
SLACKWARE=yes
|
2012-01-04 01:35:41 +01:00
|
|
|
INIT="rc.firewall"
|
2008-12-07 19:17:26 +01:00
|
|
|
elif [ -f /etc/arch-release ] ; then
|
2010-02-28 18:15:11 +01:00
|
|
|
echo "Installing ArchLinux-specific configuration..."
|
2008-12-07 19:17:26 +01:00
|
|
|
DEST="/etc/rc.d"
|
2012-01-04 01:35:41 +01:00
|
|
|
INIT="$PRODUCT"
|
2008-12-07 19:17:26 +01:00
|
|
|
ARCHLINUX=yes
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2011-08-23 23:07:44 +02:00
|
|
|
if [ -z "$DESTDIR" ]; then
|
|
|
|
if [ -f /lib/systemd/system ]; then
|
|
|
|
SYSTEMD=Yes
|
|
|
|
fi
|
|
|
|
elif [ -n "$SYSTEMD" ]; then
|
|
|
|
mkdir -p ${DESTDIR}/lib/systemd/system
|
|
|
|
fi
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
echo "Installing $Product Version $VERSION"
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
# Check for /sbin/$PRODUCT
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -f ${DESTDIR}/sbin/$PRODUCT ]; then
|
2008-12-07 19:17:26 +01:00
|
|
|
first_install=""
|
|
|
|
else
|
|
|
|
first_install="Yes"
|
|
|
|
fi
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "${DESTDIR}" -a $PRODUCT = shorewall -a ! -f /usr/share/$PRODUCT/coreversion ]; then
|
2012-01-02 05:30:09 +01:00
|
|
|
echo "Shorewall $VERSION requires Shorewall Core which does not appear to be installed"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
if [ -z "$CYGWIN" ]; then
|
2012-01-04 01:35:41 +01:00
|
|
|
install_file $PRODUCT ${DESTDIR}/sbin/$PRODUCT 0755
|
2011-07-30 19:57:32 +02:00
|
|
|
if [ -z "$MACHOST" ]; then
|
2012-01-04 01:35:41 +01:00
|
|
|
eval sed -i \'s\|g_libexec=.\*\|g_libexec=$LIBEXEC\|\' ${DESTDIR}/sbin/$PRODUCT
|
|
|
|
eval sed -i \'s\|g_perllib=.\*\|g_perllib=$PERLLIB\|\' ${DESTDIR}/sbin/$PRODUCT
|
2011-04-17 20:20:26 +02:00
|
|
|
else
|
2012-01-04 01:35:41 +01:00
|
|
|
eval sed -i \'\' -e \'s\|g_libexec=.\*\|g_libexec=$LIBEXEC\|\' ${DESTDIR}/sbin/$PRODUCT
|
|
|
|
eval sed -i \'\' -e \'s\|g_perllib=.\*\|g_perllib=$PERLLIB\|\' ${DESTDIR}/sbin/$PRODUCT
|
2011-04-17 20:20:26 +02:00
|
|
|
fi
|
2012-01-04 01:35:41 +01:00
|
|
|
echo "$PRODUCT control program installed in ${DESTDIR}/sbin/$PRODUCT"
|
2008-12-07 19:17:26 +01:00
|
|
|
else
|
2012-01-04 01:35:41 +01:00
|
|
|
install_file $PRODUCT ${DESTDIR}/bin/$PRODUCT 0755
|
|
|
|
eval sed -i \'s\|g_libexec=.\*\|g_libexec=$LIBEXEC\|\' ${DESTDIR}/bin/$PRODUCT
|
|
|
|
eval sed -i \'s\|g_perllib=.\*\|g_perllib=$PERLLIB\|\' ${DESTDIR}/bin/$PRODUCT
|
|
|
|
echo "$PRODUCT control program installed in ${DESTDIR}/bin/$PRODUCT"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Firewall Script
|
|
|
|
#
|
|
|
|
if [ -n "$DEBIAN" ]; then
|
2012-01-04 01:35:41 +01:00
|
|
|
install_file init.debian.sh ${DESTDIR}/etc/init.d/$PRODUCT 0544
|
2011-08-22 18:05:40 +02:00
|
|
|
elif [ -n "$FEDORA" ]; then
|
2012-01-04 01:35:41 +01:00
|
|
|
install_file init.fedora.sh ${DESTDIR}/etc/init.d/$PRODUCT 0544
|
2008-12-07 19:17:26 +01:00
|
|
|
elif [ -n "$ARCHLINUX" ]; then
|
2010-06-01 15:42:11 +02:00
|
|
|
install_file init.archlinux.sh ${DESTDIR}${DEST}/$INIT 0544
|
2012-01-04 01:35:41 +01:00
|
|
|
elif [ -n "$SLACKWARE" -a $PRODUCT = shorewall ]; then
|
2010-06-01 15:42:11 +02:00
|
|
|
install_file init.slackware.firewall.sh ${DESTDIR}${DEST}/rc.firewall 0644
|
2012-01-04 01:35:41 +01:00
|
|
|
install_file init.slackware.$PRODUCT.sh ${DESTDIR}${DEST}/rc.$PRODUCT 0644
|
2008-12-07 19:17:26 +01:00
|
|
|
elif [ -n "$INIT" ]; then
|
2010-06-01 15:42:11 +02:00
|
|
|
install_file init.sh ${DESTDIR}${DEST}/$INIT 0544
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
[ -n "$INIT" ] && echo "$Product script installed in ${DESTDIR}${DEST}/$INIT"
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
# Create /etc/$PRODUCT and /var/lib/$PRODUCT if needed
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
mkdir -p ${DESTDIR}/etc/$PRODUCT
|
|
|
|
mkdir -p ${DESTDIR}${LIBEXEC}/$PRODUCT
|
2011-04-17 20:20:26 +02:00
|
|
|
mkdir -p ${DESTDIR}${PERLLIB}/Shorewall
|
2012-01-04 01:35:41 +01:00
|
|
|
mkdir -p ${DESTDIR}/usr/share/$PRODUCT/configfiles
|
|
|
|
mkdir -p ${DESTDIR}/var/lib/$PRODUCT
|
2009-11-03 19:06:10 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
chmod 755 ${DESTDIR}/etc/$PRODUCT
|
|
|
|
chmod 755 ${DESTDIR}/usr/share/$PRODUCT
|
|
|
|
chmod 755 ${DESTDIR}/usr/share/$PRODUCT/configfiles
|
2011-06-18 22:03:55 +02:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -n "$DESTDIR" ]; then
|
|
|
|
mkdir -p ${DESTDIR}/etc/logrotate.d
|
|
|
|
chmod 755 ${DESTDIR}/etc/logrotate.d
|
2009-11-03 19:06:10 +01:00
|
|
|
fi
|
2010-06-07 18:16:56 +02:00
|
|
|
|
2011-08-23 23:07:44 +02:00
|
|
|
#
|
|
|
|
# Install the .service file
|
|
|
|
#
|
|
|
|
if [ -n "$SYSTEMD" ]; then
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 600 $PRODUCT.service ${DESTDIR}/lib/systemd/system/$PRODUCT.service
|
|
|
|
echo "Service file installed as ${DESTDIR}/lib/systemd/system/$PRODUCT.service"
|
2011-08-23 23:07:44 +02:00
|
|
|
fi
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/compiler
|
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/lib.accounting
|
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/lib.actions
|
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/lib.dynamiczones
|
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/lib.maclist
|
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/lib.nat
|
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/lib.providers
|
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/lib.proxyarp
|
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/lib.tc
|
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/lib.tcrules
|
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/lib.tunnels
|
2012-01-04 19:32:17 +01:00
|
|
|
|
|
|
|
if [ $PRODUCT = shorewall6 ]; then
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall6/lib.cli
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall6/lib.common
|
2012-01-06 20:40:04 +01:00
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall6/wait4ifup
|
2012-01-04 19:32:17 +01:00
|
|
|
fi
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/prog.header6
|
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/prog.footer6
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Modules file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 modules ${DESTDIR}/usr/share/$PRODUCT/modules
|
|
|
|
echo "Modules file installed as ${DESTDIR}/usr/share/$PRODUCT/modules"
|
|
|
|
|
|
|
|
for f in modules.*; do
|
|
|
|
run_install $OWNERSHIP -m 0644 $f ${DESTDIR}/usr/share/$PRODUCT/$f
|
|
|
|
echo "Modules file $f installed as ${DESTDIR}/usr/share/$PRODUCT/$f"
|
|
|
|
done
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Module Helpers file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 helpers ${DESTDIR}/usr/share/$PRODUCT/helpers
|
|
|
|
echo "Helper modules file installed as ${DESTDIR}/usr/share/$PRODUCT/helpers"
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the default config path file
|
|
|
|
#
|
|
|
|
install_file configpath ${DESTDIR}/usr/share/$PRODUCT/configpath 0644
|
|
|
|
echo "Default config path file installed as ${DESTDIR}/usr/share/$PRODUCT/configpath"
|
|
|
|
#
|
|
|
|
# Install the Standard Actions file
|
|
|
|
#
|
|
|
|
install_file actions.std ${DESTDIR}/usr/share/$PRODUCT/actions.std 0644
|
|
|
|
echo "Standard actions file installed as ${DESTDIR}/usr/shared/$PRODUCT/actions.std"
|
|
|
|
|
|
|
|
cd configfiles
|
|
|
|
|
2011-06-12 18:45:50 +02:00
|
|
|
if [ -n "$ANNOTATED" ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
suffix=.annotated
|
2011-05-29 23:34:18 +02:00
|
|
|
else
|
2011-06-25 00:13:40 +02:00
|
|
|
suffix=
|
2011-05-29 23:34:18 +02:00
|
|
|
fi
|
2012-01-04 01:35:41 +01:00
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the config file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 $PRODUCT.conf ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 $PRODUCT.conf.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
|
|
|
|
|
|
|
|
if [ ! -f ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf ]; then
|
|
|
|
run_install $OWNERSHIP -m 0644 $PRODUCT.conf${suffix} ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf
|
2009-06-05 17:46:58 +02:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -n "$DEBIAN" ] && mywhich perl; then
|
2009-06-05 17:46:58 +02:00
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
# Make a Debian-like $PRODUCT.conf
|
2009-06-05 17:46:58 +02:00
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
perl -p -w -i -e 's|^STARTUP_ENABLED=.*|STARTUP_ENABLED=Yes|;' ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf
|
2009-06-05 17:46:58 +02:00
|
|
|
fi
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
echo "Config file installed as ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
if [ -n "$ARCHLINUX" ] ; then
|
2012-01-04 01:35:41 +01:00
|
|
|
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
2012-01-04 01:35:41 +01:00
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
# Install the init file
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 init ${DESTDIR}/usr/share/$PRODUCT/configfiles/init
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/init ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 init ${DESTDIR}/etc/$PRODUCT/init
|
|
|
|
echo "Init file installed as ${DESTDIR}/etc/$PRODUCT/init"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
#
|
|
|
|
# Install the zones file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 zones ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 zones.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
|
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/zones ]; then
|
|
|
|
run_install $OWNERSHIP -m 0644 zones${suffix} ${DESTDIR}/etc/$PRODUCT/zones
|
|
|
|
echo "Zones file installed as ${DESTDIR}/etc/$PRODUCT/zones"
|
|
|
|
fi
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Install the policy file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 policy ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 policy.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/policy ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 policy${suffix} ${DESTDIR}/etc/$PRODUCT/policy
|
|
|
|
echo "Policy file installed as ${DESTDIR}/etc/$PRODUCT/policy"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the interfaces file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 interfaces ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 interfaces.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/interfaces ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 interfaces${suffix} ${DESTDIR}/etc/$PRODUCT/interfaces
|
|
|
|
echo "Interfaces file installed as ${DESTDIR}/etc/$PRODUCT/interfaces"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the hosts file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 hosts ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 hosts.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/hosts ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 hosts${suffix} ${DESTDIR}/etc/$PRODUCT/hosts
|
|
|
|
echo "Hosts file installed as ${DESTDIR}/etc/$PRODUCT/hosts"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the rules file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 rules ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 rules.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/rules ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 rules${suffix} ${DESTDIR}/etc/$PRODUCT/rules
|
|
|
|
echo "Rules file installed as ${DESTDIR}/etc/$PRODUCT/rules"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -f nat ]; then
|
|
|
|
#
|
|
|
|
# Install the NAT file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 nat ${DESTDIR}/usr/share/$PRODUCT/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 nat.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles
|
|
|
|
|
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/nat ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 nat${suffix} ${DESTDIR}/etc/$PRODUCT/nat
|
|
|
|
echo "NAT file installed as ${DESTDIR}/etc/$PRODUCT/nat"
|
|
|
|
fi
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
2012-01-04 01:35:41 +01:00
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the NETMAP file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 netmap ${DESTDIR}/usr/share/$PRODUCT/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 netmap.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/netmap ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 netmap${suffix} ${DESTDIR}/etc/$PRODUCT/netmap
|
|
|
|
echo "NETMAP file installed as ${DESTDIR}/etc/$PRODUCT/netmap"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Parameters file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 params ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 params.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -f ${DESTDIR}/etc/$PRODUCT/params ]; then
|
|
|
|
chmod 0644 ${DESTDIR}/etc/$PRODUCT/params
|
2008-12-07 19:17:26 +01:00
|
|
|
else
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 params${suffix} ${DESTDIR}/etc/$PRODUCT/params
|
|
|
|
echo "Parameter file installed as ${DESTDIR}/etc/$PRODUCT/params"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ $PRODUCT = shorewall ]; then
|
|
|
|
#
|
|
|
|
# Install the proxy ARP file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 proxyarp ${DESTDIR}/usr/share/$PRODUCT/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 proxyarp.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles
|
|
|
|
|
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/proxyarp ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 proxyarp${suffix} ${DESTDIR}/etc/$PRODUCT/proxyarp
|
|
|
|
echo "Proxy ARP file installed as ${DESTDIR}/etc/$PRODUCT/proxyarp"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
#
|
|
|
|
# Install the Proxyndp file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 proxyndp ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 proxyndp.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
|
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/proxyndp ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 proxyndp${suffix} ${DESTDIR}/etc/$PRODUCT/proxyndp
|
|
|
|
echo "Proxyndp file installed as ${DESTDIR}/etc/$PRODUCT/proxyndp"
|
|
|
|
fi
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Stopped Routing file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 routestopped ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 routestopped.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/routestopped ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 routestopped${suffix} ${DESTDIR}/etc/$PRODUCT/routestopped
|
|
|
|
echo "Stopped Routing file installed as ${DESTDIR}/etc/$PRODUCT/routestopped"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Mac List file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 maclist ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 maclist.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/maclist ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 maclist${suffix} ${DESTDIR}/etc/$PRODUCT/maclist
|
|
|
|
echo "MAC list file installed as ${DESTDIR}/etc/$PRODUCT/maclist"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -f masq ]; then
|
|
|
|
#
|
|
|
|
# Install the Masq file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 masq ${DESTDIR}/usr/share/$PRODUCT/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 masq.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles
|
|
|
|
|
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/masq ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 masq${suffix} ${DESTDIR}/etc/$PRODUCT/masq
|
|
|
|
echo "Masquerade file installed as ${DESTDIR}/etc/$PRODUCT/masq"
|
|
|
|
fi
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
2009-02-21 18:21:51 +01:00
|
|
|
# Install the Notrack file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 notrack ${DESTDIR}/usr/share/$PRODUCT/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 notrack.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles
|
2009-02-21 18:21:51 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/notrack ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 notrack${suffix} ${DESTDIR}/etc/$PRODUCT/notrack
|
|
|
|
echo "Notrack file installed as ${DESTDIR}/etc/$PRODUCT/notrack"
|
2009-02-21 18:21:51 +01:00
|
|
|
fi
|
2010-01-21 18:53:28 +01:00
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the TC Rules file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 tcrules ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 tcrules.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/tcrules ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 tcrules${suffix} ${DESTDIR}/etc/$PRODUCT/tcrules
|
|
|
|
echo "TC Rules file installed as ${DESTDIR}/etc/$PRODUCT/tcrules"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2010-01-18 16:39:36 +01:00
|
|
|
#
|
|
|
|
# Install the TC Interfaces file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 tcinterfaces ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 tcinterfaces.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
2010-01-18 16:39:36 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/tcinterfaces ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 tcinterfaces${suffix} ${DESTDIR}/etc/$PRODUCT/tcinterfaces
|
|
|
|
echo "TC Interfaces file installed as ${DESTDIR}/etc/$PRODUCT/tcinterfaces"
|
2010-01-18 16:39:36 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the TC Priority file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 tcpri ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 tcpri.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
2010-01-18 16:39:36 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/tcpri ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 tcpri${suffix} ${DESTDIR}/etc/$PRODUCT/tcpri
|
|
|
|
echo "TC Priority file installed as ${DESTDIR}/etc/$PRODUCT/tcpri"
|
2010-01-18 16:39:36 +01:00
|
|
|
fi
|
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the TOS file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 tos ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 tos.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/tos ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 tos${suffix} ${DESTDIR}/etc/$PRODUCT/tos
|
|
|
|
echo "TOS file installed as ${DESTDIR}/etc/$PRODUCT/tos"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Tunnels file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 tunnels ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 tunnels.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/tunnels ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 tunnels${suffix} ${DESTDIR}/etc/$PRODUCT/tunnels
|
|
|
|
echo "Tunnels file installed as ${DESTDIR}/etc/$PRODUCT/tunnels"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/blacklist ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 blacklist${suffix} ${DESTDIR}/etc/$PRODUCT/blacklist
|
|
|
|
echo "Blacklist file installed as ${DESTDIR}/etc/$PRODUCT/blacklist"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
2011-11-06 21:05:07 +01:00
|
|
|
# Install the blacklist rules file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 blrules ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 blrules.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
2011-11-06 21:05:07 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/blrules ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 blrules${suffix} ${DESTDIR}/etc/$PRODUCT/blrules
|
|
|
|
echo "Blrules file installed as ${DESTDIR}/etc/$PRODUCT/blrules"
|
2011-11-06 21:05:07 +01:00
|
|
|
fi
|
2009-09-14 22:43:32 +02:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -f findgw ]; then
|
|
|
|
#
|
|
|
|
# Install the findgw file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 findgw ${DESTDIR}/usr/share/$PRODUCT/configfiles
|
|
|
|
|
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/findgw ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 findgw ${DESTDIR}/etc/$PRODUCT
|
|
|
|
echo "Find GW file installed as ${DESTDIR}/etc/$PRODUCT/findgw"
|
|
|
|
fi
|
2009-09-14 22:43:32 +02:00
|
|
|
fi
|
2012-01-04 01:35:41 +01:00
|
|
|
|
2009-09-14 22:43:32 +02:00
|
|
|
#
|
2008-12-07 19:17:26 +01:00
|
|
|
# Delete the Routes file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
delete_file ${DESTDIR}/etc/$PRODUCT/routes
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Delete the tcstart file
|
|
|
|
#
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/tcstart
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Delete the Limits Files
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/action.Limit
|
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/Limit
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Delete the xmodules file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/xmodules
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the Providers file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 providers ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 providers.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/providers ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 providers${suffix} ${DESTDIR}/etc/$PRODUCT/providers
|
|
|
|
echo "Providers file installed as ${DESTDIR}/etc/$PRODUCT/providers"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Route Rules file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 route_rules ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 route_rules.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/route_rules ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 route_rules${suffix} ${DESTDIR}/etc/$PRODUCT/route_rules
|
|
|
|
echo "Routing rules file installed as ${DESTDIR}/etc/$PRODUCT/route_rules"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the tcclasses file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 tcclasses ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 tcclasses.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/tcclasses ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 tcclasses${suffix} ${DESTDIR}/etc/$PRODUCT/tcclasses
|
|
|
|
echo "TC Classes file installed as ${DESTDIR}/etc/$PRODUCT/tcclasses"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the tcdevices file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 tcdevices ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 tcdevices.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/tcdevices ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 tcdevices${suffix} ${DESTDIR}/etc/$PRODUCT/tcdevices
|
|
|
|
echo "TC Devices file installed as ${DESTDIR}/etc/$PRODUCT/tcdevices"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the tcfilters file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 tcfilters ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 tcfilters.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/tcfilters ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 tcfilters${suffix} ${DESTDIR}/etc/$PRODUCT/tcfilters
|
|
|
|
echo "TC Filters file installed as ${DESTDIR}/etc/$PRODUCT/tcfilters"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2010-09-07 16:56:11 +02:00
|
|
|
#
|
|
|
|
# Install the secmarks file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 secmarks ${DESTDIR}/usr/share/$PRODUCT/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 secmarks.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles
|
2010-09-07 16:56:11 +02:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/secmarks ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 secmarks${suffix} ${DESTDIR}/etc/$PRODUCT/secmarks
|
|
|
|
echo "Secmarks file installed as ${DESTDIR}/etc/$PRODUCT/secmarks"
|
2010-09-07 16:56:11 +02:00
|
|
|
fi
|
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the init file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 init ${DESTDIR}/usr/share/$PRODUCT/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/init ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 init ${DESTDIR}/etc/$PRODUCT
|
|
|
|
echo "Init file installed as ${DESTDIR}/etc/$PRODUCT/init"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -f initdone ]; then
|
|
|
|
#
|
|
|
|
# Install the initdone file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 initdone ${DESTDIR}/usr/share/$PRODUCT/configfiles
|
|
|
|
|
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/initdone ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 initdone ${DESTDIR}/etc/$PRODUCT
|
|
|
|
echo "Initdone file installed as ${DESTDIR}/etc/$PRODUCT/initdone"
|
|
|
|
fi
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the start file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 start ${DESTDIR}/usr/share/$PRODUCT/configfiles/start
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/start ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 start ${DESTDIR}/etc/$PRODUCT/start
|
|
|
|
echo "Start file installed as ${DESTDIR}/etc/$PRODUCT/start"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the stop file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 stop ${DESTDIR}/usr/share/$PRODUCT/configfiles/stop
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/stop ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 stop ${DESTDIR}/etc/$PRODUCT/stop
|
|
|
|
echo "Stop file installed as ${DESTDIR}/etc/$PRODUCT/stop"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the stopped file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 stopped ${DESTDIR}/usr/share/$PRODUCT/configfiles/stopped
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/stopped ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 stopped ${DESTDIR}/etc/$PRODUCT/stopped
|
|
|
|
echo "Stopped file installed as ${DESTDIR}/etc/$PRODUCT/stopped"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -f ecn ]; then
|
|
|
|
#
|
|
|
|
# Install the ECN file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 ecn ${DESTDIR}/usr/share/$PRODUCT/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 ecn.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles
|
|
|
|
|
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/ecn ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 ecn${suffix} ${DESTDIR}/etc/$PRODUCT/ecn
|
|
|
|
echo "ECN file installed as ${DESTDIR}/etc/$PRODUCT/ecn"
|
|
|
|
fi
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Accounting file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 accounting ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 accounting.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/accounting ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 accounting${suffix} ${DESTDIR}/etc/$PRODUCT/accounting
|
|
|
|
echo "Accounting file installed as ${DESTDIR}/etc/$PRODUCT/accounting"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
2009-06-20 18:35:08 +02:00
|
|
|
# Install the private library file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 lib.private ${DESTDIR}/usr/share/$PRODUCT/configfiles
|
2009-06-20 18:35:08 +02:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/lib.private ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 lib.private ${DESTDIR}/etc/$PRODUCT
|
|
|
|
echo "Private library file installed as ${DESTDIR}/etc/$PRODUCT/lib.private"
|
2009-06-20 18:35:08 +02:00
|
|
|
fi
|
|
|
|
#
|
2008-12-07 19:17:26 +01:00
|
|
|
# Install the Started file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 started ${DESTDIR}/usr/share/$PRODUCT/configfiles/started
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/started ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 started ${DESTDIR}/etc/$PRODUCT/started
|
|
|
|
echo "Started file installed as ${DESTDIR}/etc/$PRODUCT/started"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
2009-02-05 21:38:50 +01:00
|
|
|
# Install the Restored file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 restored ${DESTDIR}/usr/share/$PRODUCT/configfiles/restored
|
2009-02-05 21:38:50 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/restored ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 restored ${DESTDIR}/etc/$PRODUCT/restored
|
|
|
|
echo "Restored file installed as ${DESTDIR}/etc/$PRODUCT/restored"
|
2009-02-05 21:38:50 +01:00
|
|
|
fi
|
|
|
|
#
|
2009-05-20 02:11:31 +02:00
|
|
|
# Install the Clear file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 clear ${DESTDIR}/usr/share/$PRODUCT/configfiles/clear
|
2009-05-20 02:11:31 +02:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/clear ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 clear ${DESTDIR}/etc/$PRODUCT/clear
|
|
|
|
echo "Clear file installed as ${DESTDIR}/etc/$PRODUCT/clear"
|
2009-05-20 02:11:31 +02:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Isusable file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 isusable ${DESTDIR}/usr/share/$PRODUCT/configfiles/isusable
|
2009-05-20 02:11:31 +02:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/isusable ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 isusable ${DESTDIR}/etc/$PRODUCT/isusable
|
|
|
|
echo "Isusable file installed as ${DESTDIR}/etc/$PRODUCT/isusable"
|
2009-05-20 02:11:31 +02:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Refresh file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 refresh ${DESTDIR}/usr/share/$PRODUCT/configfiles/refresh
|
2009-05-20 02:11:31 +02:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/refresh ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 refresh ${DESTDIR}/etc/$PRODUCT/refresh
|
|
|
|
echo "Refresh file installed as ${DESTDIR}/etc/$PRODUCT/refresh"
|
2009-05-20 02:11:31 +02:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Refreshed file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 refreshed ${DESTDIR}/usr/share/$PRODUCT/configfiles/refreshed
|
2009-05-20 02:11:31 +02:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/refreshed ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 refreshed ${DESTDIR}/etc/$PRODUCT/refreshed
|
|
|
|
echo "Refreshed file installed as ${DESTDIR}/etc/$PRODUCT/refreshed"
|
2009-05-20 02:11:31 +02:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Tcclear file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 tcclear ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
2009-05-20 02:11:31 +02:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/tcclear ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 tcclear ${DESTDIR}/etc/$PRODUCT/tcclear
|
|
|
|
echo "Tcclear file installed as ${DESTDIR}/etc/$PRODUCT/tcclear"
|
2009-05-20 02:11:31 +02:00
|
|
|
fi
|
|
|
|
#
|
2010-10-01 18:15:58 +02:00
|
|
|
# Install the Scfilter file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 scfilter ${DESTDIR}/usr/share/$PRODUCT/configfiles/scfilter
|
2010-10-01 18:15:58 +02:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/scfilter ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 scfilter ${DESTDIR}/etc/$PRODUCT/scfilter
|
|
|
|
echo "Scfilter file installed as ${DESTDIR}/etc/$PRODUCT/scfilter"
|
2010-10-01 18:15:58 +02:00
|
|
|
fi
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Actions file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 actions ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 actions.annotated ${DESTDIR}/usr/share/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/actions ]; then
|
|
|
|
run_install $OWNERSHIP -m 0644 actions${suffix} ${DESTDIR}/etc/$PRODUCT/actions
|
|
|
|
echo "Actions file installed as ${DESTDIR}/etc/$PRODUCT/actions"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Standard Actions file
|
|
|
|
#
|
|
|
|
install_file actions.std ${DESTDIR}/usr/share/$PRODUCT/actions.std 0644
|
|
|
|
echo "Standard actions file installed as ${DESTDIR}/usr/shared/$PRODUCT/actions.std"
|
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the Makefiles
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 Makefile-lite ${DESTDIR}/usr/share/$PRODUCT/configfiles/Makefile
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" ]; then
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 Makefile ${DESTDIR}/etc/$PRODUCT
|
|
|
|
echo "Makefile installed as ${DESTDIR}/etc/$PRODUCT/Makefile"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Action files
|
|
|
|
#
|
|
|
|
for f in action.* ; do
|
2012-01-04 01:35:41 +01:00
|
|
|
install_file $f ${DESTDIR}/usr/share/$PRODUCT/$f 0644
|
|
|
|
echo "Action ${f#*.} file installed as ${DESTDIR}/usr/share/$PRODUCT/$f"
|
2008-12-07 19:17:26 +01:00
|
|
|
done
|
|
|
|
|
2009-03-04 01:46:31 +01:00
|
|
|
cd Macros
|
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
for f in macro.* ; do
|
2012-01-04 01:35:41 +01:00
|
|
|
install_file $f ${DESTDIR}/usr/share/$PRODUCT/$f 0644
|
|
|
|
echo "Macro ${f#*.} file installed as ${DESTDIR}/usr/share/$PRODUCT/$f"
|
2008-12-07 19:17:26 +01:00
|
|
|
done
|
2009-03-04 01:46:31 +01:00
|
|
|
|
|
|
|
cd ..
|
2012-01-04 01:35:41 +01:00
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the libraries
|
|
|
|
#
|
|
|
|
for f in lib.* ; do
|
|
|
|
if [ -f $f ]; then
|
2012-01-04 01:35:41 +01:00
|
|
|
install_file $f ${DESTDIR}/usr/share/$PRODUCT/$f 0644
|
|
|
|
echo "Library ${f#*.} file installed as ${DESTDIR}/usr/share/$PRODUCT/$f"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
done
|
2009-03-04 23:45:07 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ $PRODUCT = shorewall6 ]; then
|
|
|
|
#
|
|
|
|
# Symbolically link 'functions' to lib.base
|
|
|
|
#
|
|
|
|
ln -sf lib.base ${DESTDIR}/usr/share/$PRODUCT/functions
|
|
|
|
fi
|
2009-02-22 19:28:18 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -d Perl ]; then
|
|
|
|
#
|
|
|
|
# /usr/share/$PRODUCT/$Product if needed
|
|
|
|
#
|
|
|
|
mkdir -p ${DESTDIR}/usr/share/$PRODUCT/$Product
|
|
|
|
chmod 755 ${DESTDIR}/usr/share/$PRODUCT/$Product
|
|
|
|
#
|
|
|
|
# Install the Compiler
|
|
|
|
#
|
|
|
|
cd Perl
|
2010-11-07 01:04:17 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
install_file compiler.pl ${DESTDIR}${LIBEXEC}/$PRODUCT/compiler.pl 0755
|
2009-03-04 23:45:07 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
echo
|
|
|
|
echo "Compiler installed in ${DESTDIR}${LIBEXEC}/$PRODUCT/compiler.pl"
|
|
|
|
#
|
|
|
|
# Install the params file helper
|
|
|
|
#
|
|
|
|
install_file getparams ${DESTDIR}${LIBEXEC}/$PRODUCT/getparams 0755
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "Params file helper installed in ${DESTDIR}${LIBEXEC}/$PRODUCT/getparams"
|
|
|
|
#
|
|
|
|
# Install the Perl modules
|
|
|
|
#
|
|
|
|
for f in $Product/*.pm ; do
|
|
|
|
install_file $f ${DESTDIR}${PERLLIB}/$f 0644
|
|
|
|
echo "Module ${f%.*} installed as ${DESTDIR}${PERLLIB}/$f"
|
|
|
|
done
|
|
|
|
#
|
|
|
|
# Install the program skeleton files
|
|
|
|
#
|
|
|
|
for f in prog.* ; do
|
|
|
|
install_file $f ${DESTDIR}/usr/share/$PRODUCT/$f 0644
|
|
|
|
echo "Program skeleton file ${f#*.} installed as ${DESTDIR}/usr/share/$PRODUCT/$f"
|
|
|
|
done
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
if [ -z "$DESTDIR" ]; then
|
|
|
|
rm -rf /usr/share/$PRODUCT-perl
|
|
|
|
rm -rf /usr/share/$PRODUCT-shell
|
|
|
|
[ "$PERLLIB" != /usr/share/$PRODUCT ] && rm -rf /usr/share/$PRODUCT/$Product
|
|
|
|
fi
|
|
|
|
fi
|
2009-02-22 19:28:18 +01:00
|
|
|
#
|
2008-12-07 19:17:26 +01:00
|
|
|
# Create the version file
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
echo "$VERSION" > ${DESTDIR}/usr/share/$PRODUCT/version
|
|
|
|
chmod 644 ${DESTDIR}/usr/share/$PRODUCT/version
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Remove and create the symbolic link to the init script
|
|
|
|
#
|
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$DESTDIR" ]; then
|
2012-01-04 01:35:41 +01:00
|
|
|
rm -f /usr/share/$PRODUCT/init
|
|
|
|
ln -s ${DEST}/${INIT} /usr/share/$PRODUCT/init
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Man Pages
|
|
|
|
#
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
cd manpages
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
[ -n "$INSTALLD" ] || mkdir -p ${DESTDIR}${MANDIR}/man5/ ${DESTDIR}${MANDIR}/man8/
|
2010-05-09 01:32:03 +02:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
for f in *.5; do
|
|
|
|
gzip -c $f > $f.gz
|
|
|
|
run_install $INSTALLD -m 0644 $f.gz ${DESTDIR}${MANDIR}/man5/$f.gz
|
|
|
|
echo "Man page $f.gz installed to ${DESTDIR}${MANDIR}/man5/$f.gz"
|
|
|
|
done
|
2010-05-24 01:02:28 +02:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
for f in *.8; do
|
|
|
|
gzip -c $f > $f.gz
|
|
|
|
run_install $INSTALLD -m 0644 $f.gz ${DESTDIR}${MANDIR}/man8/$f.gz
|
|
|
|
echo "Man page $f.gz installed to ${DESTDIR}${MANDIR}/man8/$f.gz"
|
|
|
|
done
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
cd ..
|
2010-05-24 01:02:28 +02:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
echo "Man Pages Installed"
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -d ${DESTDIR}/etc/logrotate.d ]; then
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 logrotate ${DESTDIR}/etc/logrotate.d/$PRODUCT
|
|
|
|
echo "Logrotate file installed as ${DESTDIR}/etc/logrotate.d/$PRODUCT"
|
2009-10-01 16:37:30 +02:00
|
|
|
fi
|
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${CYGWIN}${MAC}" ]; then
|
2008-12-07 19:17:26 +01:00
|
|
|
if [ -n "$DEBIAN" ]; then
|
2012-01-04 01:35:41 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 default.debian /etc/default/$PRODUCT
|
2010-06-25 20:14:55 +02:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
update-rc.d $PRODUCT defaults
|
2010-06-25 20:14:55 +02:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
echo "$PRODUCT will start automatically at boot"
|
|
|
|
echo "Set startup=1 in /etc/default/$PRODUCT to enable"
|
|
|
|
touch /var/log/$PRODUCT-init.log
|
|
|
|
perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' /etc/$PRODUCT/$PRODUCT.conf
|
2008-12-07 19:17:26 +01:00
|
|
|
else
|
2011-08-23 23:07:44 +02:00
|
|
|
if [ -n "$SYSTEMD" ]; then
|
2012-01-04 01:35:41 +01:00
|
|
|
if systemctl enable $PRODUCT; then
|
|
|
|
echo "$Product will start automatically at boot"
|
2011-08-23 23:07:44 +02:00
|
|
|
fi
|
|
|
|
elif [ -x /sbin/insserv -o -x /usr/sbin/insserv ]; then
|
2012-01-04 01:35:41 +01:00
|
|
|
if insserv /etc/init.d/$PRODUCT ; then
|
|
|
|
echo "$PRODUCT will start automatically at boot"
|
|
|
|
echo "Set STARTUP_ENABLED=Yes in /etc/$PRODUCT/$PRODUCT.conf to enable"
|
2008-12-07 19:17:26 +01:00
|
|
|
else
|
|
|
|
cant_autostart
|
|
|
|
fi
|
|
|
|
elif [ -x /sbin/chkconfig -o -x /usr/sbin/chkconfig ]; then
|
2012-01-04 01:35:41 +01:00
|
|
|
if chkconfig --add $PRODUCT ; then
|
|
|
|
echo "$PRODUCT will start automatically in run levels as follows:"
|
|
|
|
echo "Set STARTUP_ENABLED=Yes in /etc/$PRODUCT/$PRODUCT.conf to enable"
|
|
|
|
chkconfig --list $PRODUCT
|
2008-12-07 19:17:26 +01:00
|
|
|
else
|
|
|
|
cant_autostart
|
|
|
|
fi
|
|
|
|
elif [ -x /sbin/rc-update ]; then
|
2012-01-04 01:35:41 +01:00
|
|
|
if rc-update add $PRODUCT default; then
|
|
|
|
echo "$PRODUCT will start automatically at boot"
|
|
|
|
echo "Set STARTUP_ENABLED=Yes in /etc/$PRODUCT/$PRODUCT.conf to enable"
|
2008-12-07 19:17:26 +01:00
|
|
|
else
|
|
|
|
cant_autostart
|
|
|
|
fi
|
|
|
|
elif [ "$INIT" != rc.firewall ]; then #Slackware starts this automatically
|
|
|
|
cant_autostart
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Report Success
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
echo "$Product Version $VERSION Installed"
|