From 8ac7dc9e232eb57db85938bc726c96cad674fd46 Mon Sep 17 00:00:00 2001 From: Alexandre Rostovtsev Date: Tue, 21 Feb 2012 23:19:19 +0000 Subject: Make timeout to go inactive at init.d script startup configurable, and reduce it to 1 second by default (bug #405141, thanks to Sylvain Alain). Package-Manager: portage-2.2.0_alpha87/cvs/Linux x86_64 --- net-misc/networkmanager/ChangeLog | 11 +- net-misc/networkmanager/Manifest | 13 +- .../networkmanager/files/conf.d.NetworkManager | 4 + ...etworkmanager-0.9.2.0-init-provide-net-r1.patch | 20 ++- .../networkmanager-0.9.2.0-r4.ebuild | 175 -------------------- .../networkmanager-0.9.2.0-r5.ebuild | 178 +++++++++++++++++++++ 6 files changed, 211 insertions(+), 190 deletions(-) create mode 100644 net-misc/networkmanager/files/conf.d.NetworkManager delete mode 100644 net-misc/networkmanager/networkmanager-0.9.2.0-r4.ebuild create mode 100644 net-misc/networkmanager/networkmanager-0.9.2.0-r5.ebuild (limited to 'net-misc') diff --git a/net-misc/networkmanager/ChangeLog b/net-misc/networkmanager/ChangeLog index a8617143141e..11cc5fecae46 100644 --- a/net-misc/networkmanager/ChangeLog +++ b/net-misc/networkmanager/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for net-misc/networkmanager # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/ChangeLog,v 1.127 2012/02/20 09:25:00 tetromino Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/ChangeLog,v 1.128 2012/02/21 23:19:19 tetromino Exp $ + +*networkmanager-0.9.2.0-r5 (21 Feb 2012) + + 21 Feb 2012; Alexandre Rostovtsev + -networkmanager-0.9.2.0-r4.ebuild, +networkmanager-0.9.2.0-r5.ebuild, + files/networkmanager-0.9.2.0-init-provide-net-r1.patch, + +files/conf.d.NetworkManager: + Make timeout to go inactive at init.d script startup configurable, and reduce + it to 1 second by default (bug #405141, thanks to Sylvain Alain). *networkmanager-0.9.2.0-r4 (20 Feb 2012) diff --git a/net-misc/networkmanager/Manifest b/net-misc/networkmanager/Manifest index ff8ff99dc0f7..0c9df2a5c743 100644 --- a/net-misc/networkmanager/Manifest +++ b/net-misc/networkmanager/Manifest @@ -5,6 +5,7 @@ AUX 01-org.freedesktop.NetworkManager.settings.modify.system.pkla 187 RMD160 a6d AUX 10-openrc-status 912 RMD160 621ef49695f344ca5731e0761f9f79bd99f1b2e7 SHA1 aba0cf91c2c771824fcc29e3b1884f43b3d736b6 SHA256 85621ae323f3ba09361ded68532e6c71522268e8dba699574bf5550bc900c004 AUX 10-openrc-status-r1 893 RMD160 d071ed084fb80cd6ce34e0b91738b00de6fa7cf5 SHA1 26d401af7b1237894f6017f63b7ef79dbf6be1d6 SHA256 06db30b90859cd01dc28040853d9ff558b9ea4616a367032996f9c30cb699f93 AUX NetworkManagerDispatcher 1198 RMD160 4345870ab40607b9aed80c8da383b604f032b98e SHA1 1dd2250c746b25566fceaab551f4ef8335fe4f55 SHA256 f8cb5d0470619cf1f0812fffcf1bf2091e3c44a757899c07164f80ddd6a2641e +AUX conf.d.NetworkManager 230 RMD160 2d13403ad7856e35ca3c5eba767c24ca7761dc45 SHA1 05cdd210968a41fef965d119e6bedafbd3ea7309 SHA256 4594573f01fe5e04b6dde4525796acf909158591bdcefd662ec23fe0d1c3e1bd AUX networkmanager-0.8-confchanges.patch 1063 RMD160 25a0d45410fa5590098386556e9947dd15507eda SHA1 ba6eaa63188f97f93bbbb327676d8104bbf7e8c8 SHA256 9fcbe0b9ab4cc38c9057a0dde2f5153efc12515ed4d28920a455dad7fc2b1e09 AUX networkmanager-0.8-nscd-clear-cache.patch 1214 RMD160 2381f455593202a740e634601c0ba8245ecb8fac SHA1 b4a0cec446b6f8fa81c06d5992db61b296f17057 SHA256 2d981bafa96607acb06740d78b8e33afdc675c52b0cf3ce5b098c67566362c99 AUX networkmanager-0.8-read-hostname.patch 2380 RMD160 8b4349293235d2b63546b4e65d30a94d91ab9a04 SHA1 f7d57c686e9bd1f1ac58e67efcd8255c0fc9a5c5 SHA256 5ee07a0fb949c7ce299f0d2459c4f9840ace765308cd1a208d89eecec51a63fe @@ -17,7 +18,7 @@ AUX networkmanager-0.9.2.0-ifnet-openrc-style.patch 18656 RMD160 deb7be203b56ba2 AUX networkmanager-0.9.2.0-ifnet-password-truncated.patch 1671 RMD160 62ffd39619c4e6e265331d7c5e63700138c47140 SHA1 8b23bc683c394187573dc971a40aeb4524adb65a SHA256 d75c2c380f9d737f2aa4933b9c13ca8afad64188de70f0d4099f9edb93188c08 AUX networkmanager-0.9.2.0-ifnet-remove-system-prefix.patch 1939 RMD160 c06e5eeb31b537ab1ccd0ce0ee52b1fb2cf16a95 SHA1 d0a7d5bb6c69c7005f7f68b20b9421e433fe9d3d SHA256 7dda93bafcb3736ba4d037897a50116e005df47008389f3fee872c1fbd3eaf9f AUX networkmanager-0.9.2.0-ifnet-unquote-hostname.patch 1005 RMD160 c5660af6a897a31a00803c24b6e9b84661b65012 SHA1 77052ac9d3629e81dee3d5bbf8a6dc9bb57deb98 SHA256 008a03e508fc3ccbe5c57f2b9caa9f90a74001961c212144842e46dd0d5b3f84 -AUX networkmanager-0.9.2.0-init-provide-net-r1.patch 2039 RMD160 713105f06912c80698b1c4b1fa9c4e84cc1c8790 SHA1 a4220535c3f4d9cb8b0dd9e4c769e8a9c94225a3 SHA256 41876c3fe31d249388dcb1f16b60df00688f20867fc0969fd8712ee1ad0a245b +AUX networkmanager-0.9.2.0-init-provide-net-r1.patch 2282 RMD160 bcae874a2de469ce95639b514509cd2881bb546f SHA1 a68b7349a3ea5c1289c7a7cdb04cf5a8d0f66abb SHA256 fd46086be527bdd79978142eb8b46653ecc919f2dcab0a02dea2d0fd28232f92 AUX networkmanager-0.9.2.0-init-provide-net.patch 1957 RMD160 20dac26714191f4eb1e7ec28eab515bd060f7b25 SHA1 39b7aa225e76b22c5d9795061b6a13980dc881d7 SHA256 76a39cf52925c863da9958d3b3ced9be3ba68b7fe98bad070ba3a3b3b9999d81 AUX networkmanager-0.9.2.0-pre-sleep.patch 9163 RMD160 a7fa48306ac7ff6aacb918a836019acb02d176ec SHA1 c080ffcde01d67fea89180799182eb9b420df1df SHA256 e391907c8699b22b6c48ff27bf4d7a116600e643d788bd579339adc180e1ed97 AUX networkmanager-0.9_rc3-fix-tests.patch 589 RMD160 a63f0d4f908a32356baf78c7e7c9a68cd9e4d68c SHA1 9f1ed4418b124bae89f9849ce2560dd713565abc SHA256 c03a97751762864dc4dcfa6d9eeee1ea70b986bcd5830a6777cd7514ba647540 @@ -32,14 +33,14 @@ EBUILD networkmanager-0.8.4.0-r2.ebuild 4335 RMD160 7f413e48de262b71f692c0585e2e EBUILD networkmanager-0.9.0.ebuild 3945 RMD160 cd897dc8dc3fa92d4f4694a5acd703be6f9b5be1 SHA1 ef7eaa7e68bf01c2f4ea280742f30f856ef76ef6 SHA256 ab67f7f112c3b415c70f08b1ea9d6c029b7733203bafb512250e483b91c61bc8 EBUILD networkmanager-0.9.2.0-r2.ebuild 4861 RMD160 700e51efe25ed4fe00da6344f212a1ec58754a3e SHA1 4a0ec8619469fec3a2b4e3d6c67eb8b9bed368e3 SHA256 4a81d453993aa6c079550481235e0634dbd78865238dcabe145eca4cd742ebb7 EBUILD networkmanager-0.9.2.0-r3.ebuild 5402 RMD160 14bea743ffb949f440a95494039b6e182e173fe3 SHA1 eda82bda2c410b60497738f4447847e8c4ed1f29 SHA256 904b1fd26fb27d458e22aa0a7a6995c6207b9d05c619675fc3e3e1a4c5fd7a92 -EBUILD networkmanager-0.9.2.0-r4.ebuild 5659 RMD160 096536984bd3fa627cb4f77afdbd708f062b7012 SHA1 3e560608ad3b1c41d552920c136f9d4bc720cf15 SHA256 09132639aaaf8cd66df90fa8f516449b331d53c3d5ba60c8f7defa4df29f2fd2 +EBUILD networkmanager-0.9.2.0-r5.ebuild 5744 RMD160 ac1d7071cae0d7e35bee40192fcc123a0abf3843 SHA1 420f00ea698b39910cc7b06cbbdd6cce018e4683 SHA256 6e0fe6098984d9a796808339ecc510e1ddef93c4613f852df4e1a43763af16b9 EBUILD networkmanager-0.9.2.0.ebuild 4603 RMD160 3debbefb4e568c8f9a88afbe99c9b396c23e2c8a SHA1 ac79b40c257c8f35785de76abd642dc57d3a2a42 SHA256 dc3ed6e10b182eaf4630e819a413c07a2193da9d2d575a4dac8ab2a443ead44e -MISC ChangeLog 29590 RMD160 dc4736c444499f741e0162db0e5e7efc5284c1e4 SHA1 2d1202c12c2fb2e7d5e45fed633c7acc85dc4abb SHA256 cb6c1f8768cb3f817ec5574c7540b6c1b11ccb9ada9572ec30e8cfe03ebe70d1 +MISC ChangeLog 30002 RMD160 19e48b959e5068544c98160883c2775e2c8aa7e9 SHA1 820ea7cd17e4d9f1c4e74c55bdb998d3b46e75f1 SHA256 f58593987d96bd4e16dc1e18a09d3209e0bba194e763d85ca29313847c654452 MISC metadata.xml 1334 RMD160 f298cbf6adc22935891d30e834f5713d439a010d SHA1 c06b8992e77b4894a13b38890c4dfa62606d1d89 SHA256 59cb4c0eb37a25238b36f0b514ff4bc232e4df3666b5491b31a1d7265c1a0c37 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) -iF4EAREIAAYFAk9CEXEACgkQdjK8w9WeBnAlIAD7BXyEiiMqEdPJ7MWSGkF6JH2H -+EEUjmyu9+UihSCkwjEBAI75YlqoWN65ygUDueI0+dpkFdP4iKx/SbTwrKjkKUKn -=S7Oy +iF4EAREIAAYFAk9EJnwACgkQdjK8w9WeBnCwYQEAnb+BfZSxTQyNNFlbOyF2Y7mZ +G50SrP6sOOgnS5P20SsA/192yYMe8ZDBDXHlZQghTv3Wsf04bLGK5kqG06PGtY7k +=CB6z -----END PGP SIGNATURE----- diff --git a/net-misc/networkmanager/files/conf.d.NetworkManager b/net-misc/networkmanager/files/conf.d.NetworkManager new file mode 100644 index 000000000000..4a99229654fa --- /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/networkmanager-0.9.2.0-init-provide-net-r1.patch b/net-misc/networkmanager/files/networkmanager-0.9.2.0-init-provide-net-r1.patch index dbe563567cd7..0f8befb345ac 100644 --- a/net-misc/networkmanager/files/networkmanager-0.9.2.0-init-provide-net-r1.patch +++ b/net-misc/networkmanager/files/networkmanager-0.9.2.0-init-provide-net-r1.patch @@ -1,4 +1,4 @@ -From e99873e7583a3838e0873b1d0b1f9c3dac49f853 Mon Sep 17 00:00:00 2001 +From 705b9978ed914aba87e5a5191a1d0acacaf70a81 Mon Sep 17 00:00:00 2001 From: Alexandre Rostovtsev Date: Wed, 1 Feb 2012 05:51:20 -0500 Subject: [PATCH] gentoo: provide net and use inactive status when not @@ -7,16 +7,16 @@ Subject: [PATCH] gentoo: provide net and use inactive status when not The status will be reset to started via a dispatcher script on up/down events. See https://bugs.gentoo.org/show_bug.cgi?id=252137 --- - initscript/Gentoo/NetworkManager.in | 22 +++++++++++++++++++++- - 1 files changed, 21 insertions(+), 1 deletions(-) + initscript/Gentoo/NetworkManager.in | 26 +++++++++++++++++++++++++- + 1 files changed, 25 insertions(+), 1 deletions(-) diff --git a/initscript/Gentoo/NetworkManager.in b/initscript/Gentoo/NetworkManager.in -index 7db410b..34f19b1 100755 +index 7db410b..1960795 100755 --- a/initscript/Gentoo/NetworkManager.in +++ b/initscript/Gentoo/NetworkManager.in -@@ -3,18 +3,38 @@ +@@ -3,18 +3,42 @@ # Distributed under the terms of the GNU General Purpose License v2 - # $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/files/networkmanager-0.9.2.0-init-provide-net-r1.patch,v 1.1 2012/02/20 09:24:59 tetromino Exp $ + # $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/files/networkmanager-0.9.2.0-init-provide-net-r1.patch,v 1.2 2012/02/21 23:19:19 tetromino Exp $ +description="NetworkManager daemon. The service is marked as started only \ +when a network connection is established." @@ -30,6 +30,8 @@ index 7db410b..34f19b1 100755 + # 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 /var/run/NetworkManager.pid \ @@ -37,8 +39,10 @@ index 7db410b..34f19b1 100755 - eend $? + local _retval=$? + eend "${_retval}" -+ if [ "x${_retval}" = 'x0' ]; then -+ nm-online -t 5 || mark_service_inactive ++ 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}" } diff --git a/net-misc/networkmanager/networkmanager-0.9.2.0-r4.ebuild b/net-misc/networkmanager/networkmanager-0.9.2.0-r4.ebuild deleted file mode 100644 index cf34fa197bfe..000000000000 --- a/net-misc/networkmanager/networkmanager-0.9.2.0-r4.ebuild +++ /dev/null @@ -1,175 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/networkmanager-0.9.2.0-r4.ebuild,v 1.1 2012/02/20 09:25:00 tetromino Exp $ - -EAPI="4" -GNOME_ORG_MODULE="NetworkManager" - -inherit autotools eutils gnome.org linux-info systemd - -DESCRIPTION="Network configuration and management in an easy way. Desktop environment independent." -HOMEPAGE="http://www.gnome.org/projects/NetworkManager/" - -LICENSE="GPL-2" -SLOT="0" -IUSE="avahi bluetooth doc +nss gnutls dhclient +dhcpcd +introspection - kernel_linux +ppp resolvconf connection-sharing wimax" -KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86" - -REQUIRED_USE=" - ^^ ( 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 -# libnl:1.1 is needed for linking to net-wireless/wimax libraries -# XXX: on bump, check that net-wireless/wimax is still using libnl:1.1 ! -# TODO: Qt support? -COMMON_DEPEND=">=sys-apps/dbus-1.2 - >=dev-libs/dbus-glib-0.75 - >=net-wireless/wireless-tools-28_pre9 - || ( >=sys-fs/udev-171[gudev] >=sys-fs/udev-147[extras] ) - >=dev-libs/glib-2.26 - >=sys-auth/polkit-0.97 - dev-libs/libnl:1.1 - >=net-wireless/wpa_supplicant-0.7.3-r3[dbus] - bluetooth? ( >=net-wireless/bluez-4.82 ) - avahi? ( net-dns/avahi[autoipd] ) - gnutls? ( - dev-libs/libgcrypt - net-libs/gnutls ) - nss? ( >=dev-libs/nss-3.11 ) - dhclient? ( net-misc/dhcp ) - dhcpcd? ( >=net-misc/dhcpcd-4.0.0_rc3 ) - introspection? ( >=dev-libs/gobject-introspection-0.10.3 ) - ppp? ( - >=net-misc/modemmanager-0.4 - >=net-dialup/ppp-2.4.5 ) - resolvconf? ( net-dns/openresolv ) - connection-sharing? ( - net-dns/dnsmasq - net-firewall/iptables ) - wimax? ( >=net-wireless/wimax-1.5.1 )" - -RDEPEND="${COMMON_DEPEND} - sys-auth/consolekit" - -DEPEND="${COMMON_DEPEND} - dev-util/pkgconfig - >=dev-util/intltool-0.40 - >=sys-devel/gettext-0.17 - doc? ( >=dev-util/gtk-doc-1.8 )" - -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() { - # Don't build tests - epatch "${FILESDIR}/${PN}-0.9_rc3-fix-tests.patch" - # Build against libnl:1.1 for net-wireless/wimax-1.5.2 compatibility - epatch "${FILESDIR}/${PN}-0.9.1.95-force-libnl1.1.patch" - # Migrate to openrc style - epatch "${FILESDIR}/${P}-ifnet-openrc-style.patch" - # Ignore per-user connections - epatch "${FILESDIR}/${P}-ifnet-ignore-user-connections.patch" - # Remove system prefix - epatch "${FILESDIR}/${P}-ifnet-remove-system-prefix.patch" - # Correctly deal with single quotes in /etc/conf.d/hostname - epatch "${FILESDIR}/${P}-ifnet-unquote-hostname.patch" - # Update init.d script to provide net and use inactive status if not connected - epatch "${FILESDIR}/${P}-init-provide-net-r1.patch" - # Bug #402133, https://bugzilla.gnome.org/show_bug.cgi?id=670381 - epatch "${FILESDIR}/${P}-ifnet-password-truncated.patch" - # Bug #402085, https://bugzilla.gnome.org/show_bug.cgi?id=387832 - epatch "${FILESDIR}/${P}-pre-sleep.patch" - - eautoreconf - default -} - -src_configure() { - ECONF="--disable-more-warnings - --disable-static - --localstatedir=/var - --with-distro=gentoo - --with-dbus-sys-dir=/etc/dbus-1/system.d - --with-udev-dir=/lib/udev - --with-iptables=/sbin/iptables - $(use_enable doc gtk-doc) - $(use_enable introspection) - $(use_enable ppp) - $(use_enable wimax) - $(use_with dhclient) - $(use_with dhcpcd) - $(use_with doc docs) - $(use_with resolvconf) - $(systemd_with_unitdir)" - - if use nss ; then - ECONF="${ECONF} $(use_with nss crypto=nss)" - else - ECONF="${ECONF} $(use_with gnutls crypto=gnutls)" - fi - - econf ${ECONF} -} - -src_install() { - default - # /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-r1" 10-openrc-status - sed -e "s:@EPREFIX@:${EPREFIX}:g" \ - -i "${ED}/etc/NetworkManager/dispatcher.d/10-openrc-status" || die - - # Add keyfile plugin support - keepdir /etc/NetworkManager/system-connections - chmod 0600 "${ED}"/etc/NetworkManager/system-connections/.keep* # bug #383765 - insinto /etc/NetworkManager - newins "${FILESDIR}/nm-system-settings.conf-ifnet" nm-system-settings.conf - - # Allow users in plugdev group to modify system connections - insinto /etc/polkit-1/localauthority/10-vendor.d - doins "${FILESDIR}/01-org.freedesktop.NetworkManager.settings.modify.system.pkla" - - # Remove useless .la files - find "${D}" -name '*.la' -exec rm -f {} + || die "la file removal failed" -} - -pkg_postinst() { - elog "To modify system network connections without needing to enter the" - elog "root password, add your user account to the 'plugdev' group." -} diff --git a/net-misc/networkmanager/networkmanager-0.9.2.0-r5.ebuild b/net-misc/networkmanager/networkmanager-0.9.2.0-r5.ebuild new file mode 100644 index 000000000000..3b8c09882c00 --- /dev/null +++ b/net-misc/networkmanager/networkmanager-0.9.2.0-r5.ebuild @@ -0,0 +1,178 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/networkmanager-0.9.2.0-r5.ebuild,v 1.1 2012/02/21 23:19:19 tetromino Exp $ + +EAPI="4" +GNOME_ORG_MODULE="NetworkManager" + +inherit autotools eutils gnome.org linux-info systemd + +DESCRIPTION="Network configuration and management in an easy way. Desktop environment independent." +HOMEPAGE="http://www.gnome.org/projects/NetworkManager/" + +LICENSE="GPL-2" +SLOT="0" +IUSE="avahi bluetooth doc +nss gnutls dhclient +dhcpcd +introspection + kernel_linux +ppp resolvconf connection-sharing wimax" +KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86" + +REQUIRED_USE=" + ^^ ( 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 +# libnl:1.1 is needed for linking to net-wireless/wimax libraries +# XXX: on bump, check that net-wireless/wimax is still using libnl:1.1 ! +# TODO: Qt support? +COMMON_DEPEND=">=sys-apps/dbus-1.2 + >=dev-libs/dbus-glib-0.75 + >=net-wireless/wireless-tools-28_pre9 + || ( >=sys-fs/udev-171[gudev] >=sys-fs/udev-147[extras] ) + >=dev-libs/glib-2.26 + >=sys-auth/polkit-0.97 + dev-libs/libnl:1.1 + >=net-wireless/wpa_supplicant-0.7.3-r3[dbus] + bluetooth? ( >=net-wireless/bluez-4.82 ) + avahi? ( net-dns/avahi[autoipd] ) + gnutls? ( + dev-libs/libgcrypt + net-libs/gnutls ) + nss? ( >=dev-libs/nss-3.11 ) + dhclient? ( net-misc/dhcp ) + dhcpcd? ( >=net-misc/dhcpcd-4.0.0_rc3 ) + introspection? ( >=dev-libs/gobject-introspection-0.10.3 ) + ppp? ( + >=net-misc/modemmanager-0.4 + >=net-dialup/ppp-2.4.5 ) + resolvconf? ( net-dns/openresolv ) + connection-sharing? ( + net-dns/dnsmasq + net-firewall/iptables ) + wimax? ( >=net-wireless/wimax-1.5.1 )" + +RDEPEND="${COMMON_DEPEND} + sys-auth/consolekit" + +DEPEND="${COMMON_DEPEND} + dev-util/pkgconfig + >=dev-util/intltool-0.40 + >=sys-devel/gettext-0.17 + doc? ( >=dev-util/gtk-doc-1.8 )" + +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() { + # Don't build tests + epatch "${FILESDIR}/${PN}-0.9_rc3-fix-tests.patch" + # Build against libnl:1.1 for net-wireless/wimax-1.5.2 compatibility + epatch "${FILESDIR}/${PN}-0.9.1.95-force-libnl1.1.patch" + # Migrate to openrc style + epatch "${FILESDIR}/${P}-ifnet-openrc-style.patch" + # Ignore per-user connections + epatch "${FILESDIR}/${P}-ifnet-ignore-user-connections.patch" + # Remove system prefix + epatch "${FILESDIR}/${P}-ifnet-remove-system-prefix.patch" + # Correctly deal with single quotes in /etc/conf.d/hostname + epatch "${FILESDIR}/${P}-ifnet-unquote-hostname.patch" + # Update init.d script to provide net and use inactive status if not connected + epatch "${FILESDIR}/${P}-init-provide-net-r1.patch" + # Bug #402133, https://bugzilla.gnome.org/show_bug.cgi?id=670381 + epatch "${FILESDIR}/${P}-ifnet-password-truncated.patch" + # Bug #402085, https://bugzilla.gnome.org/show_bug.cgi?id=387832 + epatch "${FILESDIR}/${P}-pre-sleep.patch" + + eautoreconf + default +} + +src_configure() { + ECONF="--disable-more-warnings + --disable-static + --localstatedir=/var + --with-distro=gentoo + --with-dbus-sys-dir=/etc/dbus-1/system.d + --with-udev-dir=/lib/udev + --with-iptables=/sbin/iptables + $(use_enable doc gtk-doc) + $(use_enable introspection) + $(use_enable ppp) + $(use_enable wimax) + $(use_with dhclient) + $(use_with dhcpcd) + $(use_with doc docs) + $(use_with resolvconf) + $(systemd_with_unitdir)" + + if use nss ; then + ECONF="${ECONF} $(use_with nss crypto=nss)" + else + ECONF="${ECONF} $(use_with gnutls crypto=gnutls)" + fi + + econf ${ECONF} +} + +src_install() { + default + # /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-r1" 10-openrc-status + sed -e "s:@EPREFIX@:${EPREFIX}:g" \ + -i "${ED}/etc/NetworkManager/dispatcher.d/10-openrc-status" || die + + # Add keyfile plugin support + keepdir /etc/NetworkManager/system-connections + chmod 0600 "${ED}"/etc/NetworkManager/system-connections/.keep* # bug #383765 + insinto /etc/NetworkManager + newins "${FILESDIR}/nm-system-settings.conf-ifnet" nm-system-settings.conf + + # Allow users in plugdev group to modify system connections + insinto /etc/polkit-1/localauthority/10-vendor.d + doins "${FILESDIR}/01-org.freedesktop.NetworkManager.settings.modify.system.pkla" + + # Default conf.d file + newconfd "${FILESDIR}/conf.d.NetworkManager" NetworkManager + + # Remove useless .la files + find "${D}" -name '*.la' -exec rm -f {} + || die "la file removal failed" +} + +pkg_postinst() { + elog "To modify system network connections without needing to enter the" + elog "root password, add your user account to the 'plugdev' group." +} -- cgit v1.2.3-65-gdbad