Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 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 | |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 13 | # major part is under LGPL-2.1-or-later, but several .dtd, .xsl, initscripts and |
| 14 | # python scripts are under GPL-2.0-or-later |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 15 | LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later" |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 16 | LIC_FILES_CHKSUM = "file://LICENSE;md5=2d5025d4aa3495befef8f17206a5b0a1 \ |
| 17 | file://avahi-common/address.h;endline=25;md5=b1d1d2cda1c07eb848ea7d6215712d9d \ |
| 18 | file://avahi-core/dns.h;endline=23;md5=6fe82590b81aa0ddea5095b548e2fdcb \ |
| 19 | file://avahi-daemon/main.c;endline=21;md5=9ee77368c5407af77caaef1b07285969 \ |
| 20 | file://avahi-client/client.h;endline=23;md5=f4ac741a25c4f434039ba3e18c8674cf" |
| 21 | |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 22 | SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/avahi-${PV}.tar.gz \ |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 23 | file://00avahi-autoipd \ |
| 24 | file://99avahi-autoipd \ |
| 25 | file://initscript.patch \ |
| 26 | file://0001-Fix-opening-etc-resolv.conf-error.patch \ |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 27 | file://handle-hup.patch \ |
Andrew Geissler | 5f35090 | 2021-07-23 13:09:54 -0400 | [diff] [blame] | 28 | file://local-ping.patch \ |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 29 | " |
| 30 | |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 31 | GITHUB_BASE_URI = "https://github.com/lathiat/avahi/releases/" |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 32 | SRC_URI[md5sum] = "229c6aa30674fc43c202b22c5f8c2be7" |
| 33 | SRC_URI[sha256sum] = "060309d7a333d38d951bc27598c677af1796934dbd98e1024e7ad8de798fedda" |
| 34 | |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 35 | # Issue only affects Debian/SUSE, not us |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 36 | CVE_CHECK_IGNORE += "CVE-2021-26720" |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 37 | |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 38 | DEPENDS = "expat libcap libdaemon glib-2.0 glib-2.0-native" |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 39 | |
| 40 | # For gtk related PACKAGECONFIGs: gtk, gtk3 |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 41 | AVAHI_GTK ?= "" |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 42 | |
| 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 | |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 51 | inherit autotools pkgconfig gettext gobject-introspection github-releases |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 52 | |
| 53 | EXTRA_OECONF = "--with-avahi-priv-access-group=adm \ |
| 54 | --disable-stack-protector \ |
| 55 | --disable-gdbm \ |
| 56 | --disable-dbm \ |
| 57 | --disable-mono \ |
| 58 | --disable-monodoc \ |
| 59 | --disable-qt3 \ |
| 60 | --disable-qt4 \ |
| 61 | --disable-python \ |
| 62 | --disable-doxygen-doc \ |
| 63 | --enable-manpages \ |
| 64 | ${EXTRA_OECONF_SYSVINIT} \ |
| 65 | ${EXTRA_OECONF_SYSTEMD} \ |
| 66 | " |
| 67 | |
| 68 | # The distro choice determines what init scripts are installed |
| 69 | EXTRA_OECONF_SYSVINIT = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','--with-distro=debian','--with-distro=none',d)}" |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 70 | EXTRA_OECONF_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES','systemd','--with-systemdsystemunitdir=${systemd_system_unitdir}/','--without-systemdsystemunitdir',d)}" |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 71 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 72 | do_configure:prepend() { |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 73 | # This m4 file will get in the way of our introspection.m4 with special cross-compilation fixes |
| 74 | rm "${S}/common/introspection.m4" || true |
| 75 | } |
| 76 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 77 | do_compile:prepend() { |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 78 | export GIR_EXTRA_LIBS_PATH="${B}/avahi-gobject/.libs:${B}/avahi-common/.libs:${B}/avahi-client/.libs:${B}/avahi-glib/.libs" |
| 79 | } |
| 80 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 81 | RRECOMMENDS:${PN}:append:libc-glibc = " libnss-mdns" |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 82 | |
| 83 | do_install() { |
| 84 | autotools_do_install |
| 85 | rm -rf ${D}/run |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 86 | test -d ${D}${datadir}/dbus-1 && rmdir --ignore-fail-on-non-empty ${D}${datadir}/dbus-1 |
| 87 | rm -rf ${D}${libdir}/avahi |
Andrew Geissler | 1e34c2d | 2020-05-29 16:02:59 -0500 | [diff] [blame] | 88 | |
| 89 | # Move example service files out of /etc/avahi/services so we don't |
| 90 | # advertise ssh & sftp-ssh by default |
| 91 | install -d ${D}${docdir}/avahi |
| 92 | mv ${D}${sysconfdir}/avahi/services/* ${D}${docdir}/avahi |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 93 | } |
| 94 | |
| 95 | PACKAGES =+ "${@bb.utils.contains("PACKAGECONFIG", "libdns_sd", "libavahi-compat-libdnssd", "", d)}" |
| 96 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 97 | FILES:libavahi-compat-libdnssd = "${libdir}/libdns_sd.so.*" |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 98 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 99 | RPROVIDES:libavahi-compat-libdnssd = "libdns-sd" |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 100 | |
| 101 | inherit update-rc.d systemd useradd |
| 102 | |
| 103 | PACKAGES =+ "libavahi-gobject avahi-daemon libavahi-common libavahi-core libavahi-client avahi-dnsconfd libavahi-glib avahi-autoipd avahi-utils avahi-discover avahi-ui" |
| 104 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 105 | FILES:avahi-ui = "${libdir}/libavahi-ui*.so.*" |
| 106 | FILES:avahi-discover = "${datadir}/applications/avahi-discover.desktop \ |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 107 | ${datadir}/avahi/interfaces/avahi-discover.ui \ |
| 108 | ${bindir}/avahi-discover-standalone \ |
| 109 | " |
| 110 | |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 111 | LICENSE:libavahi-gobject = "LGPL-2.1-or-later" |
| 112 | LICENSE:avahi-daemon = "LGPL-2.1-or-later" |
| 113 | LICENSE:libavahi-common = "LGPL-2.1-or-later" |
| 114 | LICENSE:libavahi-core = "LGPL-2.1-or-later" |
| 115 | LICENSE:libavahi-client = "LGPL-2.1-or-later" |
| 116 | LICENSE:avahi-dnsconfd = "LGPL-2.1-or-later" |
| 117 | LICENSE:libavahi-glib = "LGPL-2.1-or-later" |
| 118 | LICENSE:avahi-autoipd = "LGPL-2.1-or-later" |
| 119 | LICENSE:avahi-utils = "LGPL-2.1-or-later" |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 120 | |
| 121 | # As avahi doesn't put any files into PN, clear the files list to avoid problems |
| 122 | # if extra libraries appear. |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 123 | FILES:${PN} = "" |
| 124 | FILES:avahi-autoipd = "${sbindir}/avahi-autoipd \ |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 125 | ${sysconfdir}/avahi/avahi-autoipd.action \ |
| 126 | ${sysconfdir}/dhcp/*/avahi-autoipd \ |
| 127 | ${sysconfdir}/udhcpc.d/00avahi-autoipd \ |
| 128 | ${sysconfdir}/udhcpc.d/99avahi-autoipd" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 129 | FILES:libavahi-common = "${libdir}/libavahi-common.so.*" |
| 130 | FILES:libavahi-core = "${libdir}/libavahi-core.so.* ${libdir}/girepository-1.0/AvahiCore*.typelib" |
| 131 | FILES:avahi-daemon = "${sbindir}/avahi-daemon \ |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 132 | ${sysconfdir}/avahi/avahi-daemon.conf \ |
| 133 | ${sysconfdir}/avahi/hosts \ |
| 134 | ${sysconfdir}/avahi/services \ |
| 135 | ${sysconfdir}/dbus-1 \ |
| 136 | ${sysconfdir}/init.d/avahi-daemon \ |
Patrick Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 137 | ${datadir}/dbus-1/interfaces \ |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 138 | ${datadir}/avahi/avahi-service.dtd \ |
| 139 | ${datadir}/avahi/service-types \ |
| 140 | ${datadir}/dbus-1/system-services" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 141 | FILES:libavahi-client = "${libdir}/libavahi-client.so.*" |
| 142 | FILES:avahi-dnsconfd = "${sbindir}/avahi-dnsconfd \ |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 143 | ${sysconfdir}/avahi/avahi-dnsconfd.action \ |
| 144 | ${sysconfdir}/init.d/avahi-dnsconfd" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 145 | FILES:libavahi-glib = "${libdir}/libavahi-glib.so.*" |
| 146 | FILES:libavahi-gobject = "${libdir}/libavahi-gobject.so.* ${libdir}/girepository-1.0/Avahi*.typelib" |
| 147 | FILES:avahi-utils = "${bindir}/avahi-* ${bindir}/b* ${datadir}/applications/b*" |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 148 | |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame] | 149 | DEV_PKG_DEPENDENCY = "avahi-daemon (= ${EXTENDPKGV}) libavahi-core (= ${EXTENDPKGV})" |
| 150 | DEV_PKG_DEPENDENCY += "${@["", " libavahi-client (= ${EXTENDPKGV})"][bb.utils.contains('PACKAGECONFIG', 'dbus', 1, 0, d)]}" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 151 | RDEPENDS:${PN}-dnsconfd = "${PN}-daemon" |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 152 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 153 | RRECOMMENDS:avahi-daemon:append:libc-glibc = " libnss-mdns" |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 154 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 155 | CONFFILES:avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf" |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 156 | |
| 157 | USERADD_PACKAGES = "avahi-daemon avahi-autoipd" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 158 | USERADD_PARAM:avahi-daemon = "--system --home /run/avahi-daemon \ |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 159 | --no-create-home --shell /bin/false \ |
| 160 | --user-group avahi" |
| 161 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 162 | USERADD_PARAM:avahi-autoipd = "--system --home /run/avahi-autoipd \ |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 163 | --no-create-home --shell /bin/false \ |
| 164 | --user-group \ |
| 165 | -c \"Avahi autoip daemon\" \ |
| 166 | avahi-autoipd" |
| 167 | |
| 168 | INITSCRIPT_PACKAGES = "avahi-daemon avahi-dnsconfd" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 169 | INITSCRIPT_NAME:avahi-daemon = "avahi-daemon" |
| 170 | INITSCRIPT_PARAMS:avahi-daemon = "defaults 21 19" |
| 171 | INITSCRIPT_NAME:avahi-dnsconfd = "avahi-dnsconfd" |
| 172 | INITSCRIPT_PARAMS:avahi-dnsconfd = "defaults 22 19" |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 173 | |
| 174 | SYSTEMD_PACKAGES = "${PN}-daemon ${PN}-dnsconfd" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 175 | SYSTEMD_SERVICE:${PN}-daemon = "avahi-daemon.service" |
| 176 | SYSTEMD_SERVICE:${PN}-dnsconfd = "avahi-dnsconfd.service" |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 177 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 178 | do_install:append() { |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 179 | install -d ${D}${sysconfdir}/udhcpc.d |
| 180 | install ${WORKDIR}/00avahi-autoipd ${D}${sysconfdir}/udhcpc.d |
| 181 | install ${WORKDIR}/99avahi-autoipd ${D}${sysconfdir}/udhcpc.d |
| 182 | } |
| 183 | |
| 184 | # At the time the postinst runs, dbus might not be setup so only restart if running |
| 185 | # Don't exit early, because update-rc.d needs to run subsequently. |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 186 | pkg_postinst:avahi-daemon () { |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 187 | if [ -z "$D" ]; then |
| 188 | killall -q -HUP dbus-daemon || true |
| 189 | fi |
| 190 | } |
| 191 | |