Gentoo Archives: gentoo-commits

From: Pacho Ramos <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/networkmanager/, net-misc/networkmanager/files/
Date: Sat, 03 Oct 2015 11:53:15
Message-Id: 1443873176.32923fba19c5b92210481ed853cc0bdfb705c7a6.pacho@gentoo
1 commit: 32923fba19c5b92210481ed853cc0bdfb705c7a6
2 Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 3 11:51:54 2015 +0000
4 Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 3 11:52:56 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32923fba
7
8 net-misc/networkmanager: Fix VPN problems due to wrong MTU (#559908 by Markos Chandras and Lubomir Rintel).
9
10 Package-Manager: portage-2.2.22
11
12 .../files/networkmanager-1.0.6-vpn-mtu.patch | 53 ++++
13 .../networkmanager/networkmanager-1.0.6-r1.ebuild | 348 +++++++++++++++++++++
14 2 files changed, 401 insertions(+)
15
16 diff --git a/net-misc/networkmanager/files/networkmanager-1.0.6-vpn-mtu.patch b/net-misc/networkmanager/files/networkmanager-1.0.6-vpn-mtu.patch
17 new file mode 100644
18 index 0000000..6159972
19 --- /dev/null
20 +++ b/net-misc/networkmanager/files/networkmanager-1.0.6-vpn-mtu.patch
21 @@ -0,0 +1,53 @@
22 +From 105e30efbaf422401902575749efdcd18706ace1 Mon Sep 17 00:00:00 2001
23 +From: Lubomir Rintel <lkundrak@××.sk>
24 +Date: Mon, 28 Sep 2015 20:57:09 +0200
25 +Subject: vpn-connection: set the MTU for the VPN IP interface
26 +
27 +The 9b79e6c73 commit moved setting of the MTU from IP4Config to NMDevice, but
28 +VPN connections don't have a NMDevice instance (yet). Set the MTU also from the
29 +VPN connection. Also, copying of the MTU to the IP4Config is no longer needed
30 +as the ip4_config_commit no longer sets the MTU.
31 +
32 +Fixes: 9b79e6c732ffb2fb105647c1465070d36a6cc180
33 +
34 +https://bugzilla.gnome.org/show_bug.cgi?id=754781
35 +(cherry picked from commit e0fa48f224abcb73a1a129f10050f7cd942ee629)
36 +
37 +diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c
38 +index f0e6149..e2d3103 100644
39 +--- a/src/vpn-manager/nm-vpn-connection.c
40 ++++ b/src/vpn-manager/nm-vpn-connection.c
41 +@@ -980,6 +980,9 @@ nm_vpn_connection_apply_config (NMVpnConnection *connection)
42 + TRUE))
43 + return FALSE;
44 + }
45 ++
46 ++ if (priv->mtu && priv->mtu != nm_platform_link_get_mtu (NM_PLATFORM_GET, priv->ip_ifindex))
47 ++ nm_platform_link_set_mtu (NM_PLATFORM_GET, priv->ip_ifindex, priv->mtu);
48 + }
49 +
50 + apply_parent_device_config (connection);
51 +@@ -1149,10 +1152,6 @@ process_generic_config (NMVpnConnection *connection,
52 + }
53 + }
54 +
55 +- /* MTU; this is a per-connection value, though NM's API treats it
56 +- * like it's IP4-specific. So we store it for now and retrieve it
57 +- * later in ip4_config_get.
58 +- */
59 + priv->mtu = 0;
60 + val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_CONFIG_MTU);
61 + if (val) {
62 +@@ -1328,9 +1327,6 @@ nm_vpn_connection_ip4_config_get (DBusGProxy *proxy,
63 + if (val)
64 + nm_ip4_config_set_mss (config, g_value_get_uint (val));
65 +
66 +- if (priv->mtu)
67 +- nm_ip4_config_set_mtu (config, priv->mtu, NM_IP_CONFIG_SOURCE_VPN);
68 +-
69 + val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_DOMAIN);
70 + if (val)
71 + nm_ip4_config_add_domain (config, g_value_get_string (val));
72 +--
73 +cgit v0.10.2
74 +
75
76 diff --git a/net-misc/networkmanager/networkmanager-1.0.6-r1.ebuild b/net-misc/networkmanager/networkmanager-1.0.6-r1.ebuild
77 new file mode 100644
78 index 0000000..89bc91b
79 --- /dev/null
80 +++ b/net-misc/networkmanager/networkmanager-1.0.6-r1.ebuild
81 @@ -0,0 +1,348 @@
82 +# Copyright 1999-2015 Gentoo Foundation
83 +# Distributed under the terms of the GNU General Public License v2
84 +# $Id$
85 +
86 +EAPI="5"
87 +GCONF_DEBUG="no"
88 +GNOME_ORG_MODULE="NetworkManager"
89 +GNOME2_LA_PUNT="yes"
90 +VALA_USE_DEPEND="vapigen"
91 +PYTHON_COMPAT=( python{2_7,3_3,3_4} )
92 +
93 +inherit autotools bash-completion-r1 eutils gnome2 linux-info multilib python-any-r1 systemd \
94 + user readme.gentoo toolchain-funcs vala versionator virtualx udev multilib-minimal
95 +
96 +DESCRIPTION="Universal network configuration daemon for laptops, desktops, servers and virtualization hosts"
97 +HOMEPAGE="https://wiki.gnome.org/Projects/NetworkManager"
98 +
99 +LICENSE="GPL-2+"
100 +SLOT="0" # add subslot if libnm-util.so.2 or libnm-glib.so.4 bumps soname version
101 +
102 +IUSE="bluetooth connection-sharing consolekit +dhclient dhcpcd gnutls +introspection \
103 +kernel_linux +nss +modemmanager ncurses +ppp resolvconf selinux systemd teamd test \
104 +vala +wext +wifi zeroconf" # wimax
105 +
106 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
107 +
108 +REQUIRED_USE="
109 + modemmanager? ( ppp )
110 + wext? ( wifi )
111 + ^^ ( nss gnutls )
112 + ^^ ( dhclient dhcpcd )
113 +"
114 +
115 +# gobject-introspection-0.10.3 is needed due to gnome bug 642300
116 +# wpa_supplicant-0.7.3-r3 is needed due to bug 359271
117 +# TODO: Qt support?
118 +COMMON_DEPEND="
119 + >=sys-apps/dbus-1.2[${MULTILIB_USEDEP}]
120 + >=dev-libs/dbus-glib-0.100[${MULTILIB_USEDEP}]
121 + >=dev-libs/glib-2.37.6:2[${MULTILIB_USEDEP}]
122 + >=dev-libs/libnl-3.2.8:3=
123 + >=sys-auth/polkit-0.106
124 + net-libs/libndp
125 + >=net-libs/libsoup-2.26:2.4=
126 + net-misc/iputils
127 + sys-libs/readline:0
128 + >=virtual/libgudev-165:=[${MULTILIB_USEDEP}]
129 + bluetooth? ( >=net-wireless/bluez-5 )
130 + connection-sharing? (
131 + net-dns/dnsmasq[dhcp]
132 + net-firewall/iptables )
133 + gnutls? (
134 + dev-libs/libgcrypt:0=[${MULTILIB_USEDEP}]
135 + net-libs/gnutls:=[${MULTILIB_USEDEP}] )
136 + modemmanager? ( >=net-misc/modemmanager-0.7.991 )
137 + ncurses? ( >=dev-libs/newt-0.52.15 )
138 + nss? ( >=dev-libs/nss-3.11:=[${MULTILIB_USEDEP}] )
139 + dhclient? ( >=net-misc/dhcp-4[client] )
140 + dhcpcd? ( >=net-misc/dhcpcd-4.0.0_rc3 )
141 + introspection? ( >=dev-libs/gobject-introspection-0.10.3:= )
142 + ppp? ( >=net-dialup/ppp-2.4.5:=[ipv6] net-dialup/rp-pppoe )
143 + resolvconf? ( net-dns/openresolv )
144 + systemd? ( >=sys-apps/systemd-209:0= )
145 + !systemd? ( || ( sys-power/upower sys-power/upower-pm-utils ) )
146 + teamd? ( >=net-misc/libteam-1.9 )
147 + zeroconf? ( net-dns/avahi:=[autoipd] )
148 +"
149 +RDEPEND="${COMMON_DEPEND}
150 + consolekit? ( sys-auth/consolekit )
151 + wifi? ( >=net-wireless/wpa_supplicant-0.7.3-r3[dbus] )
152 +"
153 +DEPEND="${COMMON_DEPEND}
154 + dev-util/gdbus-codegen
155 + dev-util/gtk-doc-am
156 + >=dev-util/intltool-0.40
157 + >=sys-devel/gettext-0.17
158 + >=sys-kernel/linux-headers-2.6.29
159 + virtual/pkgconfig
160 + vala? ( $(vala_depend) )
161 + test? (
162 + $(python_gen_any_dep '
163 + dev-python/dbus-python[${PYTHON_USEDEP}]
164 + dev-python/pygobject:2[${PYTHON_USEDEP}]')
165 + )
166 +"
167 +
168 +sysfs_deprecated_check() {
169 + ebegin "Checking for SYSFS_DEPRECATED support"
170 +
171 + if { linux_chkconfig_present SYSFS_DEPRECATED_V2; }; then
172 + eerror "Please disable SYSFS_DEPRECATED_V2 support in your kernel config and recompile your kernel"
173 + eerror "or NetworkManager will not work correctly."
174 + eerror "See https://bugs.gentoo.org/333639 for more info."
175 + die "CONFIG_SYSFS_DEPRECATED_V2 support detected!"
176 + fi
177 + eend $?
178 +}
179 +
180 +pkg_pretend() {
181 + if use kernel_linux; then
182 + get_version
183 + if linux_config_exists; then
184 + sysfs_deprecated_check
185 + else
186 + ewarn "Was unable to determine your kernel .config"
187 + ewarn "Please note that if CONFIG_SYSFS_DEPRECATED_V2 is set in your kernel .config, NetworkManager will not work correctly."
188 + ewarn "See https://bugs.gentoo.org/333639 for more info."
189 + fi
190 +
191 + fi
192 +}
193 +
194 +pkg_setup() {
195 + enewgroup plugdev
196 +}
197 +
198 +src_prepare() {
199 + DOC_CONTENTS="To modify system network connections without needing to enter the
200 + root password, add your user account to the 'plugdev' group."
201 +
202 + # vpn-connection: set the MTU for the VPN IP interface (from nm-1.0 branch)
203 + epatch "${FILESDIR}"/${P}-vpn-mtu.patch
204 +
205 + # Force use of /run, avoid eautoreconf, upstream bug #737139, fixed in 'master'
206 + sed -e 's:$localstatedir/run/:/run/:' -i configure || die
207 +
208 + # Don't build examples, they are not needed and can cause build failure
209 + sed -e '/^\s*examples\s*\\/d' -i Makefile.{am,in} || die
210 +
211 + use vala && vala_src_prepare
212 +
213 + epatch_user # don't remove, users often want custom patches for NM
214 +
215 + eautoreconf
216 +
217 + gnome2_src_prepare
218 +}
219 +
220 +multilib_src_configure() {
221 + local myconf=()
222 +
223 + # Same hack as net-dialup/pptpd to get proper plugin dir for ppp, bug #519986
224 + if use ppp; then
225 + local PPPD_VER=`best_version net-dialup/ppp`
226 + PPPD_VER=${PPPD_VER#*/*-} #reduce it to ${PV}-${PR}
227 + PPPD_VER=${PPPD_VER%%[_-]*} # main version without beta/pre/patch/revision
228 + myconf+=( --with-pppd-plugin-dir=/usr/$(get_libdir)/pppd/${PPPD_VER} )
229 + fi
230 +
231 + # unit files directory needs to be passed only when systemd is enabled,
232 + # otherwise systemd support is not disabled completely, bug #524534
233 + use systemd && myconf+=( "$(systemd_with_unitdir)" )
234 +
235 + if multilib_is_native_abi; then
236 + # work-around man out-of-source brokenness, must be done before configure
237 + mkdir man || die
238 + find "${S}"/man -name '*.?' -exec ln -s {} man/ ';' || die
239 + else
240 + # libnl, libndp are only used for executables, not libraries
241 + myconf+=( LIB{NL,NDP}_{CFLAGS,LIBS}=' ' )
242 + fi
243 +
244 + # TODO: enable wimax when we have a libnl:3 compatible revision of it
245 + # wimax will be removed, bug #522822
246 + # ifnet plugin always disabled until someone volunteers to actively
247 + # maintain and fix it
248 + ECONF_SOURCE=${S} \
249 + gnome2_src_configure \
250 + --disable-more-warnings \
251 + --disable-static \
252 + --localstatedir=/var \
253 + --disable-lto \
254 + --disable-config-plugin-ibft \
255 + --disable-ifnet \
256 + --without-netconfig \
257 + --with-dbus-sys-dir=/etc/dbus-1/system.d \
258 + --with-udev-dir="$(get_udevdir)" \
259 + --with-config-plugins-default=keyfile \
260 + --with-iptables=/sbin/iptables \
261 + $(multilib_native_with libsoup) \
262 + $(multilib_native_enable concheck) \
263 + --with-crypto=$(usex nss nss gnutls) \
264 + --with-session-tracking=$(multilib_native_usex systemd systemd $(multilib_native_usex consolekit consolekit no)) \
265 + --with-suspend-resume=$(multilib_native_usex systemd systemd upower) \
266 + $(multilib_native_use_enable bluetooth bluez5-dun) \
267 + $(multilib_native_use_enable introspection) \
268 + $(multilib_native_use_enable ppp) \
269 + --disable-wimax \
270 + $(use_with dhclient) \
271 + $(use_with dhcpcd) \
272 + $(multilib_native_use_with modemmanager modem-manager-1) \
273 + $(multilib_native_use_with ncurses nmtui) \
274 + $(multilib_native_use_with resolvconf) \
275 + $(multilib_native_use_with selinux) \
276 + $(multilib_native_use_enable teamd teamdctl) \
277 + $(multilib_native_use_enable test tests) \
278 + $(multilib_native_use_enable vala) \
279 + --without-valgrind \
280 + $(multilib_native_use_with wext) \
281 + $(multilib_native_use_enable wifi) \
282 + "${myconf[@]}"
283 +
284 + # work-around gtk-doc out-of-source brokedness
285 + if multilib_is_native_abi; then
286 + local d
287 + for d in api libnm libnm-util libnm-glib; do
288 + ln -s "${S}"/docs/${d}/html docs/${d}/html || die
289 + done
290 + fi
291 +}
292 +
293 +multilib_src_compile() {
294 + if multilib_is_native_abi; then
295 + emake
296 + else
297 + emake all-am
298 + emake -C include
299 + emake -C introspection # generated headers, needed for libnm
300 + emake -C libnm-core
301 + emake -C libnm
302 + emake -C libnm-util
303 + emake -C libnm-glib
304 + fi
305 +}
306 +
307 +multilib_src_test() {
308 + if multilib_is_native_abi; then
309 + python_setup
310 + Xemake check
311 + fi
312 +}
313 +
314 +multilib_src_install() {
315 + if multilib_is_native_abi; then
316 + # Install completions at proper place, bug #465100
317 + gnome2_src_install completiondir="$(get_bashcompdir)"
318 + else
319 + emake DESTDIR="${D}" install-am
320 + emake DESTDIR="${D}" install -C include
321 + emake DESTDIR="${D}" install -C introspection
322 + emake DESTDIR="${D}" install -C libnm-core
323 + emake DESTDIR="${D}" install -C libnm
324 + emake DESTDIR="${D}" install -C libnm-util
325 + emake DESTDIR="${D}" install -C libnm-glib
326 + fi
327 +}
328 +
329 +multilib_src_install_all() {
330 + ! use systemd && readme.gentoo_create_doc
331 +
332 + newinitd "${FILESDIR}/init.d.NetworkManager" NetworkManager
333 + newconfd "${FILESDIR}/conf.d.NetworkManager" NetworkManager
334 +
335 + # /var/run/NetworkManager is used by some distros, but not by Gentoo
336 + rmdir -v "${ED}/var/run/NetworkManager" || die "rmdir failed"
337 + rmdir -v "${ED}/var/run" || die "rmdir failed"
338 +
339 + # Need to keep the /etc/NetworkManager/dispatched.d for dispatcher scripts
340 + keepdir /etc/NetworkManager/dispatcher.d
341 +
342 + # Provide openrc net dependency only when nm is connected
343 + exeinto /etc/NetworkManager/dispatcher.d
344 + newexe "${FILESDIR}/10-openrc-status-r4" 10-openrc-status
345 + sed -e "s:@EPREFIX@:${EPREFIX}:g" \
346 + -i "${ED}/etc/NetworkManager/dispatcher.d/10-openrc-status" || die
347 +
348 + keepdir /etc/NetworkManager/system-connections
349 + chmod 0600 "${ED}"/etc/NetworkManager/system-connections/.keep* # bug #383765, upstream bug #754594
350 +
351 + # Allow users in plugdev group to modify system connections
352 + insinto /usr/share/polkit-1/rules.d/
353 + doins "${FILESDIR}/01-org.freedesktop.NetworkManager.settings.modify.system.rules"
354 +}
355 +
356 +pkg_postinst() {
357 + gnome2_pkg_postinst
358 + ! use systemd && readme.gentoo_print_elog
359 +
360 + if [[ -e "${EROOT}etc/NetworkManager/nm-system-settings.conf" ]]; then
361 + ewarn "The ${PN} system configuration file has moved to a new location."
362 + ewarn "You must migrate your settings from ${EROOT}/etc/NetworkManager/nm-system-settings.conf"
363 + ewarn "to ${EROOT}etc/NetworkManager/NetworkManager.conf"
364 + ewarn
365 + ewarn "After doing so, you can remove ${EROOT}etc/NetworkManager/nm-system-settings.conf"
366 + fi
367 +
368 + # The polkit rules file moved to /usr/share
369 + old_rules="${EROOT}etc/polkit-1/rules.d/01-org.freedesktop.NetworkManager.settings.modify.system.rules"
370 + if [[ -f "${old_rules}" ]]; then
371 + case "$(md5sum ${old_rules})" in
372 + 574d0cfa7e911b1f7792077003060240* )
373 + # Automatically delete the old rules.d file if the user did not change it
374 + elog
375 + elog "Removing old ${old_rules} ..."
376 + rm -f "${old_rules}" || eerror "Failed, please remove ${old_rules} manually"
377 + ;;
378 + * )
379 + elog "The ${old_rules}"
380 + elog "file moved to /usr/share/polkit-1/rules.d/ in >=networkmanager-0.9.4.0-r4"
381 + elog "If you edited ${old_rules}"
382 + elog "without changing its behavior, you may want to remove it."
383 + ;;
384 + esac
385 + fi
386 +
387 + # ifnet plugin was disabled for systemd users with 0.9.8.6 version
388 + # and for all people with 0.9.10.0-r1 (see ChangeLog for full explanations)
389 + if use systemd; then
390 + if ! version_is_at_least 0.9.8.6 ${REPLACING_VERSIONS}; then
391 + ewarn "Ifnet plugin won't be used with systemd support enabled"
392 + ewarn "as it is meant to be used with openRC and can cause collisions"
393 + ewarn "(like bug #485658)."
394 + ewarn "Because of this, you will likely need to reconfigure some of"
395 + ewarn "your networks. To do this you can rely on Gnome control center,"
396 + ewarn "nm-connection-editor or nmtui tools for example once updated"
397 + ewarn "NetworkManager version is installed."
398 + fi
399 + else
400 + if ! version_is_at_least 0.9.10.0-r1 ${REPLACING_VERSIONS}; then
401 + ewarn "Ifnet plugin is now disabled because of it being unattended"
402 + ewarn "and unmaintained for a long time, leading to some unfixed bugs"
403 + ewarn "and new problems appearing. We will now use upstream 'keyfile'"
404 + ewarn "plugin."
405 + ewarn "Because of this, you will likely need to reconfigure some of"
406 + ewarn "your networks. To do this you can rely on Gnome control center,"
407 + ewarn "nm-connection-editor or nmtui tools for example once updated"
408 + ewarn "NetworkManager version is installed."
409 + fi
410 + fi
411 +
412 + # NM fallbacks to plugin specified at compile time (upstream bug #738611)
413 + # but still show a warning to remember people to have cleaner config file
414 + if [[ -e "${EROOT}etc/NetworkManager/NetworkManager.conf" ]]; then
415 + if grep plugins "${EROOT}etc/NetworkManager/NetworkManager.conf" | grep -q ifnet; then
416 + ewarn
417 + ewarn "You seem to use 'ifnet' plugin in ${EROOT}etc/NetworkManager/NetworkManager.conf"
418 + ewarn "Since it won't be used, you will need to stop setting ifnet plugin there."
419 + ewarn
420 + fi
421 + fi
422 +
423 + # NM shows lots of errors making nmcli neither unusable, bug #528748 upstream bug #690457
424 + if grep -r "psk-flags=1" "${EROOT}"/etc/NetworkManager/; then
425 + ewarn "You have psk-flags=1 setting in above files, you will need to"
426 + ewarn "either reconfigure affected networks or, at least, set the flag"
427 + ewarn "value to '0'."
428 + fi
429 +}