Rename environmental variables:

INSTALLSYS => BUILD
TARGET     => HOST

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-02-20 10:12:52 -08:00
parent 8c981e0464
commit 9869b4c068
4 changed files with 73 additions and 73 deletions

View File

@ -116,37 +116,37 @@ esac
INSTALLD='-D'
if [ -z "$INSTALLSYS" ]; then
if [ -z "$BUILD" ]; then
case $(uname) in
CYGWIN*)
INSTALLSYS=CYGWIN
BUILD=CYGWIN
;;
Darwin)
INSTALLSYS=MAC
BUILD=MAC
;;
*)
if [ -f /etc/debian_version ]; then
INSTALLSYS=DEBIAN
BUILD=DEBIAN
elif [ -f /etc/redhat-release ]; then
if [ -d /etc/sysconfig/network-scripts/ ]; then
INSTALLSYS=REDHAT
BUILD=REDHAT
else
INSTALLSYS=FEDORA
BUILD=FEDORA
fi
elif [ -f /etc/slackware-version ] ; then
INSTALLSYS=SLACKWARE
BUILD=SLACKWARE
elif [ -f /etc/SuSE-release ]; then
INSTALLSYS=SUSE
BUILD=SUSE
elif [ -f /etc/arch-release ] ; then
INSTALLSYS=ARCHLINUX
BUILD=ARCHLINUX
else
INSTALLSYS=LINUX
BUILD=LINUX
fi
;;
esac
fi
case $INSTALLSYS in
case $BUILD in
CYGWIN*)
if [ -z "$DESTDIR" ]; then
DEST=
@ -215,9 +215,9 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
# Determine where to install the firewall script
#
[ -n "$TARGET" ] || TARGET=$INSTALLSYS
[ -n "$HOST" ] || HOST=$BUILD
case "$TARGET" in
case "$HOST" in
CYGWIN)
echo "Installing Cygwin-specific configuration..."
;;
@ -231,13 +231,13 @@ case "$TARGET" in
FEDORA|REDHAT|SLACKWARE|ARCHLINUX|LINUX)
;;
*)
echo "ERROR: Unknown TARGET \"$TARGET\"" >&2
echo "ERROR: Unknown HOST \"$HOST\"" >&2
exit 1;
;;
esac
if [ -n "$DESTDIR" ]; then
if [ $INSTALLSYS != CYGWIN ]; then
if [ $BUILD != CYGWIN ]; then
if [ `id -u` != 0 ] ; then
echo "Not setting file owner/group permissions, not running as root."
OWNERSHIP=""

View File

@ -116,37 +116,37 @@ case "$LIBEXEC" in
;;
esac
if [ -z "$INSTALLSYS" ]; then
if [ -z "$BUILD" ]; then
case $(uname) in
CYGWIN*)
INSTALLSYS=CYGWIN
BUILD=CYGWIN
;;
Darwin)
INSTALLSYS=MAC
BUILD=MAC
;;
*)
if [ -f /etc/debian_version ]; then
INSTALLSYS=DEBIAN
BUILD=DEBIAN
elif [ -f /etc/redhat-release ]; then
if [ -d /etc/sysconfig/network-scripts/ ]; then
INSTALLSYS=REDHAT
BUILD=REDHAT
else
INSTALLSYS=FEDORA
BUILD=FEDORA
fi
elif [ -f /etc/SuSE-release ]; then
INSTALLSYS=SUSE
BUILD=SUSE
elif [ -f /etc/slackware-version ] ; then
INSTALLSYS=SLACKWARE
BUILD=SLACKWARE
elif [ -f /etc/arch-release ] ; then
INSTALLSYS=ARCHLINUX
BUILD=ARCHLINUX
else
INSTALLSYS=
BUILD=
fi
;;
esac
fi
case $INSTALLSYS in
case $BUILD in
CYGWIN*)
OWNER=$(id -un)
GROUP=$(id -gn)
@ -171,9 +171,9 @@ esac
OWNERSHIP="-o $OWNER -g $GROUP"
[ -n "$TARGET" ] || TARGET=$INSTALLSYS
[ -n "$HOST" ] || HOST=$BUILD
case "$TARGET" in
case "$HOST" in
DEBIAN)
echo "Installing Debian-specific configuration..."
SPARSE=yes
@ -201,7 +201,7 @@ case "$TARGET" in
echo "ERROR: Shorewall-init is not supported on this system" >&2
;;
*)
echo "ERROR: Unsupported TARGET distribution: \"$TARGET\"" >&2
echo "ERROR: Unsupported HOST distribution: \"$HOST\"" >&2
exit 1;
;;
esac
@ -250,7 +250,7 @@ fi
#
# Install the Init Script
#
case $TARGET in
case $HOST in
DEBIAN)
install_file init.debian.sh ${DESTDIR}/etc/init.d/shorewall-init 0544
;;
@ -292,7 +292,7 @@ if [ -z "$DESTDIR" ]; then
ln -s ${DEST}/${INIT} /usr/share/shorewall-init/init
fi
if [ $TARGET = DEBIAN ]; then
if [ $HOST = DEBIAN ]; then
if [ -n "${DESTDIR}" ]; then
mkdir -p ${DESTDIR}/etc/network/if-up.d/
mkdir -p ${DESTDIR}/etc/network/if-post-down.d/
@ -310,7 +310,7 @@ else
mkdir -p ${DESTDIR}/etc/sysconfig
if [ -z "$RPM" ]; then
if [ $TARGET = SUSE ]; then
if [ $HOST = SUSE ]; then
mkdir -p ${DESTDIR}/etc/sysconfig/network/if-up.d
mkdir -p ${DESTDIR}/etc/sysconfig/network/if-down.d
else
@ -336,7 +336,7 @@ if [ -d ${DESTDIR}/etc/NetworkManager ]; then
install_file ifupdown.sh ${DESTDIR}/etc/NetworkManager/dispatcher.d/01-shorewall 0544
fi
case $TARGET in
case $HOST in
DEBIAN)
install_file ifupdown.sh ${DESTDIR}/etc/network/if-up.d/shorewall 0544
install_file ifupdown.sh ${DESTDIR}/etc/network/if-post-down.d/shorewall 0544
@ -359,7 +359,7 @@ esac
if [ -z "$DESTDIR" ]; then
if [ -n "$first_install" ]; then
if [ $TARGET = DEBIAN ]; then
if [ $HOST = DEBIAN ]; then
update-rc.d shorewall-init defaults
@ -396,7 +396,7 @@ if [ -z "$DESTDIR" ]; then
fi
else
if [ -n "$first_install" ]; then
if [ $TARGET = DEBIAN ]; then
if [ $HOST = DEBIAN ]; then
if [ -n "${DESTDIR}" ]; then
mkdir -p ${DESTDIR}/etc/rcS.d
fi
@ -408,7 +408,7 @@ else
fi
if [ -f ${DESTDIR}/etc/ppp ]; then
case $TARGET in
case $HOST in
DEBIAN|SUSE)
for directory in ip-up.d ip-down.d ipv6-up.d ipv6-down.d; do
mkdir -p ${DESTDIR}/etc/ppp/$directory #SuSE doesn't create the IPv6 directories

View File

@ -138,37 +138,37 @@ CYGWIN=
INSTALLD='-D'
T='-T'
if [ -z "$INSTALLSYS" ]; then
if [ -z "$BUILD" ]; then
case $(uname) in
CYGWIN*)
INSTALLSYS=CYGWIN
BUILD=CYGWIN
;;
Darwin)
INSTALLSYS=MAC
BUILD=MAC
;;
*)
if [ -f /etc/debian_version ]; then
INSTALLSYS=DEBIAN
BUILD=DEBIAN
elif [ -f /etc/redhat-release ]; then
if [ -d /etc/sysconfig/network-scripts/ ]; then
INSTALLSYS=REDHAT
BUILD=REDHAT
else
INSTALLSYS=FEDORA
BUILD=FEDORA
fi
elif [ -f /etc/SuSE-release ]; then
INSTALLSYS=SUSE
BUILD=SUSE
elif [ -f /etc/slackware-version ] ; then
INSTALLSYS=SLACKWARE
BUILD=SLACKWARE
elif [ -f /etc/arch-release ] ; then
INSTALLSYS=ARCHLINUX
BUILD=ARCHLINUX
else
INSTALLSYS=LINUX
BUILD=LINUX
fi
;;
esac
fi
case $INSTALLSYS in
case $BUILD in
CYGWIN*)
if [ -z "$DESTDIR" ]; then
DEST=
@ -198,9 +198,9 @@ esac
OWNERSHIP="-o $OWNER -g $GROUP"
[ -n "$TARGET" ] || TARGET=$INSTALLSYS
[ -n "$HOST" ] || HOST=$BUILD
case "$TARGET" in
case "$HOST" in
CYGWIN)
echo "Installing Cygwin-specific configuration..."
;;
@ -229,7 +229,7 @@ case "$TARGET" in
LINUX|SUSE)
;;
*)
echo "ERROR: Unknown TARGET \"$TARGET\"" >&2
echo "ERROR: Unknown HOST \"$HOST\"" >&2
exit 1;
;;
esac
@ -303,7 +303,7 @@ echo "$Product control program installed in ${DESTDIR}/sbin/$PRODUCT"
#
# Install the Firewall Script
#
case $TARGET in
case $HOST in
DEBIAN)
install_file init.debian.sh ${DESTDIR}/etc/init.d/$PRODUCT 0544
;;
@ -352,7 +352,7 @@ if [ ! -f ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf ]; then
echo "Config file installed as ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf"
fi
if [ $TARGET = ARCHLINUX ] ; then
if [ $HOST = ARCHLINUX ] ; then
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf
fi
@ -463,7 +463,7 @@ if [ -z "$DESTDIR" ]; then
touch /var/log/$PRODUCT-init.log
if [ -n "$first_install" ]; then
if [ $TARGET = DEBIAN ]; then
if [ $HOST = DEBIAN ]; then
run_install $OWNERSHIP -m 0644 default.debian /etc/default/$PRODUCT
update-rc.d $PRODUCT defaults

View File

@ -131,37 +131,37 @@ case "$PERLLIB" in
;;
esac
if [ -z "$INSTALLSYS" ]; then
if [ -z "$BUILD" ]; then
case $(uname) in
CYGWIN*)
INSTALLSYS=CYGWIN
BUILD=CYGWIN
;;
Darwin)
INSTALLSYS=MAC
BUILD=MAC
;;
*)
if [ -f /etc/debian_version ]; then
INSTALLSYS=DEBIAN
BUILD=DEBIAN
elif [ -f /etc/redhat-release ]; then
if [ -d /etc/sysconfig/network-scripts/ ]; then
INSTALLSYS=REDHAT
BUILD=REDHAT
else
INSTALLSYS=FEDORA
BUILD=FEDORA
fi
elif [ -f /etc/slackware-version ] ; then
INSTALLSYS=SLACKWARE
BUILD=SLACKWARE
elif [ -f /etc/SuSE-release ]; then
INSTALLSYS=SUSE
BUILD=SUSE
elif [ -f /etc/arch-release ] ; then
INSTALLSYS=ARCHLINUX
BUILD=ARCHLINUX
else
INSTALLSYS=LINUX
BUILD=LINUX
fi
;;
esac
fi
case $INSTALLSYS in
case $BUILD in
CYGWIN*)
if [ -z "$DESTDIR" ]; then
DEST=
@ -253,9 +253,9 @@ if [ $PRODUCT = shorewall ]; then
fi
fi
[ -n "$TARGET" ] || TARGET=$INSTALLSYS
[ -n "$HOST" ] || HOST=$BUILD
case "$TARGET" in
case "$HOST" in
CYGWIN)
echo "Installing Cygwin-specific configuration..."
;;
@ -284,7 +284,7 @@ case "$TARGET" in
LINUX)
;;
*)
echo "ERROR: Unknown TARGET \"$TARGET\"" >&2
echo "ERROR: Unknown HOST \"$HOST\"" >&2
exit 1;
;;
esac
@ -298,7 +298,7 @@ if [ -z "$INIT" ] ; then
fi
if [ -n "$DESTDIR" ]; then
if [ $INSTALLSYS != CYGWIN ]; then
if [ $BUILD != CYGWIN ]; then
if [ `id -u` != 0 ] ; then
echo "Not setting file owner/group permissions, not running as root."
OWNERSHIP=""
@ -336,7 +336,7 @@ if [ -z "${DESTDIR}" -a $PRODUCT = shorewall -a ! -f /usr/share/$PRODUCT/corever
exit 1
fi
if [ $TARGET != CYGWIN ]; then
if [ $HOST != CYGWIN ]; then
install_file $PRODUCT ${DESTDIR}/sbin/$PRODUCT 0755
echo "$PRODUCT control program installed in ${DESTDIR}/sbin/$PRODUCT"
else
@ -347,7 +347,7 @@ fi
#
# Install the Firewall Script
#
case $TARGET in
case $HOST in
DEBIAN)
install_file init.debian.sh ${DESTDIR}/etc/init.d/$PRODUCT 0544
;;
@ -465,7 +465,7 @@ run_install $OWNERSHIP -m 0644 $PRODUCT.conf.annotated ${DESTDIR}/usr/share/$PRO
if [ ! -f ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf ]; then
run_install $OWNERSHIP -m 0644 $PRODUCT.conf${suffix} ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf
if [ $TARGET = DEBIAN ] && mywhich perl; then
if [ $HOST = DEBIAN ] && mywhich perl; then
#
# Make a Debian-like $PRODUCT.conf
#
@ -476,7 +476,7 @@ if [ ! -f ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf ]; then
fi
if [ $TARGET = ARCHLINUX ] ; then
if [ $HOST = ARCHLINUX ] ; then
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf
fi
@ -1119,7 +1119,7 @@ if [ -d ${DESTDIR}/etc/logrotate.d ]; then
fi
if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${CYGWIN}${MAC}" ]; then
if [ $TARGET = DEBIAN ]; then
if [ $HOST = DEBIAN ]; then
run_install $OWNERSHIP -m 0644 default.debian /etc/default/$PRODUCT
update-rc.d $PRODUCT defaults