summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/connman/connman.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/connman/connman.inc')
-rw-r--r--meta/recipes-connectivity/connman/connman.inc215
1 files changed, 215 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/connman/connman.inc b/meta/recipes-connectivity/connman/connman.inc
new file mode 100644
index 0000000000..f121a81f1e
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman.inc
@@ -0,0 +1,215 @@
1SUMMARY = "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"
12LICENSE = "GPLv2"
13LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
14 file://src/main.c;beginline=1;endline=20;md5=486a279a6ab0c8d152bcda3a5b5edc36"
15
16DEPENDS = "dbus glib-2.0 ppp iptables"
17
18INC_PR = "r20"
19
20EXTRA_OECONF += "\
21 ac_cv_path_WPASUPPLICANT=${sbindir}/wpa_supplicant \
22 ac_cv_path_PPPD=${sbindir}/pppd \
23 --enable-debug \
24 --enable-loopback \
25 --enable-ethernet \
26 --enable-tools \
27 --enable-test \
28 --disable-polkit \
29 --enable-client \
30 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-systemdunitdir=${systemd_unitdir}/system/', '--with-systemdunitdir=', d)} \
31"
32
33PACKAGECONFIG ??= "wispr \
34 ${@bb.utils.contains('DISTRO_FEATURES', 'wifi','wifi', '', d)} \
35 ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth','bluetooth', '', d)} \
36 ${@bb.utils.contains('DISTRO_FEATURES', '3g','3g', '', d)} \
37"
38
39# If you want ConnMan to support VPN, add following statement into
40# local.conf or distro config
41# PACKAGECONFIG_append_pn-connman = " openvpn vpnc l2tp pptp"
42
43PACKAGECONFIG[wifi] = "--enable-wifi, --disable-wifi, wpa-supplicant"
44PACKAGECONFIG[bluetooth] = "--enable-bluetooth, --disable-bluetooth, bluez4"
45PACKAGECONFIG[3g] = "--enable-ofono, --disable-ofono, ofono"
46PACKAGECONFIG[tist] = "--enable-tist,--disable-tist,"
47PACKAGECONFIG[openvpn] = "--enable-openvpn --with-openvpn=${sbindir}/openvpn,--disable-openvpn,,openvpn"
48PACKAGECONFIG[vpnc] = "--enable-vpnc --with-vpnc=${sbindir}/vpnc,--disable-vpnc,,vpnc"
49PACKAGECONFIG[l2tp] = "--enable-l2tp --with-l2tp=${sbindir}/xl2tpd,--disable-l2tp,,xl2tpd"
50PACKAGECONFIG[pptp] = "--enable-pptp --with-pptp=${sbindir}/pptp,--disable-pptp,,pptp-linux"
51# WISPr support for logging into hotspots, requires TLS
52PACKAGECONFIG[wispr] = "--enable-wispr,--disable-wispr,gnutls,"
53
54INITSCRIPT_NAME = "connman"
55INITSCRIPT_PARAMS = "start 05 5 2 3 . stop 22 0 1 6 ."
56
57python __anonymous () {
58 systemd_packages = "${PN}"
59 pkgconfig = d.getVar('PACKAGECONFIG', True)
60 if ('openvpn' or 'vpnc' or 'l2tp' or 'pptp') in pkgconfig.split():
61 systemd_packages += " ${PN}-vpn"
62 d.setVar('SYSTEMD_PACKAGES', systemd_packages)
63}
64
65SYSTEMD_SERVICE_${PN} = "connman.service"
66SYSTEMD_SERVICE_${PN}-vpn = "connman-vpn.service"
67SYSTEMD_WIRED_SETUP = "ExecStartPre=-${libdir}/connman/wired-setup"
68
69inherit autotools-brokensep pkgconfig systemd update-rc.d
70
71do_configure_append () {
72 sed -i "s#ExecStart=#${SYSTEMD_WIRED_SETUP}\nExecStart=#" ${S}/src/connman.service
73}
74
75# This allows *everyone* to access ConnMan over DBus, without any access
76# control. Really the at_console flag should work, which would mean that
77# both this and the xuser patch can be dropped.
78do_compile_append() {
79 sed -i -e s:deny:allow:g src/connman-dbus.conf
80 sed -i -e s:deny:allow:g vpn/vpn-dbus.conf
81}
82
83do_install_append() {
84 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
85 install -d ${D}${sysconfdir}/init.d
86 install -m 0755 ${WORKDIR}/connman ${D}${sysconfdir}/init.d/connman
87 sed -i s%@LIBDIR@%${libdir}% ${D}${sysconfdir}/init.d/connman
88 fi
89
90 install -d ${D}${bindir}
91 install -m 0755 ${S}/tools/*-test ${D}${bindir}
92 if [ -e ${S}/tools/wispr ]; then
93 install -m 0755 ${S}/tools/wispr ${D}${bindir}
94 fi
95 install -m 0755 ${B}/client/connmanctl ${D}${bindir}
96
97 # We don't need to package an empty directory
98 rmdir --ignore-fail-on-non-empty ${D}${libdir}/connman/scripts
99
100 # Automake 1.12 won't install empty directories, but we need the
101 # plugins directory to be present for ownership
102 mkdir -p ${D}${libdir}/connman/plugins
103}
104
105# These used to be plugins, but now they are core
106RPROVIDES_${PN} = "\
107 connman-plugin-loopback \
108 connman-plugin-ethernet \
109 ${@bb.utils.contains('PACKAGECONFIG', 'bluetooth','connman-plugin-bluetooth', '', d)} \
110 ${@bb.utils.contains('PACKAGECONFIG', 'wifi','connman-plugin-wifi', '', d)} \
111 ${@bb.utils.contains('PACKAGECONFIG', '3g','connman-plugin-ofono', '', d)} \
112 "
113
114RDEPENDS_${PN} = "\
115 dbus \
116 ${@bb.utils.contains('PACKAGECONFIG', 'bluetooth', 'bluez4', '', d)} \
117 ${@bb.utils.contains('PACKAGECONFIG', 'wifi','wpa-supplicant', '', d)} \
118 ${@bb.utils.contains('PACKAGECONFIG', '3g','ofono', '', d)} \
119 xuser-account \
120 "
121
122PACKAGES_DYNAMIC += "^${PN}-plugin-.*"
123
124def add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, add_insane_skip):
125 plugintype = pkg.split( '-' )[-1]
126 if plugintype in depmap:
127 rdepends = map(lambda x: multilib_prefix + x, \
128 depmap[plugintype].split())
129 d.setVar("RDEPENDS_%s" % pkg, " ".join(rdepends))
130 if add_insane_skip:
131 d.appendVar("INSANE_SKIP_%s" % pkg, "dev-so")
132
133python populate_packages_prepend() {
134 depmap = dict(pppd="ppp")
135 multilib_prefix = (d.getVar("MLPREFIX", True) or "")
136
137 hook = lambda file,pkg,x,y,z: \
138 add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, False)
139 plugin_dir = d.expand('${libdir}/connman/plugins/')
140 plugin_name = d.expand('${PN}-plugin-%s')
141 do_split_packages(d, plugin_dir, '^(.*).so$', plugin_name, \
142 '${PN} plugin for %s', extra_depends='', hook=hook, prepend=True )
143
144 hook = lambda file,pkg,x,y,z: \
145 add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, True)
146 plugin_dir = d.expand('${libdir}/connman/plugins-vpn/')
147 plugin_name = d.expand('${PN}-plugin-vpn-%s')
148 do_split_packages(d, plugin_dir, '^(.*).so$', plugin_name, \
149 '${PN} VPN plugin for %s', extra_depends='', hook=hook, prepend=True )
150}
151
152PACKAGES =+ "${PN}-tools ${PN}-tests ${PN}-client"
153
154FILES_${PN}-tools = "${bindir}/wispr"
155
156FILES_${PN}-tests = "${bindir}/*-test ${libdir}/${BPN}/test/*"
157RDEPENDS_${PN}-tests = "python-dbus python-pygobject python-textutils python-subprocess python-fcntl python-netclient"
158
159FILES_${PN}-client = "${bindir}/connmanctl"
160
161FILES_${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*.so.* \
162 ${libdir}/connman/plugins \
163 ${sysconfdir} ${sharedstatedir} ${localstatedir} \
164 ${base_bindir}/* ${base_sbindir}/* ${base_libdir}/*.so* ${datadir}/${PN} \
165 ${datadir}/dbus-1/system-services/*"
166
167FILES_${PN}-dbg += "${libdir}/connman/*/.debug"
168
169FILES_${PN}-dev += "${libdir}/connman/*/*.la"
170
171PACKAGES =+ "${PN}-vpn"
172
173SUMMARY_${PN}-vpn = "A daemon for managing VPN connections within embedded devices"
174DESCRIPTION_${PN}-vpn = "The ConnMan VPN provides a daemon for \
175managing VPN connections within embedded devices running the Linux \
176operating system. The connman-vpnd handles all the VPN connections \
177and starts/stops VPN client processes when necessary. The connman-vpnd \
178provides a DBus API for managing VPN connections. All the different \
179VPN technogies are implemented using plug-ins."
180FILES_${PN}-vpn += "${sbindir}/connman-vpnd \
181 ${sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf \
182 ${datadir}/dbus-1/system-services/net.connman.vpn.service \
183 ${systemd_unitdir}/system/connman-vpn.service"
184
185SUMMARY_${PN}-plugin-vpn-openvpn = "An OpenVPN plugin for ConnMan VPN"
186DESCRIPTION_${PN}-plugin-vpn-openvpn = "The ConnMan OpenVPN plugin uses openvpn client \
187to create a VPN connection to OpenVPN server."
188FILES_${PN}-plugin-vpn-openvpn += "${libdir}/connman/scripts/openvpn-script \
189 ${libdir}/connman/plugins-vpn/openvpn.so"
190RDEPENDS_${PN}-plugin-vpn-openvpn += "${PN}-vpn"
191RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','openvpn','${PN}-plugin-vpn-openvpn', '', d)}"
192
193SUMMARY_${PN}-plugin-vpn-vpnc = "A vpnc plugin for ConnMan VPN"
194DESCRIPTION_${PN}-plugin-vpn-vpnc = "The ConnMan vpnc plugin uses vpnc client \
195to create a VPN connection to Cisco3000 VPN Concentrator."
196FILES_${PN}-plugin-vpn-vpnc += "${libdir}/connman/scripts/openconnect-script \
197 ${libdir}/connman/plugins-vpn/vpnc.so"
198RDEPENDS_${PN}-plugin-vpn-vpnc += "${PN}-vpn"
199RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','vpnc','${PN}-plugin-vpn-vpnc', '', d)}"
200
201SUMMARY_${PN}-plugin-vpn-l2tp = "A L2TP plugin for ConnMan VPN"
202DESCRIPTION_${PN}-plugin-vpn-l2tp = "The ConnMan L2TP plugin uses xl2tpd daemon \
203to create a VPN connection to L2TP server."
204FILES_${PN}-plugin-vpn-l2tp += "${libdir}/connman/scripts/libppp-plugin.so* \
205 ${libdir}/connman/plugins-vpn/l2tp.so"
206RDEPENDS_${PN}-plugin-vpn-l2tp += "${PN}-vpn"
207RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','l2tp','${PN}-plugin-vpn-l2tp', '', d)}"
208
209SUMMARY_${PN}-plugin-vpn-pptp = "A PPTP plugin for ConnMan VPN"
210DESCRIPTION_${PN}-plugin-vpn-pptp = "The ConnMan PPTP plugin uses pptp-linux client \
211to create a VPN connection to PPTP server."
212FILES_${PN}-plugin-vpn-pptp += "${libdir}/connman/scripts/libppp-plugin.so* \
213 ${libdir}/connman/plugins-vpn/pptp.so"
214RDEPENDS_${PN}-plugin-vpn-pptp += "${PN}-vpn"
215RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','pptp','${PN}-plugin-vpn-pptp', '', d)}"