summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2018-03-18 20:38:49 +0100
committerLubomir Rintel <lkundrak@v3.sk>2018-05-09 12:59:39 +0200
commit6384ad4ee16f31dd103f790bd193c4049d89a6fc (patch)
tree6448fdad7c16dca2e8879aab97e250535960e7f4
parent6aac441f1ce9f74ccb9dd2d97d3330be3eec0cef (diff)
downloadNetworkManager-lr/version-dir.tar.gz
build: qualify plugin dir name with a version stringlr/version-dir
This makes package updates more robust, avoiding in-place replaces of the plugins. Previously, if an upgrade transaction was terminated, NetworkManager library could end up being of a different version than the plugins. If the user was unfortunate enough to connect using a connection that required a plugin (say, Wi-Fi), he would be left without a network connection making it somewhat inconvenient to recover from the botched upgrade. This makes the whole situation a little bit less sad.
-rw-r--r--Makefile.am12
-rw-r--r--configure.ac7
-rw-r--r--contrib/fedora/rpm/NetworkManager.spec26
-rw-r--r--meson.build14
4 files changed, 32 insertions, 27 deletions
diff --git a/Makefile.am b/Makefile.am
index 2658439111..26a6b8863e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,7 +20,7 @@ sbin_PROGRAMS =
bin_PROGRAMS =
libexec_PROGRAMS =
lib_LTLIBRARIES =
-pkglib_LTLIBRARIES =
+plugin_LTLIBRARIES =
core_plugins =
service_DATA =
man_MANS =
@@ -73,6 +73,8 @@ examplesdir = $(docdir)/examples
rundir=$(runstatedir)/NetworkManager
statedir=$(localstatedir)/lib/NetworkManager
+plugindir=$(pkglibdir)/$(NM_DIST_VERSION)
+
dbusactivationdir = $(datadir)/dbus-1/system-services
servicedir = $(datadir)/dbus-1/system-services
@@ -578,7 +580,7 @@ libnm_core_libnm_core_la_CPPFLAGS = \
-DLOCALEDIR=\"$(datadir)/locale\" \
-DNMCONFDIR=\"$(nmconfdir)\" \
-DNMLIBDIR=\"$(nmlibdir)\" \
- -DNMPLUGINDIR=\"$(pkglibdir)\" \
+ -DNMPLUGINDIR=\"$(plugindir)\" \
-DLIBEXECDIR=\"$(libexecdir)\" \
$(NULL)
@@ -1173,7 +1175,7 @@ src_cppflags = \
\
-DNMCONFDIR=\"$(nmconfdir)\" \
-DNMLOCALEDIR=\"$(datadir)/locale\" \
- -DNMPLUGINDIR=\"$(pkglibdir)\" \
+ -DNMPLUGINDIR=\"$(plugindir)\" \
-DNMRUNDIR=\"$(nmrundir)\" \
-DNMSTATEDIR=\"$(nmstatedir)\" \
-DNMLIBDIR=\"$(nmlibdir)\" \
@@ -4656,7 +4658,7 @@ check_PROGRAMS += $(check_programs) $(check_programs_norun)
check_LTLIBRARIES += $(check_ltlibraries)
endif
-pkglib_LTLIBRARIES += $(core_plugins)
+plugin_LTLIBRARIES += $(core_plugins)
TESTS += $(check_programs)
@@ -4756,7 +4758,7 @@ install-data-hook: $(install_data_hook)
$(mkinstalldirs) -m 0755 $(DESTDIR)$(nmlibdir)/conf.d
$(mkinstalldirs) -m 0755 $(DESTDIR)$(nmlibdir)/VPN
$(mkinstalldirs) -m 0700 $(DESTDIR)$(nmstatedir)
- $(mkinstalldirs) -m 0755 $(DESTDIR)$(pkglibdir)
+ $(mkinstalldirs) -m 0755 $(DESTDIR)$(plugindir)
uninstall-hook: $(uninstall_hook)
diff --git a/configure.ac b/configure.ac
index 7ac11e1127..5609f28121 100644
--- a/configure.ac
+++ b/configure.ac
@@ -183,10 +183,9 @@ dnl
AC_ARG_WITH(dist-version,
AS_HELP_STRING([--with-dist-version=<NM-distribution-version>],
[Define the NM''s distribution version string]),
- ac_distver=$withval, ac_distver="")
-if ! test x"$ac_distver" = x""; then
- AC_DEFINE_UNQUOTED(NM_DIST_VERSION, "$ac_distver", [Define the distribution version string])
-fi
+ ac_distver=$withval, ac_distver=$NM_VERSION)
+AC_DEFINE_UNQUOTED(NM_DIST_VERSION, "$ac_distver", [Define the distribution version string])
+AC_SUBST(NM_DIST_VERSION, "$ac_distver")
AC_ARG_ENABLE(wifi, AS_HELP_STRING([--enable-wifi], [enable Wi-Fi support]))
if test "${enable_wifi}" != "no"; then
diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec
index 04f78a205c..e1bdc45235 100644
--- a/contrib/fedora/rpm/NetworkManager.spec
+++ b/contrib/fedora/rpm/NetworkManager.spec
@@ -26,6 +26,7 @@
%global systemd_dir %{_prefix}/lib/systemd/system
%global nmlibdir %{_prefix}/lib/%{name}
+%global nmplugindir %{_libdir}/%{name}/%{version}-%{release}
%global _hardened_build 1
@@ -528,7 +529,7 @@ ln -s ../10-ifcfg-rh-routes.sh %{buildroot}%{_sysconfdir}/%{name}/dispatcher.d/n
rm -f %{buildroot}%{_libdir}/*.la
rm -f %{buildroot}%{_libdir}/pppd/%{ppp_version}/*.la
-rm -f %{buildroot}%{_libdir}/NetworkManager/*.la
+rm -f %{buildroot}%{nmplugindir}/*.la
# Ensure the documentation timestamps are constant to avoid multilib conflicts
find %{buildroot}%{_datadir}/gtk-doc -exec touch --reference configure.ac '{}' \+
@@ -604,8 +605,9 @@ fi
%{_libexecdir}/nm-dhcp-helper
%{_libexecdir}/nm-dispatcher
%{_libexecdir}/nm-iface-helper
-%dir %{_libdir}/NetworkManager
-%{_libdir}/NetworkManager/libnm-settings-plugin*.so
+%dir %{_libdir}/%{name}
+%dir %{nmplugindir}
+%{nmplugindir}/libnm-settings-plugin*.so
%if %{with nmtui}
%exclude %{_mandir}/man1/nmtui*
%endif
@@ -635,35 +637,35 @@ fi
%if %{with adsl}
%files adsl
-%{_libdir}/%{name}/libnm-device-plugin-adsl.so
+%{nmplugindir}/libnm-device-plugin-adsl.so
%else
-%exclude %{_libdir}/%{name}/libnm-device-plugin-adsl.so
+%exclude %{nmplugindir}/libnm-device-plugin-adsl.so
%endif
%if %{with bluetooth}
%files bluetooth
-%{_libdir}/%{name}/libnm-device-plugin-bluetooth.so
+%{nmplugindir}/libnm-device-plugin-bluetooth.so
%endif
%if %{with team}
%files team
-%{_libdir}/%{name}/libnm-device-plugin-team.so
+%{nmplugindir}/libnm-device-plugin-team.so
%endif
%if %{with wifi}
%files wifi
-%{_libdir}/%{name}/libnm-device-plugin-wifi.so
+%{nmplugindir}/libnm-device-plugin-wifi.so
%endif
%if %{with wwan}
%files wwan
-%{_libdir}/%{name}/libnm-device-plugin-wwan.so
-%{_libdir}/%{name}/libnm-wwan.so
+%{nmplugindir}/libnm-device-plugin-wwan.so
+%{nmplugindir}/libnm-wwan.so
%endif
%if %{with ovs}
%files ovs
-%{_libdir}/%{name}/libnm-device-plugin-ovs.so
+%{nmplugindir}/libnm-device-plugin-ovs.so
%{systemd_dir}/NetworkManager.service.d/NetworkManager-ovs.conf
%{_mandir}/man7/nm-openvswitch.7*
%endif
@@ -671,7 +673,7 @@ fi
%if %{with ppp}
%files ppp
%{_libdir}/pppd/%{ppp_version}/nm-pppd-plugin.so
-%{_libdir}/%{name}/libnm-ppp-plugin.so
+%{nmplugindir}/libnm-ppp-plugin.so
%endif
%if %{with libnm_glib}
diff --git a/meson.build b/meson.build
index dc1524aa0d..480c56ff88 100644
--- a/meson.build
+++ b/meson.build
@@ -25,6 +25,12 @@ nm_id_prefix = 'NM'
nm_gir_version = '1.0'
+# Distribution version string
+dist_version = get_option('dist_version')
+if dist_version == ''
+ dist_version = nm_version
+endif
+
nm_prefix = get_option('prefix')
nm_bindir = join_paths(nm_prefix, get_option('bindir'))
nm_datadir = join_paths(nm_prefix, get_option('datadir'))
@@ -45,7 +51,7 @@ nm_pkgincludedir = join_paths(nm_includedir, nm_name)
nm_pkglibdir = join_paths(nm_prefix, 'lib', nm_name)
nm_pkgrundir = join_paths(nm_runstatedir, nm_name)
nm_pkgstatedir = join_paths(nm_localstatedir, nm_name)
-nm_plugindir = join_paths(nm_libdir, nm_name)
+nm_plugindir = join_paths(nm_libdir, nm_name, dist_version)
libnm_name = 'libnm'
@@ -259,11 +265,7 @@ if config_plugins_default == ''
endif
config_h.set_quoted('NM_CONFIG_DEFAULT_MAIN_PLUGINS', config_plugins_default)
-# Distribution version string
-dist_version = get_option('dist_version')
-if dist_version != ''
- config_h.set_quoted('NM_DIST_VERSION', dist_version)
-endif
+config_h.set_quoted('NM_DIST_VERSION', dist_version)
enable_wifi = get_option('wifi')
config_h.set10('WITH_WIFI', enable_wifi)