Apply Thomas D's Gentoo support patch

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2013-09-17 08:22:52 -07:00
parent df028e420c
commit 4524281163
4 changed files with 44 additions and 2 deletions

View File

@ -204,6 +204,9 @@ if [ -z "$BUILD" ]; then
debian) debian)
BUILD=debian BUILD=debian
;; ;;
gentoo)
BUILD=gentoo
;;
opensuse) opensuse)
BUILD=suse BUILD=suse
;; ;;
@ -213,6 +216,8 @@ if [ -z "$BUILD" ]; then
esac esac
elif [ -f /etc/debian_version ]; then elif [ -f /etc/debian_version ]; then
BUILD=debian BUILD=debian
elif [ -f /etc/gentoo-release ]; then
BUILD=gentoo
elif [ -f /etc/redhat-release ]; then elif [ -f /etc/redhat-release ]; then
BUILD=redhat BUILD=redhat
elif [ -f /etc/slackware-version ] ; then elif [ -f /etc/slackware-version ] ; then
@ -271,7 +276,7 @@ case "$HOST" in
apple) apple)
echo "Installing Mac-specific configuration..."; echo "Installing Mac-specific configuration...";
;; ;;
debian|redhat|slackware|archlinux|linux|suse) debian|gentoo|redhat|slackware|archlinux|linux|suse)
;; ;;
*) *)
echo "ERROR: Unknown HOST \"$HOST\"" >&2 echo "ERROR: Unknown HOST \"$HOST\"" >&2

View File

@ -194,6 +194,9 @@ if [ -z "$BUILD" ]; then
debian) debian)
BUILD=debian BUILD=debian
;; ;;
gentoo)
BUILD=gentoo
;;
opensuse) opensuse)
BUILD=suse BUILD=suse
;; ;;
@ -203,6 +206,8 @@ if [ -z "$BUILD" ]; then
esac esac
elif [ -f /etc/debian_version ]; then elif [ -f /etc/debian_version ]; then
BUILD=debian BUILD=debian
elif [ -f /etc/gentoo-release ]; then
BUILD=gentoo
elif [ -f /etc/redhat-release ]; then elif [ -f /etc/redhat-release ]; then
BUILD=redhat BUILD=redhat
elif [ -f /etc/SuSE-release ]; then elif [ -f /etc/SuSE-release ]; then
@ -225,7 +230,7 @@ case $BUILD in
apple) apple)
T= T=
;; ;;
debian|redhat|suse|slackware|archlinux) debian|gentoo|redhat|suse|slackware|archlinux)
;; ;;
*) *)
[ -n "$BUILD" ] && echo "ERROR: Unknown BUILD environment ($BUILD)" >&2 || echo "ERROR: Unknown BUILD environment" [ -n "$BUILD" ] && echo "ERROR: Unknown BUILD environment ($BUILD)" >&2 || echo "ERROR: Unknown BUILD environment"
@ -241,6 +246,9 @@ case "$HOST" in
debian) debian)
echo "Installing Debian-specific configuration..." echo "Installing Debian-specific configuration..."
;; ;;
gentoo)
echo "Installing Gentoo-specific configuration..."
;;
redhat) redhat)
echo "Installing Redhat/Fedora-specific configuration..." echo "Installing Redhat/Fedora-specific configuration..."
;; ;;
@ -375,6 +383,9 @@ else
if [ $HOST = suse ]; then if [ $HOST = suse ]; then
mkdir -p ${DESTDIR}/etc/sysconfig/network/if-up.d mkdir -p ${DESTDIR}/etc/sysconfig/network/if-up.d
mkdir -p ${DESTDIR}${SYSCONFDIR}/network/if-down.d mkdir -p ${DESTDIR}${SYSCONFDIR}/network/if-down.d
elif [ $HOST = gentoo ]; then
# Gentoo does not support if-{up,down}.d
return
else else
mkdir -p ${DESTDIR}/etc/NetworkManager/dispatcher.d mkdir -p ${DESTDIR}/etc/NetworkManager/dispatcher.d
fi fi
@ -446,6 +457,10 @@ if [ -z "$DESTDIR" ]; then
update-rc.d shorewall-init enable update-rc.d shorewall-init enable
echo "Shorewall Init will start automatically at boot" echo "Shorewall Init will start automatically at boot"
elif [ $HOST = gentoo ]; then
# On Gentoo, a service must be enabled manually by the user,
# not by the installer
return
else else
if [ -n "$SYSTEMD" ]; then if [ -n "$SYSTEMD" ]; then
if systemctl enable shorewall-init.service; then if systemctl enable shorewall-init.service; then

View File

@ -212,6 +212,9 @@ if [ -z "$BUILD" ]; then
debian) debian)
BUILD=debian BUILD=debian
;; ;;
gentoo)
BUILD=gentoo
;;
opensuse) opensuse)
BUILD=suse BUILD=suse
;; ;;
@ -221,6 +224,8 @@ if [ -z "$BUILD" ]; then
esac esac
elif [ -f ${CONFDIR}/debian_version ]; then elif [ -f ${CONFDIR}/debian_version ]; then
BUILD=debian BUILD=debian
elif [ -f /etc/gentoo-release ]; then
BUILD=gentoo
elif [ -f ${CONFDIR}/redhat-release ]; then elif [ -f ${CONFDIR}/redhat-release ]; then
BUILD=redhat BUILD=redhat
elif [ -f ${CONFDIR}/SuSE-release ]; then elif [ -f ${CONFDIR}/SuSE-release ]; then
@ -269,6 +274,9 @@ case "$HOST" in
debian) debian)
echo "Installing Debian-specific configuration..." echo "Installing Debian-specific configuration..."
;; ;;
gentoo)
echo "Installing Gentoo-specific configuration..."
;;
redhat) redhat)
echo "Installing Redhat/Fedora-specific configuration..." echo "Installing Redhat/Fedora-specific configuration..."
;; ;;
@ -389,6 +397,9 @@ fi
if [ $HOST = archlinux ] ; then if [ $HOST = archlinux ] ; then
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
elif [ $HOST = gentoo ]; then
# Adjust SUBSYSLOCK path (see https://bugs.gentoo.org/show_bug.cgi?id=459316)
perl -p -w -i -e "s|^SUBSYSLOCK=.*|SUBSYSLOCK=/run/lock/$PRODUCT|;" ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
fi fi
# #

View File

@ -222,6 +222,9 @@ if [ -z "$BUILD" ]; then
debian) debian)
BUILD=debian BUILD=debian
;; ;;
gentoo)
BUILD=gentoo
;;
opensuse) opensuse)
BUILD=suse BUILD=suse
;; ;;
@ -231,6 +234,8 @@ if [ -z "$BUILD" ]; then
esac esac
elif [ -f /etc/debian_version ]; then elif [ -f /etc/debian_version ]; then
BUILD=debian BUILD=debian
elif [ -f /etc/gentoo-release ]; then
BUILD=gentoo
elif [ -f /etc/redhat-release ]; then elif [ -f /etc/redhat-release ]; then
BUILD=redhat BUILD=redhat
elif [ -f /etc/slackware-version ] ; then elif [ -f /etc/slackware-version ] ; then
@ -275,6 +280,9 @@ case "$HOST" in
debian) debian)
echo "Installing Debian-specific configuration..." echo "Installing Debian-specific configuration..."
;; ;;
gentoo)
echo "Installing Gentoo-specific configuration..."
;;
redhat) redhat)
echo "Installing Redhat/Fedora-specific configuration..." echo "Installing Redhat/Fedora-specific configuration..."
;; ;;
@ -499,6 +507,9 @@ if [ ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf ]; then
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
elif [ $HOST = debian ]; then elif [ $HOST = debian ]; then
perl -p -w -i -e 's|^STARTUP_ENABLED=.*|STARTUP_ENABLED=Yes|;' ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf${suffix} perl -p -w -i -e 's|^STARTUP_ENABLED=.*|STARTUP_ENABLED=Yes|;' ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf${suffix}
elif [ $HOST = gentoo ]; then
# Adjust SUBSYSLOCK path (see https://bugs.gentoo.org/show_bug.cgi?id=459316)
perl -p -w -i -e "s|^SUBSYSLOCK=.*|SUBSYSLOCK=/run/lock/$PRODUCT|;" ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf${suffix}
fi fi
echo "Config file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf" echo "Config file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf"