diff options
| -rw-r--r-- | meta/recipes-connectivity/connman/connman.inc | 221 | ||||
| -rw-r--r-- | meta/recipes-connectivity/connman/connman_1.44.bb | 223 |
2 files changed, 221 insertions, 223 deletions
diff --git a/meta/recipes-connectivity/connman/connman.inc b/meta/recipes-connectivity/connman/connman.inc deleted file mode 100644 index 804c2db9a7..0000000000 --- a/meta/recipes-connectivity/connman/connman.inc +++ /dev/null | |||
| @@ -1,221 +0,0 @@ | |||
| 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 = "GPL-2.0-only" | ||
| 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 update-alternatives | ||
| 17 | |||
| 18 | CVE_PRODUCT = "connman connection_manager" | ||
| 19 | |||
| 20 | DEPENDS = "dbus glib-2.0 ppp" | ||
| 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 \ | ||
| 29 | --disable-polkit \ | ||
| 30 | --runstatedir=/run \ | ||
| 31 | " | ||
| 32 | # For smooth operation it would be best to start only one wireless daemon at a time. | ||
| 33 | # If wpa-supplicant is running, connman will use it preferentially. | ||
| 34 | # Select either wpa-supplicant or iwd | ||
| 35 | WIRELESS_DAEMON ??= "wpa-supplicant" | ||
| 36 | |||
| 37 | PACKAGECONFIG ??= "wispr iptables client\ | ||
| 38 | ${@bb.utils.filter('DISTRO_FEATURES', '3g systemd', d)} \ | ||
| 39 | ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \ | ||
| 40 | ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'wifi ${WIRELESS_DAEMON}', '', d)} \ | ||
| 41 | " | ||
| 42 | |||
| 43 | # If you want ConnMan to support VPN, add following statement into | ||
| 44 | # local.conf or distro config | ||
| 45 | # PACKAGECONFIG:append:pn-connman = " openvpn vpnc l2tp pptp" | ||
| 46 | |||
| 47 | PACKAGECONFIG[systemd] = "--with-systemdunitdir=${systemd_system_unitdir}/ --with-tmpfilesdir=${sysconfdir}/tmpfiles.d/,--with-systemdunitdir='' --with-tmpfilesdir=''" | ||
| 48 | PACKAGECONFIG[wifi] = "--enable-wifi, --disable-wifi" | ||
| 49 | PACKAGECONFIG[bluez] = "--enable-bluetooth, --disable-bluetooth, bluez5, bluez5" | ||
| 50 | PACKAGECONFIG[3g] = "--enable-ofono, --disable-ofono, ofono, ofono" | ||
| 51 | PACKAGECONFIG[wpa-supplicant] = ",,wpa-supplicant,wpa-supplicant" | ||
| 52 | PACKAGECONFIG[iwd] = "--enable-iwd,--disable-iwd,,iwd" | ||
| 53 | PACKAGECONFIG[tist] = "--enable-tist,--disable-tist," | ||
| 54 | PACKAGECONFIG[openvpn] = "--enable-openvpn --with-openvpn=${sbindir}/openvpn,--disable-openvpn,,openvpn" | ||
| 55 | PACKAGECONFIG[vpnc] = "--enable-vpnc --with-vpnc=${sbindir}/vpnc,--disable-vpnc,,vpnc" | ||
| 56 | PACKAGECONFIG[l2tp] = "--enable-l2tp --with-l2tp=${sbindir}/xl2tpd,--disable-l2tp,,xl2tpd" | ||
| 57 | PACKAGECONFIG[pptp] = "--enable-pptp --with-pptp=${sbindir}/pptp,--disable-pptp,,pptp-linux" | ||
| 58 | # WISPr support for logging into hotspots, requires TLS | ||
| 59 | PACKAGECONFIG[wispr] = "--enable-wispr,--disable-wispr,gnutls," | ||
| 60 | 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" | ||
| 61 | PACKAGECONFIG[iptables] = "--with-firewall=iptables ,,iptables,iptables" | ||
| 62 | PACKAGECONFIG[nfc] = "--enable-neard, --disable-neard, neard, neard" | ||
| 63 | PACKAGECONFIG[client] = "--enable-client,--disable-client,readline" | ||
| 64 | PACKAGECONFIG[wireguard] = "--enable-wireguard,--disable-wireguard,libmnl" | ||
| 65 | |||
| 66 | INITSCRIPT_NAME = "connman" | ||
| 67 | INITSCRIPT_PARAMS = "start 05 5 2 3 . stop 22 0 1 6 ." | ||
| 68 | |||
| 69 | python __anonymous () { | ||
| 70 | systemd_packages = "${PN} ${PN}-wait-online" | ||
| 71 | pkgconfig = d.getVar('PACKAGECONFIG') | ||
| 72 | if ('openvpn' or 'vpnc' or 'l2tp' or 'pptp') in pkgconfig.split(): | ||
| 73 | systemd_packages += " ${PN}-vpn" | ||
| 74 | d.setVar('SYSTEMD_PACKAGES', systemd_packages) | ||
| 75 | } | ||
| 76 | |||
| 77 | SYSTEMD_SERVICE:${PN} = "connman.service" | ||
| 78 | SYSTEMD_SERVICE:${PN}-vpn = "connman-vpn.service" | ||
| 79 | SYSTEMD_SERVICE:${PN}-wait-online = "connman-wait-online.service" | ||
| 80 | |||
| 81 | ALTERNATIVE_PRIORITY = "100" | ||
| 82 | ALTERNATIVE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','resolv-conf','',d)}" | ||
| 83 | ALTERNATIVE_TARGET[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv-conf.connman','',d)}" | ||
| 84 | ALTERNATIVE_LINK_NAME[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv.conf','',d)}" | ||
| 85 | |||
| 86 | do_install:append() { | ||
| 87 | if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then | ||
| 88 | install -d ${D}${sysconfdir}/init.d | ||
| 89 | install -m 0755 ${UNPACKDIR}/connman ${D}${sysconfdir}/init.d/connman | ||
| 90 | sed -i s%@DATADIR@%${datadir}% ${D}${sysconfdir}/init.d/connman | ||
| 91 | fi | ||
| 92 | |||
| 93 | install -d ${D}${bindir} | ||
| 94 | install -m 0755 ${B}/tools/*-test ${D}${bindir} | ||
| 95 | if [ -e ${B}/tools/wispr ]; then | ||
| 96 | install -m 0755 ${B}/tools/wispr ${D}${bindir} | ||
| 97 | fi | ||
| 98 | |||
| 99 | # We don't need to package an empty directory | ||
| 100 | rmdir --ignore-fail-on-non-empty ${D}${libdir}/connman/scripts | ||
| 101 | |||
| 102 | # Automake 1.12 won't install empty directories, but we need the | ||
| 103 | # plugins directory to be present for ownership | ||
| 104 | mkdir -p ${D}${libdir}/connman/plugins | ||
| 105 | |||
| 106 | # For read-only filesystem, do not create links during bootup | ||
| 107 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then | ||
| 108 | ln -sf ../run/connman/resolv.conf ${D}${sysconfdir}/resolv-conf.connman | ||
| 109 | fi | ||
| 110 | } | ||
| 111 | |||
| 112 | # These used to be plugins, but now they are core | ||
| 113 | RPROVIDES:${PN} = "\ | ||
| 114 | connman-plugin-loopback \ | ||
| 115 | connman-plugin-ethernet \ | ||
| 116 | ${@bb.utils.contains('PACKAGECONFIG', 'bluetooth','connman-plugin-bluetooth', '', d)} \ | ||
| 117 | ${@bb.utils.contains('PACKAGECONFIG', 'wifi','connman-plugin-wifi', '', d)} \ | ||
| 118 | ${@bb.utils.contains('PACKAGECONFIG', '3g','connman-plugin-ofono', '', d)} \ | ||
| 119 | " | ||
| 120 | |||
| 121 | PACKAGES_DYNAMIC += "^${PN}-plugin-.*" | ||
| 122 | |||
| 123 | def add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, add_insane_skip): | ||
| 124 | plugintype = pkg.split( '-' )[-1] | ||
| 125 | if plugintype in depmap: | ||
| 126 | rdepends = map(lambda x: multilib_prefix + x, \ | ||
| 127 | depmap[plugintype].split()) | ||
| 128 | d.setVar("RDEPENDS:%s" % pkg, " ".join(rdepends)) | ||
| 129 | if add_insane_skip: | ||
| 130 | d.appendVar("INSANE_SKIP:%s" % pkg, "dev-so") | ||
| 131 | |||
| 132 | python populate_packages:prepend() { | ||
| 133 | depmap = dict(pppd="ppp") | ||
| 134 | multilib_prefix = (d.getVar("MLPREFIX") or "") | ||
| 135 | |||
| 136 | hook = lambda file,pkg,x,y,z: \ | ||
| 137 | add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, False) | ||
| 138 | plugin_dir = d.expand('${libdir}/connman/plugins/') | ||
| 139 | plugin_name = d.expand('${PN}-plugin-%s') | ||
| 140 | do_split_packages(d, plugin_dir, r'^(.*).so$', plugin_name, \ | ||
| 141 | '${PN} plugin for %s', extra_depends='', hook=hook, prepend=True ) | ||
| 142 | |||
| 143 | hook = lambda file,pkg,x,y,z: \ | ||
| 144 | add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, True) | ||
| 145 | plugin_dir = d.expand('${libdir}/connman/plugins-vpn/') | ||
| 146 | plugin_name = d.expand('${PN}-plugin-vpn-%s') | ||
| 147 | do_split_packages(d, plugin_dir, r'^(.*).so$', plugin_name, \ | ||
| 148 | '${PN} VPN plugin for %s', extra_depends='', hook=hook, prepend=True ) | ||
| 149 | } | ||
| 150 | |||
| 151 | PACKAGES =+ "${PN}-tools ${PN}-tests ${PN}-client" | ||
| 152 | |||
| 153 | FILES:${PN}-tools = "${bindir}/wispr" | ||
| 154 | RDEPENDS:${PN}-tools = "${PN}" | ||
| 155 | |||
| 156 | FILES:${PN}-tests = "${bindir}/*-test" | ||
| 157 | |||
| 158 | FILES:${PN}-client = "${bindir}/connmanctl" | ||
| 159 | RDEPENDS:${PN}-client = "${PN}" | ||
| 160 | |||
| 161 | FILES:${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*.so.* \ | ||
| 162 | ${libdir}/connman/plugins \ | ||
| 163 | ${sysconfdir} ${sharedstatedir} ${localstatedir} ${datadir} \ | ||
| 164 | ${base_bindir}/* ${base_sbindir}/* ${base_libdir}/*.so* ${datadir}/${PN} \ | ||
| 165 | ${datadir}/dbus-1/system-services/* \ | ||
| 166 | ${sysconfdir}/tmpfiles.d/connman_resolvconf.conf" | ||
| 167 | |||
| 168 | FILES:${PN}-dev += "${libdir}/connman/*/*.la" | ||
| 169 | |||
| 170 | PACKAGES =+ "${PN}-vpn ${PN}-wait-online" | ||
| 171 | |||
| 172 | SUMMARY:${PN}-vpn = "A daemon for managing VPN connections within embedded devices" | ||
| 173 | DESCRIPTION:${PN}-vpn = "The ConnMan VPN provides a daemon for \ | ||
| 174 | managing VPN connections within embedded devices running the Linux \ | ||
| 175 | operating system. The connman-vpnd handles all the VPN connections \ | ||
| 176 | and starts/stops VPN client processes when necessary. The connman-vpnd \ | ||
| 177 | provides a DBus API for managing VPN connections. All the different \ | ||
| 178 | VPN technogies are implemented using plug-ins." | ||
| 179 | FILES:${PN}-vpn += "${sbindir}/connman-vpnd \ | ||
| 180 | ${sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf \ | ||
| 181 | ${datadir}/dbus-1/system-services/net.connman.vpn.service \ | ||
| 182 | ${systemd_system_unitdir}/connman-vpn.service" | ||
| 183 | |||
| 184 | SUMMARY:${PN}-wait-online = "A program that will return once ConnMan has connected to a network" | ||
| 185 | DESCRIPTION:${PN}-wait-online = "A service that can be enabled so that \ | ||
| 186 | the system waits until a network connection is established." | ||
| 187 | FILES:${PN}-wait-online += "${sbindir}/connmand-wait-online \ | ||
| 188 | ${systemd_system_unitdir}/connman-wait-online.service" | ||
| 189 | |||
| 190 | SUMMARY:${PN}-plugin-vpn-openvpn = "An OpenVPN plugin for ConnMan VPN" | ||
| 191 | DESCRIPTION:${PN}-plugin-vpn-openvpn = "The ConnMan OpenVPN plugin uses openvpn client \ | ||
| 192 | to create a VPN connection to OpenVPN server." | ||
| 193 | FILES:${PN}-plugin-vpn-openvpn += "${libdir}/connman/scripts/openvpn-script \ | ||
| 194 | ${libdir}/connman/plugins-vpn/openvpn.so" | ||
| 195 | RDEPENDS:${PN}-plugin-vpn-openvpn += "${PN}-vpn" | ||
| 196 | RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG','openvpn','${PN}-plugin-vpn-openvpn', '', d)}" | ||
| 197 | |||
| 198 | SUMMARY:${PN}-plugin-vpn-vpnc = "A vpnc plugin for ConnMan VPN" | ||
| 199 | DESCRIPTION:${PN}-plugin-vpn-vpnc = "The ConnMan vpnc plugin uses vpnc client \ | ||
| 200 | to create a VPN connection to Cisco3000 VPN Concentrator." | ||
| 201 | FILES:${PN}-plugin-vpn-vpnc += "${libdir}/connman/scripts/openconnect-script \ | ||
| 202 | ${libdir}/connman/plugins-vpn/vpnc.so \ | ||
| 203 | ${libdir}/connman/scripts/vpn-script" | ||
| 204 | RDEPENDS:${PN}-plugin-vpn-vpnc += "${PN}-vpn" | ||
| 205 | RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG','vpnc','${PN}-plugin-vpn-vpnc', '', d)}" | ||
| 206 | |||
| 207 | SUMMARY:${PN}-plugin-vpn-l2tp = "A L2TP plugin for ConnMan VPN" | ||
| 208 | DESCRIPTION:${PN}-plugin-vpn-l2tp = "The ConnMan L2TP plugin uses xl2tpd daemon \ | ||
| 209 | to create a VPN connection to L2TP server." | ||
| 210 | FILES:${PN}-plugin-vpn-l2tp += "${libdir}/connman/scripts/libppp-plugin.so* \ | ||
| 211 | ${libdir}/connman/plugins-vpn/l2tp.so" | ||
| 212 | RDEPENDS:${PN}-plugin-vpn-l2tp += "${PN}-vpn" | ||
| 213 | RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG','l2tp','${PN}-plugin-vpn-l2tp', '', d)}" | ||
| 214 | |||
| 215 | SUMMARY:${PN}-plugin-vpn-pptp = "A PPTP plugin for ConnMan VPN" | ||
| 216 | DESCRIPTION:${PN}-plugin-vpn-pptp = "The ConnMan PPTP plugin uses pptp-linux client \ | ||
| 217 | to create a VPN connection to PPTP server." | ||
| 218 | FILES:${PN}-plugin-vpn-pptp += "${libdir}/connman/scripts/libppp-plugin.so* \ | ||
| 219 | ${libdir}/connman/plugins-vpn/pptp.so" | ||
| 220 | RDEPENDS:${PN}-plugin-vpn-pptp += "${PN}-vpn" | ||
| 221 | RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG','pptp','${PN}-plugin-vpn-pptp', '', d)}" | ||
diff --git a/meta/recipes-connectivity/connman/connman_1.44.bb b/meta/recipes-connectivity/connman/connman_1.44.bb index 396d8bc5ce..1cd97d342f 100644 --- a/meta/recipes-connectivity/connman/connman_1.44.bb +++ b/meta/recipes-connectivity/connman/connman_1.44.bb | |||
| @@ -1,4 +1,23 @@ | |||
| 1 | require connman.inc | 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 = "GPL-2.0-only" | ||
| 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 update-alternatives | ||
| 17 | |||
| 18 | CVE_PRODUCT = "connman connection_manager" | ||
| 19 | |||
| 20 | DEPENDS = "dbus glib-2.0 ppp" | ||
| 2 | 21 | ||
| 3 | SRC_URI = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \ | 22 | SRC_URI = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \ |
| 4 | file://0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch \ | 23 | file://0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch \ |
| @@ -8,8 +27,208 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \ | |||
| 8 | file://0002-resolve-musl-does-not-implement-res_ninit.patch \ | 27 | file://0002-resolve-musl-does-not-implement-res_ninit.patch \ |
| 9 | " | 28 | " |
| 10 | 29 | ||
| 11 | |||
| 12 | SRC_URI[sha256sum] = "2be2b00321632b775f9eff713acd04ef21e31fbf388f6ebf45512ff4289574ff" | 30 | SRC_URI[sha256sum] = "2be2b00321632b775f9eff713acd04ef21e31fbf388f6ebf45512ff4289574ff" |
| 13 | 31 | ||
| 14 | RRECOMMENDS:${PN} = "connman-conf" | 32 | RRECOMMENDS:${PN} = "connman-conf" |
| 15 | RCONFLICTS:${PN} = "networkmanager" | 33 | RCONFLICTS:${PN} = "networkmanager" |
| 34 | |||
| 35 | EXTRA_OECONF += "\ | ||
| 36 | ac_cv_path_WPASUPPLICANT=${sbindir}/wpa_supplicant \ | ||
| 37 | ac_cv_path_PPPD=${sbindir}/pppd \ | ||
| 38 | --enable-debug \ | ||
| 39 | --enable-loopback \ | ||
| 40 | --enable-ethernet \ | ||
| 41 | --enable-tools \ | ||
| 42 | --disable-polkit \ | ||
| 43 | --runstatedir=/run \ | ||
| 44 | " | ||
| 45 | # For smooth operation it would be best to start only one wireless daemon at a time. | ||
| 46 | # If wpa-supplicant is running, connman will use it preferentially. | ||
| 47 | # Select either wpa-supplicant or iwd | ||
| 48 | WIRELESS_DAEMON ??= "wpa-supplicant" | ||
| 49 | |||
| 50 | PACKAGECONFIG ??= "wispr iptables client\ | ||
| 51 | ${@bb.utils.filter('DISTRO_FEATURES', '3g systemd', d)} \ | ||
| 52 | ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \ | ||
| 53 | ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'wifi ${WIRELESS_DAEMON}', '', d)} \ | ||
| 54 | " | ||
| 55 | |||
| 56 | # If you want ConnMan to support VPN, add following statement into | ||
| 57 | # local.conf or distro config | ||
| 58 | # PACKAGECONFIG:append:pn-connman = " openvpn vpnc l2tp pptp" | ||
| 59 | |||
| 60 | PACKAGECONFIG[systemd] = "--with-systemdunitdir=${systemd_system_unitdir}/ --with-tmpfilesdir=${sysconfdir}/tmpfiles.d/,--with-systemdunitdir='' --with-tmpfilesdir=''" | ||
| 61 | PACKAGECONFIG[wifi] = "--enable-wifi, --disable-wifi" | ||
| 62 | PACKAGECONFIG[bluez] = "--enable-bluetooth, --disable-bluetooth, bluez5, bluez5" | ||
| 63 | PACKAGECONFIG[3g] = "--enable-ofono, --disable-ofono, ofono, ofono" | ||
| 64 | PACKAGECONFIG[wpa-supplicant] = ",,wpa-supplicant,wpa-supplicant" | ||
| 65 | PACKAGECONFIG[iwd] = "--enable-iwd,--disable-iwd,,iwd" | ||
| 66 | PACKAGECONFIG[tist] = "--enable-tist,--disable-tist," | ||
| 67 | PACKAGECONFIG[openvpn] = "--enable-openvpn --with-openvpn=${sbindir}/openvpn,--disable-openvpn,,openvpn" | ||
| 68 | PACKAGECONFIG[vpnc] = "--enable-vpnc --with-vpnc=${sbindir}/vpnc,--disable-vpnc,,vpnc" | ||
| 69 | PACKAGECONFIG[l2tp] = "--enable-l2tp --with-l2tp=${sbindir}/xl2tpd,--disable-l2tp,,xl2tpd" | ||
| 70 | PACKAGECONFIG[pptp] = "--enable-pptp --with-pptp=${sbindir}/pptp,--disable-pptp,,pptp-linux" | ||
| 71 | # WISPr support for logging into hotspots, requires TLS | ||
| 72 | PACKAGECONFIG[wispr] = "--enable-wispr,--disable-wispr,gnutls," | ||
| 73 | 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" | ||
| 74 | PACKAGECONFIG[iptables] = "--with-firewall=iptables ,,iptables,iptables" | ||
| 75 | PACKAGECONFIG[nfc] = "--enable-neard, --disable-neard, neard, neard" | ||
| 76 | PACKAGECONFIG[client] = "--enable-client,--disable-client,readline" | ||
| 77 | PACKAGECONFIG[wireguard] = "--enable-wireguard,--disable-wireguard,libmnl" | ||
| 78 | |||
| 79 | INITSCRIPT_NAME = "connman" | ||
| 80 | INITSCRIPT_PARAMS = "start 05 5 2 3 . stop 22 0 1 6 ." | ||
| 81 | |||
| 82 | python __anonymous () { | ||
| 83 | systemd_packages = "${PN} ${PN}-wait-online" | ||
| 84 | pkgconfig = d.getVar('PACKAGECONFIG') | ||
| 85 | if ('openvpn' or 'vpnc' or 'l2tp' or 'pptp') in pkgconfig.split(): | ||
| 86 | systemd_packages += " ${PN}-vpn" | ||
| 87 | d.setVar('SYSTEMD_PACKAGES', systemd_packages) | ||
| 88 | } | ||
| 89 | |||
| 90 | SYSTEMD_SERVICE:${PN} = "connman.service" | ||
| 91 | SYSTEMD_SERVICE:${PN}-vpn = "connman-vpn.service" | ||
| 92 | SYSTEMD_SERVICE:${PN}-wait-online = "connman-wait-online.service" | ||
| 93 | |||
| 94 | ALTERNATIVE_PRIORITY = "100" | ||
| 95 | ALTERNATIVE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','resolv-conf','',d)}" | ||
| 96 | ALTERNATIVE_TARGET[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv-conf.connman','',d)}" | ||
| 97 | ALTERNATIVE_LINK_NAME[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv.conf','',d)}" | ||
| 98 | |||
| 99 | do_install:append() { | ||
| 100 | if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then | ||
| 101 | install -d ${D}${sysconfdir}/init.d | ||
| 102 | install -m 0755 ${UNPACKDIR}/connman ${D}${sysconfdir}/init.d/connman | ||
| 103 | sed -i s%@DATADIR@%${datadir}% ${D}${sysconfdir}/init.d/connman | ||
| 104 | fi | ||
| 105 | |||
| 106 | install -d ${D}${bindir} | ||
| 107 | install -m 0755 ${B}/tools/*-test ${D}${bindir} | ||
| 108 | if [ -e ${B}/tools/wispr ]; then | ||
| 109 | install -m 0755 ${B}/tools/wispr ${D}${bindir} | ||
| 110 | fi | ||
| 111 | |||
| 112 | # We don't need to package an empty directory | ||
| 113 | rmdir --ignore-fail-on-non-empty ${D}${libdir}/connman/scripts | ||
| 114 | |||
| 115 | # Automake 1.12 won't install empty directories, but we need the | ||
| 116 | # plugins directory to be present for ownership | ||
| 117 | mkdir -p ${D}${libdir}/connman/plugins | ||
| 118 | |||
| 119 | # For read-only filesystem, do not create links during bootup | ||
| 120 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then | ||
| 121 | ln -sf ../run/connman/resolv.conf ${D}${sysconfdir}/resolv-conf.connman | ||
| 122 | fi | ||
| 123 | } | ||
| 124 | |||
| 125 | # These used to be plugins, but now they are core | ||
| 126 | RPROVIDES:${PN} = "\ | ||
| 127 | connman-plugin-loopback \ | ||
| 128 | connman-plugin-ethernet \ | ||
| 129 | ${@bb.utils.contains('PACKAGECONFIG', 'bluetooth','connman-plugin-bluetooth', '', d)} \ | ||
| 130 | ${@bb.utils.contains('PACKAGECONFIG', 'wifi','connman-plugin-wifi', '', d)} \ | ||
| 131 | ${@bb.utils.contains('PACKAGECONFIG', '3g','connman-plugin-ofono', '', d)} \ | ||
| 132 | " | ||
| 133 | |||
| 134 | PACKAGES_DYNAMIC += "^${PN}-plugin-.*" | ||
| 135 | |||
| 136 | def add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, add_insane_skip): | ||
| 137 | plugintype = pkg.split( '-' )[-1] | ||
| 138 | if plugintype in depmap: | ||
| 139 | rdepends = map(lambda x: multilib_prefix + x, \ | ||
| 140 | depmap[plugintype].split()) | ||
| 141 | d.setVar("RDEPENDS:%s" % pkg, " ".join(rdepends)) | ||
| 142 | if add_insane_skip: | ||
| 143 | d.appendVar("INSANE_SKIP:%s" % pkg, "dev-so") | ||
| 144 | |||
| 145 | python populate_packages:prepend() { | ||
| 146 | depmap = dict(pppd="ppp") | ||
| 147 | multilib_prefix = (d.getVar("MLPREFIX") or "") | ||
| 148 | |||
| 149 | hook = lambda file,pkg,x,y,z: \ | ||
| 150 | add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, False) | ||
| 151 | plugin_dir = d.expand('${libdir}/connman/plugins/') | ||
| 152 | plugin_name = d.expand('${PN}-plugin-%s') | ||
| 153 | do_split_packages(d, plugin_dir, r'^(.*).so$', plugin_name, \ | ||
| 154 | '${PN} plugin for %s', extra_depends='', hook=hook, prepend=True ) | ||
| 155 | |||
| 156 | hook = lambda file,pkg,x,y,z: \ | ||
| 157 | add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, True) | ||
| 158 | plugin_dir = d.expand('${libdir}/connman/plugins-vpn/') | ||
| 159 | plugin_name = d.expand('${PN}-plugin-vpn-%s') | ||
| 160 | do_split_packages(d, plugin_dir, r'^(.*).so$', plugin_name, \ | ||
| 161 | '${PN} VPN plugin for %s', extra_depends='', hook=hook, prepend=True ) | ||
| 162 | } | ||
| 163 | |||
| 164 | PACKAGES =+ "${PN}-tools ${PN}-tests ${PN}-client" | ||
| 165 | |||
| 166 | FILES:${PN}-tools = "${bindir}/wispr" | ||
| 167 | RDEPENDS:${PN}-tools = "${PN}" | ||
| 168 | |||
| 169 | FILES:${PN}-tests = "${bindir}/*-test" | ||
| 170 | |||
| 171 | FILES:${PN}-client = "${bindir}/connmanctl" | ||
| 172 | RDEPENDS:${PN}-client = "${PN}" | ||
| 173 | |||
| 174 | FILES:${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*.so.* \ | ||
| 175 | ${libdir}/connman/plugins \ | ||
| 176 | ${sysconfdir} ${sharedstatedir} ${localstatedir} ${datadir} \ | ||
| 177 | ${base_bindir}/* ${base_sbindir}/* ${base_libdir}/*.so* ${datadir}/${PN} \ | ||
| 178 | ${datadir}/dbus-1/system-services/* \ | ||
| 179 | ${sysconfdir}/tmpfiles.d/connman_resolvconf.conf" | ||
| 180 | |||
| 181 | FILES:${PN}-dev += "${libdir}/connman/*/*.la" | ||
| 182 | |||
| 183 | PACKAGES =+ "${PN}-vpn ${PN}-wait-online" | ||
| 184 | |||
| 185 | SUMMARY:${PN}-vpn = "A daemon for managing VPN connections within embedded devices" | ||
| 186 | DESCRIPTION:${PN}-vpn = "The ConnMan VPN provides a daemon for \ | ||
| 187 | managing VPN connections within embedded devices running the Linux \ | ||
| 188 | operating system. The connman-vpnd handles all the VPN connections \ | ||
| 189 | and starts/stops VPN client processes when necessary. The connman-vpnd \ | ||
| 190 | provides a DBus API for managing VPN connections. All the different \ | ||
| 191 | VPN technogies are implemented using plug-ins." | ||
| 192 | FILES:${PN}-vpn += "${sbindir}/connman-vpnd \ | ||
| 193 | ${sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf \ | ||
| 194 | ${datadir}/dbus-1/system-services/net.connman.vpn.service \ | ||
| 195 | ${systemd_system_unitdir}/connman-vpn.service" | ||
| 196 | |||
| 197 | SUMMARY:${PN}-wait-online = "A program that will return once ConnMan has connected to a network" | ||
| 198 | DESCRIPTION:${PN}-wait-online = "A service that can be enabled so that \ | ||
| 199 | the system waits until a network connection is established." | ||
| 200 | FILES:${PN}-wait-online += "${sbindir}/connmand-wait-online \ | ||
| 201 | ${systemd_system_unitdir}/connman-wait-online.service" | ||
| 202 | |||
| 203 | SUMMARY:${PN}-plugin-vpn-openvpn = "An OpenVPN plugin for ConnMan VPN" | ||
| 204 | DESCRIPTION:${PN}-plugin-vpn-openvpn = "The ConnMan OpenVPN plugin uses openvpn client \ | ||
| 205 | to create a VPN connection to OpenVPN server." | ||
| 206 | FILES:${PN}-plugin-vpn-openvpn += "${libdir}/connman/scripts/openvpn-script \ | ||
| 207 | ${libdir}/connman/plugins-vpn/openvpn.so" | ||
| 208 | RDEPENDS:${PN}-plugin-vpn-openvpn += "${PN}-vpn" | ||
| 209 | RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG','openvpn','${PN}-plugin-vpn-openvpn', '', d)}" | ||
| 210 | |||
| 211 | SUMMARY:${PN}-plugin-vpn-vpnc = "A vpnc plugin for ConnMan VPN" | ||
| 212 | DESCRIPTION:${PN}-plugin-vpn-vpnc = "The ConnMan vpnc plugin uses vpnc client \ | ||
| 213 | to create a VPN connection to Cisco3000 VPN Concentrator." | ||
| 214 | FILES:${PN}-plugin-vpn-vpnc += "${libdir}/connman/scripts/openconnect-script \ | ||
| 215 | ${libdir}/connman/plugins-vpn/vpnc.so \ | ||
| 216 | ${libdir}/connman/scripts/vpn-script" | ||
| 217 | RDEPENDS:${PN}-plugin-vpn-vpnc += "${PN}-vpn" | ||
| 218 | RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG','vpnc','${PN}-plugin-vpn-vpnc', '', d)}" | ||
| 219 | |||
| 220 | SUMMARY:${PN}-plugin-vpn-l2tp = "A L2TP plugin for ConnMan VPN" | ||
| 221 | DESCRIPTION:${PN}-plugin-vpn-l2tp = "The ConnMan L2TP plugin uses xl2tpd daemon \ | ||
| 222 | to create a VPN connection to L2TP server." | ||
| 223 | FILES:${PN}-plugin-vpn-l2tp += "${libdir}/connman/scripts/libppp-plugin.so* \ | ||
| 224 | ${libdir}/connman/plugins-vpn/l2tp.so" | ||
| 225 | RDEPENDS:${PN}-plugin-vpn-l2tp += "${PN}-vpn" | ||
| 226 | RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG','l2tp','${PN}-plugin-vpn-l2tp', '', d)}" | ||
| 227 | |||
| 228 | SUMMARY:${PN}-plugin-vpn-pptp = "A PPTP plugin for ConnMan VPN" | ||
| 229 | DESCRIPTION:${PN}-plugin-vpn-pptp = "The ConnMan PPTP plugin uses pptp-linux client \ | ||
| 230 | to create a VPN connection to PPTP server." | ||
| 231 | FILES:${PN}-plugin-vpn-pptp += "${libdir}/connman/scripts/libppp-plugin.so* \ | ||
| 232 | ${libdir}/connman/plugins-vpn/pptp.so" | ||
| 233 | RDEPENDS:${PN}-plugin-vpn-pptp += "${PN}-vpn" | ||
| 234 | RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG','pptp','${PN}-plugin-vpn-pptp', '', d)}" | ||
