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