Gentoo Archives: gentoo-commits

From: Matt Turner <mattst88@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/networkmanager/
Date: Thu, 01 Sep 2022 01:20:46
Message-Id: 1661995222.bcd8b2da86ad17f4e86cc05ac4465e194307eda1.mattst88@gentoo
1 commit: bcd8b2da86ad17f4e86cc05ac4465e194307eda1
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 1 00:57:08 2022 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 1 01:20:22 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bcd8b2da
7
8 net-misc/networkmanager: Version bump to 1.40.0
9
10 Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
11
12 net-misc/networkmanager/Manifest | 1 +
13 .../networkmanager/networkmanager-1.40.0.ebuild | 415 +++++++++++++++++++++
14 2 files changed, 416 insertions(+)
15
16 diff --git a/net-misc/networkmanager/Manifest b/net-misc/networkmanager/Manifest
17 index 78d75fca5e33..ba7c87266d40 100644
18 --- a/net-misc/networkmanager/Manifest
19 +++ b/net-misc/networkmanager/Manifest
20 @@ -1,2 +1,3 @@
21 DIST NetworkManager-1.38.2.tar.xz 5526780 BLAKE2B 54e9746d3bf41146bb2bbc1ec273c4e2ca0a458e1a488eba7e5f17572e6e8db02ccfcd5b884e00162e505512b24a38de77447944d979fbe40d20d4af4c688a71 SHA512 0da3294bec659e6742c2b941eb6cb2464df1018e801148ac37cce0a0612c4468701add13659c18b1c08b51556c7e3e2782ad2353804fdf2a094e97d531da964b
22 DIST NetworkManager-1.38.4.tar.xz 5446860 BLAKE2B c7b1e456a33ff136137cf0bd615fffdbc2d24b853bbe31dcab143c2748baf0a8f25fcc55af1811f4a179c5d85d86a09dcb2cdd3b374996b013be1acfea580316 SHA512 b36b35f1292df9888a5930cb28aca693ee566eec9216520adf3f5aeb9631d4d399bb0ea06641ab488f025584df438b69b2be01a3a7782e20267b60165f9159b6
23 +DIST NetworkManager-1.40.0.tar.xz 6580984 BLAKE2B 7c5288afd791dbf02af783540cc6c316ca061c5d9bfcc222918928c74c519a852206ed61101c1f105a0907c8ec640cb6a024c6d1055e326c0fd1c042e9d83a5e SHA512 2e51a70a6ef5c0c7ba9af400b9af8e6956c9a23dd93566a7c07efe531bb6253bf3544ac2a61e147fc17145eaaeeb25d7e58c1cb7daf7e7bf7b8ae6742545417e
24
25 diff --git a/net-misc/networkmanager/networkmanager-1.40.0.ebuild b/net-misc/networkmanager/networkmanager-1.40.0.ebuild
26 new file mode 100644
27 index 000000000000..b34c9b9ac16d
28 --- /dev/null
29 +++ b/net-misc/networkmanager/networkmanager-1.40.0.ebuild
30 @@ -0,0 +1,415 @@
31 +# Copyright 1999-2022 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=8
35 +GNOME_ORG_MODULE="NetworkManager"
36 +PYTHON_COMPAT=( python3_{8..11} )
37 +
38 +inherit gnome.org linux-info meson-multilib python-any-r1 readme.gentoo-r1 systemd toolchain-funcs udev vala virtualx
39 +
40 +DESCRIPTION="A set of co-operative tools that make networking simple and straightforward"
41 +HOMEPAGE="https://wiki.gnome.org/Projects/NetworkManager"
42 +
43 +LICENSE="GPL-2+ LGPL-2.1+"
44 +SLOT="0"
45 +
46 +IUSE="audit bluetooth +concheck connection-sharing debug dhclient dhcpcd elogind gnutls +gtk-doc +introspection iptables +iwd psl libedit lto +nss nftables +modemmanager ofono ovs policykit +ppp resolvconf selinux syslog systemd teamd test +tools vala +wext +wifi"
47 +RESTRICT="!test? ( test )"
48 +
49 +REQUIRED_USE="
50 + bluetooth? ( modemmanager )
51 + connection-sharing? ( || ( iptables nftables ) )
52 + gtk-doc? ( introspection )
53 + iwd? ( wifi )
54 + vala? ( introspection )
55 + wext? ( wifi )
56 + ^^ ( gnutls nss )
57 + ?? ( elogind systemd )
58 + ?? ( dhclient dhcpcd )
59 + ?? ( syslog systemd )
60 +"
61 +
62 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86"
63 +
64 +COMMON_DEPEND="
65 + sys-apps/util-linux[${MULTILIB_USEDEP}]
66 + elogind? ( >=sys-auth/elogind-219 )
67 + >=virtual/libudev-175:=[${MULTILIB_USEDEP}]
68 + sys-apps/dbus
69 + net-libs/libndp
70 + systemd? ( >=sys-apps/systemd-209:0= )
71 + >=dev-libs/glib-2.40:2[${MULTILIB_USEDEP}]
72 + introspection? ( >=dev-libs/gobject-introspection-0.10.3:= )
73 + selinux? (
74 + sec-policy/selinux-networkmanager
75 + sys-libs/libselinux
76 + )
77 + audit? ( sys-process/audit )
78 + teamd? (
79 + >=dev-libs/jansson-2.7:=
80 + >=net-misc/libteam-1.9
81 + )
82 + policykit? ( >=sys-auth/polkit-0.106 )
83 + nss? ( >=dev-libs/nss-3.11:=[${MULTILIB_USEDEP}] )
84 + gnutls? (
85 + >=net-libs/gnutls-2.12:=[${MULTILIB_USEDEP}]
86 + )
87 + ppp? ( >=net-dialup/ppp-2.4.5:=[ipv6] )
88 + modemmanager? (
89 + net-misc/mobile-broadband-provider-info
90 + >=net-misc/modemmanager-0.7.991:0=
91 + )
92 + bluetooth? ( >=net-wireless/bluez-5 )
93 + ofono? ( net-misc/ofono )
94 + dhclient? ( >=net-misc/dhcp-4[client] )
95 + dhcpcd? ( >=net-misc/dhcpcd-9.3.3 )
96 + ovs? ( >=dev-libs/jansson-2.7:= )
97 + resolvconf? ( virtual/resolvconf )
98 + connection-sharing? (
99 + net-dns/dnsmasq[dbus,dhcp]
100 + iptables? ( net-firewall/iptables )
101 + nftables? ( net-firewall/nftables )
102 + )
103 + psl? ( net-libs/libpsl )
104 + concheck? ( net-misc/curl )
105 + tools? (
106 + >=dev-libs/newt-0.52.15
107 + libedit? ( dev-libs/libedit )
108 + !libedit? ( sys-libs/readline:= )
109 + )
110 +"
111 +RDEPEND="${COMMON_DEPEND}
112 + acct-group/plugdev
113 + || (
114 + net-misc/iputils[arping(+)]
115 + net-analyzer/arping
116 + )
117 + wifi? (
118 + !iwd? ( >=net-wireless/wpa_supplicant-0.7.3-r3[dbus] )
119 + iwd? ( net-wireless/iwd )
120 + )
121 +"
122 +DEPEND="${COMMON_DEPEND}
123 + >=sys-kernel/linux-headers-3.18
124 + net-libs/libndp[${MULTILIB_USEDEP}]
125 + ppp? ( elibc_musl? ( net-libs/ppp-defs ) )
126 +"
127 +BDEPEND="
128 + dev-util/gdbus-codegen
129 + dev-util/glib-utils
130 + gtk-doc? (
131 + dev-util/gtk-doc
132 + app-text/docbook-xml-dtd:4.1.2
133 + )
134 + >=sys-devel/gettext-0.17
135 + virtual/pkgconfig
136 + introspection? (
137 + $(python_gen_any_dep 'dev-python/pygobject:3[${PYTHON_USEDEP}]')
138 + dev-lang/perl
139 + dev-libs/libxslt
140 + )
141 + vala? ( $(vala_depend) )
142 + test? (
143 + >=dev-libs/jansson-2.7
144 + $(python_gen_any_dep '
145 + dev-python/dbus-python[${PYTHON_USEDEP}]
146 + dev-python/pygobject:3[${PYTHON_USEDEP}]')
147 + )
148 +"
149 +
150 +python_check_deps() {
151 + if use introspection; then
152 + python_has_version "dev-python/pygobject:3[${PYTHON_USEDEP}]" || return
153 + fi
154 + if use test; then
155 + python_has_version "dev-python/dbus-python[${PYTHON_USEDEP}]" &&
156 + python_has_version "dev-python/pygobject:3[${PYTHON_USEDEP}]"
157 + fi
158 +}
159 +
160 +sysfs_deprecated_check() {
161 + ebegin "Checking for SYSFS_DEPRECATED support"
162 +
163 + if { linux_chkconfig_present SYSFS_DEPRECATED_V2; }; then
164 + eerror "Please disable SYSFS_DEPRECATED_V2 support in your kernel config and recompile your kernel"
165 + eerror "or NetworkManager will not work correctly."
166 + eerror "See https://bugs.gentoo.org/333639 for more info."
167 + die "CONFIG_SYSFS_DEPRECATED_V2 support detected!"
168 + fi
169 + eend $?
170 +}
171 +
172 +pkg_pretend() {
173 + if use kernel_linux; then
174 + get_version
175 + if linux_config_exists; then
176 + sysfs_deprecated_check
177 + else
178 + ewarn "Was unable to determine your kernel .config"
179 + ewarn "Please note that if CONFIG_SYSFS_DEPRECATED_V2 is set in your kernel .config, NetworkManager will not work correctly."
180 + ewarn "See https://bugs.gentoo.org/333639 for more info."
181 + fi
182 + fi
183 +}
184 +
185 +pkg_setup() {
186 + if use connection-sharing; then
187 + if kernel_is lt 5 1; then
188 + CONFIG_CHECK="~NF_NAT_IPV4 ~NF_NAT_MASQUERADE_IPV4"
189 + else
190 + CONFIG_CHECK="~NF_NAT ~NF_NAT_MASQUERADE"
191 + fi
192 + linux-info_pkg_setup
193 + fi
194 +
195 + if use introspection || use test; then
196 + python-any-r1_pkg_setup
197 + fi
198 +
199 + # bug 809695
200 + if tc-is-clang && use lto; then
201 + eerror "Clang does not support -flto-partition"
202 + die "Please use gcc or turn off USE=lto flag when building with clang"
203 + fi
204 +}
205 +
206 +src_prepare() {
207 + DOC_CONTENTS="To modify system network connections without needing to enter the
208 + root password, add your user account to the 'plugdev' group."
209 +
210 + default
211 + use vala && vala_setup
212 +
213 + sed -i \
214 + -e 's#/usr/bin/sed#/bin/sed#' \
215 + data/84-nm-drivers.rules \
216 + || die
217 +}
218 +
219 +meson_nm_program() {
220 + usex "$1" "-D${2:-$1}=$3" "-D${2:-$1}=no"
221 +}
222 +
223 +meson_nm_native_program() {
224 + multilib_native_usex "$1" "-D${2:-$1}=$3" "-D${2:-$1}=no"
225 +}
226 +
227 +multilib_src_configure() {
228 + local emesonargs=(
229 + --localstatedir="${EPREFIX}/var"
230 +
231 + -Dsystemdsystemunitdir=$(systemd_get_systemunitdir)
232 + -Dsystem_ca_path=/etc/ssl/certs
233 + -Dudev_dir=$(get_udevdir)
234 + -Ddbus_conf_dir=/usr/share/dbus-1/system.d
235 + -Dkernel_firmware_dir=/lib/firmware
236 + -Diptables=/sbin/iptables
237 + -Dnft=/sbin/nft
238 + -Ddnsmasq=/usr/sbin/dnsmasq
239 +
240 + -Ddist_version=${PVR}
241 + $(meson_native_use_bool policykit polkit)
242 + $(meson_native_use_bool policykit config_auth_polkit_default)
243 + -Dmodify_system=true
244 + -Dpolkit_agent_helper_1=/usr/lib/polkit-1/polkit-agent-helper-1
245 + $(meson_native_use_bool selinux)
246 + $(meson_native_use_bool systemd systemd_journal)
247 + -Dhostname_persist=gentoo
248 + -Dlibaudit=$(multilib_native_usex audit)
249 +
250 + $(meson_native_use_bool wext)
251 + $(meson_native_use_bool wifi)
252 + $(meson_native_use_bool iwd)
253 + $(meson_native_use_bool ppp)
254 + -Dpppd=/usr/sbin/pppd
255 + $(meson_native_use_bool modemmanager modem_manager)
256 + $(meson_native_use_bool ofono)
257 + $(meson_native_use_bool concheck)
258 + $(meson_native_use_bool teamd teamdctl)
259 + $(meson_native_use_bool ovs)
260 + $(meson_native_use_bool tools nmcli)
261 + $(meson_native_use_bool tools nmtui)
262 + $(meson_native_use_bool tools nm_cloud_setup)
263 + $(meson_native_use_bool bluetooth bluez5_dun)
264 + -Debpf=true
265 +
266 + -Dconfig_wifi_backend_default=$(multilib_native_usex iwd iwd default)
267 + -Dconfig_plugins_default=keyfile
268 + -Difcfg_rh=false
269 + -Difupdown=false
270 +
271 + $(meson_nm_native_program resolvconf "" /sbin/resolvconf)
272 + -Dnetconfig=no
273 + -Dconfig_dns_rc_manager_default=auto
274 +
275 + $(meson_nm_program dhclient "" /sbin/dhclient)
276 + -Ddhcpcanon=no
277 + $(meson_nm_program dhcpcd "" /sbin/dhcpcd)
278 +
279 + $(meson_native_use_bool introspection)
280 + $(meson_native_use_bool vala vapi)
281 + $(meson_native_use_bool gtk-doc docs)
282 + -Dtests=$(multilib_native_usex test)
283 + $(meson_native_true firewalld_zone)
284 + -Dmore_asserts=0
285 + $(meson_use debug more_logging)
286 + -Dvalgrind=no
287 + -Dvalgrind_suppressions=
288 + -Dld_gc=false
289 + $(meson_native_use_bool psl libpsl)
290 + -Dqt=false
291 +
292 + $(meson_use lto b_lto)
293 + )
294 +
295 + if multilib_is_native_abi && use systemd; then
296 + emesonargs+=( -Dsession_tracking_consolekit=false )
297 + emesonargs+=( -Dsession_tracking=systemd )
298 + emesonargs+=( -Dsuspend_resume=systemd )
299 + elif multilib_is_native_abi && use elogind; then
300 + emesonargs+=( -Dsession_tracking_consolekit=false )
301 + emesonargs+=( -Dsession_tracking=elogind )
302 + emesonargs+=( -Dsuspend_resume=elogind )
303 + else
304 + emesonargs+=( -Dsession_tracking_consolekit=false )
305 + emesonargs+=( -Dsession_tracking=no )
306 + emesonargs+=( -Dsuspend_resume=auto )
307 + fi
308 +
309 + if multilib_is_native_abi && use syslog; then
310 + emesonargs+=( -Dconfig_logging_backend_default=syslog )
311 + elif multilib_is_native_abi && use systemd; then
312 + emesonargs+=( -Dconfig_logging_backend_default=journal )
313 + else
314 + emesonargs+=( -Dconfig_logging_backend_default=default )
315 + fi
316 +
317 + if multilib_is_native_abi && use dhclient; then
318 + emesonargs+=( -Dconfig_dhcp_default=dhclient )
319 + elif multilib_is_native_abi && use dhcpcd; then
320 + emesonargs+=( -Dconfig_dhcp_default=dhcpcd )
321 + else
322 + emesonargs+=( -Dconfig_dhcp_default=internal )
323 + fi
324 +
325 + if use nss; then
326 + emesonargs+=( -Dcrypto=nss )
327 + else
328 + emesonargs+=( -Dcrypto=gnutls )
329 + fi
330 +
331 + if use tools ; then
332 + emesonargs+=( -Dreadline=$(usex libedit libedit libreadline) )
333 + else
334 + emesonargs+=( -Dreadline=none )
335 + fi
336 +
337 + # Same hack as net-dialup/pptpd to get proper plugin dir for ppp, bug #519986
338 + if use ppp; then
339 + local PPPD_VER=`best_version net-dialup/ppp`
340 + PPPD_VER=${PPPD_VER#*/*-} #reduce it to ${PV}-${PR}
341 + PPPD_VER=${PPPD_VER%%[_-]*} # main version without beta/pre/patch/revision
342 + emesonargs+=( -Dpppd_plugin_dir=/usr/$(get_libdir)/pppd/${PPPD_VER} )
343 + fi
344 +
345 + meson_src_configure
346 +}
347 +
348 +multilib_src_test() {
349 + if use test && multilib_is_native_abi; then
350 + python_setup
351 + virtx meson_src_test
352 + fi
353 +}
354 +
355 +multilib_src_install() {
356 + meson_src_install
357 + if ! multilib_is_native_abi; then
358 + rm -r "${ED}"/{etc,usr/{bin,lib/NetworkManager,share},var} || die
359 + fi
360 +}
361 +
362 +multilib_src_install_all() {
363 + ! use systemd && readme.gentoo_create_doc
364 +
365 + newinitd "${FILESDIR}/init.d.NetworkManager-r2" NetworkManager
366 + newconfd "${FILESDIR}/conf.d.NetworkManager" NetworkManager
367 +
368 + # Need to keep the /etc/NetworkManager/dispatched.d for dispatcher scripts
369 + keepdir /etc/NetworkManager/dispatcher.d
370 +
371 + # Provide openrc net dependency only when nm is connected
372 + exeinto /etc/NetworkManager/dispatcher.d
373 + newexe "${FILESDIR}/10-openrc-status-r4" 10-openrc-status
374 + sed -e "s:@EPREFIX@:${EPREFIX}:g" \
375 + -i "${ED}/etc/NetworkManager/dispatcher.d/10-openrc-status" || die
376 +
377 + keepdir /etc/NetworkManager/system-connections
378 + chmod 0600 "${ED}"/etc/NetworkManager/system-connections/.keep* # bug #383765, upstream bug #754594
379 +
380 + # Allow users in plugdev group to modify system connections
381 + insinto /usr/share/polkit-1/rules.d/
382 + doins "${FILESDIR}"/01-org.freedesktop.NetworkManager.settings.modify.system.rules
383 +
384 + insinto /usr/lib/NetworkManager/conf.d #702476
385 + doins "${S}"/examples/nm-conf.d/31-mac-addr-change.conf
386 +
387 + if use iwd; then
388 + # This goes to $nmlibdir/conf.d/ and $nmlibdir is '${prefix}'/lib/$PACKAGE, thus always lib, not get_libdir
389 + cat <<-EOF > "${ED}"/usr/lib/NetworkManager/conf.d/iwd.conf || die
390 + [device]
391 + wifi.backend=iwd
392 + EOF
393 + fi
394 +
395 + mv "${ED}"/usr/share/doc/{NetworkManager/examples/,${PF}} || die
396 + rmdir "${ED}"/usr/share/doc/NetworkManager || die
397 +
398 + # Empty
399 + rmdir "${ED}"/var{/lib{/NetworkManager,},} || die
400 +}
401 +
402 +pkg_postinst() {
403 + udev_reload
404 +
405 + systemd_reenable NetworkManager.service
406 + ! use systemd && readme.gentoo_print_elog
407 +
408 + if [[ -e "${EROOT}/etc/NetworkManager/nm-system-settings.conf" ]]; then
409 + ewarn "The ${PN} system configuration file has moved to a new location."
410 + ewarn "You must migrate your settings from ${EROOT}/etc/NetworkManager/nm-system-settings.conf"
411 + ewarn "to ${EROOT}/etc/NetworkManager/NetworkManager.conf"
412 + ewarn
413 + ewarn "After doing so, you can remove ${EROOT}/etc/NetworkManager/nm-system-settings.conf"
414 + fi
415 +
416 + # NM fallbacks to plugin specified at compile time (upstream bug #738611)
417 + # but still show a warning to remember people to have cleaner config file
418 + if [[ -e "${EROOT}/etc/NetworkManager/NetworkManager.conf" ]]; then
419 + if grep plugins "${EROOT}/etc/NetworkManager/NetworkManager.conf" | grep -q ifnet; then
420 + ewarn
421 + ewarn "You seem to use 'ifnet' plugin in ${EROOT}/etc/NetworkManager/NetworkManager.conf"
422 + ewarn "Since it won't be used, you will need to stop setting ifnet plugin there."
423 + ewarn
424 + fi
425 + fi
426 +
427 + # NM shows lots of errors making nmcli almost unusable, bug #528748 upstream bug #690457
428 + if grep -r "psk-flags=1" "${EROOT}"/etc/NetworkManager/; then
429 + ewarn "You have psk-flags=1 setting in above files, you will need to"
430 + ewarn "either reconfigure affected networks or, at least, set the flag"
431 + ewarn "value to '0'."
432 + fi
433 +
434 + if use dhclient || use dhcpcd; then
435 + ewarn "You have enabled USE=dhclient and/or USE=dhcpcd, but NetworkManager since"
436 + ewarn "version 1.20 defaults to the internal DHCP client. If the internal client"
437 + ewarn "works for you, and you're happy with, the alternative USE flags can be"
438 + ewarn "disabled. If you want to use dhclient or dhcpcd, then you need to tweak"
439 + ewarn "the main.dhcp configuration option to use one of them instead of internal."
440 + fi
441 +}
442 +
443 +pkg_postrm() {
444 + udev_reload
445 +}