From e66d9e34182e06e6a8fc0a216af617839386ea8c Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sun, 2 Sep 2012 14:36:11 -0700 Subject: [PATCH] Rename VARDIR to VARLIB in shorewallrc - Done so that existing shorewallrc files are still valid. Signed-off-by: Tom Eastep --- Shorewall-core/configure | 14 +++++++++++++- Shorewall-core/configure.pl | 12 +++++++++++- Shorewall-core/install.sh | 7 ++++++- Shorewall-core/lib.base | 6 ++++-- Shorewall-core/shorewallrc.apple | 2 +- Shorewall-core/shorewallrc.archlinux | 2 +- Shorewall-core/shorewallrc.cygwin | 2 +- Shorewall-core/shorewallrc.debian | 2 +- Shorewall-core/shorewallrc.default | 2 +- Shorewall-core/shorewallrc.redhat | 2 +- Shorewall-core/shorewallrc.slackware | 2 +- Shorewall-core/shorewallrc.suse | 2 +- Shorewall-init/install.sh | 7 ++++++- Shorewall-lite/install.sh | 11 ++++++++--- Shorewall/install.sh | 9 +++++++-- 15 files changed, 63 insertions(+), 19 deletions(-) diff --git a/Shorewall-core/configure b/Shorewall-core/configure index 860976aa6..8efeea73c 100755 --- a/Shorewall-core/configure +++ b/Shorewall-core/configure @@ -76,7 +76,7 @@ for p in $@; do pn=HOST ;; SHAREDSTATEDIR) - pn=VARDIR + pn=VARLIB ;; DATADIR) pn=SHAREDIR @@ -161,6 +161,17 @@ if [ $# -gt 0 ]; then echo '#' >> shorewallrc fi +if [ -n "${options[VARLIB]}" ]; then + if [ -z "${options[VARDIR]}" ]; then + options[VARDIR]='${VARLIB}/${PRODUCT}' + fi +elif [ -n "${options[VARDIR]}" ]; then + if [ -z "{$options[VARLIB]}" ]; then + options[VARLIB]=${options[VARDIR]} + options[VARDIR]='${VARLIB}/${PRODUCT}' + fi +fi + for on in \ HOST \ PREFIX \ @@ -180,6 +191,7 @@ for on in \ SYSCONFDIR \ SPARSE \ ANNOTATED \ + VARLIB \ VARDIR do echo "$on=${options[${on}]}" diff --git a/Shorewall-core/configure.pl b/Shorewall-core/configure.pl index 439c3ca7e..f2b213c3a 100755 --- a/Shorewall-core/configure.pl +++ b/Shorewall-core/configure.pl @@ -38,7 +38,7 @@ my %params; my %options; my %aliases = ( VENDOR => 'HOST', - SHAREDSTATEDIR => 'VARDIR', + SHAREDSTATEDIR => 'VARLIB', DATADIR => 'SHAREDIR' ); for ( @ARGV ) { @@ -123,6 +123,15 @@ printf $outfile "#\n# Created by Shorewall Core version %s configure.pl - %s %2d print $outfile "# Input: @ARGV\n#\n" if @ARGV; +if ( $options{VARLIB} ) { + unless ( $options{VARDIR} ) { + $options{VARDIR} = '${VARLIB}/${PRODUCT}'; + } +} elsif ( $options{VARDIR} ) { + $options{VARLIB} = $options{VARDIR}; + $options{VARDIR} = '${VARLIB}/${PRODUCT}'; +} + for ( qw/ HOST PREFIX SHAREDIR @@ -141,6 +150,7 @@ for ( qw/ HOST SYSCONFDIR SPARSE ANNOTATED + VARLIB VARDIR / ) { my $val = $options{$_} || ''; diff --git a/Shorewall-core/install.sh b/Shorewall-core/install.sh index a37de7801..0ad939d33 100755 --- a/Shorewall-core/install.sh +++ b/Shorewall-core/install.sh @@ -164,7 +164,12 @@ else usage 1 fi -for var in SHAREDIR LIBEXECDIR PERLLIBDIR CONFDIR SBINDIR VARDIR; do +if [ -z "${VARLIB}" ]; then + VARLIB=${VARDIR} + VARDIR='${VARLIB}/${PRODUCT}' +fi + +for var in SHAREDIR LIBEXECDIR PERLLIBDIR CONFDIR SBINDIR VARLIB VARDIR; do require $var done diff --git a/Shorewall-core/lib.base b/Shorewall-core/lib.base index 9559851c9..1d3398155 100644 --- a/Shorewall-core/lib.base +++ b/Shorewall-core/lib.base @@ -42,7 +42,6 @@ if [ -z "$g_readrc" ]; then g_sharedir="$SHAREDIR"/$g_program g_sbindir="$SBINDIR" g_perllib="$PERLLIBDIR" - g_vardir="$VARDIR" g_confdir="$CONFDIR"/$g_program g_readrc=1 fi @@ -76,7 +75,10 @@ case $g_program in ;; esac -VARDIR=${VARDIR}/${g_program} +if [ -z "${VARLIB}" ]; then + VARLIB=${VARDIR} + VARDIR=${VARLIB}/$g_program +fi # # Conditionally produce message diff --git a/Shorewall-core/shorewallrc.apple b/Shorewall-core/shorewallrc.apple index 0df440db2..d6889752b 100644 --- a/Shorewall-core/shorewallrc.apple +++ b/Shorewall-core/shorewallrc.apple @@ -17,4 +17,4 @@ ANNOTATED= #Unused on OS X SYSTEMD= #Unused on OS X SYSCONFDIR= #Unused on OS X SPARSE=Yes #Only install $PRODUCT/$PRODUCT.conf in $CONFDIR. -VARDIR=/var/lib #Unused on OS X +VARLIB=/var/lib #Unused on OS X diff --git a/Shorewall-core/shorewallrc.archlinux b/Shorewall-core/shorewallrc.archlinux index 922f75456..ff4146c2d 100644 --- a/Shorewall-core/shorewallrc.archlinux +++ b/Shorewall-core/shorewallrc.archlinux @@ -17,4 +17,4 @@ ANNOTATED= #If non-zero, annotated configuration fil SYSCONFDIR= #Directory where SysV init parameter files are installed SYSTEMD= #Directory where .service files are installed (systems running systemd only) SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR -VARDIR=/var/lib #Directory where product variable data is stored. +VARLIB=/var/lib #Directory where product variable data is stored. diff --git a/Shorewall-core/shorewallrc.cygwin b/Shorewall-core/shorewallrc.cygwin index 981a1ebb3..de1c86738 100644 --- a/Shorewall-core/shorewallrc.cygwin +++ b/Shorewall-core/shorewallrc.cygwin @@ -17,4 +17,4 @@ ANNOTATED= #Unused on Cygwin SYSTEMD= #Unused on Cygwin SYSCONFDIR= #Unused on Cygwin SPARSE=Yes #Only install $PRODUCT/$PRODUCT.conf in $CONFDIR. -VARDIR=/var/lib #Unused on Cygwin +VARLIB=/var/lib #Unused on Cygwin diff --git a/Shorewall-core/shorewallrc.debian b/Shorewall-core/shorewallrc.debian index 2a636bab5..a2ebf8bd0 100644 --- a/Shorewall-core/shorewallrc.debian +++ b/Shorewall-core/shorewallrc.debian @@ -18,4 +18,4 @@ SYSCONFFILE=default.debian #Name of the distributed file to be inst SYSCONFDIR=/etc/default #Directory where SysV init parameter files are installed SYSTEMD= #Directory where .service files are installed (systems running systemd only) SPARSE=Yes #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR -VARDIR=/var/lib #Directory where product variable data is stored. +VARLIB=/var/lib #Directory where product variable data is stored. diff --git a/Shorewall-core/shorewallrc.default b/Shorewall-core/shorewallrc.default index fb5f1354b..2169fa854 100644 --- a/Shorewall-core/shorewallrc.default +++ b/Shorewall-core/shorewallrc.default @@ -18,4 +18,4 @@ SYSTEMD= #Directory where .service files are inst SYSCONFFILE= #Name of the distributed file to be installed in $SYSCONFDIR SYSCONFDIR= #Directory where SysV init parameter files are installed SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR -VARDIR=/var/lib #Directory where product variable data is stored. +VARLIB=/var/lib #Directory where product variable data is stored. diff --git a/Shorewall-core/shorewallrc.redhat b/Shorewall-core/shorewallrc.redhat index ad47167f8..0b7e95079 100644 --- a/Shorewall-core/shorewallrc.redhat +++ b/Shorewall-core/shorewallrc.redhat @@ -18,4 +18,4 @@ SYSTEMD=/lib/systemd/system #Directory where .service files are inst SYSCONFFILE=sysconfig #Name of the distributed file to be installed as $SYSCONFDIR/$PRODUCT SYSCONFDIR=/etc/sysconfig/ #Directory where SysV init parameter files are installed SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR -VARDIR=/var/lib #Directory where product variable data is stored. +VARLIB=/var/lib #Directory where product variable data is stored. diff --git a/Shorewall-core/shorewallrc.slackware b/Shorewall-core/shorewallrc.slackware index c04e0bf12..cc7e4e5b7 100644 --- a/Shorewall-core/shorewallrc.slackware +++ b/Shorewall-core/shorewallrc.slackware @@ -19,4 +19,4 @@ SYSTEMD= #Name of the directory where .service SYSCONFFILE= #Name of the distributed file to be installed in $SYSCONFDIR SYSCONFDIR= #Name of the directory where SysV init parameter files are installed. ANNOTATED= #If non-empty, install annotated configuration files -VARDIR=/var/lib #Directory where product variable data is stored. +VARLIB=/var/lib #Directory where product variable data is stored. diff --git a/Shorewall-core/shorewallrc.suse b/Shorewall-core/shorewallrc.suse index f1ec6ca22..cc5a273f1 100644 --- a/Shorewall-core/shorewallrc.suse +++ b/Shorewall-core/shorewallrc.suse @@ -18,4 +18,4 @@ SYSTEMD= #Directory where .service SYSCONFFILE= #Name of the distributed file to be installed in $SYSCONFDIR SYSCONFDIR=/etc/sysconfig/ #Directory where SysV init parameter files are installed SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR -VARDIR=/var/lib #Directory where persistent product data is stored. +VARLIB=/var/lib #Directory where persistent product data is stored. diff --git a/Shorewall-init/install.sh b/Shorewall-init/install.sh index fb677ac8e..c957cab4f 100755 --- a/Shorewall-init/install.sh +++ b/Shorewall-init/install.sh @@ -160,7 +160,12 @@ else usage 1 fi -for var in SHAREDIR LIBEXECDIR CONFDIR SBINDIR VARDIR; do +if [ -z "${VARLIB}" ]; then + VARLIB=${VARDIR} + VARDIR='${VARLIB}/${PRODUCT}' +fi + +for var in SHAREDIR LIBEXECDIR CONFDIR SBINDIR VARLIB VARDIR; do require $var done diff --git a/Shorewall-lite/install.sh b/Shorewall-lite/install.sh index 3c932098a..20cbfa24c 100755 --- a/Shorewall-lite/install.sh +++ b/Shorewall-lite/install.sh @@ -171,7 +171,12 @@ else usage 1 fi -for var in SHAREDIR LIBEXECDIRDIRDIR CONFDIR SBINDIR VARDIR; do +if [ -z "${VARLIB}" ]; then + VARLIB=${VARDIR} + VARDIR='${VARLIB}/${PRODUCT}' +fi + +for var in SHAREDIR LIBEXECDIRDIRDIR CONFDIR SBINDIR VARLIB VARDIR; do require $var done @@ -307,7 +312,7 @@ if [ -z "$DESTDIR" -a -d ${CONFDIR}/$PRODUCT ]; then else rm -rf ${DESTDIR}${CONFDIR}/$PRODUCT rm -rf ${DESTDIR}${SHAREDIR}/$PRODUCT - rm -rf ${DESTDIR}${VARDIR}/$PRODUCT + rm -rf ${DESTDIR}${VARDIR} [ "$LIBEXECDIR" = /usr/share ] || rm -rf ${DESTDIR}/usr/share/$PRODUCT/wait4ifup ${DESTDIR}/usr/share/$PRODUCT/shorecap fi @@ -332,7 +337,7 @@ echo "$Product control program installed in ${DESTDIR}${SBINDIR}/$PRODUCT" mkdir -p ${DESTDIR}${CONFDIR}/$PRODUCT mkdir -p ${DESTDIR}${SHAREDIR}/$PRODUCT mkdir -p ${DESTDIR}${LIBEXECDIR}/$PRODUCT -mkdir -p ${DESTDIR}${VARDIR}/$PRODUCT +mkdir -p ${DESTDIR}${VARDIR} chmod 755 ${DESTDIR}${CONFDIR}/$PRODUCT chmod 755 ${DESTDIR}/usr/share/$PRODUCT diff --git a/Shorewall/install.sh b/Shorewall/install.sh index 0cd1f4be4..99ae45b04 100755 --- a/Shorewall/install.sh +++ b/Shorewall/install.sh @@ -193,7 +193,12 @@ else usage 1 fi -for var in SHAREDIR LIBEXECDIR PERLLIBDIR CONFDIR SBINDIR VARDIR; do +if [ -z "${VARLIB}" ]; then + VARLIB=${VARDIR} + VARDIR='${VARLIB}/${PRODUCT}' +fi + +for var in SHAREDIR LIBEXECDIR PERLLIBDIR CONFDIR SBINDIR VARLIB VARDIR; do require $var done @@ -371,7 +376,7 @@ mkdir -p ${DESTDIR}/${CONFDIR}/$PRODUCT mkdir -p ${DESTDIR}${LIBEXECDIR}/$PRODUCT mkdir -p ${DESTDIR}${PERLLIBDIR}/Shorewall mkdir -p ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles -mkdir -p ${DESTDIR}${VARDIR}/$PRODUCT +mkdir -p ${DESTDIR}${VARDIR} chmod 755 ${DESTDIR}${CONFDIR}/$PRODUCT chmod 755 ${DESTDIR}${SHAREDIR}/$PRODUCT