From 65371437b5fdaa15b1c1a87b818ba9fbe1d7f6c3 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Tue, 26 Dec 2017 15:00:15 -0800 Subject: [PATCH 1/2] Correct installer for case where SHAREDIR != /usr/share/ Signed-off-by: Tom Eastep --- Shorewall-core/install.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Shorewall-core/install.sh b/Shorewall-core/install.sh index 97509792f..fc1f3b108 100755 --- a/Shorewall-core/install.sh +++ b/Shorewall-core/install.sh @@ -335,9 +335,8 @@ for f in lib.* ; do done if [ $SHAREDIR != /usr/share ]; then - eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SHAREDIR}/${PRODUCT}/lib.base - eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SHAREDIR}/${PRODUCT}/lib.core - eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SHAREDIR}/${PRODUCT}/lib.cli + eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SHAREDIR}/shorewall/lib.base + eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SHAREDIR}/shorewall/lib.cli fi # From 43adcd26a1dff0ed8adf0f61391f8be29f9c6972 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Tue, 26 Dec 2017 11:48:33 -0800 Subject: [PATCH 2/2] Make the /etc and the configfiles .conf files the same Signed-off-by: Tom Eastep # Conflicts: # Shorewall/install.sh --- Shorewall/install.sh | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Shorewall/install.sh b/Shorewall/install.sh index 917fb619a..219a75e84 100755 --- a/Shorewall/install.sh +++ b/Shorewall/install.sh @@ -497,31 +497,31 @@ fi # # Install the config file # -run_install $OWNERSHIP -m 0644 $PRODUCT.conf ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/ +fix_config() { + if [ $HOST = archlinux ] ; then + sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i $1 + elif [ $HOST = debian ]; then + perl -p -w -i -e 's|^STARTUP_ENABLED=.*|STARTUP_ENABLED=Yes|;' $1 + 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|;" $1 + fi +} + +run_install $OWNERSHIP -m 0644 $PRODUCT.conf ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/ + +fix_config ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/$PRODUCT.conf if [ $PRODUCT = shorewall ]; then run_install $OWNERSHIP -m 0644 shorewall.conf.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/ + + fix_config ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/$PRODUCT.conf.annotated fi if [ ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf ]; then run_install $OWNERSHIP -m 0600 ${PRODUCT}.conf${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf - if [ "$SHAREDIR" != /usr/share -o "$CONFDIR" != /etc ]; then - if [ $PRODUCT = shorewall ]; then - perl -p -w -i -e "s|^CONFIG_PATH=.*|CONFIG_PATH=${CONFDIR}/shorewall:${SHAREDIR}/shorewall|;" ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf - else - perl -p -w -i -e "s|^CONFIG_PATH=.*|CONFIG_PATH=${CONFDIR}/shorewall:${SHAREDIR}/shorewall6:${SHAREDIR}/shorewall|;" ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf - fi - fi - - if [ $HOST = archlinux ] ; then - sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf - elif [ $HOST = debian ]; then - 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 + fix_config ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf echo "Config file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf" fi