summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.52.0.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-networking/recipes-connectivity/networkmanager/networkmanager_1.52.0.bb')
-rw-r--r--meta-networking/recipes-connectivity/networkmanager/networkmanager_1.52.0.bb320
1 files changed, 320 insertions, 0 deletions
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.52.0.bb b/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.52.0.bb
new file mode 100644
index 0000000000..dd894c0900
--- /dev/null
+++ b/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.52.0.bb
@@ -0,0 +1,320 @@
1SUMMARY = "NetworkManager is a program for providing detection and \
2configuration for systems to automatically connect to networks."
3
4DESCRIPTION = "NetworkManager is a program for providing detection and \
5configuration for systems to automatically connect to networks. \
6NetworkManager's functionality can be useful for both wireless and wired \
7networks. For wireless networks, NetworkManager prefers known wireless \
8networks and has the ability to switch to the most reliable network. \
9NetworkManager-aware applications can switch from online and offline mode. \
10NetworkManager also prefers wired connections over wireless ones, has support \
11for modem connections and certain types of VPN."
12
13HOMEPAGE = "https://wiki.gnome.org/Projects/NetworkManager"
14SECTION = "net/misc"
15
16LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later"
17LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
18 file://COPYING.LGPL;md5=4fbd65380cdd255951079008b364516c \
19"
20
21DEPENDS = " \
22 glib-2.0 \
23 python3-pygobject-native \
24 coreutils-native \
25 intltool-native \
26 libxslt-native \
27 libnl \
28 libnvme \
29 udev \
30 util-linux \
31 util-linux-libuuid \
32 libndp \
33 curl \
34 dbus \
35"
36DEPENDS:append:class-target = " bash-completion"
37
38inherit meson gettext update-rc.d systemd gobject-introspection update-alternatives upstream-version-is-even pkgconfig
39
40SRC_URI = " \
41 git://github.com/NetworkManager/NetworkManager.git;protocol=https;branch=main;tag=${PV} \
42 file://${BPN}.initd \
43 file://enable-dhcpcd.conf \
44 file://enable-iwd.conf \
45"
46SRC_URI:append:libc-musl = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' file://0001-linker-scripts-Do-not-export-_IO_stdin_used.patch', '', d)}"
47
48SRCREV = "995a28fa1ccc54ad22e794294c3c6783cc3f30ed"
49
50S = "${WORKDIR}/git"
51
52# ['auto', 'symlink', 'file', 'netconfig', 'resolvconf']
53NETWORKMANAGER_DNS_RC_MANAGER_DEFAULT ??= "auto"
54
55# ['dhclient', 'dhcpcd', 'internal', 'nettools']
56NETWORKMANAGER_DHCP_DEFAULT ??= "internal"
57
58# The default gets detected based on whether /usr/sbin/nft or /usr/sbin/iptables is installed, with nftables preferred.
59# ['', 'iptables', 'nftables']
60NETWORKMANAGER_FIREWALL_DEFAULT ??= "nftables"
61
62EXTRA_OEMESON = "\
63 -Difcfg_rh=false \
64 -Dtests=yes \
65 -Dudev_dir=${nonarch_base_libdir}/udev \
66 -Dlibpsl=false \
67 -Dqt=false \
68 -Dconfig_dns_rc_manager_default=${NETWORKMANAGER_DNS_RC_MANAGER_DEFAULT} \
69 -Dconfig_dhcp_default=${NETWORKMANAGER_DHCP_DEFAULT} \
70 -Diptables=${sbindir}/iptables \
71 -Dnft=${sbindir}/nft \
72"
73
74# stolen from https://github.com/void-linux/void-packages/blob/master/srcpkgs/NetworkManager/template
75# avoids:
76# | ../NetworkManager-1.16.0/libnm-core/nm-json.c:106:50: error: 'RTLD_DEEPBIND' undeclared (first use in this function); did you mean 'RTLD_DEFAULT'?
77CFLAGS:append:libc-musl = " \
78 -DRTLD_DEEPBIND=0 \
79"
80
81PACKAGECONFIG ??= "readline nss ifupdown dnsmasq nmcli \
82 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d), d)} \
83 ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez5', '', d)} \
84 ${@bb.utils.filter('DISTRO_FEATURES', 'wifi polkit ppp', d)} \
85 ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux audit', '', d)} \
86 ${@bb.utils.contains('DISTRO_FEATURES_BACKFILL_CONSIDERED', 'gobject-introspection-data', '', 'vala', d)} \
87"
88
89inherit ${@bb.utils.contains('PACKAGECONFIG', 'vala', 'vala', '', d)}
90
91PACKAGECONFIG[systemd] = "\
92 -Dsystemdsystemunitdir=${systemd_unitdir}/system -Dsession_tracking=systemd,\
93 -Dsystemdsystemunitdir=no -Dsystemd_journal=false -Dsession_tracking=no\
94"
95PACKAGECONFIG[polkit] = "-Dpolkit=true,-Dpolkit=false,polkit"
96PACKAGECONFIG[bluez5] = "-Dbluez5_dun=true,-Dbluez5_dun=false,bluez5"
97# consolekit is not picked by shlibs, so add it to RDEPENDS too
98PACKAGECONFIG[consolekit] = "-Dsession_tracking_consolekit=true,-Dsession_tracking_consolekit=false,consolekit,consolekit"
99PACKAGECONFIG[modemmanager] = "-Dmodem_manager=true,-Dmodem_manager=false,modemmanager mobile-broadband-provider-info"
100PACKAGECONFIG[ppp] = "-Dppp=true -Dpppd=${sbindir}/pppd,-Dppp=false,ppp"
101PACKAGECONFIG[dnsmasq] = "-Ddnsmasq=${bindir}/dnsmasq"
102PACKAGECONFIG[nss] = "-Dcrypto=nss,,nss"
103PACKAGECONFIG[resolvconf] = "-Dresolvconf=${base_sbindir}/resolvconf,-Dresolvconf=no,,resolvconf"
104PACKAGECONFIG[gnutls] = "-Dcrypto=gnutls,,gnutls"
105PACKAGECONFIG[crypto-null] = "-Dcrypto=null"
106PACKAGECONFIG[wifi] = "-Dwext=true -Dwifi=true,-Dwext=false -Dwifi=false"
107PACKAGECONFIG[iwd] = "-Diwd=true,-Diwd=false"
108PACKAGECONFIG[ifupdown] = "-Difupdown=true,-Difupdown=false"
109PACKAGECONFIG[cloud-setup] = "-Dnm_cloud_setup=true,-Dnm_cloud_setup=false"
110PACKAGECONFIG[nmcli] = "-Dnmcli=true,-Dnmcli=false"
111PACKAGECONFIG[nmtui] = "-Dnmtui=true,-Dnmtui=false,libnewt"
112PACKAGECONFIG[readline] = "-Dreadline=libreadline,,readline"
113PACKAGECONFIG[libedit] = "-Dreadline=libedit,,libedit"
114PACKAGECONFIG[ovs] = "-Dovs=true,-Dovs=false,jansson"
115PACKAGECONFIG[audit] = "-Dlibaudit=yes,-Dlibaudit=no"
116PACKAGECONFIG[selinux] = "-Dselinux=true,-Dselinux=false,libselinux"
117PACKAGECONFIG[vala] = "-Dvapi=true,-Dvapi=false"
118PACKAGECONFIG[dhcpcd] = "-Ddhcpcd=${base_sbindir}/dhcpcd,-Ddhcpcd=no,,dhcpcd"
119PACKAGECONFIG[dhclient] = "-Ddhclient=yes,-Ddhclient=no,,dhcp"
120PACKAGECONFIG[concheck] = "-Dconcheck=true,-Dconcheck=false"
121PACKAGECONFIG[adsl] = ",,"
122PACKAGECONFIG[wwan] = ",,"
123# The following PACKAGECONFIG is used to determine whether NM is managing /etc/resolv.conf itself or not
124PACKAGECONFIG[man-resolv-conf] = ",,"
125
126
127PACKAGES =+ " \
128 libnm \
129 ${PN}-adsl \
130 ${PN}-bluetooth \
131 ${PN}-cloud-setup \
132 ${PN}-nmcli \
133 ${PN}-nmcli-bash-completion \
134 ${PN}-nmtui \
135 ${PN}-wifi \
136 ${PN}-wwan \
137 ${PN}-ovs \
138 ${PN}-ppp \
139 ${PN}-daemon \
140"
141
142SYSTEMD_PACKAGES = "${PN}-daemon ${PN}-cloud-setup"
143INITSCRIPT_PACKAGES = "${PN}-daemon"
144
145NETWORKMANAGER_PLUGINDIR = "${libdir}/NetworkManager/${PV}"
146NETWORKMANAGER_DISPATCHERDIR = "${nonarch_libdir}/NetworkManager/dispatcher.d"
147
148
149SUMMARY:libnm = "Libraries for adding NetworkManager support to applications"
150FILES:libnm = "\
151 ${libdir}/libnm.so.* \
152 ${libdir}/girepository-1.0/NM-1.0.typelib \
153"
154
155SUMMARY:${PN}-adsl = "ADSL device plugin for NetworkManager"
156FILES:${PN}-adsl = "${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-adsl.so"
157RDEPENDS:${PN}-adsl += "${PN}-daemon"
158
159SUMMARY:${PN}-bluetooth = "Bluetooth device plugin for NetworkManager"
160FILES:${PN}-bluetooth = "${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-bluetooth.so"
161RDEPENDS:${PN}-bluetooth += "${PN}-daemon ${@bb.utils.contains('PACKAGECONFIG', 'bluez5', '${PN}-wwan bluez5', '', d)}"
162
163SUMMARY:${PN}-cloud-setup = "Automatically configure NetworkManager in cloud"
164FILES:${PN}-cloud-setup = " \
165 ${libexecdir}/nm-cloud-setup \
166 ${systemd_system_unitdir}/nm-cloud-setup.service \
167 ${systemd_system_unitdir}/nm-cloud-setup.timer \
168 ${libdir}/NetworkManager/dispatcher.d/90-nm-cloud-setup.sh \
169 ${libdir}/NetworkManager/dispatcher.d/no-wait.d/90-nm-cloud-setup.sh \
170"
171RDEPENDS:${PN}-cloud-setup += "${PN}-daemon"
172ALLOW_EMPTY:${PN}-cloud-setup = "1"
173SYSTEMD_SERVICE:${PN}-cloud-setup = "${@bb.utils.contains('PACKAGECONFIG', 'cloud-setup', 'nm-cloud-setup.service nm-cloud-setup.timer', '', d)}"
174
175SUMMARY:${PN}-nmcli = "NetworkManager command line client"
176FILES:${PN}-nmcli = " \
177 ${bindir}/nmcli \
178"
179RDEPENDS:${PN}-nmcli += "${PN}-daemon"
180
181SUMMARY:${PN}-nmcli-bash-completion = "NetworkManager command line client bash completion"
182FILES:${PN}-nmcli-bash-completion = "${datadir}/bash-completion/completions/nmcli"
183RDEPENDS:${PN}-nmcli-bash-completion = "bash-completion"
184
185SUMMARY:${PN}-nmtui = "NetworkManager curses-based UI"
186FILES:${PN}-nmtui = " \
187 ${bindir}/nmtui \
188 ${bindir}/nmtui-edit \
189 ${bindir}/nmtui-connect \
190 ${bindir}/nmtui-hostname \
191"
192RDEPENDS:${PN}-nmtui += "${PN}-daemon"
193
194SUMMARY:${PN}-wifi = "Wifi plugin for NetworkManager"
195FILES:${PN}-wifi = "\
196 ${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-wifi.so \
197 ${libdir}/NetworkManager/conf.d/enable-iwd.conf \
198"
199def get_wifi_deps(d):
200 packageconfig = (d.getVar('PACKAGECONFIG') or "").split()
201 if 'wifi' in packageconfig:
202 if 'iwd' in packageconfig:
203 return 'iwd'
204 else:
205 return 'wpa-supplicant'
206 else:
207 return ''
208RDEPENDS:${PN}-wifi += "${PN}-daemon ${@get_wifi_deps(d)}"
209
210SUMMARY:${PN}-wwan = "Mobile broadband device plugin for NetworkManager"
211FILES:${PN}-wwan = "\
212 ${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-wwan.so \
213 ${NETWORKMANAGER_PLUGINDIR}/libnm-wwan.so \
214"
215RDEPENDS:${PN}-wwan += "${PN}-daemon ${@bb.utils.contains('PACKAGECONFIG','modemmanager','modemmanager','',d)}"
216
217SUMMARY:${PN}-ovs = "Open vSwitch device plugin for NetworkManager"
218FILES:${PN}-ovs = "\
219 ${NETWORKMANAGER_PLUGINDIR}/libnm-device-plugin-ovs.so \
220 ${systemd_system_unitdir}/NetworkManager.service.d/NetworkManager-ovs.conf \
221"
222RDEPENDS:${PN}-ovs += "${PN}-daemon"
223
224SUMMARY:${PN}-ppp = "PPP plugin for NetworkManager"
225FILES:${PN}-ppp = "\
226 ${NETWORKMANAGER_PLUGINDIR}/libnm-ppp-plugin.so \
227 ${libdir}/pppd/*/nm-pppd-plugin.so \
228"
229RDEPENDS:${PN}-ppp += "${PN}-daemon ${@bb.utils.contains('PACKAGECONFIG','ppp','ppp','',d)}"
230
231FILES:${PN}-dev += " \
232 ${libdir}/pppd/*/*.la \
233 ${libdir}/NetworkManager/*.la \
234 ${NETWORKMANAGER_PLUGINDIR}/*.la \
235 ${datadir}/dbus-1/interfaces/*.xml \
236"
237
238SUMMARY:${PN}-daemon += "The NetworkManager daemon"
239FILES:${PN}-daemon += " \
240 ${bindir}/nm-online \
241 ${datadir}/dbus-1 \
242 ${datadir}/polkit-1 \
243 ${libdir}/NetworkManager \
244 ${libexecdir} \
245 ${localstatedir}/lib/NetworkManager \
246 ${NETWORKMANAGER_DISPATCHERDIR} \
247 ${nonarch_base_libdir}/udev/* \
248 ${nonarch_libdir}/firewalld \
249 ${nonarch_libdir}/NetworkManager/conf.d \
250 ${nonarch_libdir}/NetworkManager/dispatcher.d/no-wait.d \
251 ${nonarch_libdir}/NetworkManager/dispatcher.d/pre-down.d \
252 ${nonarch_libdir}/NetworkManager/dispatcher.d/pre-up.d \
253 ${nonarch_libdir}/NetworkManager/system-connections \
254 ${nonarch_libdir}/NetworkManager/VPN \
255 ${sbindir}/NetworkManager \
256 ${sysconfdir}/init.d/network-manager \
257 ${sysconfdir}/NetworkManager \
258 ${sysconfdir}/resolv-conf.NetworkManager \
259 ${sysconfdir}/sysconfig/network-scripts \
260 ${systemd_system_unitdir} \
261"
262RDEPENDS:${PN}-daemon += "\
263 ${@bb.utils.contains('PACKAGECONFIG', 'ifupdown', 'bash', '', d)} \
264"
265RRECOMMENDS:${PN}-daemon += "\
266 ${NETWORKMANAGER_FIREWALL_DEFAULT} \
267 ${@bb.utils.filter('PACKAGECONFIG', 'dnsmasq', d)} \
268"
269INITSCRIPT_NAME:${PN}-daemon = "network-manager"
270SYSTEMD_SERVICE:${PN}-daemon = "\
271 NetworkManager.service \
272 NetworkManager-dispatcher.service \
273"
274RCONFLICTS:${PN}-daemon += "connman"
275ALTERNATIVE_PRIORITY = "100"
276ALTERNATIVE:${PN}-daemon = "${@bb.utils.contains('PACKAGECONFIG','man-resolv-conf','resolv-conf','',d)}"
277ALTERNATIVE_TARGET[resolv-conf] = "${@bb.utils.contains('PACKAGECONFIG','man-resolv-conf','${sysconfdir}/resolv-conf.NetworkManager','',d)}"
278ALTERNATIVE_LINK_NAME[resolv-conf] = "${@bb.utils.contains('PACKAGECONFIG','man-resolv-conf','${sysconfdir}/resolv.conf','',d)}"
279
280
281# The networkmanager package is an empty meta package which weakly depends on all the compiled features.
282# Install this package to get all plugins and related dependencies installed. Alternatively just install
283# plugins and related dependencies e.g. by installing networkmanager-wifi or networkmanager-wwan
284# packages to the firmware.
285ALLOW_EMPTY:${PN} = "1"
286RRECOMMENDS:${PN} += "\
287 ${@bb.utils.contains('PACKAGECONFIG','adsl','${PN}-adsl','',d)} \
288 ${@bb.utils.contains('PACKAGECONFIG','bluez5','${PN}-bluetooth','',d)} \
289 ${@bb.utils.contains('PACKAGECONFIG','cloud-setup','${PN}-cloud-setup','',d)} \
290 ${@bb.utils.contains('PACKAGECONFIG','nmcli','${PN}-nmcli','',d)} \
291 ${@bb.utils.contains('PACKAGECONFIG','nmtui','${PN}-nmtui','',d)} \
292 ${@bb.utils.contains('PACKAGECONFIG','wifi','${PN}-wifi','',d)} \
293 ${@bb.utils.contains('PACKAGECONFIG','wwan','${PN}-wwan','',d)} \
294 ${@bb.utils.contains('PACKAGECONFIG','ovs','${PN}-ovs','',d)} \
295 ${@bb.utils.contains('PACKAGECONFIG','ppp','${PN}-ppp','',d)} \
296"
297
298do_install:append() {
299 install -Dm 0755 ${UNPACKDIR}/${BPN}.initd ${D}${sysconfdir}/init.d/network-manager
300
301 rm -rf ${D}/run ${D}${localstatedir}/run
302
303 if ${@bb.utils.contains('PACKAGECONFIG','man-resolv-conf','true','false',d)}; then
304 # For read-only filesystem, do not create links during bootup
305 ln -sf ../run/NetworkManager/resolv.conf ${D}${sysconfdir}/resolv-conf.NetworkManager
306
307 # systemd v210 and newer do not need this rule file
308 rm ${D}/${nonarch_base_libdir}/udev/rules.d/84-nm-drivers.rules
309 fi
310
311 # Enable iwd if compiled
312 if ${@bb.utils.contains('PACKAGECONFIG','iwd','true','false',d)}; then
313 install -Dm 0644 ${UNPACKDIR}/enable-iwd.conf ${D}${nonarch_libdir}/NetworkManager/conf.d/enable-iwd.conf
314 fi
315
316 # Enable dhcpd if compiled
317 if ${@bb.utils.contains('PACKAGECONFIG','dhcpcd','true','false',d)}; then
318 install -Dm 0644 ${UNPACKDIR}/enable-dhcpcd.conf ${D}${nonarch_libdir}/NetworkManager/conf.d/enable-dhcpcd.conf
319 fi
320}