Patrick Williams | c124f4f | 2015-09-15 14:41:29 -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" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 10 | BUGTRACKER = "https://github.com/lathiat/avahi/issues" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 11 | SECTION = "network" |
| 12 | |
| 13 | # major part is under LGPLv2.1+, but several .dtd, .xsl, initscripts and |
| 14 | # python scripts are under GPLv2+ |
| 15 | LICENSE = "GPLv2+ & LGPLv2.1+" |
| 16 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 17 | DEPENDS = "expat libcap libdaemon glib-2.0 intltool-native" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 18 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 19 | SRC_URI = "https://github.com/lathiat/avahi/releases/download/v${PV}/avahi-${PV}.tar.gz \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 20 | file://00avahi-autoipd \ |
| 21 | file://99avahi-autoipd \ |
| 22 | file://initscript.patch \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 23 | " |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 24 | UPSTREAM_CHECK_URI = "https://github.com/lathiat/avahi/releases/" |
| 25 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 26 | # For gtk related PACKAGECONFIGs: gtk, gtk3 |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 27 | AVAHI_GTK ?= "" |
| 28 | |
| 29 | PACKAGECONFIG ??= "dbus ${AVAHI_GTK}" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 30 | PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 31 | PACKAGECONFIG[gtk] = "--enable-gtk,--disable-gtk,gtk+" |
| 32 | PACKAGECONFIG[gtk3] = "--enable-gtk3,--disable-gtk3,gtk+3" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 33 | |
| 34 | USERADD_PACKAGES = "avahi-daemon avahi-autoipd" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 35 | USERADD_PARAM_avahi-daemon = "--system --home /run/avahi-daemon \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 36 | --no-create-home --shell /bin/false \ |
| 37 | --user-group avahi" |
| 38 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 39 | USERADD_PARAM_avahi-autoipd = "--system --home /run/avahi-autoipd \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 40 | --no-create-home --shell /bin/false \ |
| 41 | --user-group \ |
| 42 | -c \"Avahi autoip daemon\" \ |
| 43 | avahi-autoipd" |
| 44 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 45 | inherit autotools pkgconfig update-rc.d gettext useradd gobject-introspection |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 46 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 47 | EXTRA_OECONF = "--with-avahi-priv-access-group=adm \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 48 | --disable-stack-protector \ |
| 49 | --disable-gdbm \ |
| 50 | --disable-mono \ |
| 51 | --disable-monodoc \ |
| 52 | --disable-qt3 \ |
| 53 | --disable-qt4 \ |
| 54 | --disable-python \ |
| 55 | --disable-doxygen-doc \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 56 | --enable-manpages \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 57 | ${EXTRA_OECONF_SYSVINIT} \ |
| 58 | ${EXTRA_OECONF_SYSTEMD} \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 59 | " |
| 60 | |
| 61 | # The distro choice determines what init scripts are installed |
| 62 | EXTRA_OECONF_SYSVINIT = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','--with-distro=debian','--with-distro=none',d)}" |
| 63 | EXTRA_OECONF_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES','systemd','--with-systemdsystemunitdir=${systemd_unitdir}/system/','--without-systemdsystemunitdir',d)}" |
| 64 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 65 | do_configure_prepend() { |
| 66 | sed 's:AM_CHECK_PYMOD:echo "no pymod" #AM_CHECK_PYMOD:g' -i ${S}/configure.ac |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 67 | |
| 68 | # This m4 file will get in the way of our introspection.m4 with special cross-compilation fixes |
| 69 | rm "${S}/common/introspection.m4" || true |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 70 | } |
| 71 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 72 | do_compile_prepend() { |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 73 | export GIR_EXTRA_LIBS_PATH="${B}/avahi-gobject/.libs:${B}/avahi-common/.libs:${B}/avahi-client/.libs:${B}/avahi-glib/.libs" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 74 | } |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 75 | |
| 76 | PACKAGES =+ "avahi-daemon libavahi-common libavahi-core libavahi-client avahi-dnsconfd libavahi-glib libavahi-ui avahi-autoipd avahi-utils" |
| 77 | |
| 78 | # As avahi doesn't put any files into PN, clear the files list to avoid problems |
| 79 | # if extra libraries appear. |
| 80 | FILES_${PN} = "" |
| 81 | FILES_avahi-autoipd = "${sbindir}/avahi-autoipd \ |
| 82 | ${sysconfdir}/avahi/avahi-autoipd.action \ |
| 83 | ${sysconfdir}/dhcp/*/avahi-autoipd \ |
| 84 | ${sysconfdir}/udhcpc.d/00avahi-autoipd \ |
| 85 | ${sysconfdir}/udhcpc.d/99avahi-autoipd" |
| 86 | FILES_libavahi-common = "${libdir}/libavahi-common.so.*" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 87 | FILES_libavahi-core = "${libdir}/libavahi-core.so.* ${libdir}/girepository-1.0/AvahiCore*.typelib" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 88 | FILES_avahi-daemon = "${sbindir}/avahi-daemon \ |
| 89 | ${sysconfdir}/avahi/avahi-daemon.conf \ |
| 90 | ${sysconfdir}/avahi/hosts \ |
| 91 | ${sysconfdir}/avahi/services \ |
| 92 | ${sysconfdir}/dbus-1 \ |
| 93 | ${sysconfdir}/init.d/avahi-daemon \ |
| 94 | ${datadir}/avahi/introspection/*.introspect \ |
| 95 | ${datadir}/avahi/avahi-service.dtd \ |
| 96 | ${datadir}/avahi/service-types \ |
| 97 | ${datadir}/dbus-1/system-services" |
| 98 | FILES_libavahi-client = "${libdir}/libavahi-client.so.*" |
| 99 | FILES_libavahi-ui = "${libdir}/libavahi-ui.so.*" |
| 100 | FILES_avahi-dnsconfd = "${sbindir}/avahi-dnsconfd \ |
| 101 | ${sysconfdir}/avahi/avahi-dnsconfd.action \ |
| 102 | ${sysconfdir}/init.d/avahi-dnsconfd" |
| 103 | FILES_libavahi-glib = "${libdir}/libavahi-glib.so.*" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 104 | FILES_libavahi-gobject = "${libdir}/libavahi-gobject.so.* ${libdir}/girepository-1.0/Avahi*.typelib" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 105 | FILES_avahi-utils = "${bindir}/avahi-*" |
| 106 | |
| 107 | RDEPENDS_${PN}-dev = "avahi-daemon (= ${EXTENDPKGV}) libavahi-core (= ${EXTENDPKGV}) libavahi-client (= ${EXTENDPKGV})" |
| 108 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 109 | RRECOMMENDS_avahi-daemon_append_libc-glibc = " libnss-mdns" |
| 110 | RRECOMMENDS_${PN}_append_libc-glibc = " libnss-mdns" |
| 111 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 112 | CONFFILES_avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf" |
| 113 | |
| 114 | INITSCRIPT_PACKAGES = "avahi-daemon avahi-dnsconfd" |
| 115 | INITSCRIPT_NAME_avahi-daemon = "avahi-daemon" |
| 116 | INITSCRIPT_PARAMS_avahi-daemon = "defaults 21 19" |
| 117 | INITSCRIPT_NAME_avahi-dnsconfd = "avahi-dnsconfd" |
| 118 | INITSCRIPT_PARAMS_avahi-dnsconfd = "defaults 22 19" |
| 119 | |
| 120 | do_install() { |
| 121 | autotools_do_install |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 122 | rm -rf ${D}/run |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 123 | rm -rf ${D}${datadir}/dbus-1/interfaces |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 124 | test -d ${D}${datadir}/dbus-1 && rmdir --ignore-fail-on-non-empty ${D}${datadir}/dbus-1 |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 125 | rm -rf ${D}${libdir}/avahi |
| 126 | |
| 127 | install -d ${D}${sysconfdir}/udhcpc.d |
| 128 | install ${WORKDIR}/00avahi-autoipd ${D}${sysconfdir}/udhcpc.d |
| 129 | install ${WORKDIR}/99avahi-autoipd ${D}${sysconfdir}/udhcpc.d |
| 130 | } |
| 131 | |
| 132 | # At the time the postinst runs, dbus might not be setup so only restart if running |
| 133 | # Don't exit early, because update-rc.d needs to run subsequently. |
| 134 | |
| 135 | pkg_postinst_avahi-daemon () { |
| 136 | if [ -z "$D" ]; then |
| 137 | killall -q -HUP dbus-daemon || true |
| 138 | fi |
| 139 | } |