From 1cddc4da77ebf82141c158c294f750f2427141b9 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Fri, 23 Oct 2015 11:29:42 +0200 Subject: [PATCH] nm: Install the .name file into /usr/lib/NetworkManager/VPN It's the preferred location for system-provided plugins. A compatible file in /etc is still kept. Also, the compatibility /etc file needs to use a full path due to a bug in GNOME Shell. The full path to a arch-dependent file in a supposedly arch-independent file is a sin and a multilib violation in some distributions. However. some pre-release versions of NetworkManager-1.2 as shipped by distributions require a full path. Let's keep a configure-time option for that. --- src/frontends/gnome/Makefile.am | 19 +++++++++++++++++-- src/frontends/gnome/configure.ac | 7 +++++++ .../gnome/nm-strongswan-service.name.in | 2 +- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/frontends/gnome/Makefile.am b/src/frontends/gnome/Makefile.am index 2fc793ebe..12fa6cfb2 100644 --- a/src/frontends/gnome/Makefile.am +++ b/src/frontends/gnome/Makefile.am @@ -2,7 +2,7 @@ AUTOMAKE_OPTIONS = foreign SUBDIRS = properties auth-dialog po -nmvpnservicedir = $(sysconfdir)/NetworkManager/VPN +nmvpnservicedir = $(prefix)/lib/NetworkManager/VPN nmvpnservice_DATA = nm-strongswan-service.name @INTLTOOL_DESKTOP_RULE@ @@ -12,9 +12,24 @@ appdata_DATA = $(appdata_in_files:.xml.in=.xml) appdata_in_files = NetworkManager-strongswan.appdata.xml.in @INTLTOOL_XML_RULE@ +# Install a file with full path to plugins for an old gnome-shell +# https://bugzilla.gnome.org/show_bug.cgi?id=693590 +install-data-hook: + mkdir -p $(DESTDIR)$(sysconfdir)/NetworkManager/VPN + sed -e "1s|^|# This file is obsoleted by a file in $(NM_VPN_SERVICE_DIR)\n\n|" \ + -e 's|[@]NM_LIBEXECDIR[@]|$(nm_libexecdir)|g' \ + -e 's|[@]NM_PLUGINDIR[@]|$(nm_plugindir)|g' \ + -e 's|[@]CHARON[@]|$(charon)|' \ + <$(srcdir)/nm-strongswan-service.name.in \ + >$(DESTDIR)$(sysconfdir)/NetworkManager/VPN/nm-strongswan-service.name + +uninstall-hook: + rm -f $(DESTDIR)$(sysconfdir)/NetworkManager/VPN/nm-strongswan-service.name + nm-strongswan-service.name: $(srcdir)/nm-strongswan-service.name.in $(AM_V_GEN) \ sed -e 's|[@]NM_LIBEXECDIR[@]|$(nm_libexecdir)|' \ + -e 's|[@]NM_PLUGINDIR[@]/|$(nm_plugindir_abs)|g' \ -e 's|[@]CHARON[@]|$(charon)|' $< >$@ EXTRA_DIST = \ @@ -25,7 +40,7 @@ EXTRA_DIST = \ intltool-merge.in \ intltool-update.in -CLEANFILES = $(nmvpnservice_DATA) $(appdata_DATA) *~ +CLEANFILES = $(appdata_DATA) *~ DISTCLEANFILES = intltool-extract intltool-merge intltool-update ACLOCAL_AMFLAGS = -I m4 diff --git a/src/frontends/gnome/configure.ac b/src/frontends/gnome/configure.ac index 1a7df205a..bf73d1d2e 100644 --- a/src/frontends/gnome/configure.ac +++ b/src/frontends/gnome/configure.ac @@ -76,10 +76,17 @@ AC_ARG_WITH( [AC_SUBST(charon, "$withval")], [AC_SUBST(charon, "${libexecdir}/ipsec/charon-nm")] ) +AC_ARG_ENABLE( + [nm-absolute-paths], + AS_HELP_STRING([--enable-nm-absolute-paths],[use absolute paths for NM plugins in the .name file]) +) + nm_libexecdir=$($PKG_CONFIG --variable=libgnome_serverdir NetworkManager) AC_SUBST(nm_libexecdir) nm_plugindir=$($PKG_CONFIG --variable=plugindir NetworkManager) AC_SUBST(nm_plugindir) +test x"$enable_nm_absolute_paths" = x"yes" && nm_plugindir_abs="$(nm_plugindir)/" +AC_SUBST(nm_plugindir_abs) NM_COMPILER_WARNINGS diff --git a/src/frontends/gnome/nm-strongswan-service.name.in b/src/frontends/gnome/nm-strongswan-service.name.in index ccba0b7b9..eb64a22ff 100644 --- a/src/frontends/gnome/nm-strongswan-service.name.in +++ b/src/frontends/gnome/nm-strongswan-service.name.in @@ -5,4 +5,4 @@ program=@CHARON@ [GNOME] auth-dialog=@NM_LIBEXECDIR@/nm-strongswan-auth-dialog -properties=libnm-strongswan-properties +properties=@NM_PLUGINDIR@/libnm-strongswan-properties