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