Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "A daemon for managing internet connections within embedded devices" |
| 2 | DESCRIPTION = "The ConnMan project provides a daemon for managing \ |
| 3 | internet connections within embedded devices running the Linux \ |
| 4 | operating system. The Connection Manager is designed to be slim and \ |
| 5 | to use as few resources as possible, so it can be easily integrated. \ |
| 6 | It is a fully modular system that can be extended, through plug-ins, \ |
| 7 | to support all kinds of wired or wireless technologies. Also, \ |
| 8 | configuration methods, like DHCP and domain name resolving, are \ |
| 9 | implemented using plug-ins." |
| 10 | HOMEPAGE = "http://connman.net/" |
| 11 | BUGTRACKER = "https://01.org/jira/browse/CM" |
| 12 | LICENSE = "GPLv2" |
| 13 | LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \ |
| 14 | file://src/main.c;beginline=1;endline=20;md5=486a279a6ab0c8d152bcda3a5b5edc36" |
| 15 | |
Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame] | 16 | inherit autotools pkgconfig systemd update-rc.d update-alternatives |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 17 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 18 | DEPENDS = "dbus glib-2.0 ppp" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 19 | |
| 20 | INC_PR = "r20" |
| 21 | |
| 22 | EXTRA_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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 29 | --disable-polkit \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 30 | " |
| 31 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 32 | PACKAGECONFIG ??= "wispr iptables client\ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 33 | ${@bb.utils.filter('DISTRO_FEATURES', '3g systemd wifi', d)} \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 34 | ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 35 | " |
| 36 | |
| 37 | # If you want ConnMan to support VPN, add following statement into |
| 38 | # local.conf or distro config |
| 39 | # PACKAGECONFIG_append_pn-connman = " openvpn vpnc l2tp pptp" |
| 40 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 41 | PACKAGECONFIG[systemd] = "--with-systemdunitdir=${systemd_unitdir}/system/ --with-tmpfilesdir=${sysconfdir}/tmpfiles.d/,--with-systemdunitdir='' --with-tmpfilesdir=''" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 42 | PACKAGECONFIG[wifi] = "--enable-wifi, --disable-wifi, wpa-supplicant, wpa-supplicant" |
Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame] | 43 | PACKAGECONFIG[bluez] = "--enable-bluetooth, --disable-bluetooth, bluez5, bluez5" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 44 | PACKAGECONFIG[3g] = "--enable-ofono, --disable-ofono, ofono, ofono" |
| 45 | PACKAGECONFIG[tist] = "--enable-tist,--disable-tist," |
| 46 | PACKAGECONFIG[openvpn] = "--enable-openvpn --with-openvpn=${sbindir}/openvpn,--disable-openvpn,,openvpn" |
| 47 | PACKAGECONFIG[vpnc] = "--enable-vpnc --with-vpnc=${sbindir}/vpnc,--disable-vpnc,,vpnc" |
| 48 | PACKAGECONFIG[l2tp] = "--enable-l2tp --with-l2tp=${sbindir}/xl2tpd,--disable-l2tp,,xl2tpd" |
| 49 | PACKAGECONFIG[pptp] = "--enable-pptp --with-pptp=${sbindir}/pptp,--disable-pptp,,pptp-linux" |
| 50 | # WISPr support for logging into hotspots, requires TLS |
| 51 | PACKAGECONFIG[wispr] = "--enable-wispr,--disable-wispr,gnutls," |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 52 | PACKAGECONFIG[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 Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 53 | PACKAGECONFIG[iptables] = "--with-firewall=iptables ,,iptables,iptables" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 54 | PACKAGECONFIG[nfc] = "--enable-neard, --disable-neard, neard, neard" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 55 | PACKAGECONFIG[client] = "--enable-client,--disable-client,readline" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 56 | |
| 57 | INITSCRIPT_NAME = "connman" |
| 58 | INITSCRIPT_PARAMS = "start 05 5 2 3 . stop 22 0 1 6 ." |
| 59 | |
| 60 | python __anonymous () { |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame] | 61 | systemd_packages = "${PN} ${PN}-wait-online" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 62 | pkgconfig = d.getVar('PACKAGECONFIG') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 63 | if ('openvpn' or 'vpnc' or 'l2tp' or 'pptp') in pkgconfig.split(): |
| 64 | systemd_packages += " ${PN}-vpn" |
| 65 | d.setVar('SYSTEMD_PACKAGES', systemd_packages) |
| 66 | } |
| 67 | |
| 68 | SYSTEMD_SERVICE_${PN} = "connman.service" |
| 69 | SYSTEMD_SERVICE_${PN}-vpn = "connman-vpn.service" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 70 | SYSTEMD_SERVICE_${PN}-wait-online = "connman-wait-online.service" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 71 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 72 | ALTERNATIVE_PRIORITY = "100" |
| 73 | ALTERNATIVE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','resolv-conf','',d)}" |
| 74 | ALTERNATIVE_TARGET[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv-conf.connman','',d)}" |
| 75 | ALTERNATIVE_LINK_NAME[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv.conf','',d)}" |
| 76 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 77 | do_install_append() { |
| 78 | if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then |
| 79 | install -d ${D}${sysconfdir}/init.d |
| 80 | install -m 0755 ${WORKDIR}/connman ${D}${sysconfdir}/init.d/connman |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 81 | sed -i s%@DATADIR@%${datadir}% ${D}${sysconfdir}/init.d/connman |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 82 | fi |
| 83 | |
| 84 | install -d ${D}${bindir} |
| 85 | install -m 0755 ${B}/tools/*-test ${D}${bindir} |
| 86 | if [ -e ${B}/tools/wispr ]; then |
| 87 | install -m 0755 ${B}/tools/wispr ${D}${bindir} |
| 88 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 89 | |
| 90 | # We don't need to package an empty directory |
| 91 | rmdir --ignore-fail-on-non-empty ${D}${libdir}/connman/scripts |
| 92 | |
| 93 | # Automake 1.12 won't install empty directories, but we need the |
| 94 | # plugins directory to be present for ownership |
| 95 | mkdir -p ${D}${libdir}/connman/plugins |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 96 | |
| 97 | # For read-only filesystem, do not create links during bootup |
| 98 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 99 | ln -sf ../run/connman/resolv.conf ${D}${sysconfdir}/resolv-conf.connman |
| 100 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 101 | } |
| 102 | |
| 103 | # These used to be plugins, but now they are core |
| 104 | RPROVIDES_${PN} = "\ |
| 105 | connman-plugin-loopback \ |
| 106 | connman-plugin-ethernet \ |
| 107 | ${@bb.utils.contains('PACKAGECONFIG', 'bluetooth','connman-plugin-bluetooth', '', d)} \ |
| 108 | ${@bb.utils.contains('PACKAGECONFIG', 'wifi','connman-plugin-wifi', '', d)} \ |
| 109 | ${@bb.utils.contains('PACKAGECONFIG', '3g','connman-plugin-ofono', '', d)} \ |
| 110 | " |
| 111 | |
| 112 | RDEPENDS_${PN} = "\ |
| 113 | dbus \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 114 | " |
| 115 | |
| 116 | PACKAGES_DYNAMIC += "^${PN}-plugin-.*" |
| 117 | |
| 118 | def add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, add_insane_skip): |
| 119 | plugintype = pkg.split( '-' )[-1] |
| 120 | if plugintype in depmap: |
| 121 | rdepends = map(lambda x: multilib_prefix + x, \ |
| 122 | depmap[plugintype].split()) |
| 123 | d.setVar("RDEPENDS_%s" % pkg, " ".join(rdepends)) |
| 124 | if add_insane_skip: |
| 125 | d.appendVar("INSANE_SKIP_%s" % pkg, "dev-so") |
| 126 | |
| 127 | python populate_packages_prepend() { |
| 128 | depmap = dict(pppd="ppp") |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 129 | multilib_prefix = (d.getVar("MLPREFIX") or "") |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 130 | |
| 131 | hook = lambda file,pkg,x,y,z: \ |
| 132 | add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, False) |
| 133 | plugin_dir = d.expand('${libdir}/connman/plugins/') |
| 134 | plugin_name = d.expand('${PN}-plugin-%s') |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 135 | do_split_packages(d, plugin_dir, r'^(.*).so$', plugin_name, \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 136 | '${PN} plugin for %s', extra_depends='', hook=hook, prepend=True ) |
| 137 | |
| 138 | hook = lambda file,pkg,x,y,z: \ |
| 139 | add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, True) |
| 140 | plugin_dir = d.expand('${libdir}/connman/plugins-vpn/') |
| 141 | plugin_name = d.expand('${PN}-plugin-vpn-%s') |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 142 | do_split_packages(d, plugin_dir, r'^(.*).so$', plugin_name, \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 143 | '${PN} VPN plugin for %s', extra_depends='', hook=hook, prepend=True ) |
| 144 | } |
| 145 | |
| 146 | PACKAGES =+ "${PN}-tools ${PN}-tests ${PN}-client" |
| 147 | |
| 148 | FILES_${PN}-tools = "${bindir}/wispr" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 149 | RDEPENDS_${PN}-tools ="${PN}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 150 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 151 | FILES_${PN}-tests = "${bindir}/*-test" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 152 | |
| 153 | FILES_${PN}-client = "${bindir}/connmanctl" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 154 | RDEPENDS_${PN}-client ="${PN}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 155 | |
| 156 | FILES_${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*.so.* \ |
| 157 | ${libdir}/connman/plugins \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 158 | ${sysconfdir} ${sharedstatedir} ${localstatedir} ${datadir} \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 159 | ${base_bindir}/* ${base_sbindir}/* ${base_libdir}/*.so* ${datadir}/${PN} \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 160 | ${datadir}/dbus-1/system-services/* \ |
| 161 | ${sysconfdir}/tmpfiles.d/connman_resolvconf.conf" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 162 | |
| 163 | FILES_${PN}-dev += "${libdir}/connman/*/*.la" |
| 164 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 165 | PACKAGES =+ "${PN}-vpn ${PN}-wait-online" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 166 | |
| 167 | SUMMARY_${PN}-vpn = "A daemon for managing VPN connections within embedded devices" |
| 168 | DESCRIPTION_${PN}-vpn = "The ConnMan VPN provides a daemon for \ |
| 169 | managing VPN connections within embedded devices running the Linux \ |
| 170 | operating system. The connman-vpnd handles all the VPN connections \ |
| 171 | and starts/stops VPN client processes when necessary. The connman-vpnd \ |
| 172 | provides a DBus API for managing VPN connections. All the different \ |
| 173 | VPN technogies are implemented using plug-ins." |
| 174 | FILES_${PN}-vpn += "${sbindir}/connman-vpnd \ |
| 175 | ${sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf \ |
| 176 | ${datadir}/dbus-1/system-services/net.connman.vpn.service \ |
| 177 | ${systemd_unitdir}/system/connman-vpn.service" |
| 178 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 179 | SUMMARY_${PN}-wait-online = "A program that will return once ConnMan has connected to a network" |
| 180 | DESCRIPTION_${PN}-wait-online = "A service that can be enabled so that \ |
| 181 | the system waits until a network connection is established." |
| 182 | FILES_${PN}-wait-online += "${sbindir}/connmand-wait-online \ |
| 183 | ${systemd_unitdir}/system/connman-wait-online.service" |
| 184 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 185 | SUMMARY_${PN}-plugin-vpn-openvpn = "An OpenVPN plugin for ConnMan VPN" |
| 186 | DESCRIPTION_${PN}-plugin-vpn-openvpn = "The ConnMan OpenVPN plugin uses openvpn client \ |
| 187 | to create a VPN connection to OpenVPN server." |
| 188 | FILES_${PN}-plugin-vpn-openvpn += "${libdir}/connman/scripts/openvpn-script \ |
| 189 | ${libdir}/connman/plugins-vpn/openvpn.so" |
| 190 | RDEPENDS_${PN}-plugin-vpn-openvpn += "${PN}-vpn" |
| 191 | RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','openvpn','${PN}-plugin-vpn-openvpn', '', d)}" |
| 192 | |
| 193 | SUMMARY_${PN}-plugin-vpn-vpnc = "A vpnc plugin for ConnMan VPN" |
| 194 | DESCRIPTION_${PN}-plugin-vpn-vpnc = "The ConnMan vpnc plugin uses vpnc client \ |
| 195 | to create a VPN connection to Cisco3000 VPN Concentrator." |
| 196 | FILES_${PN}-plugin-vpn-vpnc += "${libdir}/connman/scripts/openconnect-script \ |
| 197 | ${libdir}/connman/plugins-vpn/vpnc.so" |
| 198 | RDEPENDS_${PN}-plugin-vpn-vpnc += "${PN}-vpn" |
| 199 | RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','vpnc','${PN}-plugin-vpn-vpnc', '', d)}" |
| 200 | |
| 201 | SUMMARY_${PN}-plugin-vpn-l2tp = "A L2TP plugin for ConnMan VPN" |
| 202 | DESCRIPTION_${PN}-plugin-vpn-l2tp = "The ConnMan L2TP plugin uses xl2tpd daemon \ |
| 203 | to create a VPN connection to L2TP server." |
| 204 | FILES_${PN}-plugin-vpn-l2tp += "${libdir}/connman/scripts/libppp-plugin.so* \ |
| 205 | ${libdir}/connman/plugins-vpn/l2tp.so" |
| 206 | RDEPENDS_${PN}-plugin-vpn-l2tp += "${PN}-vpn" |
| 207 | RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','l2tp','${PN}-plugin-vpn-l2tp', '', d)}" |
| 208 | |
| 209 | SUMMARY_${PN}-plugin-vpn-pptp = "A PPTP plugin for ConnMan VPN" |
| 210 | DESCRIPTION_${PN}-plugin-vpn-pptp = "The ConnMan PPTP plugin uses pptp-linux client \ |
| 211 | to create a VPN connection to PPTP server." |
| 212 | FILES_${PN}-plugin-vpn-pptp += "${libdir}/connman/scripts/libppp-plugin.so* \ |
| 213 | ${libdir}/connman/plugins-vpn/pptp.so" |
| 214 | RDEPENDS_${PN}-plugin-vpn-pptp += "${PN}-vpn" |
| 215 | RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','pptp','${PN}-plugin-vpn-pptp', '', d)}" |