connman_1.45.bb 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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 = "https://web.git.kernel.org/pub/scm/network/connman/connman.git/about/"
  11. LICENSE = "GPL-2.0-only"
  12. LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
  13. file://src/main.c;beginline=1;endline=20;md5=486a279a6ab0c8d152bcda3a5b5edc36"
  14. inherit autotools pkgconfig systemd update-rc.d update-alternatives
  15. CVE_PRODUCT = "connman connection_manager"
  16. DEPENDS = "dbus glib-2.0"
  17. SRC_URI = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
  18. file://connman \
  19. file://no-version-scripts.patch \
  20. file://0001-connman-vpn-avoid-hiding-implementation-reserved-sym.patch \
  21. file://0002-resolve-musl-does-not-implement-res_ninit.patch \
  22. "
  23. SRC_URI[sha256sum] = "77128cce80865455c4f106b5901a575e2dfdb35a7d2e2e2996f16e85cba10913"
  24. RRECOMMENDS:${PN} = "connman-conf"
  25. RCONFLICTS:${PN} = "networkmanager"
  26. EXTRA_OECONF += "\
  27. ac_cv_path_IP6TABLES_SAVE=${sbindir}/ip6tables-save \
  28. ac_cv_path_IPTABLES_SAVE=${sbindir}/iptables-save \
  29. ac_cv_path_PPPD=${sbindir}/pppd \
  30. ac_cv_path_WPASUPPLICANT=${sbindir}/wpa_supplicant \
  31. --enable-debug \
  32. --enable-loopback \
  33. --enable-ethernet \
  34. --enable-tools \
  35. --disable-polkit \
  36. --runstatedir='${runtimedir}' \
  37. --with-dns-backend='${@bb.utils.contains("DISTRO_FEATURES", "systemd-resolved", "systemd-resolved", "internal", d)}' \
  38. "
  39. # For smooth operation it would be best to start only one wireless daemon at a time.
  40. # If wpa-supplicant is running, connman will use it preferentially.
  41. # Select either wpa-supplicant or iwd
  42. WIRELESS_DAEMON ??= "wpa-supplicant"
  43. PACKAGECONFIG ??= "wispr iptables client\
  44. ${@bb.utils.filter('DISTRO_FEATURES', '3g systemd', d)} \
  45. ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
  46. ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'wifi ${WIRELESS_DAEMON}', '', d)} \
  47. "
  48. # If you want ConnMan to support VPN, add following statement into
  49. # local.conf or distro config
  50. # PACKAGECONFIG:append:pn-connman = " openvpn vpnc l2tp pptp"
  51. PACKAGECONFIG[systemd] = "--with-systemdunitdir=${systemd_system_unitdir}/ --with-tmpfilesdir=${sysconfdir}/tmpfiles.d/,--with-systemdunitdir='' --with-tmpfilesdir=''"
  52. PACKAGECONFIG[wifi] = "--enable-wifi, --disable-wifi"
  53. PACKAGECONFIG[bluez] = "--enable-bluetooth, --disable-bluetooth, bluez5, bluez5"
  54. PACKAGECONFIG[3g] = "--enable-ofono, --disable-ofono, ofono, ofono"
  55. PACKAGECONFIG[wpa-supplicant] = ",,wpa-supplicant,wpa-supplicant"
  56. PACKAGECONFIG[iwd] = "--enable-iwd,--disable-iwd,,iwd"
  57. PACKAGECONFIG[tist] = "--enable-tist,--disable-tist,"
  58. PACKAGECONFIG[openvpn] = "--enable-openvpn --with-openvpn=${sbindir}/openvpn,--disable-openvpn,,openvpn"
  59. PACKAGECONFIG[vpnc] = "--enable-vpnc --with-vpnc=${sbindir}/vpnc,--disable-vpnc,,vpnc"
  60. PACKAGECONFIG[l2tp] = "--enable-l2tp --with-l2tp=${sbindir}/xl2tpd,--disable-l2tp,ppp,xl2tpd"
  61. PACKAGECONFIG[pptp] = "--enable-pptp --with-pptp=${sbindir}/pptp,--disable-pptp,ppp,pptp-linux"
  62. # WISPr support for logging into hotspots, requires TLS
  63. PACKAGECONFIG[wispr] = "--enable-wispr,--disable-wispr,gnutls,"
  64. PACKAGECONFIG[nftables] = "--with-firewall=nftables ,,libmnl libnftnl,,kernel-module-nf-tables kernel-module-nft-chain-nat-ipv4 kernel-module-nft-chain-route-ipv4 kernel-module-nft-masq-ipv4 kernel-module-nft-nat,iptables"
  65. PACKAGECONFIG[iptables] = "--with-firewall=iptables,,iptables,,,nftables"
  66. PACKAGECONFIG[nfc] = "--enable-neard, --disable-neard, neard, neard"
  67. PACKAGECONFIG[client] = "--enable-client,--disable-client,readline"
  68. PACKAGECONFIG[wireguard] = "--enable-wireguard,--disable-wireguard,libmnl"
  69. INITSCRIPT_NAME = "connman"
  70. INITSCRIPT_PARAMS = "start 05 5 2 3 . stop 22 0 1 6 ."
  71. python __anonymous () {
  72. systemd_packages = "${PN} ${PN}-wait-online"
  73. pkgconfig = d.getVar('PACKAGECONFIG')
  74. if ('openvpn' or 'vpnc' or 'l2tp' or 'pptp') in pkgconfig.split():
  75. systemd_packages += " ${PN}-vpn"
  76. d.setVar('SYSTEMD_PACKAGES', systemd_packages)
  77. }
  78. SYSTEMD_SERVICE:${PN} = "connman.service"
  79. SYSTEMD_SERVICE:${PN}-vpn = "connman-vpn.service"
  80. SYSTEMD_SERVICE:${PN}-wait-online = "connman-wait-online.service"
  81. ALTERNATIVE_PRIORITY = "${@bb.utils.contains('DISTRO_FEATURES','systemd-resolved','10','100',d)}"
  82. ALTERNATIVE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','resolv-conf','',d)}"
  83. ALTERNATIVE_TARGET[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv-conf.connman','',d)}"
  84. ALTERNATIVE_LINK_NAME[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv.conf','',d)}"
  85. do_install:append() {
  86. if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
  87. install -d ${D}${sysconfdir}/init.d
  88. install -m 0755 ${UNPACKDIR}/connman ${D}${sysconfdir}/init.d/connman
  89. sed -i s%@DATADIR@%${datadir}% ${D}${sysconfdir}/init.d/connman
  90. fi
  91. install -d ${D}${bindir}
  92. install -m 0755 ${B}/tools/*-test ${D}${bindir}
  93. if [ -e ${B}/tools/wispr ]; then
  94. install -m 0755 ${B}/tools/wispr ${D}${bindir}
  95. fi
  96. # We don't need to package an empty directory
  97. rmdir --ignore-fail-on-non-empty ${D}${libdir}/connman/scripts
  98. # Automake 1.12 won't install empty directories, but we need the
  99. # plugins directory to be present for ownership
  100. mkdir -p ${D}${libdir}/connman/plugins
  101. # For read-only filesystem, do not create links during bootup
  102. if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
  103. install -d ${D}${sysconfdir}
  104. ln -sf ../run/connman/resolv.conf ${D}${sysconfdir}/resolv-conf.connman
  105. fi
  106. }
  107. # These used to be plugins, but now they are core
  108. RPROVIDES:${PN} = "\
  109. connman-plugin-loopback \
  110. connman-plugin-ethernet \
  111. ${@bb.utils.contains('PACKAGECONFIG', 'bluetooth','connman-plugin-bluetooth', '', d)} \
  112. ${@bb.utils.contains('PACKAGECONFIG', 'wifi','connman-plugin-wifi', '', d)} \
  113. ${@bb.utils.contains('PACKAGECONFIG', '3g','connman-plugin-ofono', '', d)} \
  114. "
  115. PACKAGES_DYNAMIC += "^${PN}-plugin-.*"
  116. def add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, add_insane_skip):
  117. plugintype = pkg.split( '-' )[-1]
  118. if plugintype in depmap:
  119. rdepends = map(lambda x: multilib_prefix + x, \
  120. depmap[plugintype].split())
  121. d.setVar("RDEPENDS:%s" % pkg, " ".join(rdepends))
  122. if add_insane_skip:
  123. d.appendVar("INSANE_SKIP:%s" % pkg, "dev-so")
  124. python populate_packages:prepend() {
  125. depmap = dict(pppd="ppp")
  126. multilib_prefix = (d.getVar("MLPREFIX") or "")
  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, r'^(.*).so$', plugin_name, \
  132. '${PN} plugin for %s', extra_depends='', hook=hook, prepend=True )
  133. hook = lambda file,pkg,x,y,z: \
  134. add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, True)
  135. plugin_dir = d.expand('${libdir}/connman/plugins-vpn/')
  136. plugin_name = d.expand('${PN}-plugin-vpn-%s')
  137. do_split_packages(d, plugin_dir, r'^(.*).so$', plugin_name, \
  138. '${PN} VPN plugin for %s', extra_depends='', hook=hook, prepend=True )
  139. }
  140. PACKAGES =+ "${PN}-tools ${PN}-tests ${PN}-client"
  141. FILES:${PN}-tools = "${bindir}/wispr"
  142. RDEPENDS:${PN}-tools = "${PN}"
  143. FILES:${PN}-tests = "${bindir}/*-test"
  144. RDEPENDS:${PN}-tests = "${@bb.utils.contains('PACKAGECONFIG', 'iptables', 'iptables', '', d)}"
  145. FILES:${PN}-client = "${bindir}/connmanctl"
  146. RDEPENDS:${PN}-client = "${PN}"
  147. FILES:${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*.so.* \
  148. ${libdir}/connman/plugins \
  149. ${sysconfdir} ${sharedstatedir} ${localstatedir} ${datadir} \
  150. ${base_bindir}/* ${base_sbindir}/* ${base_libdir}/*.so* ${datadir}/${PN} \
  151. ${datadir}/dbus-1/system-services/* \
  152. ${sysconfdir}/tmpfiles.d/connman_resolvconf.conf"
  153. FILES:${PN}-dev += "${libdir}/connman/*/*.la"
  154. PACKAGES =+ "${PN}-vpn ${PN}-wait-online"
  155. SUMMARY:${PN}-vpn = "A daemon for managing VPN connections within embedded devices"
  156. DESCRIPTION:${PN}-vpn = "The ConnMan VPN provides a daemon for \
  157. managing VPN connections within embedded devices running the Linux \
  158. operating system. The connman-vpnd handles all the VPN connections \
  159. and starts/stops VPN client processes when necessary. The connman-vpnd \
  160. provides a DBus API for managing VPN connections. All the different \
  161. VPN technogies are implemented using plug-ins."
  162. FILES:${PN}-vpn += "${sbindir}/connman-vpnd \
  163. ${sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf \
  164. ${datadir}/dbus-1/system-services/net.connman.vpn.service \
  165. ${systemd_system_unitdir}/connman-vpn.service"
  166. SUMMARY:${PN}-wait-online = "A program that will return once ConnMan has connected to a network"
  167. DESCRIPTION:${PN}-wait-online = "A service that can be enabled so that \
  168. the system waits until a network connection is established."
  169. FILES:${PN}-wait-online += "${sbindir}/connmand-wait-online \
  170. ${systemd_system_unitdir}/connman-wait-online.service"
  171. SUMMARY:${PN}-plugin-vpn-openvpn = "An OpenVPN plugin for ConnMan VPN"
  172. DESCRIPTION:${PN}-plugin-vpn-openvpn = "The ConnMan OpenVPN plugin uses openvpn client \
  173. to create a VPN connection to OpenVPN server."
  174. FILES:${PN}-plugin-vpn-openvpn += "${libdir}/connman/scripts/openvpn-script \
  175. ${libdir}/connman/plugins-vpn/openvpn.so"
  176. RDEPENDS:${PN}-plugin-vpn-openvpn += "${PN}-vpn"
  177. RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG','openvpn','${PN}-plugin-vpn-openvpn', '', d)}"
  178. SUMMARY:${PN}-plugin-vpn-vpnc = "A vpnc plugin for ConnMan VPN"
  179. DESCRIPTION:${PN}-plugin-vpn-vpnc = "The ConnMan vpnc plugin uses vpnc client \
  180. to create a VPN connection to Cisco3000 VPN Concentrator."
  181. FILES:${PN}-plugin-vpn-vpnc += "${libdir}/connman/scripts/openconnect-script \
  182. ${libdir}/connman/plugins-vpn/vpnc.so \
  183. ${libdir}/connman/scripts/vpn-script"
  184. RDEPENDS:${PN}-plugin-vpn-vpnc += "${PN}-vpn"
  185. RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG','vpnc','${PN}-plugin-vpn-vpnc', '', d)}"
  186. SUMMARY:${PN}-plugin-vpn-l2tp = "A L2TP plugin for ConnMan VPN"
  187. DESCRIPTION:${PN}-plugin-vpn-l2tp = "The ConnMan L2TP plugin uses xl2tpd daemon \
  188. to create a VPN connection to L2TP server."
  189. FILES:${PN}-plugin-vpn-l2tp += "${libdir}/connman/scripts/libppp-plugin.so* \
  190. ${libdir}/connman/plugins-vpn/l2tp.so"
  191. RDEPENDS:${PN}-plugin-vpn-l2tp += "${PN}-vpn"
  192. RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG','l2tp','${PN}-plugin-vpn-l2tp', '', d)}"
  193. SUMMARY:${PN}-plugin-vpn-pptp = "A PPTP plugin for ConnMan VPN"
  194. DESCRIPTION:${PN}-plugin-vpn-pptp = "The ConnMan PPTP plugin uses pptp-linux client \
  195. to create a VPN connection to PPTP server."
  196. FILES:${PN}-plugin-vpn-pptp += "${libdir}/connman/scripts/libppp-plugin.so* \
  197. ${libdir}/connman/plugins-vpn/pptp.so"
  198. RDEPENDS:${PN}-plugin-vpn-pptp += "${PN}-vpn"
  199. RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG','pptp','${PN}-plugin-vpn-pptp', '', d)}"