/[gentoo-x86]/net-misc/networkmanager/networkmanager-1.0.2.ebuild
Gentoo

Contents of /net-misc/networkmanager/networkmanager-1.0.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Tue Aug 4 04:36:16 2015 UTC (4 years, 4 months ago) by tetromino
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +2 -2 lines
readline is slotted

(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 0x18E5B6F2D8D5EC8D)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/networkmanager-1.0.2.ebuild,v 1.6 2015/06/24 09:00:50 ago Exp $
4
5 EAPI="5"
6 GCONF_DEBUG="no"
7 GNOME_ORG_MODULE="NetworkManager"
8 GNOME2_LA_PUNT="yes"
9 VALA_MIN_API_VERSION="0.18"
10 VALA_USE_DEPEND="vapigen"
11 PYTHON_COMPAT=( python{2_7,3_3,3_4} )
12
13 inherit bash-completion-r1 eutils gnome2 linux-info multilib python-any-r1 systemd \
14 user readme.gentoo toolchain-funcs vala versionator virtualx udev
15
16 DESCRIPTION="Universal network configuration daemon for laptops, desktops, servers and virtualization hosts"
17 HOMEPAGE="https://wiki.gnome.org/Projects/NetworkManager"
18
19 LICENSE="GPL-2+"
20 SLOT="0" # add subslot if libnm-util.so.2 or libnm-glib.so.4 bumps soname version
21
22 IUSE="bluetooth connection-sharing consolekit +dhclient dhcpcd gnutls +introspection \
23 kernel_linux +nss +modemmanager ncurses +ppp resolvconf selinux systemd teamd test \
24 vala +wext +wifi zeroconf" # wimax
25
26 KEYWORDS="~alpha amd64 arm ~arm64 ppc ppc64 ~sparc x86"
27
28 REQUIRED_USE="
29 modemmanager? ( ppp )
30 ^^ ( nss gnutls )
31 ^^ ( dhclient dhcpcd )
32 "
33
34 # gobject-introspection-0.10.3 is needed due to gnome bug 642300
35 # wpa_supplicant-0.7.3-r3 is needed due to bug 359271
36 # TODO: Qt support?
37 COMMON_DEPEND="
38 >=sys-apps/dbus-1.2
39 >=dev-libs/dbus-glib-0.100
40 >=dev-libs/glib-2.32:2
41 >=dev-libs/libnl-3.2.8:3=
42 >=sys-auth/polkit-0.106
43 net-libs/libndp
44 >=net-libs/libsoup-2.26:2.4=
45 net-misc/iputils
46 sys-libs/readline:0
47 >=virtual/libgudev-165:=
48 bluetooth? ( >=net-wireless/bluez-5 )
49 connection-sharing? (
50 net-dns/dnsmasq[dhcp]
51 net-firewall/iptables )
52 gnutls? (
53 dev-libs/libgcrypt:0=
54 net-libs/gnutls:= )
55 modemmanager? ( >=net-misc/modemmanager-0.7.991 )
56 ncurses? ( >=dev-libs/newt-0.52.15 )
57 nss? ( >=dev-libs/nss-3.11:= )
58 dhclient? ( >=net-misc/dhcp-4[client] )
59 dhcpcd? ( >=net-misc/dhcpcd-4.0.0_rc3 )
60 introspection? ( >=dev-libs/gobject-introspection-0.10.3:= )
61 ppp? ( >=net-dialup/ppp-2.4.5:=[ipv6] net-dialup/rp-pppoe )
62 resolvconf? ( net-dns/openresolv )
63 systemd? ( >=sys-apps/systemd-209:0= )
64 !systemd? ( || ( sys-power/upower sys-power/upower-pm-utils ) )
65 teamd? ( >=net-misc/libteam-1.9 )
66 zeroconf? ( net-dns/avahi:=[autoipd] )
67 "
68 RDEPEND="${COMMON_DEPEND}
69 consolekit? ( sys-auth/consolekit )
70 wifi? ( >=net-wireless/wpa_supplicant-0.7.3-r3[dbus] )
71 "
72 DEPEND="${COMMON_DEPEND}
73 dev-util/gdbus-codegen
74 dev-util/gtk-doc-am
75 >=dev-util/intltool-0.40
76 >=sys-devel/gettext-0.17
77 >=sys-kernel/linux-headers-2.6.29
78 virtual/pkgconfig
79 vala? ( $(vala_depend) )
80 test? (
81 $(python_gen_any_dep '
82 dev-python/dbus-python[${PYTHON_USEDEP}]
83 dev-python/pygobject:2[${PYTHON_USEDEP}]')
84 )
85 "
86
87 sysfs_deprecated_check() {
88 ebegin "Checking for SYSFS_DEPRECATED support"
89
90 if { linux_chkconfig_present SYSFS_DEPRECATED_V2; }; then
91 eerror "Please disable SYSFS_DEPRECATED_V2 support in your kernel config and recompile your kernel"
92 eerror "or NetworkManager will not work correctly."
93 eerror "See http://bugs.gentoo.org/333639 for more info."
94 die "CONFIG_SYSFS_DEPRECATED_V2 support detected!"
95 fi
96 eend $?
97 }
98
99 pkg_pretend() {
100 if use kernel_linux; then
101 get_version
102 if linux_config_exists; then
103 sysfs_deprecated_check
104 else
105 ewarn "Was unable to determine your kernel .config"
106 ewarn "Please note that if CONFIG_SYSFS_DEPRECATED_V2 is set in your kernel .config, NetworkManager will not work correctly."
107 ewarn "See http://bugs.gentoo.org/333639 for more info."
108 fi
109
110 fi
111 }
112
113 pkg_setup() {
114 enewgroup plugdev
115 }
116
117 src_prepare() {
118 DOC_CONTENTS="To modify system network connections without needing to enter the
119 root password, add your user account to the 'plugdev' group."
120
121 # Force use of /run, avoid eautoreconf, upstream bug #737139
122 sed -e 's:$localstatedir/run/:/run/:' -i configure || die
123
124 use vala && vala_src_prepare
125
126 epatch_user # don't remove, users often want custom patches for NM
127 gnome2_src_prepare
128 }
129
130 src_configure() {
131 local myconf
132
133 # Same hack as net-dialup/pptpd to get proper plugin dir for ppp, bug #519986
134 if use ppp; then
135 local PPPD_VER=`best_version net-dialup/ppp`
136 PPPD_VER=${PPPD_VER#*/*-} #reduce it to ${PV}-${PR}
137 PPPD_VER=${PPPD_VER%%[_-]*} # main version without beta/pre/patch/revision
138 myconf="${myconf} --with-pppd-plugin-dir=/usr/$(get_libdir)/pppd/${PPPD_VER}"
139 fi
140
141 # unit files directory needs to be passed only when systemd is enabled,
142 # otherwise systemd support is not disabled completely, bug #524534
143 use systemd && myconf="${myconf} "$(systemd_with_unitdir)""
144
145 # TODO: enable wimax when we have a libnl:3 compatible revision of it
146 # wimax will be removed, bug #522822
147 # ifnet plugin always disabled until someone volunteers to actively
148 # maintain and fix it
149 gnome2_src_configure \
150 --disable-more-warnings \
151 --disable-static \
152 --localstatedir=/var \
153 --disable-lto \
154 --disable-config-plugin-ibft \
155 --disable-ifnet \
156 --without-netconfig \
157 --with-dbus-sys-dir=/etc/dbus-1/system.d \
158 --with-udev-dir="$(get_udevdir)" \
159 --with-config-plugins-default=keyfile \
160 --with-iptables=/sbin/iptables \
161 --with-libsoup=yes \
162 --enable-concheck \
163 --with-crypto=$(usex nss nss gnutls) \
164 --with-session-tracking=$(usex systemd systemd $(usex consolekit consolekit no)) \
165 --with-suspend-resume=$(usex systemd systemd upower) \
166 $(use_enable bluetooth bluez5-dun) \
167 $(use_enable introspection) \
168 $(use_enable ppp) \
169 --disable-wimax \
170 $(use_with dhclient) \
171 $(use_with dhcpcd) \
172 $(use_with modemmanager modem-manager-1) \
173 $(use_with ncurses nmtui) \
174 $(use_with resolvconf) \
175 $(use_with selinux) \
176 $(use_enable teamd teamdctl) \
177 $(use_enable test tests) \
178 $(use_enable vala) \
179 --without-valgrind \
180 $(use_with wext) \
181 ${myconf}
182 }
183
184 src_test() {
185 python_setup
186 Xemake check
187 }
188
189 src_install() {
190 # Install completions at proper place, bug #465100
191 gnome2_src_install completiondir="$(get_bashcompdir)"
192
193 ! use systemd && readme.gentoo_create_doc
194
195 newinitd "${FILESDIR}/init.d.NetworkManager" NetworkManager
196 newconfd "${FILESDIR}/conf.d.NetworkManager" NetworkManager
197
198 # /var/run/NetworkManager is used by some distros, but not by Gentoo
199 rmdir -v "${ED}/var/run/NetworkManager" || die "rmdir failed"
200 rmdir -v "${ED}/var/run" || die "rmdir failed"
201
202 # Need to keep the /etc/NetworkManager/dispatched.d for dispatcher scripts
203 keepdir /etc/NetworkManager/dispatcher.d
204
205 # Provide openrc net dependency only when nm is connected
206 exeinto /etc/NetworkManager/dispatcher.d
207 newexe "${FILESDIR}/10-openrc-status-r4" 10-openrc-status
208 sed -e "s:@EPREFIX@:${EPREFIX}:g" \
209 -i "${ED}/etc/NetworkManager/dispatcher.d/10-openrc-status" || die
210
211 keepdir /etc/NetworkManager/system-connections
212 chmod 0600 "${ED}"/etc/NetworkManager/system-connections/.keep* # bug #383765
213
214 # Allow users in plugdev group to modify system connections
215 insinto /usr/share/polkit-1/rules.d/
216 doins "${FILESDIR}/01-org.freedesktop.NetworkManager.settings.modify.system.rules"
217 }
218
219 pkg_postinst() {
220 gnome2_pkg_postinst
221 ! use systemd && readme.gentoo_print_elog
222
223 if [[ -e "${EROOT}etc/NetworkManager/nm-system-settings.conf" ]]; then
224 ewarn "The ${PN} system configuration file has moved to a new location."
225 ewarn "You must migrate your settings from ${EROOT}/etc/NetworkManager/nm-system-settings.conf"
226 ewarn "to ${EROOT}etc/NetworkManager/NetworkManager.conf"
227 ewarn
228 ewarn "After doing so, you can remove ${EROOT}etc/NetworkManager/nm-system-settings.conf"
229 fi
230
231 # The polkit rules file moved to /usr/share
232 old_rules="${EROOT}etc/polkit-1/rules.d/01-org.freedesktop.NetworkManager.settings.modify.system.rules"
233 if [[ -f "${old_rules}" ]]; then
234 case "$(md5sum ${old_rules})" in
235 574d0cfa7e911b1f7792077003060240* )
236 # Automatically delete the old rules.d file if the user did not change it
237 elog
238 elog "Removing old ${old_rules} ..."
239 rm -f "${old_rules}" || eerror "Failed, please remove ${old_rules} manually"
240 ;;
241 * )
242 elog "The ${old_rules}"
243 elog "file moved to /usr/share/polkit-1/rules.d/ in >=networkmanager-0.9.4.0-r4"
244 elog "If you edited ${old_rules}"
245 elog "without changing its behavior, you may want to remove it."
246 ;;
247 esac
248 fi
249
250 # ifnet plugin was disabled for systemd users with 0.9.8.6 version
251 # and for all people with 0.9.10.0-r1 (see ChangeLog for full explanations)
252 if use systemd; then
253 if ! version_is_at_least 0.9.8.6 ${REPLACING_VERSIONS}; then
254 ewarn "Ifnet plugin won't be used with systemd support enabled"
255 ewarn "as it is meant to be used with openRC and can cause collisions"
256 ewarn "(like bug #485658)."
257 ewarn "Because of this, you will likely need to reconfigure some of"
258 ewarn "your networks. To do this you can rely on Gnome control center,"
259 ewarn "nm-connection-editor or nmtui tools for example once updated"
260 ewarn "NetworkManager version is installed."
261 fi
262 else
263 if ! version_is_at_least 0.9.10.0-r1 ${REPLACING_VERSIONS}; then
264 ewarn "Ifnet plugin is now disabled because of it being unattended"
265 ewarn "and unmaintained for a long time, leading to some unfixed bugs"
266 ewarn "and new problems appearing. We will now use upstream 'keyfile'"
267 ewarn "plugin."
268 ewarn "Because of this, you will likely need to reconfigure some of"
269 ewarn "your networks. To do this you can rely on Gnome control center,"
270 ewarn "nm-connection-editor or nmtui tools for example once updated"
271 ewarn "NetworkManager version is installed."
272 fi
273 fi
274
275 # NM fallbacks to plugin specified at compile time (upstream bug #738611)
276 # but still show a warning to remember people to have cleaner config file
277 if [[ -e "${EROOT}etc/NetworkManager/NetworkManager.conf" ]]; then
278 if grep plugins "${EROOT}etc/NetworkManager/NetworkManager.conf" | grep -q ifnet; then
279 ewarn
280 ewarn "You seem to use 'ifnet' plugin in ${EROOT}etc/NetworkManager/NetworkManager.conf"
281 ewarn "Since it won't be used, you will need to stop setting ifnet plugin there."
282 ewarn
283 fi
284 fi
285
286 # NM shows lots of errors making nmcli neither unusable, bug #528748 upstream bug #690457
287 if grep -r "psk-flags=1" "${EROOT}"/etc/NetworkManager/; then
288 ewarn "You have psk-flags=1 setting in above files, you will need to"
289 ewarn "either reconfigure affected networks or, at least, set the flag"
290 ewarn "value to '0'."
291 fi
292 }

  ViewVC Help
Powered by ViewVC 1.1.20