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