diff options
author | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
commit | 972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch) | |
tree | 97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/recipes-connectivity/connman/connman.inc | |
download | poky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz |
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-connectivity/connman/connman.inc')
-rw-r--r-- | meta/recipes-connectivity/connman/connman.inc | 215 |
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 @@ | |||
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 | DEPENDS = "dbus glib-2.0 ppp iptables" | ||
17 | |||
18 | INC_PR = "r20" | ||
19 | |||
20 | EXTRA_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 | |||
33 | PACKAGECONFIG ??= "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 | |||
43 | PACKAGECONFIG[wifi] = "--enable-wifi, --disable-wifi, wpa-supplicant" | ||
44 | PACKAGECONFIG[bluetooth] = "--enable-bluetooth, --disable-bluetooth, bluez4" | ||
45 | PACKAGECONFIG[3g] = "--enable-ofono, --disable-ofono, ofono" | ||
46 | PACKAGECONFIG[tist] = "--enable-tist,--disable-tist," | ||
47 | PACKAGECONFIG[openvpn] = "--enable-openvpn --with-openvpn=${sbindir}/openvpn,--disable-openvpn,,openvpn" | ||
48 | PACKAGECONFIG[vpnc] = "--enable-vpnc --with-vpnc=${sbindir}/vpnc,--disable-vpnc,,vpnc" | ||
49 | PACKAGECONFIG[l2tp] = "--enable-l2tp --with-l2tp=${sbindir}/xl2tpd,--disable-l2tp,,xl2tpd" | ||
50 | PACKAGECONFIG[pptp] = "--enable-pptp --with-pptp=${sbindir}/pptp,--disable-pptp,,pptp-linux" | ||
51 | # WISPr support for logging into hotspots, requires TLS | ||
52 | PACKAGECONFIG[wispr] = "--enable-wispr,--disable-wispr,gnutls," | ||
53 | |||
54 | INITSCRIPT_NAME = "connman" | ||
55 | INITSCRIPT_PARAMS = "start 05 5 2 3 . stop 22 0 1 6 ." | ||
56 | |||
57 | python __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 | |||
65 | SYSTEMD_SERVICE_${PN} = "connman.service" | ||
66 | SYSTEMD_SERVICE_${PN}-vpn = "connman-vpn.service" | ||
67 | SYSTEMD_WIRED_SETUP = "ExecStartPre=-${libdir}/connman/wired-setup" | ||
68 | |||
69 | inherit autotools-brokensep pkgconfig systemd update-rc.d | ||
70 | |||
71 | do_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. | ||
78 | do_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 | |||
83 | do_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 | ||
106 | RPROVIDES_${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 | |||
114 | RDEPENDS_${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 | |||
122 | PACKAGES_DYNAMIC += "^${PN}-plugin-.*" | ||
123 | |||
124 | def 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 | |||
133 | python 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 | |||
152 | PACKAGES =+ "${PN}-tools ${PN}-tests ${PN}-client" | ||
153 | |||
154 | FILES_${PN}-tools = "${bindir}/wispr" | ||
155 | |||
156 | FILES_${PN}-tests = "${bindir}/*-test ${libdir}/${BPN}/test/*" | ||
157 | RDEPENDS_${PN}-tests = "python-dbus python-pygobject python-textutils python-subprocess python-fcntl python-netclient" | ||
158 | |||
159 | FILES_${PN}-client = "${bindir}/connmanctl" | ||
160 | |||
161 | FILES_${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 | |||
167 | FILES_${PN}-dbg += "${libdir}/connman/*/.debug" | ||
168 | |||
169 | FILES_${PN}-dev += "${libdir}/connman/*/*.la" | ||
170 | |||
171 | PACKAGES =+ "${PN}-vpn" | ||
172 | |||
173 | SUMMARY_${PN}-vpn = "A daemon for managing VPN connections within embedded devices" | ||
174 | DESCRIPTION_${PN}-vpn = "The ConnMan VPN provides a daemon for \ | ||
175 | managing VPN connections within embedded devices running the Linux \ | ||
176 | operating system. The connman-vpnd handles all the VPN connections \ | ||
177 | and starts/stops VPN client processes when necessary. The connman-vpnd \ | ||
178 | provides a DBus API for managing VPN connections. All the different \ | ||
179 | VPN technogies are implemented using plug-ins." | ||
180 | FILES_${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 | |||
185 | SUMMARY_${PN}-plugin-vpn-openvpn = "An OpenVPN plugin for ConnMan VPN" | ||
186 | DESCRIPTION_${PN}-plugin-vpn-openvpn = "The ConnMan OpenVPN plugin uses openvpn client \ | ||
187 | to create a VPN connection to OpenVPN server." | ||
188 | FILES_${PN}-plugin-vpn-openvpn += "${libdir}/connman/scripts/openvpn-script \ | ||
189 | ${libdir}/connman/plugins-vpn/openvpn.so" | ||
190 | RDEPENDS_${PN}-plugin-vpn-openvpn += "${PN}-vpn" | ||
191 | RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','openvpn','${PN}-plugin-vpn-openvpn', '', d)}" | ||
192 | |||
193 | SUMMARY_${PN}-plugin-vpn-vpnc = "A vpnc plugin for ConnMan VPN" | ||
194 | DESCRIPTION_${PN}-plugin-vpn-vpnc = "The ConnMan vpnc plugin uses vpnc client \ | ||
195 | to create a VPN connection to Cisco3000 VPN Concentrator." | ||
196 | FILES_${PN}-plugin-vpn-vpnc += "${libdir}/connman/scripts/openconnect-script \ | ||
197 | ${libdir}/connman/plugins-vpn/vpnc.so" | ||
198 | RDEPENDS_${PN}-plugin-vpn-vpnc += "${PN}-vpn" | ||
199 | RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','vpnc','${PN}-plugin-vpn-vpnc', '', d)}" | ||
200 | |||
201 | SUMMARY_${PN}-plugin-vpn-l2tp = "A L2TP plugin for ConnMan VPN" | ||
202 | DESCRIPTION_${PN}-plugin-vpn-l2tp = "The ConnMan L2TP plugin uses xl2tpd daemon \ | ||
203 | to create a VPN connection to L2TP server." | ||
204 | FILES_${PN}-plugin-vpn-l2tp += "${libdir}/connman/scripts/libppp-plugin.so* \ | ||
205 | ${libdir}/connman/plugins-vpn/l2tp.so" | ||
206 | RDEPENDS_${PN}-plugin-vpn-l2tp += "${PN}-vpn" | ||
207 | RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','l2tp','${PN}-plugin-vpn-l2tp', '', d)}" | ||
208 | |||
209 | SUMMARY_${PN}-plugin-vpn-pptp = "A PPTP plugin for ConnMan VPN" | ||
210 | DESCRIPTION_${PN}-plugin-vpn-pptp = "The ConnMan PPTP plugin uses pptp-linux client \ | ||
211 | to create a VPN connection to PPTP server." | ||
212 | FILES_${PN}-plugin-vpn-pptp += "${libdir}/connman/scripts/libppp-plugin.so* \ | ||
213 | ${libdir}/connman/plugins-vpn/pptp.so" | ||
214 | RDEPENDS_${PN}-plugin-vpn-pptp += "${PN}-vpn" | ||
215 | RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','pptp','${PN}-plugin-vpn-pptp', '', d)}" | ||