1 |
commit: cd412456377f71593b058f0b2930bcfd798fa26a |
2 |
Author: Alexandre Rostovtsev <tetromino <AT> gmail <DOT> com> |
3 |
AuthorDate: Fri Sep 30 23:43:53 2011 +0000 |
4 |
Commit: Alexandre Restovtsev <tetromino <AT> gmail <DOT> com> |
5 |
CommitDate: Fri Sep 30 23:43:53 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=cd412456 |
7 |
|
8 |
net-misc/networkmanager: add 0.9.1.90 |
9 |
|
10 |
Needed for nm-applet-0.9.1.90. |
11 |
|
12 |
--- |
13 |
.../files/networkmanager-0.9.1.90-rfkill.patch | 133 +++++++++++++++++++ |
14 |
.../files/networkmanager-0.9_rc3-fix-tests.patch | 18 +++ |
15 |
.../files/nm-system-settings.conf-ifnet | 6 + |
16 |
.../networkmanager/networkmanager-0.9.1.90.ebuild | 138 ++++++++++++++++++++ |
17 |
4 files changed, 295 insertions(+), 0 deletions(-) |
18 |
|
19 |
diff --git a/net-misc/networkmanager/files/networkmanager-0.9.1.90-rfkill.patch b/net-misc/networkmanager/files/networkmanager-0.9.1.90-rfkill.patch |
20 |
new file mode 100644 |
21 |
index 0000000..0ddf3ad |
22 |
--- /dev/null |
23 |
+++ b/net-misc/networkmanager/files/networkmanager-0.9.1.90-rfkill.patch |
24 |
@@ -0,0 +1,133 @@ |
25 |
+From 339229e4c698c61e20a28bfc33d8501490891427 Mon Sep 17 00:00:00 2001 |
26 |
+From: Gary Ching-Pang Lin <chingpang@×××××.com> |
27 |
+Date: Tue, 20 Sep 2011 08:36:35 +0000 |
28 |
+Subject: core: improving handling of rfkill (bgo #655773) |
29 |
+ |
30 |
+This commit improves the handling of rfkill. |
31 |
+ |
32 |
+- The original two passes check gathers the states of platform |
33 |
+ and non-platform switches in two separate loops. Now we gather |
34 |
+ the both states in one loop and determine the final states later. |
35 |
+ |
36 |
+- A new rule is used to determine the states of switches. |
37 |
+ |
38 |
+ if (platform_state == UNBLOCKED) |
39 |
+ choose non_platform_state; |
40 |
+ else |
41 |
+ choose platform_state; |
42 |
+ |
43 |
+ The state is UNBLOCKED if and only if both the platform and |
44 |
+ non-platform switches are unblocked, so the ambiguous state in |
45 |
+ bgo#655773 will not happen. |
46 |
+ |
47 |
+ Original code always preferred the platform switch state over |
48 |
+ the device switch state, so if the platform switch was UNBLOCKED |
49 |
+ but the device was BLOCKED, NM would treat the device as |
50 |
+ UNBLOCKED and try to activate it, and obviously fail. |
51 |
+--- |
52 |
+diff --git a/src/nm-udev-manager.c b/src/nm-udev-manager.c |
53 |
+index 72501c2..3e855b7 100644 |
54 |
+--- a/src/nm-udev-manager.c |
55 |
++++ b/src/nm-udev-manager.c |
56 |
+@@ -195,78 +195,50 @@ recheck_killswitches (NMUdevManager *self) |
57 |
+ NMUdevManagerPrivate *priv = NM_UDEV_MANAGER_GET_PRIVATE (self); |
58 |
+ GSList *iter; |
59 |
+ RfKillState poll_states[RFKILL_TYPE_MAX]; |
60 |
++ RfKillState platform_states[RFKILL_TYPE_MAX]; |
61 |
+ gboolean platform_checked[RFKILL_TYPE_MAX]; |
62 |
+ int i; |
63 |
+ |
64 |
+ /* Default state is unblocked */ |
65 |
+ for (i = 0; i < RFKILL_TYPE_MAX; i++) { |
66 |
+ poll_states[i] = RFKILL_UNBLOCKED; |
67 |
++ platform_states[i] = RFKILL_UNBLOCKED; |
68 |
+ platform_checked[i] = FALSE; |
69 |
+ } |
70 |
+ |
71 |
+- /* Perform two passes here; the first pass is for non-platform switches, |
72 |
+- * which typically if hardkilled cannot be changed except by a physical |
73 |
+- * hardware switch. The second pass checks platform killswitches, which |
74 |
+- * take precedence over device killswitches, because typically platform |
75 |
+- * killswitches control device killswitches. That is, a hardblocked device |
76 |
+- * switch can often be unblocked by a platform switch. Thus if we have |
77 |
+- * a hardblocked device switch and a softblocked platform switch, the |
78 |
+- * combined state should be softblocked since the platform switch can be |
79 |
+- * unblocked to change the device switch. |
80 |
+- */ |
81 |
+- |
82 |
+- /* Device switches first */ |
83 |
++ /* Poll the states of all killswitches */ |
84 |
+ for (iter = priv->killswitches; iter; iter = g_slist_next (iter)) { |
85 |
+ Killswitch *ks = iter->data; |
86 |
+ GUdevDevice *device; |
87 |
+ RfKillState dev_state; |
88 |
+ int sysfs_state; |
89 |
+ |
90 |
+- if (ks->platform == FALSE) { |
91 |
+- device = g_udev_client_query_by_subsystem_and_name (priv->client, "rfkill", ks->name); |
92 |
+- if (device) { |
93 |
+- sysfs_state = g_udev_device_get_property_as_int (device, "RFKILL_STATE"); |
94 |
+- dev_state = sysfs_state_to_nm_state (sysfs_state); |
95 |
++ device = g_udev_client_query_by_subsystem_and_name (priv->client, "rfkill", ks->name); |
96 |
++ if (device) { |
97 |
++ sysfs_state = g_udev_device_get_property_as_int (device, "RFKILL_STATE"); |
98 |
++ dev_state = sysfs_state_to_nm_state (sysfs_state); |
99 |
++ if (ks->platform == FALSE) { |
100 |
+ if (dev_state > poll_states[ks->rtype]) |
101 |
+ poll_states[ks->rtype] = dev_state; |
102 |
+- g_object_unref (device); |
103 |
+- } |
104 |
+- } |
105 |
+- } |
106 |
+- |
107 |
+- /* Platform switches next; their state overwrites device state */ |
108 |
+- for (iter = priv->killswitches; iter; iter = g_slist_next (iter)) { |
109 |
+- Killswitch *ks = iter->data; |
110 |
+- GUdevDevice *device; |
111 |
+- RfKillState dev_state; |
112 |
+- int sysfs_state; |
113 |
+- |
114 |
+- if (ks->platform == TRUE) { |
115 |
+- device = g_udev_client_query_by_subsystem_and_name (priv->client, "rfkill", ks->name); |
116 |
+- if (device) { |
117 |
+- sysfs_state = g_udev_device_get_property_as_int (device, "RFKILL_STATE"); |
118 |
+- dev_state = sysfs_state_to_nm_state (sysfs_state); |
119 |
+- |
120 |
+- if (platform_checked[ks->rtype] == FALSE) { |
121 |
+- /* Overwrite device state with platform state for first |
122 |
+- * platform switch found. |
123 |
+- */ |
124 |
+- poll_states[ks->rtype] = dev_state; |
125 |
+- platform_checked[ks->rtype] = TRUE; |
126 |
+- } else { |
127 |
+- /* If there are multiple platform switches of the same type, |
128 |
+- * take the "worst" state for all of that type. |
129 |
+- */ |
130 |
+- if (dev_state > poll_states[ks->rtype]) |
131 |
+- poll_states[ks->rtype] = dev_state; |
132 |
+- } |
133 |
+- g_object_unref (device); |
134 |
++ } else { |
135 |
++ platform_checked[ks->rtype] = TRUE; |
136 |
++ if (dev_state > platform_states[ks->rtype]) |
137 |
++ platform_states[ks->rtype] = dev_state; |
138 |
+ } |
139 |
++ g_object_unref (device); |
140 |
+ } |
141 |
+ } |
142 |
+ |
143 |
+ /* Log and emit change signal for final rfkill states */ |
144 |
+ for (i = 0; i < RFKILL_TYPE_MAX; i++) { |
145 |
++ if (platform_checked[i] == TRUE) { |
146 |
++ /* blocked platform switch state overrides device state, otherwise |
147 |
++ * let the device state stand. (bgo #655773) |
148 |
++ */ |
149 |
++ if (platform_states[i] != RFKILL_UNBLOCKED) |
150 |
++ poll_states[i] = platform_states[i]; |
151 |
++ } |
152 |
++ |
153 |
+ if (poll_states[i] != priv->rfkill_states[i]) { |
154 |
+ nm_log_dbg (LOGD_RFKILL, "%s rfkill state now '%s'", |
155 |
+ rfkill_type_to_desc (i), |
156 |
+-- |
157 |
+cgit v0.9.0.2-2-gbebe |
158 |
|
159 |
diff --git a/net-misc/networkmanager/files/networkmanager-0.9_rc3-fix-tests.patch b/net-misc/networkmanager/files/networkmanager-0.9_rc3-fix-tests.patch |
160 |
new file mode 100644 |
161 |
index 0000000..7bd8a2b |
162 |
--- /dev/null |
163 |
+++ b/net-misc/networkmanager/files/networkmanager-0.9_rc3-fix-tests.patch |
164 |
@@ -0,0 +1,18 @@ |
165 |
+--- configure.ac |
166 |
++++ configure.ac |
167 |
+@@ -577,7 +577,6 @@ |
168 |
+ src/settings/plugins/ifupdown/Makefile |
169 |
+ src/settings/plugins/ifupdown/tests/Makefile |
170 |
+ src/settings/plugins/ifnet/Makefile |
171 |
+-src/settings/plugins/ifnet/tests/Makefile |
172 |
+ src/settings/plugins/ifcfg-rh/Makefile |
173 |
+ src/settings/plugins/ifcfg-rh/tests/Makefile |
174 |
+ src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile |
175 |
+--- src/settings/plugins/ifnet/Makefile.am |
176 |
++++ src/settings/plugins/ifnet/Makefile.am |
177 |
+@@ -1,4 +1,4 @@ |
178 |
+-SUBDIRS = . tests |
179 |
++SUBDIRS = . |
180 |
+ INCLUDES = \ |
181 |
+ -I$(top_srcdir)/src/settings \ |
182 |
+ -I$(top_srcdir)/include \ |
183 |
|
184 |
diff --git a/net-misc/networkmanager/files/nm-system-settings.conf-ifnet b/net-misc/networkmanager/files/nm-system-settings.conf-ifnet |
185 |
new file mode 100644 |
186 |
index 0000000..4d14ee7 |
187 |
--- /dev/null |
188 |
+++ b/net-misc/networkmanager/files/nm-system-settings.conf-ifnet |
189 |
@@ -0,0 +1,6 @@ |
190 |
+[main] |
191 |
+plugins=ifnet,keyfile |
192 |
+ |
193 |
+[ifnet] |
194 |
+managed=true |
195 |
+auto_refresh=false |
196 |
|
197 |
diff --git a/net-misc/networkmanager/networkmanager-0.9.1.90.ebuild b/net-misc/networkmanager/networkmanager-0.9.1.90.ebuild |
198 |
new file mode 100644 |
199 |
index 0000000..73ea51e |
200 |
--- /dev/null |
201 |
+++ b/net-misc/networkmanager/networkmanager-0.9.1.90.ebuild |
202 |
@@ -0,0 +1,138 @@ |
203 |
+# Copyright 1999-2011 Gentoo Foundation |
204 |
+# Distributed under the terms of the GNU General Public License v2 |
205 |
+# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/networkmanager-0.9.0.ebuild,v 1.1 2011/08/23 23:17:09 nirbheek Exp $ |
206 |
+ |
207 |
+EAPI="4" |
208 |
+GNOME_ORG_MODULE="NetworkManager" |
209 |
+ |
210 |
+inherit autotools eutils gnome.org linux-info systemd |
211 |
+ |
212 |
+DESCRIPTION="Network configuration and management in an easy way. Desktop environment independent." |
213 |
+HOMEPAGE="http://www.gnome.org/projects/NetworkManager/" |
214 |
+ |
215 |
+LICENSE="GPL-2" |
216 |
+SLOT="0" |
217 |
+IUSE="avahi bluetooth doc +nss gnutls dhclient +dhcpcd +introspection |
218 |
+ kernel_linux +ppp resolvconf connection-sharing wimax" |
219 |
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86" |
220 |
+ |
221 |
+REQUIRED_USE=" |
222 |
+ ^^ ( nss gnutls ) |
223 |
+ ^^ ( dhclient dhcpcd )" |
224 |
+ |
225 |
+# gobject-introspection-0.10.3 is needed due to gnome bug 642300 |
226 |
+# wpa_supplicant-0.7.3-r3 is needed due to bug 359271 |
227 |
+# TODO: Qt support? |
228 |
+COMMON_DEPEND=">=sys-apps/dbus-1.2 |
229 |
+ >=dev-libs/dbus-glib-0.75 |
230 |
+ >=net-wireless/wireless-tools-28_pre9 |
231 |
+ || ( >=sys-fs/udev-171[gudev] >=sys-fs/udev-147[extras] ) |
232 |
+ >=dev-libs/glib-2.26 |
233 |
+ >=sys-auth/polkit-0.97 |
234 |
+ >=dev-libs/libnl-1.1 |
235 |
+ >=net-wireless/wpa_supplicant-0.7.3-r3[dbus] |
236 |
+ bluetooth? ( >=net-wireless/bluez-4.82 ) |
237 |
+ avahi? ( net-dns/avahi[autoipd] ) |
238 |
+ gnutls? ( |
239 |
+ dev-libs/libgcrypt |
240 |
+ net-libs/gnutls ) |
241 |
+ nss? ( >=dev-libs/nss-3.11 ) |
242 |
+ dhclient? ( net-misc/dhcp ) |
243 |
+ dhcpcd? ( >=net-misc/dhcpcd-4.0.0_rc3 ) |
244 |
+ introspection? ( >=dev-libs/gobject-introspection-0.10.3 ) |
245 |
+ ppp? ( |
246 |
+ >=net-misc/modemmanager-0.4 |
247 |
+ >=net-dialup/ppp-2.4.5 ) |
248 |
+ resolvconf? ( net-dns/openresolv ) |
249 |
+ connection-sharing? ( |
250 |
+ net-dns/dnsmasq |
251 |
+ net-firewall/iptables ) |
252 |
+ wimax? ( >=net-wireless/wimax-1.5.1 )" |
253 |
+ |
254 |
+RDEPEND="${COMMON_DEPEND} |
255 |
+ sys-auth/consolekit" |
256 |
+ |
257 |
+DEPEND="${COMMON_DEPEND} |
258 |
+ dev-util/pkgconfig |
259 |
+ >=dev-util/intltool-0.40 |
260 |
+ >=sys-devel/gettext-0.17 |
261 |
+ doc? ( >=dev-util/gtk-doc-1.8 )" |
262 |
+ |
263 |
+sysfs_deprecated_check() { |
264 |
+ ebegin "Checking for SYSFS_DEPRECATED support" |
265 |
+ |
266 |
+ if { linux_chkconfig_present SYSFS_DEPRECATED_V2; }; then |
267 |
+ eerror "Please disable SYSFS_DEPRECATED_V2 support in your kernel config and recompile your kernel" |
268 |
+ eerror "or NetworkManager will not work correctly." |
269 |
+ eerror "See http://bugs.gentoo.org/333639 for more info." |
270 |
+ die "CONFIG_SYSFS_DEPRECATED_V2 support detected!" |
271 |
+ fi |
272 |
+ eend $? |
273 |
+} |
274 |
+ |
275 |
+pkg_pretend() { |
276 |
+ if use kernel_linux; then |
277 |
+ get_version |
278 |
+ if linux_config_exists; then |
279 |
+ sysfs_deprecated_check |
280 |
+ else |
281 |
+ ewarn "Was unable to determine your kernel .config" |
282 |
+ ewarn "Please note that if CONFIG_SYSFS_DEPRECATED_V2 is set in your kernel .config, NetworkManager will not work correctly." |
283 |
+ ewarn "See http://bugs.gentoo.org/333639 for more info." |
284 |
+ fi |
285 |
+ |
286 |
+ fi |
287 |
+} |
288 |
+ |
289 |
+src_prepare() { |
290 |
+ # Don't build tests |
291 |
+ epatch "${FILESDIR}/${PN}-0.9_rc3-fix-tests.patch" |
292 |
+ # Fix rfkill handling, will be in next release |
293 |
+ epatch "${FILESDIR}/${P}-rfkill.patch" |
294 |
+ eautoreconf |
295 |
+ default |
296 |
+} |
297 |
+ |
298 |
+src_configure() { |
299 |
+ ECONF="--disable-more-warnings |
300 |
+ --disable-static |
301 |
+ --localstatedir=/var |
302 |
+ --with-distro=gentoo |
303 |
+ --with-dbus-sys-dir=/etc/dbus-1/system.d |
304 |
+ --with-udev-dir=/lib/udev |
305 |
+ --with-iptables=/sbin/iptables |
306 |
+ $(use_enable doc gtk-doc) |
307 |
+ $(use_enable introspection) |
308 |
+ $(use_enable ppp) |
309 |
+ $(use_enable wimax) |
310 |
+ $(use_with dhclient) |
311 |
+ $(use_with dhcpcd) |
312 |
+ $(use_with doc docs) |
313 |
+ $(use_with resolvconf) |
314 |
+ $(systemd_with_unitdir)" |
315 |
+ |
316 |
+ if use nss ; then |
317 |
+ ECONF="${ECONF} $(use_with nss crypto=nss)" |
318 |
+ else |
319 |
+ ECONF="${ECONF} $(use_with gnutls crypto=gnutls)" |
320 |
+ fi |
321 |
+ |
322 |
+ econf ${ECONF} |
323 |
+} |
324 |
+ |
325 |
+src_install() { |
326 |
+ default |
327 |
+ # Need to keep the /var/run/NetworkManager directory |
328 |
+ keepdir /var/run/NetworkManager |
329 |
+ |
330 |
+ # Need to keep the /etc/NetworkManager/dispatched.d for dispatcher scripts |
331 |
+ keepdir /etc/NetworkManager/dispatcher.d |
332 |
+ |
333 |
+ # Add keyfile plugin support |
334 |
+ keepdir /etc/NetworkManager/system-connections |
335 |
+ insinto /etc/NetworkManager |
336 |
+ newins "${FILESDIR}/nm-system-settings.conf-ifnet" nm-system-settings.conf |
337 |
+ |
338 |
+ # Remove useless .la files |
339 |
+ find "${D}" -name '*.la' -exec rm -f {} + || die "la file removal failed" |
340 |
+} |