avahi_0.8.bb 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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. AUTHOR = "Lennart Poettering <lennart@poettering.net>"
  9. HOMEPAGE = "http://avahi.org"
  10. BUGTRACKER = "https://github.com/lathiat/avahi/issues"
  11. SECTION = "network"
  12. # major part is under LGPLv2.1+, but several .dtd, .xsl, initscripts and
  13. # python scripts are under GPLv2+
  14. LICENSE = "GPLv2+ & LGPLv2.1+"
  15. LIC_FILES_CHKSUM = "file://LICENSE;md5=2d5025d4aa3495befef8f17206a5b0a1 \
  16. file://avahi-common/address.h;endline=25;md5=b1d1d2cda1c07eb848ea7d6215712d9d \
  17. file://avahi-core/dns.h;endline=23;md5=6fe82590b81aa0ddea5095b548e2fdcb \
  18. file://avahi-daemon/main.c;endline=21;md5=9ee77368c5407af77caaef1b07285969 \
  19. file://avahi-client/client.h;endline=23;md5=f4ac741a25c4f434039ba3e18c8674cf"
  20. SRC_URI = "https://github.com/lathiat/avahi/releases/download/v${PV}/avahi-${PV}.tar.gz \
  21. file://00avahi-autoipd \
  22. file://99avahi-autoipd \
  23. file://initscript.patch \
  24. file://0001-Fix-opening-etc-resolv.conf-error.patch \
  25. "
  26. UPSTREAM_CHECK_URI = "https://github.com/lathiat/avahi/releases/"
  27. SRC_URI[md5sum] = "229c6aa30674fc43c202b22c5f8c2be7"
  28. SRC_URI[sha256sum] = "060309d7a333d38d951bc27598c677af1796934dbd98e1024e7ad8de798fedda"
  29. DEPENDS = "expat libcap libdaemon glib-2.0 intltool-native"
  30. # For gtk related PACKAGECONFIGs: gtk, gtk3
  31. AVAHI_GTK ?= "gtk3"
  32. PACKAGECONFIG ??= "dbus ${@bb.utils.contains_any('DISTRO_FEATURES','x11 wayland','${AVAHI_GTK}','',d)}"
  33. PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
  34. PACKAGECONFIG[gtk] = "--enable-gtk,--disable-gtk,gtk+"
  35. PACKAGECONFIG[gtk3] = "--enable-gtk3,--disable-gtk3,gtk+3"
  36. PACKAGECONFIG[libdns_sd] = "--enable-compat-libdns_sd --enable-dbus,,dbus"
  37. PACKAGECONFIG[libevent] = "--enable-libevent,--disable-libevent,libevent"
  38. PACKAGECONFIG[qt5] = "--enable-qt5,--disable-qt5,qtbase"
  39. inherit autotools pkgconfig gettext gobject-introspection
  40. EXTRA_OECONF = "--with-avahi-priv-access-group=adm \
  41. --disable-stack-protector \
  42. --disable-gdbm \
  43. --disable-dbm \
  44. --disable-mono \
  45. --disable-monodoc \
  46. --disable-qt3 \
  47. --disable-qt4 \
  48. --disable-python \
  49. --disable-doxygen-doc \
  50. --enable-manpages \
  51. ${EXTRA_OECONF_SYSVINIT} \
  52. ${EXTRA_OECONF_SYSTEMD} \
  53. "
  54. # The distro choice determines what init scripts are installed
  55. EXTRA_OECONF_SYSVINIT = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','--with-distro=debian','--with-distro=none',d)}"
  56. EXTRA_OECONF_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES','systemd','--with-systemdsystemunitdir=${systemd_unitdir}/system/','--without-systemdsystemunitdir',d)}"
  57. do_configure_prepend() {
  58. # This m4 file will get in the way of our introspection.m4 with special cross-compilation fixes
  59. rm "${S}/common/introspection.m4" || true
  60. }
  61. do_compile_prepend() {
  62. export GIR_EXTRA_LIBS_PATH="${B}/avahi-gobject/.libs:${B}/avahi-common/.libs:${B}/avahi-client/.libs:${B}/avahi-glib/.libs"
  63. }
  64. RRECOMMENDS_${PN}_append_libc-glibc = " libnss-mdns"
  65. do_install() {
  66. autotools_do_install
  67. rm -rf ${D}/run
  68. rm -rf ${D}${datadir}/dbus-1/interfaces
  69. test -d ${D}${datadir}/dbus-1 && rmdir --ignore-fail-on-non-empty ${D}${datadir}/dbus-1
  70. rm -rf ${D}${libdir}/avahi
  71. # Move example service files out of /etc/avahi/services so we don't
  72. # advertise ssh & sftp-ssh by default
  73. install -d ${D}${docdir}/avahi
  74. mv ${D}${sysconfdir}/avahi/services/* ${D}${docdir}/avahi
  75. }
  76. PACKAGES =+ "${@bb.utils.contains("PACKAGECONFIG", "libdns_sd", "libavahi-compat-libdnssd", "", d)}"
  77. FILES_libavahi-compat-libdnssd = "${libdir}/libdns_sd.so.*"
  78. RPROVIDES_libavahi-compat-libdnssd = "libdns-sd"
  79. inherit update-rc.d systemd useradd
  80. PACKAGES =+ "libavahi-gobject avahi-daemon libavahi-common libavahi-core libavahi-client avahi-dnsconfd libavahi-glib avahi-autoipd avahi-utils avahi-discover avahi-ui"
  81. FILES_avahi-ui = "${libdir}/libavahi-ui*.so.*"
  82. FILES_avahi-discover = "${datadir}/applications/avahi-discover.desktop \
  83. ${datadir}/avahi/interfaces/avahi-discover.ui \
  84. ${bindir}/avahi-discover-standalone \
  85. "
  86. LICENSE_libavahi-gobject = "LGPLv2.1+"
  87. LICENSE_avahi-daemon = "LGPLv2.1+"
  88. LICENSE_libavahi-common = "LGPLv2.1+"
  89. LICENSE_libavahi-core = "LGPLv2.1+"
  90. LICENSE_libavahi-client = "LGPLv2.1+"
  91. LICENSE_avahi-dnsconfd = "LGPLv2.1+"
  92. LICENSE_libavahi-glib = "LGPLv2.1+"
  93. LICENSE_avahi-autoipd = "LGPLv2.1+"
  94. LICENSE_avahi-utils = "LGPLv2.1+"
  95. # As avahi doesn't put any files into PN, clear the files list to avoid problems
  96. # if extra libraries appear.
  97. FILES_${PN} = ""
  98. FILES_avahi-autoipd = "${sbindir}/avahi-autoipd \
  99. ${sysconfdir}/avahi/avahi-autoipd.action \
  100. ${sysconfdir}/dhcp/*/avahi-autoipd \
  101. ${sysconfdir}/udhcpc.d/00avahi-autoipd \
  102. ${sysconfdir}/udhcpc.d/99avahi-autoipd"
  103. FILES_libavahi-common = "${libdir}/libavahi-common.so.*"
  104. FILES_libavahi-core = "${libdir}/libavahi-core.so.* ${libdir}/girepository-1.0/AvahiCore*.typelib"
  105. FILES_avahi-daemon = "${sbindir}/avahi-daemon \
  106. ${sysconfdir}/avahi/avahi-daemon.conf \
  107. ${sysconfdir}/avahi/hosts \
  108. ${sysconfdir}/avahi/services \
  109. ${sysconfdir}/dbus-1 \
  110. ${sysconfdir}/init.d/avahi-daemon \
  111. ${datadir}/avahi/introspection/*.introspect \
  112. ${datadir}/avahi/avahi-service.dtd \
  113. ${datadir}/avahi/service-types \
  114. ${datadir}/dbus-1/system-services"
  115. FILES_libavahi-client = "${libdir}/libavahi-client.so.*"
  116. FILES_avahi-dnsconfd = "${sbindir}/avahi-dnsconfd \
  117. ${sysconfdir}/avahi/avahi-dnsconfd.action \
  118. ${sysconfdir}/init.d/avahi-dnsconfd"
  119. FILES_libavahi-glib = "${libdir}/libavahi-glib.so.*"
  120. FILES_libavahi-gobject = "${libdir}/libavahi-gobject.so.* ${libdir}/girepository-1.0/Avahi*.typelib"
  121. FILES_avahi-utils = "${bindir}/avahi-* ${bindir}/b* ${datadir}/applications/b*"
  122. RDEPENDS_${PN}-dev = "avahi-daemon (= ${EXTENDPKGV}) libavahi-core (= ${EXTENDPKGV})"
  123. RDEPENDS_${PN}-dev += "${@["", " libavahi-client (= ${EXTENDPKGV})"][bb.utils.contains('PACKAGECONFIG', 'dbus', 1, 0, d)]}"
  124. RDEPENDS_${PN}-dnsconfd = "${PN}-daemon"
  125. RRECOMMENDS_avahi-daemon_append_libc-glibc = " libnss-mdns"
  126. CONFFILES_avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf"
  127. USERADD_PACKAGES = "avahi-daemon avahi-autoipd"
  128. USERADD_PARAM_avahi-daemon = "--system --home /run/avahi-daemon \
  129. --no-create-home --shell /bin/false \
  130. --user-group avahi"
  131. USERADD_PARAM_avahi-autoipd = "--system --home /run/avahi-autoipd \
  132. --no-create-home --shell /bin/false \
  133. --user-group \
  134. -c \"Avahi autoip daemon\" \
  135. avahi-autoipd"
  136. INITSCRIPT_PACKAGES = "avahi-daemon avahi-dnsconfd"
  137. INITSCRIPT_NAME_avahi-daemon = "avahi-daemon"
  138. INITSCRIPT_PARAMS_avahi-daemon = "defaults 21 19"
  139. INITSCRIPT_NAME_avahi-dnsconfd = "avahi-dnsconfd"
  140. INITSCRIPT_PARAMS_avahi-dnsconfd = "defaults 22 19"
  141. SYSTEMD_PACKAGES = "${PN}-daemon ${PN}-dnsconfd"
  142. SYSTEMD_SERVICE_${PN}-daemon = "avahi-daemon.service"
  143. SYSTEMD_SERVICE_${PN}-dnsconfd = "avahi-dnsconfd.service"
  144. do_install_append() {
  145. install -d ${D}${sysconfdir}/udhcpc.d
  146. install ${WORKDIR}/00avahi-autoipd ${D}${sysconfdir}/udhcpc.d
  147. install ${WORKDIR}/99avahi-autoipd ${D}${sysconfdir}/udhcpc.d
  148. }
  149. # At the time the postinst runs, dbus might not be setup so only restart if running
  150. # Don't exit early, because update-rc.d needs to run subsequently.
  151. pkg_postinst_avahi-daemon () {
  152. if [ -z "$D" ]; then
  153. killall -q -HUP dbus-daemon || true
  154. fi
  155. }