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