From 3125a4d0d327b2aa911a291ac8a6aa47cbbae4b3 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Thu, 27 May 2010 06:49:49 -0700 Subject: [PATCH] Restore RPM RedHat compatibility Signed-off-by: Tom Eastep --- Shorewall-init/install.sh | 12 +++++++----- Shorewall-init/shorewall-init.spec | 30 ++++++++++++++++++------------ Shorewall/releasenotes.txt | 3 +-- 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/Shorewall-init/install.sh b/Shorewall-init/install.sh index c75fcea94..4d4942c07 100755 --- a/Shorewall-init/install.sh +++ b/Shorewall-init/install.sh @@ -238,11 +238,13 @@ else if [ -n "$PREFIX" ]; then mkdir -p ${PREFIX}/etc/sysconfig - if [ -n "$SUSE" ]; then - mkdir -p ${PREFIX}/etc/sysconfig/network/if-up.d - mkdir -p ${PREFIX}/etc/sysconfig/network/if-down.d - else - mkdir -p ${PREFIX}/etc/NetworkManager/dispatcher.d + if [ -z "$RPM" ]; then + if [ -n "$SUSE" ]; then + mkdir -p ${PREFIX}/etc/sysconfig/network/if-up.d + mkdir -p ${PREFIX}/etc/sysconfig/network/if-down.d + else + mkdir -p ${PREFIX}/etc/NetworkManager/dispatcher.d + fi fi fi diff --git a/Shorewall-init/shorewall-init.spec b/Shorewall-init/shorewall-init.spec index dfc98479d..4eb924860 100644 --- a/Shorewall-init/shorewall-init.spec +++ b/Shorewall-init/shorewall-init.spec @@ -48,19 +48,27 @@ if [ $1 -eq 1 ]; then elif [ -x /sbin/chkconfig ]; then /sbin/chkconfig --add shorewall-init; fi +fi - if [ ! -f /etc/SuSE-release ]; then - if [ -f /sbin/ifup-local -o -f /sbin/ifdown-local ]; then +if [ -f /etc/SuSE-release ]; 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 else - cp -a /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/ifup-local + cp -af /usr/share/shorewall-init/ifupdown /sbin/ifdown-local 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 - cp -af /usr/share/shorewall-init/ifupdown /etc/NetworkManager/dispatcher.d/01-shorewall - fi - fi + if [ -d /etc/NetworkManager/dispatcher.d/ ]; then + cp -af /usr/share/shorewall-init/ifupdown /etc/NetworkManager/dispatcher.d/01-shorewall + fi fi %preun @@ -72,8 +80,8 @@ if [ $1 -eq 0 ]; then /sbin/chkconfig --del shorewall-init fi - grep -q Shorewall /sbin/ifup-local && rm -f /sbin/ifup-local - grep -q Shorewall /sbin/ifdown-local && rm -f /sbin/ifdown-local + [ -f /sbin/ifup-local ] && grep -q Shorewall /sbin/ifup-local && rm -f /sbin/ifup-local + [ -f /sbin/ifdown-local ] && grep -q Shorewall /sbin/ifdown-local && rm -f /sbin/ifdown-local rm -f /etc/NetworkManager/dispatcher.d/01-shorewall fi @@ -81,8 +89,6 @@ fi %files %defattr(0644,root,root,0755) %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(0755,root,root) %dir /usr/share/shorewall-init diff --git a/Shorewall/releasenotes.txt b/Shorewall/releasenotes.txt index 7619dc208..a6a11e0be 100644 --- a/Shorewall/releasenotes.txt +++ b/Shorewall/releasenotes.txt @@ -356,8 +356,7 @@ None. interfaces remaining in the up state, then the firewall is stopped. Shorewall-init may be installed on Debian-based systems, SuSE-based - systems and RedHat-based systems. The RPM included with the release - may only be installed on SuSE-based systems. + systems and RedHat-based systems. On Debian-based systems, during system shutdown the firewall is opened prior to network shutdown (/etc/init.d/shorewall stop