connman.inc 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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. inherit autotools pkgconfig systemd update-rc.d update-alternatives
  16. DEPENDS = "dbus glib-2.0 ppp readline"
  17. INC_PR = "r20"
  18. EXTRA_OECONF += "\
  19. ac_cv_path_WPASUPPLICANT=${sbindir}/wpa_supplicant \
  20. ac_cv_path_PPPD=${sbindir}/pppd \
  21. --enable-debug \
  22. --enable-loopback \
  23. --enable-ethernet \
  24. --enable-tools \
  25. --disable-polkit \
  26. --enable-client \
  27. "
  28. PACKAGECONFIG ??= "wispr \
  29. ${@bb.utils.filter('DISTRO_FEATURES', '3g systemd wifi', d)} \
  30. ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
  31. iptables \
  32. "
  33. # If you want ConnMan to support VPN, add following statement into
  34. # local.conf or distro config
  35. # PACKAGECONFIG_append_pn-connman = " openvpn vpnc l2tp pptp"
  36. PACKAGECONFIG[systemd] = "--with-systemdunitdir=${systemd_unitdir}/system/ --with-tmpfilesdir=${sysconfdir}/tmpfiles.d/,--with-systemdunitdir='' --with-tmpfilesdir=''"
  37. PACKAGECONFIG[wifi] = "--enable-wifi, --disable-wifi, wpa-supplicant, wpa-supplicant"
  38. PACKAGECONFIG[bluez] = "--enable-bluetooth, --disable-bluetooth, bluez5, bluez5"
  39. PACKAGECONFIG[3g] = "--enable-ofono, --disable-ofono, ofono, ofono"
  40. PACKAGECONFIG[tist] = "--enable-tist,--disable-tist,"
  41. PACKAGECONFIG[openvpn] = "--enable-openvpn --with-openvpn=${sbindir}/openvpn,--disable-openvpn,,openvpn"
  42. PACKAGECONFIG[vpnc] = "--enable-vpnc --with-vpnc=${sbindir}/vpnc,--disable-vpnc,,vpnc"
  43. PACKAGECONFIG[l2tp] = "--enable-l2tp --with-l2tp=${sbindir}/xl2tpd,--disable-l2tp,,xl2tpd"
  44. PACKAGECONFIG[pptp] = "--enable-pptp --with-pptp=${sbindir}/pptp,--disable-pptp,,pptp-linux"
  45. # WISPr support for logging into hotspots, requires TLS
  46. PACKAGECONFIG[wispr] = "--enable-wispr,--disable-wispr,gnutls,"
  47. PACKAGECONFIG[nftables] = "--with-firewall=nftables ,,libmnl libnftnl,,kernel-module-nf-tables-ipv4 kernel-module-nft-chain-nat-ipv4 kernel-module-nft-chain-route-ipv4 kernel-module-nft-meta kernel-module-nft-masq-ipv4 kernel-module-nft-nat"
  48. PACKAGECONFIG[iptables] = "--with-firewall=iptables ,,iptables,iptables"
  49. PACKAGECONFIG[nfc] = "--enable-neard, --disable-neard, neard, neard"
  50. INITSCRIPT_NAME = "connman"
  51. INITSCRIPT_PARAMS = "start 05 5 2 3 . stop 22 0 1 6 ."
  52. python __anonymous () {
  53. systemd_packages = "${PN}"
  54. pkgconfig = d.getVar('PACKAGECONFIG')
  55. if ('openvpn' or 'vpnc' or 'l2tp' or 'pptp') in pkgconfig.split():
  56. systemd_packages += " ${PN}-vpn"
  57. d.setVar('SYSTEMD_PACKAGES', systemd_packages)
  58. }
  59. SYSTEMD_SERVICE_${PN} = "connman.service"
  60. SYSTEMD_SERVICE_${PN}-vpn = "connman-vpn.service"
  61. SYSTEMD_SERVICE_${PN}-wait-online = "connman-wait-online.service"
  62. ALTERNATIVE_PRIORITY = "100"
  63. ALTERNATIVE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','resolv-conf','',d)}"
  64. ALTERNATIVE_TARGET[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv-conf.connman','',d)}"
  65. ALTERNATIVE_LINK_NAME[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv.conf','',d)}"
  66. do_install_append() {
  67. if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
  68. install -d ${D}${sysconfdir}/init.d
  69. install -m 0755 ${WORKDIR}/connman ${D}${sysconfdir}/init.d/connman
  70. sed -i s%@DATADIR@%${datadir}% ${D}${sysconfdir}/init.d/connman
  71. fi
  72. install -d ${D}${bindir}
  73. install -m 0755 ${B}/tools/*-test ${D}${bindir}
  74. if [ -e ${B}/tools/wispr ]; then
  75. install -m 0755 ${B}/tools/wispr ${D}${bindir}
  76. fi
  77. install -m 0755 ${B}/client/connmanctl ${D}${bindir}
  78. # We don't need to package an empty directory
  79. rmdir --ignore-fail-on-non-empty ${D}${libdir}/connman/scripts
  80. # Automake 1.12 won't install empty directories, but we need the
  81. # plugins directory to be present for ownership
  82. mkdir -p ${D}${libdir}/connman/plugins
  83. # For read-only filesystem, do not create links during bootup
  84. if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
  85. ln -sf ../run/connman/resolv.conf ${D}${sysconfdir}/resolv-conf.connman
  86. fi
  87. }
  88. # These used to be plugins, but now they are core
  89. RPROVIDES_${PN} = "\
  90. connman-plugin-loopback \
  91. connman-plugin-ethernet \
  92. ${@bb.utils.contains('PACKAGECONFIG', 'bluetooth','connman-plugin-bluetooth', '', d)} \
  93. ${@bb.utils.contains('PACKAGECONFIG', 'wifi','connman-plugin-wifi', '', d)} \
  94. ${@bb.utils.contains('PACKAGECONFIG', '3g','connman-plugin-ofono', '', d)} \
  95. "
  96. RDEPENDS_${PN} = "\
  97. dbus \
  98. "
  99. PACKAGES_DYNAMIC += "^${PN}-plugin-.*"
  100. def add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, add_insane_skip):
  101. plugintype = pkg.split( '-' )[-1]
  102. if plugintype in depmap:
  103. rdepends = map(lambda x: multilib_prefix + x, \
  104. depmap[plugintype].split())
  105. d.setVar("RDEPENDS_%s" % pkg, " ".join(rdepends))
  106. if add_insane_skip:
  107. d.appendVar("INSANE_SKIP_%s" % pkg, "dev-so")
  108. python populate_packages_prepend() {
  109. depmap = dict(pppd="ppp")
  110. multilib_prefix = (d.getVar("MLPREFIX") or "")
  111. hook = lambda file,pkg,x,y,z: \
  112. add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, False)
  113. plugin_dir = d.expand('${libdir}/connman/plugins/')
  114. plugin_name = d.expand('${PN}-plugin-%s')
  115. do_split_packages(d, plugin_dir, r'^(.*).so$', plugin_name, \
  116. '${PN} plugin for %s', extra_depends='', hook=hook, prepend=True )
  117. hook = lambda file,pkg,x,y,z: \
  118. add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, True)
  119. plugin_dir = d.expand('${libdir}/connman/plugins-vpn/')
  120. plugin_name = d.expand('${PN}-plugin-vpn-%s')
  121. do_split_packages(d, plugin_dir, r'^(.*).so$', plugin_name, \
  122. '${PN} VPN plugin for %s', extra_depends='', hook=hook, prepend=True )
  123. }
  124. PACKAGES =+ "${PN}-tools ${PN}-tests ${PN}-client"
  125. FILES_${PN}-tools = "${bindir}/wispr"
  126. RDEPENDS_${PN}-tools ="${PN}"
  127. FILES_${PN}-tests = "${bindir}/*-test"
  128. FILES_${PN}-client = "${bindir}/connmanctl"
  129. RDEPENDS_${PN}-client ="${PN}"
  130. FILES_${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*.so.* \
  131. ${libdir}/connman/plugins \
  132. ${sysconfdir} ${sharedstatedir} ${localstatedir} ${datadir} \
  133. ${base_bindir}/* ${base_sbindir}/* ${base_libdir}/*.so* ${datadir}/${PN} \
  134. ${datadir}/dbus-1/system-services/* \
  135. ${sysconfdir}/tmpfiles.d/connman_resolvconf.conf"
  136. FILES_${PN}-dev += "${libdir}/connman/*/*.la"
  137. PACKAGES =+ "${PN}-vpn ${PN}-wait-online"
  138. SUMMARY_${PN}-vpn = "A daemon for managing VPN connections within embedded devices"
  139. DESCRIPTION_${PN}-vpn = "The ConnMan VPN provides a daemon for \
  140. managing VPN connections within embedded devices running the Linux \
  141. operating system. The connman-vpnd handles all the VPN connections \
  142. and starts/stops VPN client processes when necessary. The connman-vpnd \
  143. provides a DBus API for managing VPN connections. All the different \
  144. VPN technogies are implemented using plug-ins."
  145. FILES_${PN}-vpn += "${sbindir}/connman-vpnd \
  146. ${sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf \
  147. ${datadir}/dbus-1/system-services/net.connman.vpn.service \
  148. ${systemd_unitdir}/system/connman-vpn.service"
  149. SUMMARY_${PN}-wait-online = "A program that will return once ConnMan has connected to a network"
  150. DESCRIPTION_${PN}-wait-online = "A service that can be enabled so that \
  151. the system waits until a network connection is established."
  152. FILES_${PN}-wait-online += "${sbindir}/connmand-wait-online \
  153. ${systemd_unitdir}/system/connman-wait-online.service"
  154. SUMMARY_${PN}-plugin-vpn-openvpn = "An OpenVPN plugin for ConnMan VPN"
  155. DESCRIPTION_${PN}-plugin-vpn-openvpn = "The ConnMan OpenVPN plugin uses openvpn client \
  156. to create a VPN connection to OpenVPN server."
  157. FILES_${PN}-plugin-vpn-openvpn += "${libdir}/connman/scripts/openvpn-script \
  158. ${libdir}/connman/plugins-vpn/openvpn.so"
  159. RDEPENDS_${PN}-plugin-vpn-openvpn += "${PN}-vpn"
  160. RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','openvpn','${PN}-plugin-vpn-openvpn', '', d)}"
  161. SUMMARY_${PN}-plugin-vpn-vpnc = "A vpnc plugin for ConnMan VPN"
  162. DESCRIPTION_${PN}-plugin-vpn-vpnc = "The ConnMan vpnc plugin uses vpnc client \
  163. to create a VPN connection to Cisco3000 VPN Concentrator."
  164. FILES_${PN}-plugin-vpn-vpnc += "${libdir}/connman/scripts/openconnect-script \
  165. ${libdir}/connman/plugins-vpn/vpnc.so"
  166. RDEPENDS_${PN}-plugin-vpn-vpnc += "${PN}-vpn"
  167. RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','vpnc','${PN}-plugin-vpn-vpnc', '', d)}"
  168. SUMMARY_${PN}-plugin-vpn-l2tp = "A L2TP plugin for ConnMan VPN"
  169. DESCRIPTION_${PN}-plugin-vpn-l2tp = "The ConnMan L2TP plugin uses xl2tpd daemon \
  170. to create a VPN connection to L2TP server."
  171. FILES_${PN}-plugin-vpn-l2tp += "${libdir}/connman/scripts/libppp-plugin.so* \
  172. ${libdir}/connman/plugins-vpn/l2tp.so"
  173. RDEPENDS_${PN}-plugin-vpn-l2tp += "${PN}-vpn"
  174. RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','l2tp','${PN}-plugin-vpn-l2tp', '', d)}"
  175. SUMMARY_${PN}-plugin-vpn-pptp = "A PPTP plugin for ConnMan VPN"
  176. DESCRIPTION_${PN}-plugin-vpn-pptp = "The ConnMan PPTP plugin uses pptp-linux client \
  177. to create a VPN connection to PPTP server."
  178. FILES_${PN}-plugin-vpn-pptp += "${libdir}/connman/scripts/libppp-plugin.so* \
  179. ${libdir}/connman/plugins-vpn/pptp.so"
  180. RDEPENDS_${PN}-plugin-vpn-pptp += "${PN}-vpn"
  181. RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','pptp','${PN}-plugin-vpn-pptp', '', d)}"