summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@gentoo.org>2010-01-25 06:31:01 +0000
committerNirbheek Chauhan <nirbheek@gentoo.org>2010-01-25 06:31:01 +0000
commitbebbe9f3441af5a119732509674f94cc8a86dae5 (patch)
treeefa5d2e684d1cc6ce0bed89c17fe284abdf32236 /net-misc/networkmanager
parentMask the final rc of networkmanager-0.8 for testing, will be unmasked in a fe... (diff)
downloadgentoo-2-bebbe9f3441af5a119732509674f94cc8a86dae5.tar.gz
gentoo-2-bebbe9f3441af5a119732509674f94cc8a86dae5.tar.bz2
gentoo-2-bebbe9f3441af5a119732509674f94cc8a86dae5.zip
Bump to 0.7.999 -- final RC of networkmanager-0.8; add fix for bug 176873
(Portage version: 2.1.7.16/cvs/Linux i686)
Diffstat (limited to 'net-misc/networkmanager')
-rw-r--r--net-misc/networkmanager/ChangeLog9
-rw-r--r--net-misc/networkmanager/files/networkmanager-0.8-read-hostname.patch76
-rw-r--r--net-misc/networkmanager/networkmanager-0.7.999.ebuild126
3 files changed, 210 insertions, 1 deletions
diff --git a/net-misc/networkmanager/ChangeLog b/net-misc/networkmanager/ChangeLog
index de507da08c58..b4542aa62666 100644
--- a/net-misc/networkmanager/ChangeLog
+++ b/net-misc/networkmanager/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for net-misc/networkmanager
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/ChangeLog,v 1.64 2010/01/22 19:19:21 ranger Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/ChangeLog,v 1.65 2010/01/25 06:31:01 nirbheek Exp $
+
+*networkmanager-0.7.999 (25 Jan 2010)
+
+ 25 Jan 2010; Nirbheek Chauhan <nirbheek@gentoo.org>
+ +networkmanager-0.7.999.ebuild,
+ +files/networkmanager-0.8-read-hostname.patch:
+ Bump to 0.7.999 -- final RC of networkmanager-0.8; add fix for bug 176873
22 Jan 2010; Brent Baude <ranger@gentoo.org> networkmanager-0.7.2.ebuild:
Marking networkmanager-0.7.2 ppc64 for bug 274688
diff --git a/net-misc/networkmanager/files/networkmanager-0.8-read-hostname.patch b/net-misc/networkmanager/files/networkmanager-0.8-read-hostname.patch
new file mode 100644
index 000000000000..ac59fe26ca26
--- /dev/null
+++ b/net-misc/networkmanager/files/networkmanager-0.8-read-hostname.patch
@@ -0,0 +1,76 @@
+When reading hostname from NM keyfile, if no hostname is set, read from the
+system file at /etc/conf.d/hostname to set hostname. This patch is not meant to
+be ever upstreamed. Proper fix is to write a gentoo-specific ifcfg plugin.
+
+To change hostname, touch nm-system-settings.conf, which will reload the keyfile
+and cause /etc/conf.d/hostname to be reloaded.
+
+This horrible hack fixes http://bugs.gentoo.org/176873
+
+Author: Nirbheek Chauhan <nirbheek@gentoo.org>
+Reviewed-by: Arun Raghavan <ford_prefect@gentoo.org>
+
+---
+--- system-settings/plugins/keyfile/plugin.c
++++ system-settings/plugins/keyfile/plugin.c
+@@ -43,6 +43,9 @@
+ #define KEYFILE_PLUGIN_INFO "(c) 2007 - 2008 Red Hat, Inc. To report bugs please use the NetworkManager mailing list."
+
+ #define CONF_FILE SYSCONFDIR "/NetworkManager/nm-system-settings.conf"
++#ifdef TARGET_GENTOO
++#define HOSTNAME_FILE SYSCONFDIR "/conf.d/hostname"
++#endif
+
+ static char *plugin_get_hostname (SCPluginKeyfile *plugin);
+ static void system_config_interface_init (NMSystemConfigInterface *system_config_interface_class);
+@@ -381,6 +384,12 @@
+ GKeyFile *key_file;
+ char *hostname = NULL;
+ GError *error = NULL;
++#ifdef TARGET_GENTOO
++ char *contents = NULL;
++ char **lines = NULL, **line;
++ GError *contents_err = NULL;
++ gsize contents_len = 0;
++#endif
+
+ key_file = g_key_file_new ();
+ if (g_key_file_load_from_file (key_file, CONF_FILE, G_KEY_FILE_NONE, &error))
+@@ -392,7 +401,37 @@
+
+ g_key_file_free (key_file);
+
++ if (hostname)
++ goto out;
++#ifdef TARGET_GENTOO
++ /* If hostname is unset in keyfile, read system file to get hostname */
++ if (!g_file_get_contents (HOSTNAME_FILE, &contents,
++ &contents_len, &contents_err))
++ goto out;
++
++ lines = g_strsplit_set (contents, "\n\r", 0);
++ if (!lines)
++ goto out;
++
++ for (line = lines; *line; line++) {
++ if (!g_str_has_prefix (*line, "hostname="))
++ continue;
++ hostname = g_strsplit_set (g_strsplit_set (*line, "=", 0)[1], "#", 0)[0];
++ g_strstrip (hostname);
++ if (!hostname)
++ goto out;
++ /* Remove quotes surrounding hostname */
++ if (hostname[0] == '"' && hostname[strlen(hostname)-1] == '"')
++ contents = g_strndup(&hostname[1], strlen(hostname)-2);
++ /* Un-escape before using to imitate librc behaviour */
++ hostname = g_strcompress (contents);
++ }
++
++out:
++ g_error_free(contents_err);
++
+ return hostname;
++#endif
+ }
+
+ static gboolean
diff --git a/net-misc/networkmanager/networkmanager-0.7.999.ebuild b/net-misc/networkmanager/networkmanager-0.7.999.ebuild
new file mode 100644
index 000000000000..f7736b3c88ab
--- /dev/null
+++ b/net-misc/networkmanager/networkmanager-0.7.999.ebuild
@@ -0,0 +1,126 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/networkmanager-0.7.999.ebuild,v 1.1 2010/01/25 06:31:01 nirbheek Exp $
+
+EAPI="2"
+
+inherit gnome.org eutils
+
+# 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 ~x86"
+IUSE="avahi bluetooth doc nss gnutls dhclient dhcpcd 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.2
+ >=net-wireless/wpa_supplicant-0.5.10[dbus]
+ bluetooth? ( net-wireless/bluez )
+ || ( sys-libs/e2fsprogs-libs <sys-fs/e2fsprogs-1.41.0 )
+ avahi? ( net-dns/avahi[autoipd] )
+ gnutls? (
+ nss? ( >=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-3.0.0 ) )
+ !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
+ >=dev-util/gtk-doc-1.8
+ doc? ( >=dev-util/gtk-doc-1.8 )"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ # Fix up the dbus conf file to use plugdev group
+ epatch "${FILESDIR}/${PN}-0.7.1-confchanges.patch"
+
+ # Hack keyfile plugin to read hostname file, fixes bug 176873
+ epatch "${FILESDIR}/${PN}-0.8-read-hostname.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-dhcp-client=dhcpcd"
+ else
+ ECONF="${ECONF} --with-dhcp-client=dhclient"
+ fi
+ else
+ ECONF="${ECONF} --with-dhcp-client=dhcpcd"
+ 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" nm-system-settings.conf \
+ || die "newins failed"
+}
+
+pkg_postinst() {
+ elog "You will need to restart DBUS if this is your first time"
+ elog "installing NetworkManager."
+ elog ""
+ elog "To save system-wide settings as a user, that user needs to have the"
+ elog "right policykit privileges. You can add them by running:"
+ elog 'polkit-auth --grant org.freedesktop.network-manager-settings.system.modify --user "USERNAME"'
+}