summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Kiernan <alex.kiernan@gmail.com>2025-04-02 16:02:17 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-04-02 21:28:12 +0100
commita062bf017cfe5b648b8fb0f6de35f450894c7926 (patch)
tree29aa06ee990a1e1e645d0ef98654c46799de498a
parent38c37272671e25d0fa131f919827dda89ea7e995 (diff)
downloadpoky-a062bf017cfe5b648b8fb0f6de35f450894c7926.tar.gz
connman: Rework to avoid splitting into many single binary packages
This recipe predates PACKAGECONFIG (or maybe widespread usage?) and so to use the VPN options they had to be both enabled at the PACKAGECONFIG level and then included as a separate package. In addition the list of VPN packages has drifted so (for example) wireguard was not delivered this way. Remove most of the subordinate packages and just populate the main connman package based on PACKAGECONFIG. Keep connman-client separate as `connmanctl` has a dependency on readline (which is GPLv3 licensed) and separate out connman-tools for `stats-tool` and connman-tests for all the test binaries (which possibly in the future could be used as the basis of a ptest package). (From OE-Core rev: f7eb48b7da6c3a1d4732f43fa4504ae2eedf3e83) Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-connectivity/connman/connman_1.44.bb159
1 files changed, 34 insertions, 125 deletions
diff --git a/meta/recipes-connectivity/connman/connman_1.44.bb b/meta/recipes-connectivity/connman/connman_1.44.bb
index 2622a8ebfe..b1616351b5 100644
--- a/meta/recipes-connectivity/connman/connman_1.44.bb
+++ b/meta/recipes-connectivity/connman/connman_1.44.bb
@@ -90,17 +90,11 @@ PACKAGECONFIG[wireguard] = "--enable-wireguard,--disable-wireguard,libmnl"
90INITSCRIPT_NAME = "connman" 90INITSCRIPT_NAME = "connman"
91INITSCRIPT_PARAMS = "start 05 5 2 3 . stop 22 0 1 6 ." 91INITSCRIPT_PARAMS = "start 05 5 2 3 . stop 22 0 1 6 ."
92 92
93python __anonymous () { 93SYSTEMD_SERVICE:${PN} = "\
94 systemd_packages = "${PN} ${PN}-wait-online" 94 connman.service \
95 pkgconfig = d.getVar('PACKAGECONFIG') 95 connman-wait-online.service \
96 if ('openvpn' or 'vpnc' or 'l2tp' or 'pptp') in pkgconfig.split(): 96 ${@bb.utils.contains_any('PACKAGECONFIG', ['openconnect', 'openvpn', 'vpnc', 'l2tp', 'pptp', 'wireguard'], 'connman-vpn.service', '', d)} \
97 systemd_packages += " ${PN}-vpn" 97"
98 d.setVar('SYSTEMD_PACKAGES', systemd_packages)
99}
100
101SYSTEMD_SERVICE:${PN} = "connman.service"
102SYSTEMD_SERVICE:${PN}-vpn = "connman-vpn.service"
103SYSTEMD_SERVICE:${PN}-wait-online = "connman-wait-online.service"
104 98
105ALTERNATIVE_PRIORITY = "100" 99ALTERNATIVE_PRIORITY = "100"
106ALTERNATIVE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','resolv-conf','',d)}" 100ALTERNATIVE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','resolv-conf','',d)}"
@@ -114,18 +108,15 @@ do_install:append() {
114 sed -i s%@DATADIR@%${datadir}% ${D}${sysconfdir}/init.d/connman 108 sed -i s%@DATADIR@%${datadir}% ${D}${sysconfdir}/init.d/connman
115 fi 109 fi
116 110
117 install -d ${D}${bindir} 111 for noinst_program in ${NOINST_TESTS} ${NOINST_TOOLS}; do
118 install -m 0755 ${B}/tools/*-test ${D}${bindir} 112 if [ -r "${B}/$noinst_program" ]; then
119 if [ -e ${B}/tools/wispr ]; then 113 install -d ${D}${bindir}
120 install -m 0755 ${B}/tools/wispr ${D}${bindir} 114 install -m 0755 "${B}/$noinst_program" ${D}${bindir}
121 fi 115 fi
116 done
122 117
123 # We don't need to package an empty directory 118 # We don't need to package an empty directory
124 rmdir --ignore-fail-on-non-empty ${D}${libdir}/connman/scripts 119 rmdir --ignore-fail-on-non-empty ${D}${libdir}/connman/scripts ${D}${libdir}/connman
125
126 # Automake 1.12 won't install empty directories, but we need the
127 # plugins directory to be present for ownership
128 mkdir -p ${D}${libdir}/connman/plugins
129 120
130 # For read-only filesystem, do not create links during bootup 121 # For read-only filesystem, do not create links during bootup
131 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then 122 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
@@ -134,113 +125,31 @@ do_install:append() {
134 fi 125 fi
135} 126}
136 127
137# These used to be plugins, but now they are core 128NOINST_TESTS = "tools/supplicant-test tools/dhcp-test tools/dhcp-server-test \
138RPROVIDES:${PN} = "\ 129 tools/addr-test tools/web-test tools/resolv-test tools/dbus-test \
139 connman-plugin-loopback \ 130 tools/polkit-test tools/wpad-test tools/private-network-test \
140 connman-plugin-ethernet \ 131 tools/session-test tools/dnsproxy-test tools/iptables-test tools/ip6tables-test \
141 ${@bb.utils.contains('PACKAGECONFIG', 'bluetooth','connman-plugin-bluetooth', '', d)} \ 132 tools/iptables-unit tools/dnsproxy-standalone \
142 ${@bb.utils.contains('PACKAGECONFIG', 'wifi','connman-plugin-wifi', '', d)} \ 133 unit/test-ippool unit/test-iptables \
143 ${@bb.utils.contains('PACKAGECONFIG', '3g','connman-plugin-ofono', '', d)} \ 134"
144 " 135NOINST_TOOLS = "tools/stats-tool tools/wispr"
145
146PACKAGES_DYNAMIC += "^${PN}-plugin-.*"
147
148def add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, add_insane_skip):
149 plugintype = pkg.split( '-' )[-1]
150 if plugintype in depmap:
151 rdepends = map(lambda x: multilib_prefix + x, \
152 depmap[plugintype].split())
153 d.setVar("RDEPENDS:%s" % pkg, " ".join(rdepends))
154 if add_insane_skip:
155 d.appendVar("INSANE_SKIP:%s" % pkg, "dev-so")
156
157python populate_packages:prepend() {
158 depmap = dict(pppd="ppp")
159 multilib_prefix = (d.getVar("MLPREFIX") or "")
160
161 hook = lambda file,pkg,x,y,z: \
162 add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, False)
163 plugin_dir = d.expand('${libdir}/connman/plugins/')
164 plugin_name = d.expand('${PN}-plugin-%s')
165 do_split_packages(d, plugin_dir, r'^(.*).so$', plugin_name, \
166 '${PN} plugin for %s', extra_depends='', hook=hook, prepend=True )
167
168 hook = lambda file,pkg,x,y,z: \
169 add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, True)
170 plugin_dir = d.expand('${libdir}/connman/plugins-vpn/')
171 plugin_name = d.expand('${PN}-plugin-vpn-%s')
172 do_split_packages(d, plugin_dir, r'^(.*).so$', plugin_name, \
173 '${PN} VPN plugin for %s', extra_depends='', hook=hook, prepend=True )
174}
175
176PACKAGES =+ "${PN}-tools ${PN}-tests ${PN}-client"
177 136
178FILES:${PN}-tools = "${bindir}/wispr" 137PACKAGE_BEFORE_PN = "${PN}-client ${PN}-tests ${PN}-tools"
179RDEPENDS:${PN}-tools = "${PN}"
180 138
181FILES:${PN}-tests = "${bindir}/*-test" 139FILES:${PN} += " \
140 ${datadir}/dbus-1/system-services \
141 ${datadir}/dbus-1/system.d \
142 ${datadir}/polkit-1 \
143 ${nonarch_libdir}/tmpfiles.d/*.conf \
144"
182 145
183FILES:${PN}-client = "${bindir}/connmanctl" 146FILES:${PN}-client = "${bindir}/connmanctl"
184RDEPENDS:${PN}-client = "${PN}" 147RDEPENDS:${PN}-client = "${PN}"
185 148
186FILES:${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*.so.* \ 149FILES:${PN}-tests = "${@ ' '.join([os.path.join('${bindir}', os.path.basename(noinst_program)) for noinst_program in NOINST_TESTS.split()]) }"
187 ${libdir}/connman/plugins \ 150RDEPENDS:${PN}-tests = "${PN}"
188 ${sysconfdir} ${sharedstatedir} ${localstatedir} ${datadir} \ 151ALLOW_EMPTY:${PN}-tests = "1"
189 ${base_bindir}/* ${base_sbindir}/* ${base_libdir}/*.so* ${datadir}/${PN} \ 152
190 ${datadir}/dbus-1/system-services/* \ 153FILES:${PN}-tools = "${@ ' '.join([os.path.join('${bindir}', os.path.basename(noinst_program)) for noinst_program in NOINST_TOOLS.split()]) }"
191 ${sysconfdir}/tmpfiles.d/connman_resolvconf.conf" 154RDEPENDS:${PN}-tools = "${PN}"
192 155ALLOW_EMPTY:${PN}-tools = "1"
193FILES:${PN}-dev += "${libdir}/connman/*/*.la"
194
195PACKAGES =+ "${PN}-vpn ${PN}-wait-online"
196
197SUMMARY:${PN}-vpn = "A daemon for managing VPN connections within embedded devices"
198DESCRIPTION:${PN}-vpn = "The ConnMan VPN provides a daemon for \
199managing VPN connections within embedded devices running the Linux \
200operating system. The connman-vpnd handles all the VPN connections \
201and starts/stops VPN client processes when necessary. The connman-vpnd \
202provides a DBus API for managing VPN connections. All the different \
203VPN technogies are implemented using plug-ins."
204FILES:${PN}-vpn += "${sbindir}/connman-vpnd \
205 ${sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf \
206 ${datadir}/dbus-1/system-services/net.connman.vpn.service \
207 ${systemd_system_unitdir}/connman-vpn.service"
208
209SUMMARY:${PN}-wait-online = "A program that will return once ConnMan has connected to a network"
210DESCRIPTION:${PN}-wait-online = "A service that can be enabled so that \
211the system waits until a network connection is established."
212FILES:${PN}-wait-online += "${sbindir}/connmand-wait-online \
213 ${systemd_system_unitdir}/connman-wait-online.service"
214
215SUMMARY:${PN}-plugin-vpn-openvpn = "An OpenVPN plugin for ConnMan VPN"
216DESCRIPTION:${PN}-plugin-vpn-openvpn = "The ConnMan OpenVPN plugin uses openvpn client \
217to create a VPN connection to OpenVPN server."
218FILES:${PN}-plugin-vpn-openvpn += "${libdir}/connman/scripts/openvpn-script \
219 ${libdir}/connman/plugins-vpn/openvpn.so"
220RDEPENDS:${PN}-plugin-vpn-openvpn += "${PN}-vpn"
221RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG','openvpn','${PN}-plugin-vpn-openvpn', '', d)}"
222
223SUMMARY:${PN}-plugin-vpn-vpnc = "A vpnc plugin for ConnMan VPN"
224DESCRIPTION:${PN}-plugin-vpn-vpnc = "The ConnMan vpnc plugin uses vpnc client \
225to create a VPN connection to Cisco3000 VPN Concentrator."
226FILES:${PN}-plugin-vpn-vpnc += "${libdir}/connman/scripts/openconnect-script \
227 ${libdir}/connman/plugins-vpn/vpnc.so \
228 ${libdir}/connman/scripts/vpn-script"
229RDEPENDS:${PN}-plugin-vpn-vpnc += "${PN}-vpn"
230RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG','vpnc','${PN}-plugin-vpn-vpnc', '', d)}"
231
232SUMMARY:${PN}-plugin-vpn-l2tp = "A L2TP plugin for ConnMan VPN"
233DESCRIPTION:${PN}-plugin-vpn-l2tp = "The ConnMan L2TP plugin uses xl2tpd daemon \
234to create a VPN connection to L2TP server."
235FILES:${PN}-plugin-vpn-l2tp += "${libdir}/connman/scripts/libppp-plugin.so* \
236 ${libdir}/connman/plugins-vpn/l2tp.so"
237RDEPENDS:${PN}-plugin-vpn-l2tp += "${PN}-vpn"
238RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG','l2tp','${PN}-plugin-vpn-l2tp', '', d)}"
239
240SUMMARY:${PN}-plugin-vpn-pptp = "A PPTP plugin for ConnMan VPN"
241DESCRIPTION:${PN}-plugin-vpn-pptp = "The ConnMan PPTP plugin uses pptp-linux client \
242to create a VPN connection to PPTP server."
243FILES:${PN}-plugin-vpn-pptp += "${libdir}/connman/scripts/libppp-plugin.so* \
244 ${libdir}/connman/plugins-vpn/pptp.so"
245RDEPENDS:${PN}-plugin-vpn-pptp += "${PN}-vpn"
246RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG','pptp','${PN}-plugin-vpn-pptp', '', d)}"