diff --git a/Shorewall-core/install.sh b/Shorewall-core/install.sh index 2a8ded99b..96dae998b 100755 --- a/Shorewall-core/install.sh +++ b/Shorewall-core/install.sh @@ -280,13 +280,36 @@ fi echo "Installing Shorewall Core Version $VERSION" # -# Create /usr/share/shorewall +# Create directories # mkdir -p ${DESTDIR}${LIBEXECDIR}/shorewall chmod 755 ${DESTDIR}${LIBEXECDIR}/shorewall mkdir -p ${DESTDIR}${SHAREDIR}/shorewall chmod 755 ${DESTDIR}${SHAREDIR}/shorewall + +mkdir -p ${DESTDIR}${CONFDIR} +chmod 755 ${DESTDIR}${CONFDIR} + +if [ -n "${SYSCONFDIR}" ]; then + mkdir -p ${DESTDIR}${SYSCONFDIR} + chmod 755 ${DESTDIR}${SYSCONFDIR} +fi + +if [ -n "${SYSTEMD}" ]; then + mkdir -p ${DESTDIR}${SYSTEMD} + chmod 755 ${DESTDIR}${SYSTEMD} +fi + +mkdir -p ${DESTDIR}${SBINDIR} +chmod 755 ${DESTDIR}${SBINDIR} + +mkdir -p ${DESTDIR}${MANDIR} +chmod 755 ${DESTDIR}${MANDIR} + +# +# Note: ${VARDIR} is created at run-time since it has always been +# a relocatable directory on a per-product basis # # Install wait4ifup # diff --git a/Shorewall-core/lib.base b/Shorewall-core/lib.base index 5656d9566..14e8ad826 100644 --- a/Shorewall-core/lib.base +++ b/Shorewall-core/lib.base @@ -45,6 +45,8 @@ if [ -z "$g_readrc" ]; then g_readrc=1 fi +g_basedir=${SHAREDIR}/shorewall + case $g_program in shorewall) SHAREDIR=${SHAREDIR}/shorewall diff --git a/Shorewall-lite/install.sh b/Shorewall-lite/install.sh index ff504e544..be2dd406f 100755 --- a/Shorewall-lite/install.sh +++ b/Shorewall-lite/install.sh @@ -498,8 +498,8 @@ if [ -n "$SYSCONFFILE" -a ! -f ${DESTDIR}${SYSCONFDIR}/${PRODUCT} ]; then fi if [ ${SHAREDIR} != /usr/share ]; then - [ $PRODUCT = shorewall ] && eval sed -i \'s\|/usr/share/|${SHAREDIR}/|\' ${DESTDIR}/${SHAREDIR}/lib.base - sed -i \'s\|/usr/share/|${SHAREDIR}/|\' ${DESTDIR}/${SBINDIR}/$PRODUCT + eval sed -i \'s\|/usr/share/|${SHAREDIR}/|\' ${DESTDIR}/${SHAREDIR}/${PRODUCT}/lib.base + eval sed -i \'s\|/usr/share/|${SHAREDIR}/|\' ${DESTDIR}/${SBINDIR}/$PRODUCT fi if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${cygwin}${mac}" ]; then diff --git a/Shorewall-lite/lib.base b/Shorewall-lite/lib.base index df6064fe8..bd4ce0f2e 100644 --- a/Shorewall-lite/lib.base +++ b/Shorewall-lite/lib.base @@ -24,11 +24,10 @@ g_program=shorewall-lite g_family=4 +# +# This may be altered by the installer +# g_basedir=/usr/share/shorewall -[ -n "${VARDIR:=/var/lib/$g_program}" ] -[ -n "${SHAREDIR:=/usr/share/$g_program}" ] -[ -n "${CONFDIR:=/etc/$g_program}" ] - -. /usr/share/shorewall/lib.base +. ${g_basedir}/lib.base diff --git a/Shorewall/install.sh b/Shorewall/install.sh index c4e5c46b0..c59481ed9 100755 --- a/Shorewall/install.sh +++ b/Shorewall/install.sh @@ -993,6 +993,7 @@ if [ $PRODUCT = shorewall6 ]; then # Symbolically link 'functions' to lib.base # ln -sf lib.base ${DESTDIR}${SHAREDIR}/$PRODUCT/functions + [ $SHAREDIR = /usr/share ] || eval sed -i \'s\|/usr/share/|${SHAREDIR}/|\' ${DESTDIR}/${SHAREDIR}/${PRODUCT}/lib.base fi if [ -d Perl ]; then diff --git a/Shorewall6/lib.base b/Shorewall6/lib.base index 7c49ea29d..4bcda047a 100644 --- a/Shorewall6/lib.base +++ b/Shorewall6/lib.base @@ -24,11 +24,10 @@ g_program=shorewall6 g_family=6 +# +# This may be altered by the installer +# g_basedir=/usr/share/shorewall -[ -n "${VARDIR:=/var/lib/$g_program}" ] -[ -n "${SHAREDIR:=/usr/share/$g_program}" ] -[ -n "${CONFDIR:=/etc/$g_program}" ] - -. /usr/share/shorewall/lib.base +. ${g_basedir}/lib.base