avahi_0.8.bb 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. SUMMARY = "Avahi IPv4LL network address configuration daemon"
  2. DESCRIPTION = 'Avahi is a fully LGPL framework for Multicast DNS Service Discovery. It \
  3. allows programs to publish and discover services and hosts running on a local network \
  4. with no specific configuration. This tool implements IPv4LL, "Dynamic Configuration of \
  5. IPv4 Link-Local Addresses" (IETF RFC3927), a protocol for automatic IP address \
  6. configuration from the link-local 169.254.0.0/16 range without the need for a central \
  7. server.'
  8. HOMEPAGE = "http://avahi.org"
  9. BUGTRACKER = "https://github.com/avahi/avahi/issues"
  10. SECTION = "network"
  11. # major part is under LGPL-2.1-or-later, but several .dtd, .xsl, initscripts and
  12. # python scripts are under GPL-2.0-or-later
  13. LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later"
  14. LIC_FILES_CHKSUM = "file://LICENSE;md5=2d5025d4aa3495befef8f17206a5b0a1 \
  15. file://avahi-common/address.h;endline=25;md5=b1d1d2cda1c07eb848ea7d6215712d9d \
  16. file://avahi-core/dns.h;endline=23;md5=6fe82590b81aa0ddea5095b548e2fdcb \
  17. file://avahi-daemon/main.c;endline=21;md5=9ee77368c5407af77caaef1b07285969 \
  18. file://avahi-client/client.h;endline=23;md5=f4ac741a25c4f434039ba3e18c8674cf"
  19. SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/avahi-${PV}.tar.gz \
  20. file://00avahi-autoipd \
  21. file://99avahi-autoipd \
  22. file://initscript.patch \
  23. file://0001-Fix-opening-etc-resolv.conf-error.patch \
  24. file://handle-hup.patch \
  25. file://local-ping.patch \
  26. file://invalid-service.patch \
  27. file://CVE-2023-1981.patch \
  28. file://CVE-2023-38469-1.patch \
  29. file://CVE-2023-38469-2.patch \
  30. file://CVE-2023-38470-1.patch \
  31. file://CVE-2023-38470-2.patch \
  32. file://CVE-2023-38471-1.patch \
  33. file://CVE-2023-38471-2.patch \
  34. file://CVE-2023-38472.patch \
  35. file://CVE-2023-38473.patch \
  36. "
  37. GITHUB_BASE_URI = "https://github.com/avahi/avahi/releases/"
  38. SRC_URI[sha256sum] = "060309d7a333d38d951bc27598c677af1796934dbd98e1024e7ad8de798fedda"
  39. CVE_STATUS[CVE-2021-26720] = "not-applicable-platform: Issue only affects Debian/SUSE"
  40. DEPENDS = "expat libcap libdaemon glib-2.0 glib-2.0-native"
  41. # For gtk related PACKAGECONFIGs: gtk, gtk3
  42. AVAHI_GTK ?= ""
  43. PACKAGECONFIG ??= "dbus ${@bb.utils.contains_any('DISTRO_FEATURES','x11 wayland','${AVAHI_GTK}','',d)}"
  44. PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
  45. PACKAGECONFIG[gtk] = "--enable-gtk,--disable-gtk,gtk+"
  46. PACKAGECONFIG[gtk3] = "--enable-gtk3,--disable-gtk3,gtk+3"
  47. PACKAGECONFIG[libdns_sd] = "--enable-compat-libdns_sd --enable-dbus,,dbus"
  48. PACKAGECONFIG[libevent] = "--enable-libevent,--disable-libevent,libevent"
  49. PACKAGECONFIG[qt5] = "--enable-qt5,--disable-qt5,qtbase"
  50. inherit autotools pkgconfig gettext gobject-introspection github-releases
  51. EXTRA_OECONF = "--with-avahi-priv-access-group=adm \
  52. --disable-stack-protector \
  53. --disable-gdbm \
  54. --disable-dbm \
  55. --disable-mono \
  56. --disable-monodoc \
  57. --disable-qt3 \
  58. --disable-qt4 \
  59. --disable-python \
  60. --disable-doxygen-doc \
  61. --enable-manpages \
  62. ${EXTRA_OECONF_SYSVINIT} \
  63. ${EXTRA_OECONF_SYSTEMD} \
  64. "
  65. # The distro choice determines what init scripts are installed
  66. EXTRA_OECONF_SYSVINIT = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','--with-distro=debian','--with-distro=none',d)}"
  67. EXTRA_OECONF_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES','systemd','--with-systemdsystemunitdir=${systemd_system_unitdir}/','--without-systemdsystemunitdir',d)}"
  68. do_configure:prepend() {
  69. # This m4 file will get in the way of our introspection.m4 with special cross-compilation fixes
  70. rm "${S}/common/introspection.m4" || true
  71. }
  72. do_compile:prepend() {
  73. export GIR_EXTRA_LIBS_PATH="${B}/avahi-gobject/.libs:${B}/avahi-common/.libs:${B}/avahi-client/.libs:${B}/avahi-glib/.libs"
  74. }
  75. RRECOMMENDS:${PN}:append:libc-glibc = " libnss-mdns"
  76. do_install() {
  77. autotools_do_install
  78. rm -rf ${D}/run
  79. test -d ${D}${datadir}/dbus-1 && rmdir --ignore-fail-on-non-empty ${D}${datadir}/dbus-1
  80. rm -rf ${D}${libdir}/avahi
  81. # Move example service files out of /etc/avahi/services so we don't
  82. # advertise ssh & sftp-ssh by default
  83. install -d ${D}${docdir}/avahi
  84. mv ${D}${sysconfdir}/avahi/services/* ${D}${docdir}/avahi
  85. }
  86. PACKAGES =+ "${@bb.utils.contains("PACKAGECONFIG", "libdns_sd", "libavahi-compat-libdnssd", "", d)}"
  87. FILES:libavahi-compat-libdnssd = "${libdir}/libdns_sd.so.*"
  88. RPROVIDES:libavahi-compat-libdnssd = "libdns-sd"
  89. inherit update-rc.d systemd useradd
  90. PACKAGES =+ "libavahi-gobject avahi-daemon libavahi-common libavahi-core libavahi-client avahi-dnsconfd libavahi-glib avahi-autoipd avahi-utils avahi-discover avahi-ui"
  91. FILES:avahi-ui = "${libdir}/libavahi-ui*.so.*"
  92. FILES:avahi-discover = "${datadir}/applications/avahi-discover.desktop \
  93. ${datadir}/avahi/interfaces/avahi-discover.ui \
  94. ${bindir}/avahi-discover-standalone \
  95. "
  96. LICENSE:libavahi-gobject = "LGPL-2.1-or-later"
  97. LICENSE:avahi-daemon = "LGPL-2.1-or-later"
  98. LICENSE:libavahi-common = "LGPL-2.1-or-later"
  99. LICENSE:libavahi-core = "LGPL-2.1-or-later"
  100. LICENSE:libavahi-client = "LGPL-2.1-or-later"
  101. LICENSE:avahi-dnsconfd = "LGPL-2.1-or-later"
  102. LICENSE:libavahi-glib = "LGPL-2.1-or-later"
  103. LICENSE:avahi-autoipd = "LGPL-2.1-or-later"
  104. LICENSE:avahi-utils = "LGPL-2.1-or-later"
  105. # As avahi doesn't put any files into PN, clear the files list to avoid problems
  106. # if extra libraries appear.
  107. FILES:${PN} = ""
  108. FILES:avahi-autoipd = "${sbindir}/avahi-autoipd \
  109. ${sysconfdir}/avahi/avahi-autoipd.action \
  110. ${sysconfdir}/dhcp/*/avahi-autoipd \
  111. ${sysconfdir}/udhcpc.d/00avahi-autoipd \
  112. ${sysconfdir}/udhcpc.d/99avahi-autoipd"
  113. FILES:libavahi-common = "${libdir}/libavahi-common.so.*"
  114. FILES:libavahi-core = "${libdir}/libavahi-core.so.* ${libdir}/girepository-1.0/AvahiCore*.typelib"
  115. FILES:avahi-daemon = "${sbindir}/avahi-daemon \
  116. ${sysconfdir}/avahi/avahi-daemon.conf \
  117. ${sysconfdir}/avahi/hosts \
  118. ${sysconfdir}/avahi/services \
  119. ${sysconfdir}/dbus-1 \
  120. ${sysconfdir}/init.d/avahi-daemon \
  121. ${datadir}/dbus-1/interfaces \
  122. ${datadir}/avahi/avahi-service.dtd \
  123. ${datadir}/avahi/service-types \
  124. ${datadir}/dbus-1/system-services"
  125. FILES:libavahi-client = "${libdir}/libavahi-client.so.*"
  126. FILES:avahi-dnsconfd = "${sbindir}/avahi-dnsconfd \
  127. ${sysconfdir}/avahi/avahi-dnsconfd.action \
  128. ${sysconfdir}/init.d/avahi-dnsconfd"
  129. FILES:libavahi-glib = "${libdir}/libavahi-glib.so.*"
  130. FILES:libavahi-gobject = "${libdir}/libavahi-gobject.so.* ${libdir}/girepository-1.0/Avahi*.typelib"
  131. FILES:avahi-utils = "${bindir}/avahi-* ${bindir}/b* ${datadir}/applications/b*"
  132. DEV_PKG_DEPENDENCY = "avahi-daemon (= ${EXTENDPKGV}) libavahi-core (= ${EXTENDPKGV})"
  133. DEV_PKG_DEPENDENCY += "${@["", " libavahi-client (= ${EXTENDPKGV})"][bb.utils.contains('PACKAGECONFIG', 'dbus', 1, 0, d)]}"
  134. RDEPENDS:${PN}-dnsconfd = "${PN}-daemon"
  135. RRECOMMENDS:avahi-daemon:append:libc-glibc = " libnss-mdns"
  136. CONFFILES:avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf"
  137. USERADD_PACKAGES = "avahi-daemon avahi-autoipd"
  138. USERADD_PARAM:avahi-daemon = "--system --home /run/avahi-daemon \
  139. --no-create-home --shell /bin/false \
  140. --user-group avahi"
  141. USERADD_PARAM:avahi-autoipd = "--system --home /run/avahi-autoipd \
  142. --no-create-home --shell /bin/false \
  143. --user-group \
  144. -c \"Avahi autoip daemon\" \
  145. avahi-autoipd"
  146. INITSCRIPT_PACKAGES = "avahi-daemon avahi-dnsconfd"
  147. INITSCRIPT_NAME:avahi-daemon = "avahi-daemon"
  148. INITSCRIPT_PARAMS:avahi-daemon = "defaults 21 19"
  149. INITSCRIPT_NAME:avahi-dnsconfd = "avahi-dnsconfd"
  150. INITSCRIPT_PARAMS:avahi-dnsconfd = "defaults 22 19"
  151. SYSTEMD_PACKAGES = "${PN}-daemon ${PN}-dnsconfd"
  152. SYSTEMD_SERVICE:${PN}-daemon = "avahi-daemon.service"
  153. SYSTEMD_SERVICE:${PN}-dnsconfd = "avahi-dnsconfd.service"
  154. do_install:append() {
  155. install -d ${D}${sysconfdir}/udhcpc.d
  156. install ${UNPACKDIR}/00avahi-autoipd ${D}${sysconfdir}/udhcpc.d
  157. install ${UNPACKDIR}/99avahi-autoipd ${D}${sysconfdir}/udhcpc.d
  158. }
  159. # At the time the postinst runs, dbus might not be setup so only restart if running
  160. # Don't exit early, because update-rc.d needs to run subsequently.
  161. pkg_postinst:avahi-daemon () {
  162. if [ -z "$D" ]; then
  163. killall -q -HUP dbus-daemon || true
  164. fi
  165. }