From bdf16b183ad8da216ff332157d6538b66e934833 Mon Sep 17 00:00:00 2001 From: Mu Qiao Date: Sun, 16 Jan 2011 13:20:55 +0800 Subject: Do not remove old connection when ssid is not changed (Portage version: 2.1.9.31/git/Linux x86_64, signed Manifest commit with key 17B157E9) --- net-misc/networkmanager/Manifest | 18 +-- .../networkmanager-0.8.2-shared-connection.patch | 179 +++++++++++++++++++-- .../networkmanager-0.8.2-r103.ebuild | 152 ----------------- .../networkmanager-0.8.2-r104.ebuild | 152 +++++++++++++++++ 4 files changed, 324 insertions(+), 177 deletions(-) delete mode 100644 net-misc/networkmanager/networkmanager-0.8.2-r103.ebuild create mode 100644 net-misc/networkmanager/networkmanager-0.8.2-r104.ebuild diff --git a/net-misc/networkmanager/Manifest b/net-misc/networkmanager/Manifest index 5ea61a7..7a23246 100644 --- a/net-misc/networkmanager/Manifest +++ b/net-misc/networkmanager/Manifest @@ -5,22 +5,22 @@ AUX NetworkManagerDispatcher 1198 RMD160 4345870ab40607b9aed80c8da383b604f032b98 AUX networkmanager-0.8.2-1.patch 6642 RMD160 466f7c2bd34043d13d1b265f4a52b172c594430e SHA1 7af80cb4ea3cf1d60566c8dacd3eadc3ef4cc186 SHA256 f29cfa186c9b77452266e9c303711c2368986fb7e5455e388a5dfe064e80b3e3 AUX networkmanager-0.8.2-accept-gw.patch 3679 RMD160 b163afa5215f0eb52ba2562d22c65ec5e0bd3380 SHA1 a71f25413abf0c359439add74a73545790604ac9 SHA256 631ccad5bc4c2d880b5235bc8e6ace494467bad1734023ded9d8bcd52b9177af AUX networkmanager-0.8.2-confchanges.patch 1279 RMD160 1ff5b6d663aa4417beaf9c7630d710a17a1812b5 SHA1 634ad19b189509e75362e5cd7f069ca795b4aeba SHA256 7c9ed8dc35b5b6d0414f96902fbe8117408ad556af655c0afc593ec5a1beac28 -AUX networkmanager-0.8.2-shared-connection.patch 10242 RMD160 26df22af1ee21f321890e36b88384b60ab795d5f SHA1 fc3c3abcf4599b536c7f173a72819b7c5f48f607 SHA256 a980aaa2e03f409e0607f32f9943282cc067ddeb3eca7c3b5b68e5f85698ff2f +AUX networkmanager-0.8.2-shared-connection.patch 14877 RMD160 5897156374833d29253fdba9f2f8aaf6a7a32d87 SHA1 842dc7a682578f7659d864b400b23d25d373933d SHA256 7dc3157415800291eaac8a26bb9072e2dfa7021276c678b389cd34d07996532b AUX nm-system-settings.conf 23 RMD160 6d66c702b345bde668a420a15716feea6005fbd1 SHA1 49ba558d20f5ca5a201e027e13b878dd5ac3569c SHA256 44b048804c7c0b8b3b0c29b8632b6ad613c397d0a1635ec918e10c0fbcdadf21 AUX nm-system-settings.conf-ifnet 70 RMD160 c0d2be147383999b62cead86ab4333169e4ef277 SHA1 679ec8052b610969c148a2d34cd4da7a41484a76 SHA256 34f53d9ac1ad65eda6942dc3059117f60f6321059ca23f4fbfcc2f2edcae151f DIST NetworkManager-0.8.2.tar.bz2 1629296 RMD160 d5ef4adfc74db4a77fadcbeb545175b2f49dfd9c SHA1 2c9a9f0317d2ad4fd8a05631211cfd6040070f8e SHA256 58e49dcd83cb641a9dcaad4fd566a08196c862479ad3086c00f28f03768eb4f1 -EBUILD networkmanager-0.8.2-r103.ebuild 4202 RMD160 16fddd8bd4a77905a47850fecb12dd4a2d266931 SHA1 00daba60673f8886fa23efef7ad95193a8a5423d SHA256 78c93c5de6c2b1c1d46b1113f52c87df334a440e34d494d1af9efa6ab96764e2 +EBUILD networkmanager-0.8.2-r104.ebuild 4202 RMD160 16fddd8bd4a77905a47850fecb12dd4a2d266931 SHA1 00daba60673f8886fa23efef7ad95193a8a5423d SHA256 78c93c5de6c2b1c1d46b1113f52c87df334a440e34d494d1af9efa6ab96764e2 EBUILD networkmanager-9999.ebuild 4197 RMD160 4a64e0b4141d174eda2716f2a08f6ce5f0a52ed8 SHA1 fd2a1e026e7625312431048ccca94216c3936b76 SHA256 006eea72c4dfc9e605d353c47ad85b8a6a70cbd0eb784aa363b49397b53e393a MISC ChangeLog 18915 RMD160 6b010bfb98563502a1503c06f962ab2c030043f3 SHA1 88a338f79f4c7980b0322642aa055bb2ffb2adb9 SHA256 c4f984efef8828c8d04cc34ec4b42b187f012515bcb4675ae10fa1005f97f00d MISC metadata.xml 975 RMD160 7f7f8f54c53fe2098dae8ed0a4cd177900289d3f SHA1 11de32f78915bbc01c6b0665b45233d004d75c25 SHA256 e0ce95394f82f5631ecec62c6595dc4dad9afc52cf5e1bb0f30618edfb79becc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) -iQEcBAEBAgAGBQJNMCaTAAoJEDCzDeQXsVfp5aQIAK1Jq71uax+PQxFk/ja31lbs -Jo+1WYq0NledDew9i18PVjp8orGPLEAKLRQbMZ8h+amQR2u/6AmSPjBrkrEnyAi6 -e4csy0/relzlj83XMsqkOvIQC46TY4UZW/VjMEJIDZGJIYsDn9MgY3QagEG8H9uK -6+OkCJIFqFNingqiCUquoDBo2avh6iau4k+fI4U8y7IDfQumsPPpuvYP2DPRdcr/ -e2YY5dMRJi4NX5qEjMAFMNzfpFL2cWwEQjhtTJ9jXaklF3Xx2fdyYqVOrbkExAeX -rE2uZUvmblDuwVKYzbu+IpXJqjmz6+qvRaU2viFoN19vUaCXPgFc3NW1OJazYRI= -=rlEy +iQEcBAEBAgAGBQJNMoA3AAoJEDCzDeQXsVfpPeAH/iB6ZKYySfJAmWIwSijiuAPD +WVgB+Q0l3VB1GkpnhnUPF6HZYySNIW3Plj0QXs7JI6QPKaR+0Hq2Hpy81wDPfiW8 +LA2TN4U38iZyB729miTjBuk1xMQXRHcUbGvNF1VU0EyIZbeK4QiTLPFbu0/j7ETK +4lANcU8Jw590DdZq4udUCoePm6ThjOWpo1k0NyJw5XO0d9/3V13oZetdyckMQ/hp +j1MCDwNf9rSY6+TIHQYxxENmPVTbn4gbicNkapEE0Zh2uujlZwRTmXoi8wVpmwc0 +ah7Yr5xFLjdgqo+8VR1L/fAIxGGfmcQemdXem4waXgaUI//byxeu7mIOb44fGOY= +=fKIJ -----END PGP SIGNATURE----- diff --git a/net-misc/networkmanager/files/networkmanager-0.8.2-shared-connection.patch b/net-misc/networkmanager/files/networkmanager-0.8.2-shared-connection.patch index 14cce76..49e94a0 100644 --- a/net-misc/networkmanager/files/networkmanager-0.8.2-shared-connection.patch +++ b/net-misc/networkmanager/files/networkmanager-0.8.2-shared-connection.patch @@ -1,21 +1,24 @@ -From ea13027128e5d2781fe88805ee580cc9a49a8a4f Mon Sep 17 00:00:00 2001 +From 744f1789da873c98867855f2936c77310548b980 Mon Sep 17 00:00:00 2001 From: Mu Qiao Date: Wed, 5 Jan 2011 13:30:08 +0800 Subject: [PATCH] Support shared and link-local method for ipv4 Signed-off-by: Mu Qiao fix flush_to_file, return TRUE when nothing changed ssid do not lose quotes anymore + do not delete old connection when ssid is not changed +Signed-off-by: Mu Qiao --- - system-settings/plugins/ifnet/connection_parser.c | 77 +++++++++++++++----- - system-settings/plugins/ifnet/net_parser.c | 14 +++- + system-settings/plugins/ifnet/connection_parser.c | 92 ++++++++++++++------ + system-settings/plugins/ifnet/net_parser.c | 53 +++++++----- + system-settings/plugins/ifnet/net_parser.h | 4 +- system-settings/plugins/ifnet/net_utils.c | 4 + - .../plugins/ifnet/nm-ifnet-connection.c | 8 ++- - system-settings/plugins/ifnet/wpa_parser.c | 19 +++-- - 5 files changed, 87 insertions(+), 35 deletions(-) + .../plugins/ifnet/nm-ifnet-connection.c | 8 +- + system-settings/plugins/ifnet/wpa_parser.c | 21 +++-- + 6 files changed, 121 insertions(+), 61 deletions(-) diff --git a/system-settings/plugins/ifnet/connection_parser.c b/system-settings/plugins/ifnet/connection_parser.c -index f9fae51..a755ec8 100644 +index f9fae51..539f33c 100644 --- a/system-settings/plugins/ifnet/connection_parser.c +++ b/system-settings/plugins/ifnet/connection_parser.c @@ -557,7 +557,7 @@ make_ip4_setting (NMConnection * connection, gchar * conn_name, GError ** error) @@ -134,7 +137,7 @@ index f9fae51..a755ec8 100644 if (auth_alg) { if (!strcmp (auth_alg, "shared")) -@@ -2180,12 +2211,14 @@ write_wireless_security_setting (NMConnection * connection, +@@ -2180,8 +2211,11 @@ write_wireless_security_setting (NMConnection * connection, g_string_append (quoted, psk); g_string_append_c (quoted, '"'); } @@ -147,13 +150,32 @@ index f9fae51..a755ec8 100644 + PLUGIN_WARN (IFNET_PLUGIN_NAME, "Use WPA, but no psk received from NM"); if (quoted) g_string_free (quoted, TRUE); -- } else -- wpa_set_data (conn_name, "psk", NULL); + } else +@@ -2190,15 +2224,19 @@ write_wireless_security_setting (NMConnection * connection, + return TRUE; + } + +-/* remove old ssid and add new one*/ ++/* Only remove old config when ssid is changed. ++ * See bug #350476. ++ * */ + static void + update_wireless_ssid (NMConnection * connection, gchar * conn_name, + gchar * ssid, gboolean hex) + { +- ifnet_delete_network (conn_name); +- ifnet_add_connection (ssid, "wireless"); ++ if (strcmp (conn_name, ssid)){ ++ ifnet_delete_network (conn_name); ++ wpa_delete_security (conn_name); + } - return TRUE; +- wpa_delete_security (conn_name); ++ ifnet_add_network (ssid, "wireless"); + wpa_add_security (ssid); } -@@ -2443,8 +2476,12 @@ write_ip4_setting (NMConnection * connection, gchar * conn_name, + +@@ -2443,8 +2481,12 @@ write_ip4_setting (NMConnection * connection, gchar * conn_name, } ifnet_set_data (conn_name, "config", ips->str); g_string_free (ips, TRUE); @@ -168,11 +190,86 @@ index f9fae51..a755ec8 100644 /* DNS Servers */ ifnet_set_data (conn_name, "dns_servers", NULL); +@@ -2858,7 +2900,7 @@ get_wired_name () + for (; i < 256; i++) { + gchar *conn_name = g_strdup_printf ("eth%d", i); + +- if (!ifnet_has_connection (conn_name)) { ++ if (!ifnet_has_network (conn_name)) { + return conn_name; + } else + g_free (conn_name); +@@ -2875,7 +2917,7 @@ get_ppp_name () + for (; i < 256; i++) { + gchar *conn_name = g_strdup_printf ("ppp%d", i); + +- if (!ifnet_has_connection (conn_name)) { ++ if (!ifnet_has_network (conn_name)) { + return conn_name; + } else + g_free (conn_name); +@@ -2982,7 +3024,7 @@ ifnet_add_new_connection (NMConnection * connection, + goto out; + } + +- if (ifnet_add_connection (new_name, new_type)) ++ if (ifnet_add_network (new_name, new_type)) + success = + ifnet_update_parsers_by_connection (connection, new_name, + NULL, config_file, diff --git a/system-settings/plugins/ifnet/net_parser.c b/system-settings/plugins/ifnet/net_parser.c -index b4a381d..9f58e91 100644 +index b4a381d..8dc4f7f 100644 --- a/system-settings/plugins/ifnet/net_parser.c +++ b/system-settings/plugins/ifnet/net_parser.c -@@ -377,21 +377,27 @@ ifnet_set_data (gchar * conn_name, gchar * key, gchar * value) +@@ -37,6 +37,9 @@ static GList *functions_list; + /* Used to decide whether to write changes to file*/ + static gboolean net_parser_data_changed = FALSE; + ++static void ++destroy_connection_config (GHashTable * conn); ++ + static GHashTable * + add_new_connection_config (const gchar * type, const gchar * name) + { +@@ -58,7 +61,7 @@ add_new_connection_config (const gchar * type, const gchar * name) + } + + gboolean +-ifnet_add_connection (gchar * name, gchar * type) ++ifnet_add_network (gchar * name, gchar * type) + { + if (add_new_connection_config (type, name)) { + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Adding network for %s", name); +@@ -69,11 +72,27 @@ ifnet_add_connection (gchar * name, gchar * type) + } + + gboolean +-ifnet_has_connection (gchar * conn_name) ++ifnet_has_network (gchar * conn_name) + { + return g_hash_table_lookup (conn_table, conn_name) != NULL; + } + ++gboolean ++ifnet_delete_network (gchar * conn_name) ++{ ++ GHashTable *network = NULL; ++ ++ g_return_val_if_fail (conn_table != NULL && conn_name != NULL, FALSE); ++ PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Deleting network for %s", conn_name); ++ network = g_hash_table_lookup (conn_table, conn_name); ++ if (!network) ++ return FALSE; ++ g_hash_table_remove (conn_table, conn_name); ++ destroy_connection_config (network); ++ net_parser_data_changed = TRUE; ++ return TRUE; ++} ++ + static GHashTable * + get_connection_config (gchar * name) + { +@@ -377,21 +396,27 @@ ifnet_set_data (gchar * conn_name, gchar * key, gchar * value) { gpointer orin_key = NULL, orin_value = NULL; GHashTable *conn = g_hash_table_lookup (conn_table, conn_name); @@ -203,7 +300,7 @@ index b4a381d..9f58e91 100644 net_parser_data_changed = TRUE; } -@@ -467,7 +473,7 @@ ifnet_flush_to_file (gchar * config_file) +@@ -467,7 +492,7 @@ ifnet_flush_to_file (gchar * config_file) gboolean result = FALSE; if (!net_parser_data_changed) @@ -212,6 +309,47 @@ index b4a381d..9f58e91 100644 if (!conn_table || !global_settings_table) return FALSE; +@@ -583,22 +608,6 @@ ifnet_flush_to_file (gchar * config_file) + return result; + } + +-gboolean +-ifnet_delete_network (gchar * conn_name) +-{ +- GHashTable *network = NULL; +- +- g_return_val_if_fail (conn_table != NULL && conn_name != NULL, FALSE); +- PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Deleting network for %s", conn_name); +- network = g_hash_table_lookup (conn_table, conn_name); +- if (!network) +- return FALSE; +- g_hash_table_remove (conn_table, conn_name); +- destroy_connection_config (network); +- net_parser_data_changed = TRUE; +- return TRUE; +-} +- + void + ifnet_destroy (void) + { +diff --git a/system-settings/plugins/ifnet/net_parser.h b/system-settings/plugins/ifnet/net_parser.h +index 73a44c8..b71a01f 100644 +--- a/system-settings/plugins/ifnet/net_parser.h ++++ b/system-settings/plugins/ifnet/net_parser.h +@@ -36,11 +36,11 @@ GList *ifnet_get_connection_names (void); + gchar *ifnet_get_data (gchar * conn_name, const gchar * key); + gchar *ifnet_get_global_data (const gchar * key); + gchar *ifnet_get_global_setting (gchar * group, gchar * key); +-gboolean ifnet_has_connection (gchar * conn_name); ++gboolean ifnet_has_network (gchar * conn_name); + + /* Writer functions */ + gboolean ifnet_flush_to_file (gchar * config_file); + void ifnet_set_data (gchar * conn_name, gchar * key, gchar * value); +-gboolean ifnet_add_connection (gchar * name, gchar * type); ++gboolean ifnet_add_network (gchar * name, gchar * type); + gboolean ifnet_delete_network (gchar * conn_name); + #endif diff --git a/system-settings/plugins/ifnet/net_utils.c b/system-settings/plugins/ifnet/net_utils.c index 2dc253c..7e52f10 100644 --- a/system-settings/plugins/ifnet/net_utils.c @@ -250,7 +388,7 @@ index e47495c..ebe2581 100644 NM_IFNET_CONNECTION_CONN_NAME, conn_name, NULL); diff --git a/system-settings/plugins/ifnet/wpa_parser.c b/system-settings/plugins/ifnet/wpa_parser.c -index 5e94108..726e4b2 100644 +index 5e94108..42c52c3 100644 --- a/system-settings/plugins/ifnet/wpa_parser.c +++ b/system-settings/plugins/ifnet/wpa_parser.c @@ -366,7 +366,7 @@ wpa_flush_to_file (gchar * config_file) @@ -299,6 +437,15 @@ index 5e94108..726e4b2 100644 wpa_parser_data_changed = TRUE; } +@@ -483,7 +486,7 @@ gboolean + wpa_add_security (gchar * ssid) + { + if (wpa_has_security (ssid)) +- return FALSE; ++ return TRUE; + else { + GHashTable *security = + g_hash_table_new (g_str_hash, g_str_equal); -- 1.7.3.4 diff --git a/net-misc/networkmanager/networkmanager-0.8.2-r103.ebuild b/net-misc/networkmanager/networkmanager-0.8.2-r103.ebuild deleted file mode 100644 index 8094376..0000000 --- a/net-misc/networkmanager/networkmanager-0.8.2-r103.ebuild +++ /dev/null @@ -1,152 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -EAPI="2" - -inherit gnome.org linux-info - -# NetworkManager likes itself with capital letters -MY_PN=${PN/networkmanager/NetworkManager} -MY_P=${MY_PN}-${PV} - -DESCRIPTION="Network configuration and management in an easy way. Desktop environment independent." -HOMEPAGE="http://www.gnome.org/projects/NetworkManager/" -SRC_URI="${SRC_URI//${PN}/${MY_PN}}" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86" -IUSE="avahi bluetooth doc nss gnutls dhclient dhcpcd kernel_linux resolvconf connection-sharing" - -RDEPEND=">=sys-apps/dbus-1.2 - >=dev-libs/dbus-glib-0.75 - >=net-wireless/wireless-tools-28_pre9 - >=sys-fs/udev-145[extras] - >=dev-libs/glib-2.18 - >=sys-auth/polkit-0.92 - >=dev-libs/libnl-1.1 - >=net-misc/modemmanager-0.4 - >=net-wireless/wpa_supplicant-0.5.10[dbus] - bluetooth? ( net-wireless/bluez ) - || ( sys-libs/e2fsprogs-libs =dev-libs/nss-3.11 ) - !nss? ( dev-libs/libgcrypt - net-libs/gnutls ) ) - !gnutls? ( >=dev-libs/nss-3.11 ) - dhclient? ( - dhcpcd? ( >=net-misc/dhcpcd-4.0.0_rc3 ) - !dhcpcd? ( net-misc/dhcp ) ) - !dhclient? ( >=net-misc/dhcpcd-4.0.0_rc3 ) - resolvconf? ( net-dns/openresolv ) - connection-sharing? ( - net-dns/dnsmasq - net-firewall/iptables )" - -DEPEND="${RDEPEND} - dev-util/pkgconfig - dev-util/intltool - >=net-dialup/ppp-2.4.5 - doc? ( >=dev-util/gtk-doc-1.8 )" - -S=${WORKDIR}/${MY_P} - -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_setup() { - - 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 -} - -src_prepare() { - # dbus policy patch - epatch "${FILESDIR}/${P}-confchanges.patch" - # accept "gw" in /etc/conf.d/net (bug #339215) - epatch "${FILESDIR}/${P}-accept-gw.patch" - # wrt bug #350476 - epatch "${FILESDIR}/${P}-shared-connection.patch" - # Backports #1 - epatch "${FILESDIR}/${P}-1.patch" -} - -src_configure() { - ECONF="--disable-more-warnings - --localstatedir=/var - --with-distro=gentoo - --with-dbus-sys-dir=/etc/dbus-1/system.d - --with-udev-dir=/etc/udev - --with-iptables=/sbin/iptables - $(use_enable doc gtk-doc) - $(use_with doc docs) - $(use_with resolvconf)" - - # default is dhcpcd (if none or both are specified), ISC dchclient otherwise - if use dhclient ; then - if use dhcpcd ; then - ECONF="${ECONF} --with-dhcpcd --without-dhclient" - else - ECONF="${ECONF} --with-dhclient --without-dhcpcd" - fi - else - ECONF="${ECONF} --with-dhcpcd --without-dhclient" - fi - - # default is NSS (if none or both are specified), GnuTLS otherwise - if use gnutls ; then - if use nss ; then - ECONF="${ECONF} --with-crypto=nss" - else - ECONF="${ECONF} --with-crypto=gnutls" - fi - else - ECONF="${ECONF} --with-crypto=nss" - fi - - econf ${ECONF} -} - -src_install() { - emake DESTDIR="${D}" install || die "emake install failed" - - # Need to keep the /var/run/NetworkManager directory - keepdir /var/run/NetworkManager - - # Need to keep the /etc/NetworkManager/dispatched.d for dispatcher scripts - keepdir /etc/NetworkManager/dispatcher.d - - dodoc AUTHORS ChangeLog NEWS README TODO || die "dodoc failed" - - # Add keyfile plugin support - keepdir /etc/NetworkManager/system-connections - insinto /etc/NetworkManager - newins "${FILESDIR}/nm-system-settings.conf-ifnet" nm-system-settings.conf \ - || die "newins failed" -} - -pkg_postinst() { - elog "You will need to reload DBus if this is your first time installing" - elog "NetworkManager, or if you're upgrading from 0.7 or older." - elog "" -} diff --git a/net-misc/networkmanager/networkmanager-0.8.2-r104.ebuild b/net-misc/networkmanager/networkmanager-0.8.2-r104.ebuild new file mode 100644 index 0000000..8094376 --- /dev/null +++ b/net-misc/networkmanager/networkmanager-0.8.2-r104.ebuild @@ -0,0 +1,152 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="2" + +inherit gnome.org linux-info + +# NetworkManager likes itself with capital letters +MY_PN=${PN/networkmanager/NetworkManager} +MY_P=${MY_PN}-${PV} + +DESCRIPTION="Network configuration and management in an easy way. Desktop environment independent." +HOMEPAGE="http://www.gnome.org/projects/NetworkManager/" +SRC_URI="${SRC_URI//${PN}/${MY_PN}}" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86" +IUSE="avahi bluetooth doc nss gnutls dhclient dhcpcd kernel_linux resolvconf connection-sharing" + +RDEPEND=">=sys-apps/dbus-1.2 + >=dev-libs/dbus-glib-0.75 + >=net-wireless/wireless-tools-28_pre9 + >=sys-fs/udev-145[extras] + >=dev-libs/glib-2.18 + >=sys-auth/polkit-0.92 + >=dev-libs/libnl-1.1 + >=net-misc/modemmanager-0.4 + >=net-wireless/wpa_supplicant-0.5.10[dbus] + bluetooth? ( net-wireless/bluez ) + || ( sys-libs/e2fsprogs-libs =dev-libs/nss-3.11 ) + !nss? ( dev-libs/libgcrypt + net-libs/gnutls ) ) + !gnutls? ( >=dev-libs/nss-3.11 ) + dhclient? ( + dhcpcd? ( >=net-misc/dhcpcd-4.0.0_rc3 ) + !dhcpcd? ( net-misc/dhcp ) ) + !dhclient? ( >=net-misc/dhcpcd-4.0.0_rc3 ) + resolvconf? ( net-dns/openresolv ) + connection-sharing? ( + net-dns/dnsmasq + net-firewall/iptables )" + +DEPEND="${RDEPEND} + dev-util/pkgconfig + dev-util/intltool + >=net-dialup/ppp-2.4.5 + doc? ( >=dev-util/gtk-doc-1.8 )" + +S=${WORKDIR}/${MY_P} + +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_setup() { + + 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 +} + +src_prepare() { + # dbus policy patch + epatch "${FILESDIR}/${P}-confchanges.patch" + # accept "gw" in /etc/conf.d/net (bug #339215) + epatch "${FILESDIR}/${P}-accept-gw.patch" + # wrt bug #350476 + epatch "${FILESDIR}/${P}-shared-connection.patch" + # Backports #1 + epatch "${FILESDIR}/${P}-1.patch" +} + +src_configure() { + ECONF="--disable-more-warnings + --localstatedir=/var + --with-distro=gentoo + --with-dbus-sys-dir=/etc/dbus-1/system.d + --with-udev-dir=/etc/udev + --with-iptables=/sbin/iptables + $(use_enable doc gtk-doc) + $(use_with doc docs) + $(use_with resolvconf)" + + # default is dhcpcd (if none or both are specified), ISC dchclient otherwise + if use dhclient ; then + if use dhcpcd ; then + ECONF="${ECONF} --with-dhcpcd --without-dhclient" + else + ECONF="${ECONF} --with-dhclient --without-dhcpcd" + fi + else + ECONF="${ECONF} --with-dhcpcd --without-dhclient" + fi + + # default is NSS (if none or both are specified), GnuTLS otherwise + if use gnutls ; then + if use nss ; then + ECONF="${ECONF} --with-crypto=nss" + else + ECONF="${ECONF} --with-crypto=gnutls" + fi + else + ECONF="${ECONF} --with-crypto=nss" + fi + + econf ${ECONF} +} + +src_install() { + emake DESTDIR="${D}" install || die "emake install failed" + + # Need to keep the /var/run/NetworkManager directory + keepdir /var/run/NetworkManager + + # Need to keep the /etc/NetworkManager/dispatched.d for dispatcher scripts + keepdir /etc/NetworkManager/dispatcher.d + + dodoc AUTHORS ChangeLog NEWS README TODO || die "dodoc failed" + + # Add keyfile plugin support + keepdir /etc/NetworkManager/system-connections + insinto /etc/NetworkManager + newins "${FILESDIR}/nm-system-settings.conf-ifnet" nm-system-settings.conf \ + || die "newins failed" +} + +pkg_postinst() { + elog "You will need to reload DBus if this is your first time installing" + elog "NetworkManager, or if you're upgrading from 0.7 or older." + elog "" +} -- cgit v1.2.3-65-gdbad