Rename HOST -> TARGET and BUILD -> HOST

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-02-21 13:00:09 -08:00
parent 3acd01a44d
commit f6cc44eb6b
4 changed files with 69 additions and 74 deletions

View File

@ -96,7 +96,6 @@ T="-T"
[ -n "${LIBEXEC:=/usr/share}" ]
[ -n "${PERLLIB:=/usr/share/shorewall}" ]
MACHOST=
case "$LIBEXEC" in
/*)
@ -118,33 +117,33 @@ esac
INSTALLD='-D'
if [ -z "$BUILD" ]; then
if [ -z "$HOST" ]; then
case $(uname) in
CYGWIN*)
BUILD=CYGWIN
HOST=CYGWIN
;;
Darwin)
BUILD=MAC
HOST=MAC
;;
*)
if [ -f /etc/debian_version ]; then
BUILD=DEBIAN
HOST=DEBIAN
elif [ -f /etc/redhat-release ]; then
BUILD=REDHAT
HOST=REDHAT
elif [ -f /etc/slackware-version ] ; then
BUILD=SLACKWARE
HOST=SLACKWARE
elif [ -f /etc/SuSE-release ]; then
BUILD=SUSE
HOST=SUSE
elif [ -f /etc/arch-release ] ; then
BUILD=ARCHLINUX
HOST=ARCHLINUX
else
BUILD=LINUX
HOST=LINUX
fi
;;
esac
fi
case $BUILD in
case $HOST in
CYGWIN*)
if [ -z "$DESTDIR" ]; then
DEST=
@ -213,29 +212,25 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
# Determine where to install the firewall script
#
[ -n "$HOST" ] || HOST=$BUILD
[ -n "$TARGET" ] || TARGET=$HOST
case "$HOST" in
case "$TARGET" in
CYGWIN)
echo "Installing Cygwin-specific configuration..."
;;
MAC)
echo "Installing Mac-specific configuration...";
;;
DEBIAN)
echo "Installing Debian-specific configuration..."
SPARSE=yes
;;
REDHAT|SLACKWARE|ARCHLINUX|LINUX)
DEBIAN|REDHAT|SLACKWARE|ARCHLINUX|LINUX|SUSE)
;;
*)
echo "ERROR: Unknown HOST \"$HOST\"" >&2
echo "ERROR: Unknown TARGET \"$TARGET\"" >&2
exit 1;
;;
esac
if [ -n "$DESTDIR" ]; then
if [ $BUILD != CYGWIN ]; then
if [ $HOST != CYGWIN ]; then
if [ `id -u` != 0 ] ; then
echo "Not setting file owner/group permissions, not running as root."
OWNERSHIP=""
@ -276,7 +271,7 @@ for f in lib.* ; do
echo "Library ${f#*.} file installed as ${DESTDIR}/usr/share/shorewall/$f"
done
if [ -z "$MACHOST" ]; then
if [ $HOST = MAC ]; then
eval sed -i \'s\|g_libexec=.\*\|g_libexec=$LIBEXEC\|\' ${DESTDIR}/usr/share/shorewall/lib.cli
eval sed -i \'s\|g_perllib=.\*\|g_perllib=$PERLLIB\|\' ${DESTDIR}/usr/share/shorewall/lib.cli
else

View File

@ -119,33 +119,33 @@ esac
INITFILE="shorewall-init"
if [ -z "$BUILD" ]; then
if [ -z "$HOST" ]; then
case $(uname) in
CYGWIN*)
BUILD=CYGWIN
HOST=CYGWIN
;;
Darwin)
BUILD=MAC
HOST=MAC
;;
*)
if [ -f /etc/debian_version ]; then
BUILD=DEBIAN
HOST=DEBIAN
elif [ -f /etc/redhat-release ]; then
BUILD=REDHAT
HOST=REDHAT
elif [ -f /etc/SuSE-release ]; then
BUILD=SUSE
HOST=SUSE
elif [ -f /etc/slackware-version ] ; then
BUILD=SLACKWARE
HOST=SLACKWARE
elif [ -f /etc/arch-release ] ; then
BUILD=ARCHLINUX
HOST=ARCHLINUX
else
BUILD=
HOST=
fi
;;
esac
fi
case $BUILD in
case $HOST in
CYGWIN*)
OWNER=$(id -un)
GROUP=$(id -gn)
@ -164,9 +164,9 @@ esac
OWNERSHIP="-o $OWNER -g $GROUP"
[ -n "$HOST" ] || HOST=$BUILD
[ -n "$TARGET" ] || TARGET=$HOST
case "$HOST" in
case "$TARGET" in
DEBIAN)
echo "Installing Debian-specific configuration..."
SPARSE=yes
@ -190,7 +190,7 @@ case "$HOST" in
echo "ERROR: Shorewall-init is not supported on this system" >&2
;;
*)
echo "ERROR: Unsupported HOST distribution: \"$HOST\"" >&2
echo "ERROR: Unsupported TARGET distribution: \"$TARGET\"" >&2
exit 1;
;;
esac
@ -268,7 +268,7 @@ if [ -z "$DESTDIR" ]; then
ln -s ${INITDIR}/${INITFILE} /usr/share/shorewall-init/init
fi
if [ $HOST = DEBIAN ]; then
if [ $TARGET = DEBIAN ]; then
if [ -n "${DESTDIR}" ]; then
mkdir -p ${DESTDIR}/etc/network/if-up.d/
mkdir -p ${DESTDIR}/etc/network/if-post-down.d/
@ -286,7 +286,7 @@ else
mkdir -p ${DESTDIR}/etc/sysconfig
if [ -z "$RPM" ]; then
if [ $HOST = SUSE ]; then
if [ $TARGET = SUSE ]; then
mkdir -p ${DESTDIR}/etc/sysconfig/network/if-up.d
mkdir -p ${DESTDIR}/etc/sysconfig/network/if-down.d
else
@ -312,7 +312,7 @@ if [ -d ${DESTDIR}/etc/NetworkManager ]; then
install_file ifupdown.sh ${DESTDIR}/etc/NetworkManager/dispatcher.d/01-shorewall 0544
fi
case $HOST in
case $TARGET 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
@ -335,7 +335,7 @@ esac
if [ -z "$DESTDIR" ]; then
if [ -n "$first_install" ]; then
if [ $HOST = DEBIAN ]; then
if [ $TARGET = DEBIAN ]; then
update-rc.d shorewall-init defaults
@ -372,7 +372,7 @@ if [ -z "$DESTDIR" ]; then
fi
else
if [ -n "$first_install" ]; then
if [ $HOST = DEBIAN ]; then
if [ $TARGET = DEBIAN ]; then
if [ -n "${DESTDIR}" ]; then
mkdir -p ${DESTDIR}/etc/rcS.d
fi
@ -384,7 +384,7 @@ else
fi
if [ -f ${DESTDIR}/etc/ppp ]; then
case $HOST in
case $TARGET 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

@ -140,33 +140,33 @@ INSTALLD='-D'
INITFILE=$PRODUCT
T='-T'
if [ -z "$BUILD" ]; then
if [ -z "$HOST" ]; then
case $(uname) in
CYGWIN*)
BUILD=CYGWIN
HOST=CYGWIN
;;
Darwin)
BUILD=MAC
HOST=MAC
;;
*)
if [ -f /etc/debian_version ]; then
BUILD=DEBIAN
HOST=DEBIAN
elif [ -f /etc/redhat-release ]; then
BUILD=REDHAT
HOST=REDHAT
elif [ -f /etc/SuSE-release ]; then
BUILD=SUSE
HOST=SUSE
elif [ -f /etc/slackware-version ] ; then
BUILD=SLACKWARE
HOST=SLACKWARE
elif [ -f /etc/arch-release ] ; then
BUILD=ARCHLINUX
HOST=ARCHLINUX
else
BUILD=LINUX
HOST=LINUX
fi
;;
esac
fi
case $BUILD in
case $HOST in
CYGWIN*)
OWNER=$(id -un)
GROUP=$(id -gn)
@ -185,9 +185,9 @@ esac
OWNERSHIP="-o $OWNER -g $GROUP"
[ -n "$HOST" ] || HOST=$BUILD
[ -n "$TARGET" ] || TARGET=$HOST
case "$HOST" in
case "$TARGET" in
CYGWIN)
echo "$PRODUCT is not supported on Cygwin" >&2
exit 1
@ -218,7 +218,7 @@ case "$HOST" in
LINUX|SUSE)
;;
*)
echo "ERROR: Unknown HOST \"$HOST\"" >&2
echo "ERROR: Unknown TARGET \"$TARGET\"" >&2
exit 1;
;;
esac
@ -321,7 +321,7 @@ if [ ! -f ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf ]; then
echo "Config file installed as ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf"
fi
if [ $HOST = ARCHLINUX ] ; then
if [ $TARGET = ARCHLINUX ] ; then
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf
fi
@ -432,7 +432,7 @@ if [ -z "$DESTDIR" ]; then
touch /var/log/$PRODUCT-init.log
if [ -n "$first_install" ]; then
if [ $HOST = DEBIAN ]; then
if [ $TARGET = DEBIAN ]; then
run_install $OWNERSHIP -m 0644 default.debian /etc/default/$PRODUCT
update-rc.d $PRODUCT defaults

View File

@ -135,33 +135,33 @@ case "$PERLLIB" in
;;
esac
if [ -z "$BUILD" ]; then
if [ -z "$HOST" ]; then
case $(uname) in
CYGWIN*)
BUILD=CYGWIN
HOST=CYGWIN
;;
Darwin)
BUILD=MAC
HOST=MAC
;;
*)
if [ -f /etc/debian_version ]; then
BUILD=DEBIAN
HOST=DEBIAN
elif [ -f /etc/redhat-release ]; then
BUILD=REDHAT
HOST=REDHAT
elif [ -f /etc/slackware-version ] ; then
BUILD=SLACKWARE
HOST=SLACKWARE
elif [ -f /etc/SuSE-release ]; then
BUILD=SUSE
HOST=SUSE
elif [ -f /etc/arch-release ] ; then
BUILD=ARCHLINUX
HOST=ARCHLINUX
else
BUILD=LINUX
HOST=LINUX
fi
;;
esac
fi
case $BUILD in
case $HOST in
CYGWIN*)
OWNER=$(id -un)
GROUP=$(id -gn)
@ -242,9 +242,9 @@ if [ $PRODUCT = shorewall ]; then
fi
fi
[ -n "$HOST" ] || HOST=$BUILD
[ -n "$TARGET" ] || TARGET=$HOST
case "$HOST" in
case "$TARGET" in
CYGWIN)
echo "Installing Cygwin-specific configuration..."
INITFILE=
@ -275,7 +275,7 @@ case "$HOST" in
LINUX)
;;
*)
echo "ERROR: Unknown HOST \"$HOST\"" >&2
echo "ERROR: Unknown TARGET \"$TARGET\"" >&2
exit 1;
;;
esac
@ -285,7 +285,7 @@ if [ -z "$INITDIR" -a -n "$INITFILE" ] ; then
fi
if [ -n "$DESTDIR" ]; then
if [ $BUILD != CYGWIN ]; then
if [ $HOST != CYGWIN ]; then
if [ `id -u` != 0 ] ; then
echo "Not setting file owner/group permissions, not running as root."
OWNERSHIP=""
@ -323,7 +323,7 @@ if [ -z "${DESTDIR}" -a $PRODUCT = shorewall -a ! -f /usr/share/$PRODUCT/corever
exit 1
fi
if [ $HOST != CYGWIN ]; then
if [ $TARGET != CYGWIN ]; then
install_file $PRODUCT ${DESTDIR}/sbin/$PRODUCT 0755
echo "$PRODUCT control program installed in ${DESTDIR}/sbin/$PRODUCT"
else
@ -334,7 +334,7 @@ fi
#
# Install the Firewall Script
#
case $HOST in
case $TARGET in
SLACKWARE)
if [ $PRODUCT = shorewall ]; then
install_file init.slackware.firewall.sh ${DESTDIR}${DEST}/rc.firewall 0644
@ -443,7 +443,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 [ $HOST = DEBIAN ] && mywhich perl; then
if [ $TARGET = DEBIAN ] && mywhich perl; then
#
# Make a Debian-like $PRODUCT.conf
#
@ -454,7 +454,7 @@ if [ ! -f ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf ]; then
fi
if [ $HOST = ARCHLINUX ] ; then
if [ $TARGET = ARCHLINUX ] ; then
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf
fi
@ -1097,7 +1097,7 @@ if [ -d ${DESTDIR}/etc/logrotate.d ]; then
fi
if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${CYGWIN}${MAC}" ]; then
if [ $HOST = DEBIAN ]; then
if [ $TARGET = DEBIAN ]; then
run_install $OWNERSHIP -m 0644 default.debian /etc/default/$PRODUCT
update-rc.d $PRODUCT defaults