commit:     15bc4da10afa385b2652c704a5de06ef3ce20cc0
Author:     Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 24 22:28:54 2014 +0000
Commit:     Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
CommitDate: Thu Apr 24 22:34:54 2014 +0000
URL:        
http://git.overlays.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=15bc4da1

net-misc/networkmanager: 0.9.8.8 → 0.9.8.10

---
 ...ktop.NetworkManager.settings.modify.system.pkla |   6 +
 ...top.NetworkManager.settings.modify.system.rules |   7 +
 net-misc/networkmanager/files/10-openrc-status-r4  |  35 +++
 .../networkmanager/files/conf.d.NetworkManager     |   4 +
 .../networkmanager/files/init.d.NetworkManager     |  57 +++++
 .../files/networkmanager-0.9.8.4-pre-sleep.patch   | 131 +++++++++++
 .../files/nm-system-settings.conf-ifnet            |   6 +
 net-misc/networkmanager/metadata.xml               |  29 +++
 .../networkmanager/networkmanager-0.9.8.10.ebuild  | 248 +++++++++++++++++++++
 9 files changed, 523 insertions(+)

diff --git 
a/net-misc/networkmanager/files/01-org.freedesktop.NetworkManager.settings.modify.system.pkla
 
b/net-misc/networkmanager/files/01-org.freedesktop.NetworkManager.settings.modify.system.pkla
new file mode 100644
index 0000000..d443327
--- /dev/null
+++ 
b/net-misc/networkmanager/files/01-org.freedesktop.NetworkManager.settings.modify.system.pkla
@@ -0,0 +1,6 @@
+[Let users in plugdev group modify NetworkManager]
+Identity=unix-group:plugdev
+Action=org.freedesktop.NetworkManager.settings.modify.system
+ResultAny=no
+ResultInactive=no
+ResultActive=yes
\ No newline at end of file

diff --git 
a/net-misc/networkmanager/files/01-org.freedesktop.NetworkManager.settings.modify.system.rules
 
b/net-misc/networkmanager/files/01-org.freedesktop.NetworkManager.settings.modify.system.rules
new file mode 100644
index 0000000..d00b268
--- /dev/null
+++ 
b/net-misc/networkmanager/files/01-org.freedesktop.NetworkManager.settings.modify.system.rules
@@ -0,0 +1,7 @@
+// Let users in plugdev group modify NetworkManager
+polkit.addRule(function(action, subject) {
+    if (action.id == "org.freedesktop.NetworkManager.settings.modify.system" &&
+        subject.isInGroup("plugdev") && subject.active) {
+        return "yes";
+    }
+});

diff --git a/net-misc/networkmanager/files/10-openrc-status-r4 
b/net-misc/networkmanager/files/10-openrc-status-r4
new file mode 100644
index 0000000..e195ccc
--- /dev/null
+++ b/net-misc/networkmanager/files/10-openrc-status-r4
@@ -0,0 +1,35 @@
+#!/bin/sh
+# Copyright (c) 2012 Alexandre Rostovtsev
+# Released under the 2-clause BSD license.
+
+# Ensures that the NetworkManager OpenRC service is marked as started and
+# providing net only when it has a successful connection.
+
+if [ ! -e "/run/openrc/softlevel" ]; then
+       # OpenRC is not running
+       exit 0
+fi
+
+# Ensure rc-service is in PATH
+PATH="${PATH}:@EPREFIX@/sbin:@EPREFIX@/usr/sbin"
+
+# Exit if the NetworkManager OpenRC service is not running
+rc-service NetworkManager status 2>&1 | grep -Eq "status: 
(starting|started|inactive|stopping)" || exit 0
+
+# Call rc-service in background mode so that the start/stop functions update
+# NetworkManager service status to started or inactive instead of actually
+# starting or stopping the daemon
+export IN_BACKGROUND=YES
+
+case "$2" in
+       up) nm-online -t 0 -x &&
+               ! rc-service NetworkManager status 2>&1 | grep -q started &&
+               exec rc-service NetworkManager start ;;
+       down) nm-online -t 0 -x ||
+               rc-service NetworkManager status 2>&1 | grep -q stopped ||
+               exec rc-service NetworkManager stop ;;
+       pre-sleep) rc-service NetworkManager status 2>&1 | grep -q stopped ||
+               exec rc-service NetworkManager stop ;;
+esac
+exit 0
+# vim: set ts=4:

diff --git a/net-misc/networkmanager/files/conf.d.NetworkManager 
b/net-misc/networkmanager/files/conf.d.NetworkManager
new file mode 100644
index 0000000..4a99229
--- /dev/null
+++ b/net-misc/networkmanager/files/conf.d.NetworkManager
@@ -0,0 +1,4 @@
+# If NetworkManager does not establish a connection within $INACTIVE_TIMEOUT
+# seconds after starting, the service will be marked as inactive, and it will
+# continue to wait for a connection in background mode.
+INACTIVE_TIMEOUT=1

diff --git a/net-misc/networkmanager/files/init.d.NetworkManager 
b/net-misc/networkmanager/files/init.d.NetworkManager
new file mode 100755
index 0000000..8465449
--- /dev/null
+++ b/net-misc/networkmanager/files/init.d.NetworkManager
@@ -0,0 +1,57 @@
+#!/sbin/runscript
+# Copyright (c) 2008 Saleem Abdulrasool <[email protected]>
+# Distributed under the terms of the GNU General Purpose License v2
+# $Header: 
/var/cvsroot/gentoo-x86/net-misc/networkmanager/files/init.d.NetworkManager,v 
1.1 2013/01/28 07:05:05 tetromino Exp $
+
+description="NetworkManager daemon. The service is marked as started only \
+when a network connection is established."
+
+depend() {
+       need dbus
+       provide net
+}
+
+start() {
+       # If we are re-called by a dispatcher event, we want to mark the service
+       # as started without starting the daemon again
+       yesno "${IN_BACKGROUND}" && return 0
+
+       [ -z "${INACTIVE_TIMEOUT}" ] && INACTIVE_TIMEOUT="1"
+
+       ebegin "Starting NetworkManager"
+       start-stop-daemon --start --quiet --pidfile 
/run/NetworkManager/NetworkManager.pid \
+               --exec /usr/sbin/NetworkManager -- --pid-file 
/run/NetworkManager/NetworkManager.pid
+       local _retval=$?
+       eend "${_retval}"
+       if [ "x${_retval}" = 'x0' ] && ! nm-online -t "${INACTIVE_TIMEOUT}"; 
then
+               einfo "Marking NetworkManager as inactive. It will 
automatically be marked"
+               einfo "as started after a network connection has been 
established."
+               mark_service_inactive
+       fi
+       return "${_retval}"
+}
+
+stop() {
+       # If we are re-called by a dispatcher event, we want to mark the service
+       # as inactive without stopping the daemon
+       if yesno "${IN_BACKGROUND}"; then
+               mark_service_inactive "${SVCNAME}"
+               return 0
+       fi
+
+       ebegin "Stopping NetworkManager"
+       local pidfile=/run/NetworkManager/NetworkManager.pid
+       if [ ! -e "${pidfile}" ] && [ -e /var/run/NetworkManager.pid ]; then 
+               # Try stopping the pid file used by <0.9.7
+               pidfile=/var/run/NetworkManager.pid
+               start-stop-daemon --stop --quiet --pidfile "${pidfile}"
+               ret=$?
+               [ ${ret} = 0 ] && [ -e "${pidfile}" ] && rm "${pidfile}"
+               eend ${ret}
+       else
+               start-stop-daemon --stop --quiet --pidfile "${pidfile}"
+               eend $?
+       fi
+}
+
+# vim: set ft=gentoo-init-d ts=4 :

diff --git 
a/net-misc/networkmanager/files/networkmanager-0.9.8.4-pre-sleep.patch 
b/net-misc/networkmanager/files/networkmanager-0.9.8.4-pre-sleep.patch
new file mode 100644
index 0000000..6e6dfbe
--- /dev/null
+++ b/net-misc/networkmanager/files/networkmanager-0.9.8.4-pre-sleep.patch
@@ -0,0 +1,131 @@
+From ffb08fa288cea4c9ac8f18fd83e063b2e86ac51b Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <[email protected]>
+Date: Sun, 27 Jan 2013 23:39:56 -0500
+Subject: [PATCH] Implement "pre-sleep" action dispatch
+
+Based on work by Christian Becke <[email protected]> in
+https://bugzilla.gnome.org/show_bug.cgi?id=387832
+---
+ callouts/nm-dispatcher-utils.c |  3 ++-
+ src/nm-dispatcher.c            |  8 ++++++--
+ src/nm-dispatcher.h            |  3 ++-
+ src/nm-manager.c               | 28 +++++++++++++++++++++-------
+ 4 files changed, 31 insertions(+), 11 deletions(-)
+
+diff --git a/callouts/nm-dispatcher-utils.c b/callouts/nm-dispatcher-utils.c
+index 8824295..66cbc4b 100644
+--- a/callouts/nm-dispatcher-utils.c
++++ b/callouts/nm-dispatcher-utils.c
+@@ -409,7 +409,8 @@ nm_dispatcher_utils_construct_envp (const char *action,
+       g_return_val_if_fail (*out_iface == NULL, NULL);
+ 
+       /* Hostname changes don't require a device nor contain a connection */
+-      if (!strcmp (action, "hostname"))
++      if (!strcmp (action, "hostname") ||
++          !strcmp (action, "pre-sleep"))
+               return g_new0 (char *, 1);
+ 
+       /* Canonicalize the VPN interface name; "" is used when passing it 
through
+diff --git a/src/nm-dispatcher.c b/src/nm-dispatcher.c
+index 12cd0f0..42d7e12 100644
+--- a/src/nm-dispatcher.c
++++ b/src/nm-dispatcher.c
+@@ -237,6 +237,8 @@ action_to_string (DispatcherAction action)
+               return "dhcp4-change";
+       case DISPATCHER_ACTION_DHCP6_CHANGE:
+               return "dhcp6-change";
++      case DISPATCHER_ACTION_PRE_SLEEP:
++              return "pre-sleep";
+       default:
+               break;
+       }
+@@ -269,7 +271,8 @@ _dispatcher_call (DispatcherAction action,
+       DispatchInfo *info;
+ 
+       /* All actions except 'hostname' require a device */
+-      if (action != DISPATCHER_ACTION_HOSTNAME)
++      if (action != DISPATCHER_ACTION_HOSTNAME &&
++          action != DISPATCHER_ACTION_PRE_SLEEP)
+               g_return_val_if_fail (NM_IS_DEVICE (device), NULL);
+       /* VPN actions require at least an IPv4 config (for now) */
+       if (action == DISPATCHER_ACTION_VPN_UP)
+@@ -308,7 +311,8 @@ _dispatcher_call (DispatcherAction action,
+       vpn_ip6_props = value_hash_create ();
+ 
+       /* hostname actions only send the hostname */
+-      if (action != DISPATCHER_ACTION_HOSTNAME) {
++      if (action != DISPATCHER_ACTION_HOSTNAME &&
++          action != DISPATCHER_ACTION_PRE_SLEEP) {
+               fill_device_props (device,
+                                  device_props,
+                                  device_ip4_props,
+diff --git a/src/nm-dispatcher.h b/src/nm-dispatcher.h
+index 05a6c87..8e95834 100644
+--- a/src/nm-dispatcher.h
++++ b/src/nm-dispatcher.h
+@@ -39,7 +39,8 @@ typedef enum {
+       DISPATCHER_ACTION_VPN_PRE_DOWN,
+       DISPATCHER_ACTION_VPN_DOWN,
+       DISPATCHER_ACTION_DHCP4_CHANGE,
+-      DISPATCHER_ACTION_DHCP6_CHANGE
++      DISPATCHER_ACTION_DHCP6_CHANGE,
++      DISPATCHER_ACTION_PRE_SLEEP = 999,
+ } DispatcherAction;
+ 
+ typedef void (*DispatcherFunc) (gconstpointer call, gpointer user_data);
+diff --git a/src/nm-manager.c b/src/nm-manager.c
+index 811f49d..f52956d 100644
+--- a/src/nm-manager.c
++++ b/src/nm-manager.c
+@@ -73,6 +73,7 @@
+ #include "nm-sleep-monitor.h"
+ #include "nm-connectivity.h"
+ #include "nm-policy.h"
++#include "nm-dispatcher.h"
+ 
+ 
+ #define NM_AUTOIP_DBUS_SERVICE "org.freedesktop.nm_avahi_autoipd"
+@@ -3350,6 +3351,23 @@ impl_manager_deactivate_connection (NMManager *self,
+ }
+ 
+ static void
++pre_sleep_dispatcher_done (gpointer call, gpointer user_data)
++{
++      NMManager *self = (NMManager *) user_data;
++      NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
++      GSList *iter;
++
++      /* Just deactivate and down all devices from the device list,
++       * to keep things fast the device list will get resynced when
++       * the manager wakes up.
++       */
++      for (iter = priv->devices; iter; iter = iter->next)
++              nm_device_set_managed (NM_DEVICE (iter->data), FALSE, 
NM_DEVICE_STATE_REASON_SLEEPING);
++
++      nm_manager_update_state (self);
++}
++
++static void
+ do_sleep_wake (NMManager *self)
+ {
+       NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
+@@ -3359,13 +3377,9 @@ do_sleep_wake (NMManager *self)
+       if (manager_sleeping (self)) {
+               nm_log_info (LOGD_SUSPEND, "sleeping or disabling...");
+ 
+-              /* Just deactivate and down all devices from the device list,
+-               * to keep things fast the device list will get resynced when
+-               * the manager wakes up.
+-               */
+-              for (iter = priv->devices; iter; iter = iter->next)
+-                      nm_device_set_managed (NM_DEVICE (iter->data), FALSE, 
NM_DEVICE_STATE_REASON_SLEEPING);
+-
++              nm_dispatcher_call (DISPATCHER_ACTION_PRE_SLEEP, NULL, NULL,
++                                  pre_sleep_dispatcher_done, self);
++              return;
+       } else {
+               nm_log_info (LOGD_SUSPEND, "waking up and re-enabling...");
+ 
+-- 
+1.8.3.2
+

diff --git a/net-misc/networkmanager/files/nm-system-settings.conf-ifnet 
b/net-misc/networkmanager/files/nm-system-settings.conf-ifnet
new file mode 100644
index 0000000..4d14ee7
--- /dev/null
+++ b/net-misc/networkmanager/files/nm-system-settings.conf-ifnet
@@ -0,0 +1,6 @@
+[main]
+plugins=ifnet,keyfile
+
+[ifnet]
+managed=true
+auto_refresh=false

diff --git a/net-misc/networkmanager/metadata.xml 
b/net-misc/networkmanager/metadata.xml
new file mode 100644
index 0000000..13d26ab
--- /dev/null
+++ b/net-misc/networkmanager/metadata.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+<herd>gnome</herd>
+       <use>
+               <flag name="connection-sharing">Use <pkg>net-dns/dnsmasq</pkg> 
and
+                       <pkg>net-firewall/iptables</pkg> for connection 
sharing</flag>
+               <flag name="consolekit">Use <pkg>sys-auth/consolekit</pkg> for 
session
+                       tracking</flag>
+               <flag name="dhclient">Use dhclient from 
<pkg>net-misc/dhcp</pkg> for
+                       getting ip</flag>
+               <flag name="dhcpcd">Use <pkg>net-misc/dhcpcd</pkg> for getting 
ip</flag>
+               <flag name="modemmanager">Enable support for mobile broadband 
devices
+                       using <pkg>net-misc/modemmanager</pkg></flag>
+               <flag name="nss">Use <pkg>dev-libs/nss</pkg> for 
cryptography</flag>
+               <flag name="ppp">Enable support for mobile broadband and PPPoE
+                       connections using <pkg>net-dialup/ppp</pkg></flag>
+               <flag name="resolvconf">Use <pkg>net-dns/openresolv</pkg> for 
managing
+                       DNS information</flag>
+               <flag name="vala">Enable bindings for 
<pkg>dev-lang/vala</pkg></flag>
+               <flag name="wifi">Enable support for wifi and 802.1x security 
using
+                   <pkg>net-wireless/wpa_supplicant</pkg></flag>
+               <flag name="wext">Enable support for the deprecated Wext 
(Wireless
+                       Extensions) API; needed for some older drivers (e.g. 
ipw2200,
+                       ndiswrapper)</flag>
+               <flag name="wimax">Enable support for WiMAX connections using
+                       <pkg>net-wireless/wimax</pkg></flag>
+       </use>
+</pkgmetadata>

diff --git a/net-misc/networkmanager/networkmanager-0.9.8.10.ebuild 
b/net-misc/networkmanager/networkmanager-0.9.8.10.ebuild
new file mode 100644
index 0000000..0885924
--- /dev/null
+++ b/net-misc/networkmanager/networkmanager-0.9.8.10.ebuild
@@ -0,0 +1,248 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="5"
+GNOME_ORG_MODULE="NetworkManager"
+VALA_MIN_API_VERSION="0.18"
+VALA_USE_DEPEND="vapigen"
+
+inherit bash-completion-r1 gnome.org linux-info systemd user readme.gentoo 
toolchain-funcs vala virtualx udev eutils
+
+DESCRIPTION="Universal network configuration daemon for laptops, desktops, 
servers and virtualization hosts"
+HOMEPAGE="http://projects.gnome.org/NetworkManager/";
+
+LICENSE="GPL-2+"
+SLOT="0" # add subslot if libnm-util.so.2 or libnm-glib.so.4 bumps soname 
version
+IUSE="avahi bluetooth connection-sharing consolekit dhclient +dhcpcd gnutls 
+introspection kernel_linux +nss +modemmanager +ppp resolvconf systemd test 
vala +wext +wifi" # wimax
+
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+
+REQUIRED_USE="
+       modemmanager? ( ppp )
+       ^^ ( nss gnutls )
+       ^^ ( dhclient dhcpcd )
+"
+
+# gobject-introspection-0.10.3 is needed due to gnome bug 642300
+# wpa_supplicant-0.7.3-r3 is needed due to bug 359271
+# TODO: Qt support?
+COMMON_DEPEND="
+       >=sys-apps/dbus-1.2
+       >=dev-libs/dbus-glib-0.94
+       >=dev-libs/glib-2.30
+       >=dev-libs/libnl-3.2.7:3=
+       >=sys-auth/polkit-0.106
+       >=net-libs/libsoup-2.26:2.4=
+       >=virtual/udev-165[gudev]
+       bluetooth? ( >=net-wireless/bluez-4.82 )
+       avahi? ( net-dns/avahi:=[autoipd] )
+       connection-sharing? (
+               net-dns/dnsmasq[dhcp]
+               net-firewall/iptables )
+       gnutls? (
+               dev-libs/libgcrypt:0=
+               net-libs/gnutls:= )
+       modemmanager? ( >=net-misc/modemmanager-0.7.991 )
+       nss? ( >=dev-libs/nss-3.11:= )
+       dhclient? ( =net-misc/dhcp-4*[client] )
+       dhcpcd? ( >=net-misc/dhcpcd-4.0.0_rc3 )
+       introspection? ( >=dev-libs/gobject-introspection-0.10.3 )
+       ppp? ( >=net-dialup/ppp-2.4.5[ipv6] )
+       resolvconf? ( net-dns/openresolv )
+       systemd? ( >=sys-apps/systemd-183:0= )
+       || ( sys-power/upower >=sys-apps/systemd-183 )
+"
+RDEPEND="${COMMON_DEPEND}
+       consolekit? ( sys-auth/consolekit )
+       wifi? ( >=net-wireless/wpa_supplicant-0.7.3-r3[dbus] )
+"
+DEPEND="${COMMON_DEPEND}
+       dev-util/gtk-doc-am
+       >=dev-util/intltool-0.40
+       >=sys-devel/gettext-0.17
+       >=sys-kernel/linux-headers-2.6.29
+       virtual/pkgconfig
+       vala? ( $(vala_depend) )
+       test? (
+               dev-lang/python:2.7
+               dev-python/dbus-python[python_targets_python2_7]
+               dev-python/pygobject:2[python_targets_python2_7] )
+"
+
+sysfs_deprecated_check() {
+       ebegin "Checking for SYSFS_DEPRECATED support"
+
+       if { linux_chkconfig_present SYSFS_DEPRECATED_V2; }; then
+               eerror "Please disable SYSFS_DEPRECATED_V2 support in your 
kernel config and recompile your kernel"
+               eerror "or NetworkManager will not work correctly."
+               eerror "See http://bugs.gentoo.org/333639 for more info."
+               die "CONFIG_SYSFS_DEPRECATED_V2 support detected!"
+       fi
+       eend $?
+}
+
+pkg_pretend() {
+       if use kernel_linux; then
+               get_version
+               if linux_config_exists; then
+                       sysfs_deprecated_check
+               else
+                       ewarn "Was unable to determine your kernel .config"
+                       ewarn "Please note that if CONFIG_SYSFS_DEPRECATED_V2 
is set in your kernel .config, NetworkManager will not work correctly."
+                       ewarn "See http://bugs.gentoo.org/333639 for more info."
+               fi
+
+       fi
+}
+
+pkg_setup() {
+       enewgroup plugdev
+}
+
+src_prepare() {
+       DOC_CONTENTS="To modify system network connections without needing to 
enter the
+               root password, add your user account to the 'plugdev' group."
+
+       # Bug #402085, https://bugzilla.gnome.org/show_bug.cgi?id=387832
+       epatch "${FILESDIR}/${PN}-0.9.8.4-pre-sleep.patch"
+
+       # Use python2.7 shebangs for test scripts
+       sed -e 's@\(^#!.*python\)@\12.7@' \
+               -i */tests/*.py || die
+
+       # Fix completiondir, avoid eautoreconf, bug #465100
+       sed -i "s|^completiondir =.*|completiondir = $(get_bashcompdir)|" \
+               cli/completion/Makefile.in || die "sed completiondir failed"
+
+       ## Force use of /run, avoid eautoreconf
+       sed -e 's:$localstatedir/run/:/run/:' -i configure || die
+
+       use vala && vala_src_prepare
+
+       epatch_user # don't remove, users often want custom patches for NM
+}
+
+src_configure() {
+       # TODO: enable wimax when we have a libnl:3 compatible revision of it
+       # We are not ready for bluez5 yet
+       econf \
+               --enable-bluez4 \
+               --disable-more-warnings \
+               --disable-static \
+               --localstatedir=/var \
+               $(usex systemd '--disable-ifnet' '--enable-ifnet') \
+               --without-netconfig \
+               --with-dbus-sys-dir=/etc/dbus-1/system.d \
+               --with-udev-dir="$(udev_get_udevdir)" \
+               --with-iptables=/sbin/iptables \
+               --enable-concheck \
+               --with-crypto=$(usex nss nss gnutls) \
+               --with-session-tracking=$(usex systemd systemd $(usex 
consolekit consolekit no)) \
+               --with-suspend-resume=$(usex systemd systemd upower) \
+               $(use_enable introspection) \
+               $(use_enable ppp) \
+               --disable-wimax \
+               $(use_with dhclient) \
+               $(use_with dhcpcd) \
+               $(use_with modemmanager modem-manager-1) \
+               $(use_with resolvconf) \
+               $(use_enable test tests) \
+               $(use_enable vala) \
+               $(use_with wext) \
+               "$(systemd_with_unitdir)"
+}
+
+src_test() {
+       # bug #????
+       cp libnm-util/tests/certs/test_ca_cert.pem 
src/settings/plugins/ifnet/tests/ || die
+       Xemake check
+}
+
+src_install() {
+       default
+
+       readme.gentoo_create_doc
+
+       # Gentoo init script
+       newinitd "${FILESDIR}/init.d.NetworkManager" NetworkManager
+
+       # /var/run/NetworkManager is used by some distros, but not by Gentoo
+       rmdir -v "${ED}/var/run/NetworkManager" || die "rmdir failed"
+
+       # Need to keep the /etc/NetworkManager/dispatched.d for dispatcher 
scripts
+       keepdir /etc/NetworkManager/dispatcher.d
+
+       # Provide openrc net dependency only when nm is connected
+       exeinto /etc/NetworkManager/dispatcher.d
+       newexe "${FILESDIR}/10-openrc-status-r4" 10-openrc-status
+       sed -e "s:@EPREFIX@:${EPREFIX}:g" \
+               -i "${ED}/etc/NetworkManager/dispatcher.d/10-openrc-status" || 
die
+
+       # Default conf.d file
+       newconfd "${FILESDIR}/conf.d.NetworkManager" NetworkManager
+
+       # Add keyfile plugin support
+       keepdir /etc/NetworkManager/system-connections
+       chmod 0600 "${ED}"/etc/NetworkManager/system-connections/.keep* # bug 
#383765
+
+       if ! use systemd; then
+               insinto /etc/NetworkManager
+               newins "${FILESDIR}/nm-system-settings.conf-ifnet" 
NetworkManager.conf
+       fi
+
+       # Allow users in plugdev group to modify system connections
+       insinto /usr/share/polkit-1/rules.d/
+       doins 
"${FILESDIR}/01-org.freedesktop.NetworkManager.settings.modify.system.rules"
+
+       prune_libtool_files --modules
+}
+
+pkg_postinst() {
+       readme.gentoo_print_elog
+
+       if [[ -e "${EROOT}etc/NetworkManager/nm-system-settings.conf" ]]; then
+               ewarn "The ${PN} system configuration file has moved to a new 
location."
+               ewarn "You must migrate your settings from 
${EROOT}/etc/NetworkManager/nm-system-settings.conf"
+               ewarn "to ${EROOT}etc/NetworkManager/NetworkManager.conf"
+               ewarn
+               ewarn "After doing so, you can remove 
${EROOT}etc/NetworkManager/nm-system-settings.conf"
+       fi
+
+       # The polkit rules file moved to /usr/share
+       
old_rules="${EROOT}etc/polkit-1/rules.d/01-org.freedesktop.NetworkManager.settings.modify.system.rules"
+       if [[ -f "${old_rules}" ]]; then
+               case "$(md5sum ${old_rules})" in
+                 574d0cfa7e911b1f7792077003060240* )
+                       # Automatically delete the old rules.d file if the user 
did not change it
+                       elog
+                       elog "Removing old ${old_rules} ..."
+                       rm -f "${old_rules}" || eerror "Failed, please remove 
${old_rules} manually"
+                       ;;
+                 * )
+                       elog "The ${old_rules}"
+                       elog "file moved to /usr/share/polkit-1/rules.d/ in 
>=networkmanager-0.9.4.0-r4"
+                       elog "If you edited ${old_rules}"
+                       elog "without changing its behavior, you may want to 
remove it."
+                       ;;
+               esac
+       fi
+
+       if use systemd; then
+               if [[ ${REPLACING_VERSIONS} < 0.9.8.6 ]]; then
+                       ewarn "Ifnet plugin won't be used with systemd support 
enabled"
+                       ewarn "as it is meant to be used with openRC and can 
cause collisions"
+                       ewarn "(like bug #485658)."
+                       ewarn "Because of this, you will likely need to 
reconfigure some of"
+                       ewarn "your networks."
+               fi
+
+               if [[ -e "${EROOT}etc/NetworkManager/NetworkManager.conf" ]]; 
then
+                       if grep -q plugins 
"${EROOT}etc/NetworkManager/NetworkManager.conf" | grep -q ifnet; then
+                               ewarn "You seem to use 'ifnet' plugin in 
${EROOT}etc/NetworkManager/NetworkManager.conf"
+                               ewarn "Since it won't be used when running 
under Systemd, you will need to stop setting"
+                               ewarn "ifnet plugin there to allow 
NetworkManager to work."
+                       fi
+               fi
+       fi
+}

Reply via email to