summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/connman/connman.inc
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2013-05-14 11:10:41 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-16 00:09:48 +0300
commit7c41d839f9a00a10c763a8f6c3c349b61da3fd21 (patch)
tree2dcc94fd6138761c346ece7ec1660fe375ac34a2 /meta/recipes-connectivity/connman/connman.inc
parentca64333d0bc2666eae18dbaa90cebb090cd43a45 (diff)
downloadpoky-7c41d839f9a00a10c763a8f6c3c349b61da3fd21.tar.gz
connman: Add VPN support
One needs to add following statement into local.conf or distro config PACKAGECONFIG_append_pn-connman = " openvpn vpnc l2tp pptp" in order to activate support for these VPN technogies in ConnMan. (From OE-Core rev: 92da847ed6cea6342bdc86de121534259332a2c3) Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/connman/connman.inc')
-rw-r--r--meta/recipes-connectivity/connman/connman.inc52
1 files changed, 42 insertions, 10 deletions
diff --git a/meta/recipes-connectivity/connman/connman.inc b/meta/recipes-connectivity/connman/connman.inc
index afc361ccc7..137deedb30 100644
--- a/meta/recipes-connectivity/connman/connman.inc
+++ b/meta/recipes-connectivity/connman/connman.inc
@@ -38,6 +38,10 @@ PACKAGECONFIG ??= "\
38 ${@base_contains('DISTRO_FEATURES', '3g','3g', '', d)} \ 38 ${@base_contains('DISTRO_FEATURES', '3g','3g', '', d)} \
39" 39"
40 40
41# If you want ConnMan to support VPN, add following statement into
42# local.conf or distro config
43# PACKAGECONFIG_append_pn-connman = " openvpn vpnc l2tp pptp"
44
41PACKAGECONFIG[wifi] = "--enable-wifi, --disable-wifi, wpa-supplicant" 45PACKAGECONFIG[wifi] = "--enable-wifi, --disable-wifi, wpa-supplicant"
42PACKAGECONFIG[bluetooth] = "--enable-bluetooth, --disable-bluetooth, bluez4" 46PACKAGECONFIG[bluetooth] = "--enable-bluetooth, --disable-bluetooth, bluez4"
43PACKAGECONFIG[3g] = "--enable-ofono, --disable-ofono, ofono" 47PACKAGECONFIG[3g] = "--enable-ofono, --disable-ofono, ofono"
@@ -47,6 +51,7 @@ INITSCRIPT_NAME = "connman"
47INITSCRIPT_PARAMS = "start 05 5 2 3 . stop 22 0 1 6 ." 51INITSCRIPT_PARAMS = "start 05 5 2 3 . stop 22 0 1 6 ."
48 52
49SYSTEMD_SERVICE_${PN} = "connman.service" 53SYSTEMD_SERVICE_${PN} = "connman.service"
54SYSTEMD_SERVICE_${PN}-vpn = "connman-vpn.service"
50SYSTEMD_WIRED_SETUP = "ExecStartPre=-/usr/lib/connman/wired-setup" 55SYSTEMD_WIRED_SETUP = "ExecStartPre=-/usr/lib/connman/wired-setup"
51 56
52# IMPORTANT: because xuser is shared with rootless X, please make sure the 57# IMPORTANT: because xuser is shared with rootless X, please make sure the
@@ -67,6 +72,7 @@ do_configure_append () {
67# both this and the xuser patch can be dropped. 72# both this and the xuser patch can be dropped.
68do_compile_append() { 73do_compile_append() {
69 sed -i -e s:deny:allow:g src/connman-dbus.conf 74 sed -i -e s:deny:allow:g src/connman-dbus.conf
75 sed -i -e s:deny:allow:g vpn/vpn-dbus.conf
70} 76}
71 77
72do_install_append() { 78do_install_append() {
@@ -81,7 +87,7 @@ do_install_append() {
81 install -m 0755 ${B}/client/connmanctl ${D}${bindir} 87 install -m 0755 ${B}/client/connmanctl ${D}${bindir}
82 88
83 # We don't need to package an empty directory 89 # We don't need to package an empty directory
84 rmdir ${D}${libdir}/connman/scripts 90 rmdir --ignore-fail-on-non-empty ${D}${libdir}/connman/scripts
85 91
86 # Automake 1.12 won't install empty directories, but we need the 92 # Automake 1.12 won't install empty directories, but we need the
87 # plugins directory to be present for ownership 93 # plugins directory to be present for ownership
@@ -106,20 +112,32 @@ RDEPENDS_${PN} = "\
106 112
107PACKAGES_DYNAMIC += "^${PN}-plugin-.*" 113PACKAGES_DYNAMIC += "^${PN}-plugin-.*"
108 114
115def add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, add_insane_skip):
116 plugintype = pkg.split( '-' )[-1]
117 if plugintype in depmap:
118 rdepends = map(lambda x: multilib_prefix + x, \
119 depmap[plugintype].split())
120 d.setVar("RDEPENDS_%s" % pkg, " ".join(rdepends))
121 if add_insane_skip:
122 d.appendVar("INSANE_SKIP_%s" % pkg, "dev-so")
123
109python populate_packages_prepend() { 124python populate_packages_prepend() {
110 depmap = dict(pppd="ppp") 125 depmap = dict(pppd="ppp")
111 packages = []
112 multilib_prefix = (d.getVar("MLPREFIX", True) or "") 126 multilib_prefix = (d.getVar("MLPREFIX", True) or "")
113 hook = lambda file,pkg,b,c,d:packages.append((file,pkg)) 127
128 hook = lambda file,pkg,x,y,z: \
129 add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, False)
114 plugin_dir = d.expand('${libdir}/connman/plugins/') 130 plugin_dir = d.expand('${libdir}/connman/plugins/')
115 plugin_name = d.expand('${PN}-plugin-%s') 131 plugin_name = d.expand('${PN}-plugin-%s')
116 do_split_packages(d, plugin_dir, '^(.*).so$', plugin_name, '${PN} plugin for %s', extra_depends='', hook=hook, prepend=True ) 132 do_split_packages(d, plugin_dir, '^(.*).so$', plugin_name, \
117 for (file, package) in packages: 133 '${PN} plugin for %s', extra_depends='', hook=hook, prepend=True )
118 plugintype = package.split( '-' )[-1] 134
119 if plugintype in depmap: 135 hook = lambda file,pkg,x,y,z: \
120 rdepends = map(lambda x: multilib_prefix + x, depmap[plugintype].split()) 136 add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, True)
121 bb.note( "Adding rdependency on %s to %s" % ( rdepends, package ) ) 137 plugin_dir = d.expand('${libdir}/connman/plugins-vpn/')
122 d.setVar("RDEPENDS_%s" % package, " ".join(rdepends)) 138 plugin_name = d.expand('${PN}-plugin-vpn-%s')
139 do_split_packages(d, plugin_dir, '^(.*).so$', plugin_name, \
140 '${PN} VPN plugin for %s', extra_depends='', hook=hook, prepend=True )
123} 141}
124 142
125PACKAGES =+ "${PN}-tools ${PN}-tests ${PN}-client" 143PACKAGES =+ "${PN}-tools ${PN}-tests ${PN}-client"
@@ -140,3 +158,17 @@ FILES_${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*.so.* \
140FILES_${PN}-dbg += "${libdir}/connman/*/.debug" 158FILES_${PN}-dbg += "${libdir}/connman/*/.debug"
141 159
142FILES_${PN}-dev += "${libdir}/connman/*/*.la" 160FILES_${PN}-dev += "${libdir}/connman/*/*.la"
161
162PACKAGES =+ "${PN}-vpn"
163
164SUMMARY_${PN}-vpn = "A daemon for managing VPN connections within embedded devices"
165DESCRIPTION_${PN}-vpn = "The ConnMan VPN provides a daemon for \
166managing VPN connections within embedded devices running the Linux \
167operating system. The connman-vpnd handles all the VPN connections \
168and starts/stops VPN client processes when necessary. The connman-vpnd \
169provides a DBus API for managing VPN connections. All the different \
170VPN technogies are implemented using plug-ins."
171FILES_${PN}-vpn += "${sbindir}/connman-vpnd \
172 ${sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf \
173 ${datadir}/dbus-1/system-services/net.connman.vpn.service \
174 ${systemd_unitdir}/system/connman-vpn.service"