#1 Move the NetworkManager dispatcher script out of /etc
Merged a month ago by mbaldessari. Opened a month ago by lkundrak.
rpms/ lkundrak/shorewall lr/nm-dispatcher-dir  into  master

@@ -0,0 +1,81 @@ 

+ From 490aaafc9593a150316ea500f6fe9888562f84e5 Mon Sep 17 00:00:00 2001

+ From: Lubomir Rintel <lkundrak@v3.sk>

+ Date: Thu, 22 Aug 2019 17:21:50 +0200

+ Subject: [PATCH] Move the NetworkManager dispatcher script out of /etc

+ 

+ It's not user configuration and shouldn't ever have been there. Except for that

+ it used to be the only location NetworkManager looked into. With NetworkManager

+ 1.20 that is no longer the case and the dispatcher scripts can be moved to

+ /usr/lib.

+ ---

+  install.sh          | 8 ++++----

+  shorewall-init.spec | 6 +++---

+  uninstall.sh        | 2 +-

+  3 files changed, 8 insertions(+), 8 deletions(-)

+ 

+ diff --git a/install.sh b/install.sh

+ index d848ac5..1f8cd42 100755

+ --- a/install.sh

+ +++ b/install.sh

+ @@ -389,7 +389,7 @@ else

+  		# Not implemented on OpenWRT

+  		/bin/true

+  	    else

+ -		make_parent_directory ${DESTDIR}/${ETC}/NetworkManager/dispatcher.d 0755

+ +		make_parent_directory ${DESTDIR}${PREFIX}/lib/NetworkManager/dispatcher.d 0755

+  	    fi

+  	fi

+      fi

+ @@ -416,9 +416,9 @@ if [ $HOST != openwrt ]; then

+      install_file ifupdown ${DESTDIR}${LIBEXECDIR}/$PRODUCT/ifupdown 0544

+  fi

+  

+ -if [ -d ${DESTDIR}/etc/NetworkManager ]; then

+ -    [ $configure -eq 1 ] || make_parent_directory ${DESTDIR}${CONFDIR}/NetworkManager/dispatcher.d 0755

+ -    install_file ifupdown ${DESTDIR}${ETC}/NetworkManager/dispatcher.d/01-shorewall 0544

+ +if [ -d ${DESTDIR}${PREFIX}/lib/NetworkManager ]; then

+ +    [ $configure -eq 1 ] || make_parent_directory ${DESTDIR}${PREFIX}/lib/NetworkManager/dispatcher.d 0755

+ +    install_file ifupdown ${DESTDIR}${PREFIX}/lib/NetworkManager/dispatcher.d/01-shorewall 0544

+  fi

+  

+  case $HOST in

+ diff --git a/shorewall-init.spec b/shorewall-init.spec

+ index b2ef290..7f56648 100644

+ --- a/shorewall-init.spec

+ +++ b/shorewall-init.spec

+ @@ -92,8 +92,8 @@ else

+  	fi

+      fi

+  

+ -    if [ -d /etc/NetworkManager/dispatcher.d/ ]; then

+ -	cp -pf %{_libexecdir}/shorewall-init/ifupdown /etc/NetworkManager/dispatcher.d/01-shorewall

+ +    if [ -d %{_prefix}/lib/NetworkManager/dispatcher.d/ ]; then

+ +	cp -pf %{_libexecdir}/shorewall-init/ifupdown %{_prefix}/lib/NetworkManager/dispatcher.d/01-shorewall

+      fi

+  fi

+  

+ @@ -116,7 +116,7 @@ if [ $1 -eq 0 ]; then

+      [ -f /etc/ppp/ip-up.local ]   && grep -q Shorewall-based /etc/ppp/ip-up.local   && rm -f /etc/ppp/ip-up.local

+      [ -f /etc/ppp/ip-down.local ] && grep -q Shorewall-based /etc/ppp/ip-down.local && rm -f /etc/ppp/ip-down.local

+  

+ -    rm -f /etc/NetworkManager/dispatcher.d/01-shorewall

+ +    rm -f %{_prefix}/lib/NetworkManager/dispatcher.d/01-shorewall

+  fi

+  

+  %files

+ diff --git a/uninstall.sh b/uninstall.sh

+ index abd842e..f7ef628 100755

+ --- a/uninstall.sh

+ +++ b/uninstall.sh

+ @@ -177,7 +177,7 @@ fi

+  remove_file ${CONFDIR}/default/$PRODUCT

+  remove_file ${CONFDIR}/sysconfig/$PRODUCT

+  

+ -remove_file ${CONFDIR}/NetworkManager/dispatcher.d/01-shorewall

+ +remove_file ${PREFIX}/lib/NetworkManager/dispatcher.d/01-shorewall

+  

+  remove_file ${CONFDIR}/network/if-up.d/shorewall

+  remove_file ${CONFDIR}/network/if-down.d/shorewall

+ -- 

+ 2.23.0

+ 

file modified
+13 -4

@@ -6,7 +6,7 @@ 

  

  Name:           shorewall

  Version:        %{mainver}

- Release:        3%{?dist}

+ Release:        4%{?dist}

  Summary:        An iptables front end for firewall configuration

  License:        GPLv2+

  URL:            http://www.shorewall.net/

@@ -19,6 +19,8 @@ 

  Source4:        %{baseurl}/%{name}-init-%{version}.tar.bz2

  Source5:        %{baseurl}/%{name}-core-%{version}.tar.bz2

  

+ Patch0:         %{name}-init-5.2.2-nm-dispatcher-dir.patch

+ 

  BuildRequires:  perl-interpreter

  BuildRequires:  perl-generators

  BuildRequires:  perl(Digest::SHA)

@@ -103,7 +105,7 @@ 

  Summary:        Initialization functionality and NetworkManager integration for Shorewall

  

  Requires:         shorewall(firewall) = %{version}-%{release}

- Requires:         NetworkManager

+ Requires:         NetworkManager >= 1.20

  Requires:         shorewall = %{version}-%{release}

  Requires:         iptables iproute logrotate

  Requires(post):   systemd

@@ -130,6 +132,10 @@ 

      xargs sed -i -e 's/^MODULE_SUFFIX=ko$/MODULE_SUFFIX="ko.xz ko"/'

  %endif

  

+ pushd %{name}-init-%{version}

+ %patch0 -p1

+ popd

+ 

  %build

  

  %install

@@ -153,7 +159,7 @@ 

  chmod 755 $RPM_BUILD_ROOT%{_sbindir}/shorewall6-lite

  chmod 644 $RPM_BUILD_ROOT%{_sysconfdir}/shorewall-lite/shorewall-lite.conf

  chmod 644 $RPM_BUILD_ROOT%{_sysconfdir}/shorewall6-lite/shorewall6-lite.conf

- chmod 755 $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d/01-shorewall

+ chmod 755 $RPM_BUILD_ROOT%{_prefix}/lib/NetworkManager/dispatcher.d/01-shorewall

  

  %post

  %systemd_post shorewall.service

@@ -315,7 +321,7 @@ 

  %license shorewall-init-%{version}/COPYING

  %doc shorewall-init-%{version}/{changelog.txt,releasenotes.txt}

  %{_sbindir}/shorewall-init

- %{_sysconfdir}/NetworkManager/dispatcher.d/01-shorewall

+ %{_prefix}/lib/NetworkManager/dispatcher.d/01-shorewall

  %config(noreplace) %{_sysconfdir}/sysconfig/shorewall-init

  %{_sysconfdir}/logrotate.d/shorewall-init

  %{_mandir}/man8/shorewall-init.8.*

@@ -325,6 +331,9 @@ 

  

  

  %changelog

+ * Thu Aug 22 2019 Lubomir Rintel <lkundrak@v3.sk> - 5.2.2-4

+ - Move the NetworkManager dispatcher script out of /etc

+ 

  * Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.2.2-3

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

  

It's not user configuration and shouldn't ever have been there. Except for that
it used to be the only location NetworkManager looked into. With NetworkManager
1.20 that is no longer the case and the dispatcher scripts can be moved to
/usr/lib.

Pull-Request has been merged by mbaldessari

a month ago