blob: d7af94f792bd7d8088292982779fbe9a01165c64 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "A daemon for managing internet connections within embedded devices"
2DESCRIPTION = "The ConnMan project provides a daemon for managing \
3internet connections within embedded devices running the Linux \
4operating system. The Connection Manager is designed to be slim and \
5to use as few resources as possible, so it can be easily integrated. \
6It is a fully modular system that can be extended, through plug-ins, \
7to support all kinds of wired or wireless technologies. Also, \
8configuration methods, like DHCP and domain name resolving, are \
9implemented using plug-ins."
10HOMEPAGE = "http://connman.net/"
11BUGTRACKER = "https://01.org/jira/browse/CM"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000012LICENSE = "GPL-2.0-only"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050013LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
14 file://src/main.c;beginline=1;endline=20;md5=486a279a6ab0c8d152bcda3a5b5edc36"
15
Brad Bishop96ff1982019-08-19 13:50:42 -040016inherit autotools pkgconfig systemd update-rc.d update-alternatives
Patrick Williamsc124f4f2015-09-15 14:41:29 -050017
Andrew Geissler5199d832021-09-24 16:47:35 -050018CVE_PRODUCT = "connman connection_manager"
19
Andrew Geissler82c905d2020-04-13 13:39:40 -050020DEPENDS = "dbus glib-2.0 ppp"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050021
Patrick Williamsc124f4f2015-09-15 14:41:29 -050022EXTRA_OECONF += "\
23 ac_cv_path_WPASUPPLICANT=${sbindir}/wpa_supplicant \
24 ac_cv_path_PPPD=${sbindir}/pppd \
25 --enable-debug \
26 --enable-loopback \
27 --enable-ethernet \
28 --enable-tools \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050029 --disable-polkit \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050030"
Patrick Williams92b42cb2022-09-03 06:53:57 -050031# For smooth operation it would be best to start only one wireless daemon at a time.
32# If wpa-supplicant is running, connman will use it preferentially.
33# Select either wpa-supplicant or iwd
34WIRELESS_DAEMON ??= "wpa-supplicant"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050035
Andrew Geissler82c905d2020-04-13 13:39:40 -050036PACKAGECONFIG ??= "wispr iptables client\
Patrick Williams92b42cb2022-09-03 06:53:57 -050037 ${@bb.utils.filter('DISTRO_FEATURES', '3g systemd', d)} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050038 ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
Patrick Williams92b42cb2022-09-03 06:53:57 -050039 ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'wifi ${WIRELESS_DAEMON}', '', d)} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050040"
41
42# If you want ConnMan to support VPN, add following statement into
43# local.conf or distro config
Patrick Williams213cb262021-08-07 19:21:33 -050044# PACKAGECONFIG:append:pn-connman = " openvpn vpnc l2tp pptp"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050045
Andrew Geissler5199d832021-09-24 16:47:35 -050046PACKAGECONFIG[systemd] = "--with-systemdunitdir=${systemd_system_unitdir}/ --with-tmpfilesdir=${sysconfdir}/tmpfiles.d/,--with-systemdunitdir='' --with-tmpfilesdir=''"
Patrick Williams92b42cb2022-09-03 06:53:57 -050047PACKAGECONFIG[wifi] = "--enable-wifi, --disable-wifi"
Brad Bishop96ff1982019-08-19 13:50:42 -040048PACKAGECONFIG[bluez] = "--enable-bluetooth, --disable-bluetooth, bluez5, bluez5"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050049PACKAGECONFIG[3g] = "--enable-ofono, --disable-ofono, ofono, ofono"
Patrick Williams92b42cb2022-09-03 06:53:57 -050050PACKAGECONFIG[wpa-supplicant] = ",,wpa-supplicant,wpa-supplicant"
51PACKAGECONFIG[iwd] = "--enable-iwd,--disable-iwd,,iwd"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050052PACKAGECONFIG[tist] = "--enable-tist,--disable-tist,"
53PACKAGECONFIG[openvpn] = "--enable-openvpn --with-openvpn=${sbindir}/openvpn,--disable-openvpn,,openvpn"
54PACKAGECONFIG[vpnc] = "--enable-vpnc --with-vpnc=${sbindir}/vpnc,--disable-vpnc,,vpnc"
55PACKAGECONFIG[l2tp] = "--enable-l2tp --with-l2tp=${sbindir}/xl2tpd,--disable-l2tp,,xl2tpd"
56PACKAGECONFIG[pptp] = "--enable-pptp --with-pptp=${sbindir}/pptp,--disable-pptp,,pptp-linux"
57# WISPr support for logging into hotspots, requires TLS
58PACKAGECONFIG[wispr] = "--enable-wispr,--disable-wispr,gnutls,"
Andrew Geissler82c905d2020-04-13 13:39:40 -050059PACKAGECONFIG[nftables] = "--with-firewall=nftables ,,libmnl libnftnl,,kernel-module-nf-tables kernel-module-nft-chain-nat-ipv4 kernel-module-nft-chain-route-ipv4 kernel-module-nft-masq-ipv4 kernel-module-nft-nat"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050060PACKAGECONFIG[iptables] = "--with-firewall=iptables ,,iptables,iptables"
Brad Bishopc342db32019-05-15 21:57:59 -040061PACKAGECONFIG[nfc] = "--enable-neard, --disable-neard, neard, neard"
Andrew Geissler82c905d2020-04-13 13:39:40 -050062PACKAGECONFIG[client] = "--enable-client,--disable-client,readline"
Andrew Geissler4b740dc2020-05-05 08:54:39 -050063PACKAGECONFIG[wireguard] = "--enable-wireguard,--disable-wireguard,libmnl"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050064
65INITSCRIPT_NAME = "connman"
66INITSCRIPT_PARAMS = "start 05 5 2 3 . stop 22 0 1 6 ."
67
68python __anonymous () {
Brad Bishop64c979e2019-11-04 13:55:29 -050069 systemd_packages = "${PN} ${PN}-wait-online"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050070 pkgconfig = d.getVar('PACKAGECONFIG')
Patrick Williamsc124f4f2015-09-15 14:41:29 -050071 if ('openvpn' or 'vpnc' or 'l2tp' or 'pptp') in pkgconfig.split():
72 systemd_packages += " ${PN}-vpn"
73 d.setVar('SYSTEMD_PACKAGES', systemd_packages)
74}
75
Patrick Williams213cb262021-08-07 19:21:33 -050076SYSTEMD_SERVICE:${PN} = "connman.service"
77SYSTEMD_SERVICE:${PN}-vpn = "connman-vpn.service"
78SYSTEMD_SERVICE:${PN}-wait-online = "connman-wait-online.service"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050079
Brad Bishopd7bf8c12018-02-25 22:55:05 -050080ALTERNATIVE_PRIORITY = "100"
Patrick Williams213cb262021-08-07 19:21:33 -050081ALTERNATIVE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','resolv-conf','',d)}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050082ALTERNATIVE_TARGET[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv-conf.connman','',d)}"
83ALTERNATIVE_LINK_NAME[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv.conf','',d)}"
84
Patrick Williams213cb262021-08-07 19:21:33 -050085do_install:append() {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050086 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
87 install -d ${D}${sysconfdir}/init.d
88 install -m 0755 ${WORKDIR}/connman ${D}${sysconfdir}/init.d/connman
Patrick Williamsf1e5d692016-03-30 15:21:19 -050089 sed -i s%@DATADIR@%${datadir}% ${D}${sysconfdir}/init.d/connman
Patrick Williamsc124f4f2015-09-15 14:41:29 -050090 fi
91
92 install -d ${D}${bindir}
93 install -m 0755 ${B}/tools/*-test ${D}${bindir}
94 if [ -e ${B}/tools/wispr ]; then
95 install -m 0755 ${B}/tools/wispr ${D}${bindir}
96 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050097
98 # We don't need to package an empty directory
99 rmdir --ignore-fail-on-non-empty ${D}${libdir}/connman/scripts
100
101 # Automake 1.12 won't install empty directories, but we need the
102 # plugins directory to be present for ownership
103 mkdir -p ${D}${libdir}/connman/plugins
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500104
105 # For read-only filesystem, do not create links during bootup
106 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
107 ln -sf ../run/connman/resolv.conf ${D}${sysconfdir}/resolv-conf.connman
108 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500109}
110
111# These used to be plugins, but now they are core
Patrick Williams213cb262021-08-07 19:21:33 -0500112RPROVIDES:${PN} = "\
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500113 connman-plugin-loopback \
114 connman-plugin-ethernet \
115 ${@bb.utils.contains('PACKAGECONFIG', 'bluetooth','connman-plugin-bluetooth', '', d)} \
116 ${@bb.utils.contains('PACKAGECONFIG', 'wifi','connman-plugin-wifi', '', d)} \
117 ${@bb.utils.contains('PACKAGECONFIG', '3g','connman-plugin-ofono', '', d)} \
118 "
119
Patrick Williams213cb262021-08-07 19:21:33 -0500120RDEPENDS:${PN} = "\
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500121 dbus \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500122 "
123
124PACKAGES_DYNAMIC += "^${PN}-plugin-.*"
125
126def add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, add_insane_skip):
127 plugintype = pkg.split( '-' )[-1]
128 if plugintype in depmap:
129 rdepends = map(lambda x: multilib_prefix + x, \
130 depmap[plugintype].split())
Patrick Williams213cb262021-08-07 19:21:33 -0500131 d.setVar("RDEPENDS:%s" % pkg, " ".join(rdepends))
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500132 if add_insane_skip:
Patrick Williams213cb262021-08-07 19:21:33 -0500133 d.appendVar("INSANE_SKIP:%s" % pkg, "dev-so")
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500134
Patrick Williams213cb262021-08-07 19:21:33 -0500135python populate_packages:prepend() {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500136 depmap = dict(pppd="ppp")
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500137 multilib_prefix = (d.getVar("MLPREFIX") or "")
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500138
139 hook = lambda file,pkg,x,y,z: \
140 add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, False)
141 plugin_dir = d.expand('${libdir}/connman/plugins/')
142 plugin_name = d.expand('${PN}-plugin-%s')
Brad Bishop19323692019-04-05 15:28:33 -0400143 do_split_packages(d, plugin_dir, r'^(.*).so$', plugin_name, \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500144 '${PN} plugin for %s', extra_depends='', hook=hook, prepend=True )
145
146 hook = lambda file,pkg,x,y,z: \
147 add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, True)
148 plugin_dir = d.expand('${libdir}/connman/plugins-vpn/')
149 plugin_name = d.expand('${PN}-plugin-vpn-%s')
Brad Bishop19323692019-04-05 15:28:33 -0400150 do_split_packages(d, plugin_dir, r'^(.*).so$', plugin_name, \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500151 '${PN} VPN plugin for %s', extra_depends='', hook=hook, prepend=True )
152}
153
154PACKAGES =+ "${PN}-tools ${PN}-tests ${PN}-client"
155
Patrick Williams213cb262021-08-07 19:21:33 -0500156FILES:${PN}-tools = "${bindir}/wispr"
157RDEPENDS:${PN}-tools ="${PN}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500158
Patrick Williams213cb262021-08-07 19:21:33 -0500159FILES:${PN}-tests = "${bindir}/*-test"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500160
Patrick Williams213cb262021-08-07 19:21:33 -0500161FILES:${PN}-client = "${bindir}/connmanctl"
162RDEPENDS:${PN}-client ="${PN}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500163
Patrick Williams213cb262021-08-07 19:21:33 -0500164FILES:${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*.so.* \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500165 ${libdir}/connman/plugins \
Brad Bishop19323692019-04-05 15:28:33 -0400166 ${sysconfdir} ${sharedstatedir} ${localstatedir} ${datadir} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500167 ${base_bindir}/* ${base_sbindir}/* ${base_libdir}/*.so* ${datadir}/${PN} \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500168 ${datadir}/dbus-1/system-services/* \
169 ${sysconfdir}/tmpfiles.d/connman_resolvconf.conf"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500170
Patrick Williams213cb262021-08-07 19:21:33 -0500171FILES:${PN}-dev += "${libdir}/connman/*/*.la"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500172
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500173PACKAGES =+ "${PN}-vpn ${PN}-wait-online"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500174
Patrick Williams213cb262021-08-07 19:21:33 -0500175SUMMARY:${PN}-vpn = "A daemon for managing VPN connections within embedded devices"
176DESCRIPTION:${PN}-vpn = "The ConnMan VPN provides a daemon for \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500177managing VPN connections within embedded devices running the Linux \
178operating system. The connman-vpnd handles all the VPN connections \
179and starts/stops VPN client processes when necessary. The connman-vpnd \
180provides a DBus API for managing VPN connections. All the different \
181VPN technogies are implemented using plug-ins."
Patrick Williams213cb262021-08-07 19:21:33 -0500182FILES:${PN}-vpn += "${sbindir}/connman-vpnd \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500183 ${sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf \
184 ${datadir}/dbus-1/system-services/net.connman.vpn.service \
Andrew Geissler5199d832021-09-24 16:47:35 -0500185 ${systemd_system_unitdir}/connman-vpn.service"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500186
Patrick Williams213cb262021-08-07 19:21:33 -0500187SUMMARY:${PN}-wait-online = "A program that will return once ConnMan has connected to a network"
188DESCRIPTION:${PN}-wait-online = "A service that can be enabled so that \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500189the system waits until a network connection is established."
Patrick Williams213cb262021-08-07 19:21:33 -0500190FILES:${PN}-wait-online += "${sbindir}/connmand-wait-online \
Andrew Geissler5199d832021-09-24 16:47:35 -0500191 ${systemd_system_unitdir}/connman-wait-online.service"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500192
Patrick Williams213cb262021-08-07 19:21:33 -0500193SUMMARY:${PN}-plugin-vpn-openvpn = "An OpenVPN plugin for ConnMan VPN"
194DESCRIPTION:${PN}-plugin-vpn-openvpn = "The ConnMan OpenVPN plugin uses openvpn client \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500195to create a VPN connection to OpenVPN server."
Patrick Williams213cb262021-08-07 19:21:33 -0500196FILES:${PN}-plugin-vpn-openvpn += "${libdir}/connman/scripts/openvpn-script \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500197 ${libdir}/connman/plugins-vpn/openvpn.so"
Patrick Williams213cb262021-08-07 19:21:33 -0500198RDEPENDS:${PN}-plugin-vpn-openvpn += "${PN}-vpn"
199RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG','openvpn','${PN}-plugin-vpn-openvpn', '', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500200
Patrick Williams213cb262021-08-07 19:21:33 -0500201SUMMARY:${PN}-plugin-vpn-vpnc = "A vpnc plugin for ConnMan VPN"
202DESCRIPTION:${PN}-plugin-vpn-vpnc = "The ConnMan vpnc plugin uses vpnc client \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500203to create a VPN connection to Cisco3000 VPN Concentrator."
Patrick Williams213cb262021-08-07 19:21:33 -0500204FILES:${PN}-plugin-vpn-vpnc += "${libdir}/connman/scripts/openconnect-script \
Andrew Geisslerc182c622020-05-15 14:13:32 -0500205 ${libdir}/connman/plugins-vpn/vpnc.so \
206 ${libdir}/connman/scripts/vpn-script"
Patrick Williams213cb262021-08-07 19:21:33 -0500207RDEPENDS:${PN}-plugin-vpn-vpnc += "${PN}-vpn"
208RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG','vpnc','${PN}-plugin-vpn-vpnc', '', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500209
Patrick Williams213cb262021-08-07 19:21:33 -0500210SUMMARY:${PN}-plugin-vpn-l2tp = "A L2TP plugin for ConnMan VPN"
211DESCRIPTION:${PN}-plugin-vpn-l2tp = "The ConnMan L2TP plugin uses xl2tpd daemon \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500212to create a VPN connection to L2TP server."
Patrick Williams213cb262021-08-07 19:21:33 -0500213FILES:${PN}-plugin-vpn-l2tp += "${libdir}/connman/scripts/libppp-plugin.so* \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500214 ${libdir}/connman/plugins-vpn/l2tp.so"
Patrick Williams213cb262021-08-07 19:21:33 -0500215RDEPENDS:${PN}-plugin-vpn-l2tp += "${PN}-vpn"
216RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG','l2tp','${PN}-plugin-vpn-l2tp', '', d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500217
Patrick Williams213cb262021-08-07 19:21:33 -0500218SUMMARY:${PN}-plugin-vpn-pptp = "A PPTP plugin for ConnMan VPN"
219DESCRIPTION:${PN}-plugin-vpn-pptp = "The ConnMan PPTP plugin uses pptp-linux client \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500220to create a VPN connection to PPTP server."
Patrick Williams213cb262021-08-07 19:21:33 -0500221FILES:${PN}-plugin-vpn-pptp += "${libdir}/connman/scripts/libppp-plugin.so* \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500222 ${libdir}/connman/plugins-vpn/pptp.so"
Patrick Williams213cb262021-08-07 19:21:33 -0500223RDEPENDS:${PN}-plugin-vpn-pptp += "${PN}-vpn"
224RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG','pptp','${PN}-plugin-vpn-pptp', '', d)}"