From 2fc3fa060252d69011e898eec5513d6658e63a5c Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sun, 23 May 2010 12:53:56 -0700 Subject: [PATCH] Some fixes for the RPM Signed-off-by: Tom Eastep --- Shorewall-init/install.sh | 22 ++++++++++------------ Shorewall-init/shorewall-init.spec | 13 ++----------- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/Shorewall-init/install.sh b/Shorewall-init/install.sh index de984b294..f0b5dca85 100755 --- a/Shorewall-init/install.sh +++ b/Shorewall-init/install.sh @@ -223,11 +223,6 @@ if [ -z "$PREFIX" ]; then ln -s ${DEST}/${INIT} /usr/share/shorewall-init/init fi -# -# Install the ifupdown script -# -run_install $OWNERSHIP -m 744 ifupdown.sh ${PREFIX}/usr/share/shorewall-init/ifupdown - if [ -n "$DEBIAN" ]; then if [ ! -f /etc/default/shorewall-init ]; then run_install $OWNERSHIP -m 0644 sysconfig /etc/default/shorewall-init @@ -235,6 +230,7 @@ if [ -n "$DEBIAN" ]; then else if [ -n "$PREFIX" ]; then mkdir -p ${PREFIX}/etc/sysconfig + mkdir -p ${PREFIX}/NetworkManager/dispatcher.d fi if [ -d ${PREFIX}/etc/sysconfig -a ! -f ${PREFIX}/etc/sysconfig/shorewall-init ]; then @@ -242,6 +238,15 @@ else fi fi +# +# Install the ifupdown script +# +run_install $OWNERSHIP -m 744 ifupdown.sh ${PREFIX}/usr/share/shorewall-init/ifupdown + +if [ -d ${PREFIX}/etc/NetworkManager ]; then + run_install ifupdown.sh ${PREFIX}/etc/NetworkManager/dispatcher.d/01-shorewall +fi + if [ -z "$PREFIX" ]; then if [ -n "$first_install" ]; then if [ -n "$DEBIAN" ]; then @@ -260,13 +265,6 @@ if [ -z "$PREFIX" ]; then ln -s /usr/share/shorewall-init/ifupdown /sbin/ifup-local ln -s /usr/share/shorewall-init/ifupdown /sbin/ifdown-local fi - - if [ -d /etc/NetworkManager/dispatcher.d ]; then - # - # RedHat doesn't integrate ifup-local/ifdown-local with NetworkManager - # - ln -s /usr/share/shorewall-init/ifupdown /etc/NetworkManager/dispatcher.d/01-shorewall - fi fi if [ -x /sbin/insserv -o -x /usr/sbin/insserv ]; then diff --git a/Shorewall-init/shorewall-init.spec b/Shorewall-init/shorewall-init.spec index eebc5e0ae..a0f87b94f 100644 --- a/Shorewall-init/shorewall-init.spec +++ b/Shorewall-init/shorewall-init.spec @@ -65,13 +65,6 @@ if [ $1 -eq 1 ]; then ln -s /usr/share/shorewall-init/ifupdown /sbin/ifup-local ln -s /usr/share/shorewall-init/ifupdown /sbin/ifdown-local fi - - if [ -d /etc/NetworkManager/dispatcher.d ]; then - # - # RedHat doesn't integrate ifup-local/ifdown-local with NetworkManager - # - ln -s /usr/share/shorewall-init/ifupdown /etc/NetworkManager/dispatcher.d/01-shorewall - fi fi fi @@ -87,10 +80,6 @@ if [ $1 -eq 0 ]; then [ -f /sbin/ifup-local ] && $(ls -l /sbin/ifup-local) | grep -q /usr/share/shorewall-init && rm -f /sbin/ifup-local [ -f /sbin/ifdown-local ] && $(ls -l /sbin/ifdown-local) | grep -q /usr/share/shorewall-init && rm -f /sbin/ifdown-local - rm -f /etc/sysconfig/shorewall-init - - rm -f /etc/NetworkManager/dispatcher.d/01-shorewall - rm -f /etc/sysconfig/network/if-up.d/shorewall rm -f /etc/sysconfig/network/if-down.d/shorewall fi @@ -98,6 +87,8 @@ fi %files %defattr(0644,root,root,0755) %attr(0644,root,root) %config(noreplace) /etc/sysconfig/shorewall-init +%attr(0544,root,root) /etc/NetworkManager/dispatcher.d/01-shorewall + %attr(0544,root,root) /etc/init.d/shorewall-init %attr(0755,root,root) %dir /usr/share/shorewall-init