Restore RPM RedHat compatibility

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2010-05-27 06:49:49 -07:00
parent d0bf4e016c
commit 3125a4d0d3
3 changed files with 26 additions and 19 deletions

View File

@ -238,11 +238,13 @@ else
if [ -n "$PREFIX" ]; then if [ -n "$PREFIX" ]; then
mkdir -p ${PREFIX}/etc/sysconfig mkdir -p ${PREFIX}/etc/sysconfig
if [ -n "$SUSE" ]; then if [ -z "$RPM" ]; then
mkdir -p ${PREFIX}/etc/sysconfig/network/if-up.d if [ -n "$SUSE" ]; then
mkdir -p ${PREFIX}/etc/sysconfig/network/if-down.d mkdir -p ${PREFIX}/etc/sysconfig/network/if-up.d
else mkdir -p ${PREFIX}/etc/sysconfig/network/if-down.d
mkdir -p ${PREFIX}/etc/NetworkManager/dispatcher.d else
mkdir -p ${PREFIX}/etc/NetworkManager/dispatcher.d
fi
fi fi
fi fi

View File

@ -48,19 +48,27 @@ if [ $1 -eq 1 ]; then
elif [ -x /sbin/chkconfig ]; then elif [ -x /sbin/chkconfig ]; then
/sbin/chkconfig --add shorewall-init; /sbin/chkconfig --add shorewall-init;
fi fi
fi
if [ ! -f /etc/SuSE-release ]; then if [ -f /etc/SuSE-release ]; then
if [ -f /sbin/ifup-local -o -f /sbin/ifdown-local ]; then cp -af /usr/share/shorewall-init/ifupdown /etc/sysconfig/network/if-up.d/shorewall
cp -af /usr/share/shorewall-init/ifupdown /etc/sysconfig/network/if-down.d/shorewall
else
if [ -f /sbin/ifup-local -o -f /sbin/ifdown-local ]; then
if ! grep -q Shorewall /sbin/ifup-local || ! grep -q Shorewall /sbin/ifdown-local; then
echo "WARNING: /sbin/ifup-local and/or /sbin/ifdown-local already exist; ifup/ifdown events will not be handled" >&2 echo "WARNING: /sbin/ifup-local and/or /sbin/ifdown-local already exist; ifup/ifdown events will not be handled" >&2
else else
cp -a /usr/share/shorewall-init/ifupdown /sbin/ifup-local cp -af /usr/share/shorewall-init/ifupdown /sbin/ifup-local
cp -a /usr/share/shorewall-init/ifupdown /sbin/ifdown-local cp -af /usr/share/shorewall-init/ifupdown /sbin/ifdown-local
fi fi
else
cp -af /usr/share/shorewall-init/ifupdown /sbin/ifup-local
cp -af /usr/share/shorewall-init/ifupdown /sbin/ifdown-local
fi
if [ -d /etc/NetworkManager/dispatcher.d/ ]; then if [ -d /etc/NetworkManager/dispatcher.d/ ]; then
cp -af /usr/share/shorewall-init/ifupdown /etc/NetworkManager/dispatcher.d/01-shorewall cp -af /usr/share/shorewall-init/ifupdown /etc/NetworkManager/dispatcher.d/01-shorewall
fi fi
fi
fi fi
%preun %preun
@ -72,8 +80,8 @@ if [ $1 -eq 0 ]; then
/sbin/chkconfig --del shorewall-init /sbin/chkconfig --del shorewall-init
fi fi
grep -q Shorewall /sbin/ifup-local && rm -f /sbin/ifup-local [ -f /sbin/ifup-local ] && grep -q Shorewall /sbin/ifup-local && rm -f /sbin/ifup-local
grep -q Shorewall /sbin/ifdown-local && rm -f /sbin/ifdown-local [ -f /sbin/ifdown-local ] && grep -q Shorewall /sbin/ifdown-local && rm -f /sbin/ifdown-local
rm -f /etc/NetworkManager/dispatcher.d/01-shorewall rm -f /etc/NetworkManager/dispatcher.d/01-shorewall
fi fi
@ -81,8 +89,6 @@ fi
%files %files
%defattr(0644,root,root,0755) %defattr(0644,root,root,0755)
%attr(0644,root,root) %config(noreplace) /etc/sysconfig/shorewall-init %attr(0644,root,root) %config(noreplace) /etc/sysconfig/shorewall-init
%attr(0544,root,root) /etc/sysconfig/network/if-up.d/shorewall
%attr(0544,root,root) /etc/sysconfig/network/if-down.d/shorewall
%attr(0544,root,root) /etc/init.d/shorewall-init %attr(0544,root,root) /etc/init.d/shorewall-init
%attr(0755,root,root) %dir /usr/share/shorewall-init %attr(0755,root,root) %dir /usr/share/shorewall-init

View File

@ -356,8 +356,7 @@ None.
interfaces remaining in the up state, then the firewall is stopped. interfaces remaining in the up state, then the firewall is stopped.
Shorewall-init may be installed on Debian-based systems, SuSE-based Shorewall-init may be installed on Debian-based systems, SuSE-based
systems and RedHat-based systems. The RPM included with the release systems and RedHat-based systems.
may only be installed on SuSE-based systems.
On Debian-based systems, during system shutdown the firewall is On Debian-based systems, during system shutdown the firewall is
opened prior to network shutdown (/etc/init.d/shorewall stop opened prior to network shutdown (/etc/init.d/shorewall stop