#1 Move the NetworkManager dispatcher script out of /etc
Closed 2 months ago by lkundrak. Opened 2 months ago by lkundrak.
rpms/ lkundrak/modem-manager-gui lr/nm-dispatcher-dir  into  master

@@ -0,0 +1,73 @@ 

+ From 2b2777785d97d0160e0e57e917ebab0c3b7a0a67 Mon Sep 17 00:00:00 2001

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

+ Date: Thu, 22 Aug 2019 16:52:26 +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.

+ ---

+  packages/fedora/modem-manager-gui.spec | 7 +++++--

+  src/scripts/Makefile                   | 2 +-

+  src/scripts/meson.build                | 2 +-

+  3 files changed, 7 insertions(+), 4 deletions(-)

+ 

+ diff --git a/packages/fedora/modem-manager-gui.spec b/packages/fedora/modem-manager-gui.spec

+ index c777c51..df9524c 100644

+ --- a/packages/fedora/modem-manager-gui.spec

+ +++ b/packages/fedora/modem-manager-gui.spec

+ @@ -1,7 +1,7 @@

+  Summary: Modem Manager GUI

+  Name: modem-manager-gui

+  Version: 0.0.19.1

+ -Release: 1%{dist}

+ +Release: 2%{dist}

+  License: GPLv3

+  Group: Applications/Communications

+  URL: https://linuxonly.ru/page/modem-manager-gui

+ @@ -46,7 +46,6 @@ rm -rf %{buildroot}

+  %{_bindir}/%{name}

+  %{_libdir}/%{name}/modules/*.so

+  %{_libdir}/ofono/plugins/libmmgui-ofono-history.so

+ -%{_sysconfdir}/NetworkManager/dispatcher.d/95-mmgui-timestamp-notifier

+  %{_datadir}/icons/hicolor/128x128/apps/%{name}.png

+  %{_datadir}/icons/hicolor/scalable/apps/%{name}.svg

+  %{_datadir}/icons/hicolor/symbolic/apps/%{name}-symbolic.svg

+ @@ -58,8 +57,12 @@ rm -rf %{buildroot}

+  %{_datadir}/polkit-1/actions/ru.linuxonly.%{name}.policy

+  %{_datadir}/applications/%{name}.desktop

+  %{_mandir}/*

+ +%{_prefix}/lib/NetworkManager

+  

+  %changelog

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

+ +- Move the NetworkManager dispatcher script out of /etc

+ +

+  * Fri Apr 6 2018 Alex <alex@linuxonly.ru> - 0.0.19.1-1.fc27

+  - Version 0.0.19.1

+  

+ diff --git a/src/scripts/Makefile b/src/scripts/Makefile

+ index c54513b..f4e8ef8 100644

+ --- a/src/scripts/Makefile

+ +++ b/src/scripts/Makefile

+ @@ -1,6 +1,6 @@

+  include ../../Makefile_h

+  

+ -NMDISPDIR     = /etc/NetworkManager/dispatcher.d

+ +NMDISPDIR     = $(PREFIX)/lib/NetworkManager/dispatcher.d

+  

+  install:

+  	mkdir -p $(INSTALLPREFIX)$(DESTDIR)$(NMDISPDIR)

+ diff --git a/src/scripts/meson.build b/src/scripts/meson.build

+ index 9bb33a7..94bbdee 100644

+ --- a/src/scripts/meson.build

+ +++ b/src/scripts/meson.build

+ @@ -1,3 +1,3 @@

+ -nmdispdir = join_paths([ get_option('prefix'), get_option('sysconfdir'), 'NetworkManager', 'dispatcher.d' ])

+ +nmdispdir = join_paths([ get_option('prefix'), 'lib', 'NetworkManager', 'dispatcher.d' ])

+  

+  install_data('95-mmgui-timestamp-notifier', install_mode : 'rwxr-xr-x', install_dir: nmdispdir)

+ -- 

+ 2.23.0

+ 

file modified
+11 -4

@@ -4,7 +4,7 @@ 

  Summary(ru):   Графический интерфейс для демона ModemManager

  

  Version:       0.0.19.1

- Release:       9%{?dist}

+ Release:       10%{?dist}

  License:       GPLv3

  

  URL:           https://linuxonly.ru/page/modem-manager-gui

@@ -18,6 +18,9 @@ 

  Patch1: mmgui-6710bf86869852bb8a9946b628eff5bc1019b5aa.diff

  Patch2: mmgui-83553d042443c71be71533b6b91ee10f228d935f.diff

  

+ # Fix the NetworkManager dispatcher script location

+ Patch3: 0001-Move-the-NetworkManager-dispatcher-script-out-of-etc.patch

+ 

  %global build_using_meson 0

  %global with_ofono 0

  

@@ -101,7 +104,7 @@ 

  

  %package cm-NetworkManager

  Summary: Use NetworkManager to manage connections in %{name}

- Requires: NetworkManager >= 0.9.0

+ Requires: NetworkManager >= 1.20

  Requires: python3

  Provides: %{name}-cm%{?_isa}

  %description cm-NetworkManager

@@ -137,6 +140,7 @@ 

  %patch0 -p1

  %patch1 -p1

  %patch2 -p1

+ %patch3 -p1

  sed -e "s/meson_version: '>=0.37'/meson_version: '>=0.38'/" -i meson.build

  

  

@@ -166,7 +170,7 @@ 

  

  # Fix /usr/bin/env usage

  sed -e 's|/usr/bin/env python3|/usr/bin/python3|' \

-     -i %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d/95-mmgui-timestamp-notifier

+     -i %{buildroot}%{_prefix}/lib/NetworkManager/dispatcher.d/95-mmgui-timestamp-notifier

  

  # Remove plugin for obsolete ModemManager version

  rm %{buildroot}/%{_libdir}/%{name}/modules/libmodmm_mm06.so

@@ -202,7 +206,7 @@ 

  

  %files cm-NetworkManager

  %{_libdir}/%{name}/modules/libmodcm_nm09.so

- %{_sysconfdir}/NetworkManager/dispatcher.d/95-mmgui-timestamp-notifier

+ %{_prefix}/lib/NetworkManager/dispatcher.d/95-mmgui-timestamp-notifier

  

  %files cm-pppd

  %{_libdir}/%{name}/modules/libmodcm_pppd245.so

@@ -218,6 +222,9 @@ 

  

  

  %changelog

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

+ - Move the NetworkManager dispatcher script out of /etc

+ 

  * Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.19.1-9

  - 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.

Merging with the provenpackager hat on.

Pull-Request has been closed by lkundrak

2 months ago

Sorry for not responding, I saw the PR, thought about making some minor changes and then put it away "for later", which turned into "whoops forgot", as it often does.

The patch is solid, though changes to the bundled .spec aren't really necessary. Either way, I'll take this and submit it upsteam.