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 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 26 | # For gtk related PACKAGECONFIGs: gtk, gtk3 and pygtk |
| 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" |
| 33 | PACKAGECONFIG[pygtk] = "--enable-pygtk,--disable-pygtk," |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 34 | |
| 35 | USERADD_PACKAGES = "avahi-daemon avahi-autoipd" |
| 36 | USERADD_PARAM_avahi-daemon = "--system --home /var/run/avahi-daemon \ |
| 37 | --no-create-home --shell /bin/false \ |
| 38 | --user-group avahi" |
| 39 | |
| 40 | USERADD_PARAM_avahi-autoipd = "--system --home /var/run/avahi-autoipd \ |
| 41 | --no-create-home --shell /bin/false \ |
| 42 | --user-group \ |
| 43 | -c \"Avahi autoip daemon\" \ |
| 44 | avahi-autoipd" |
| 45 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 46 | inherit autotools pkgconfig update-rc.d gettext useradd gobject-introspection |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 47 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 48 | EXTRA_OECONF = "--with-avahi-priv-access-group=adm \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 49 | --disable-stack-protector \ |
| 50 | --disable-gdbm \ |
| 51 | --disable-mono \ |
| 52 | --disable-monodoc \ |
| 53 | --disable-qt3 \ |
| 54 | --disable-qt4 \ |
| 55 | --disable-python \ |
| 56 | --disable-doxygen-doc \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 57 | --enable-manpages \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 58 | ${EXTRA_OECONF_SYSVINIT} \ |
| 59 | ${EXTRA_OECONF_SYSTEMD} \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 60 | " |
| 61 | |
| 62 | # The distro choice determines what init scripts are installed |
| 63 | EXTRA_OECONF_SYSVINIT = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','--with-distro=debian','--with-distro=none',d)}" |
| 64 | EXTRA_OECONF_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES','systemd','--with-systemdsystemunitdir=${systemd_unitdir}/system/','--without-systemdsystemunitdir',d)}" |
| 65 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 66 | |
| 67 | LDFLAGS_append_libc-uclibc = " -lintl" |
| 68 | LDFLAGS_append_uclinux-uclibc = " -lintl" |
| 69 | |
| 70 | do_configure_prepend() { |
| 71 | 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] | 72 | |
| 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 |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 75 | } |
| 76 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 77 | do_compile_prepend() { |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 78 | 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] | 79 | } |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 80 | |
| 81 | PACKAGES =+ "avahi-daemon libavahi-common libavahi-core libavahi-client avahi-dnsconfd libavahi-glib libavahi-ui avahi-autoipd avahi-utils" |
| 82 | |
| 83 | # As avahi doesn't put any files into PN, clear the files list to avoid problems |
| 84 | # if extra libraries appear. |
| 85 | FILES_${PN} = "" |
| 86 | FILES_avahi-autoipd = "${sbindir}/avahi-autoipd \ |
| 87 | ${sysconfdir}/avahi/avahi-autoipd.action \ |
| 88 | ${sysconfdir}/dhcp/*/avahi-autoipd \ |
| 89 | ${sysconfdir}/udhcpc.d/00avahi-autoipd \ |
| 90 | ${sysconfdir}/udhcpc.d/99avahi-autoipd" |
| 91 | FILES_libavahi-common = "${libdir}/libavahi-common.so.*" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 92 | 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] | 93 | FILES_avahi-daemon = "${sbindir}/avahi-daemon \ |
| 94 | ${sysconfdir}/avahi/avahi-daemon.conf \ |
| 95 | ${sysconfdir}/avahi/hosts \ |
| 96 | ${sysconfdir}/avahi/services \ |
| 97 | ${sysconfdir}/dbus-1 \ |
| 98 | ${sysconfdir}/init.d/avahi-daemon \ |
| 99 | ${datadir}/avahi/introspection/*.introspect \ |
| 100 | ${datadir}/avahi/avahi-service.dtd \ |
| 101 | ${datadir}/avahi/service-types \ |
| 102 | ${datadir}/dbus-1/system-services" |
| 103 | FILES_libavahi-client = "${libdir}/libavahi-client.so.*" |
| 104 | FILES_libavahi-ui = "${libdir}/libavahi-ui.so.*" |
| 105 | FILES_avahi-dnsconfd = "${sbindir}/avahi-dnsconfd \ |
| 106 | ${sysconfdir}/avahi/avahi-dnsconfd.action \ |
| 107 | ${sysconfdir}/init.d/avahi-dnsconfd" |
| 108 | FILES_libavahi-glib = "${libdir}/libavahi-glib.so.*" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 109 | 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] | 110 | FILES_avahi-utils = "${bindir}/avahi-*" |
| 111 | |
| 112 | RDEPENDS_${PN}-dev = "avahi-daemon (= ${EXTENDPKGV}) libavahi-core (= ${EXTENDPKGV}) libavahi-client (= ${EXTENDPKGV})" |
| 113 | |
| 114 | # uclibc has no nss |
| 115 | RRECOMMENDS_avahi-daemon_append_libc-glibc = " libnss-mdns" |
| 116 | RRECOMMENDS_${PN}_append_libc-glibc = " libnss-mdns" |
| 117 | |
| 118 | RRECOMMENDS_avahi-dev = "expat-dev libcap-dev libdaemon-dev dbus-dev glib-2.0-dev update-rc.d-dev" |
| 119 | RRECOMMENDS_avahi-dev_append_libc-glibc = " gettext-dev" |
| 120 | |
| 121 | RRECOMMENDS_avahi-dev[nodeprrecs] = "1" |
| 122 | |
| 123 | CONFFILES_avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf" |
| 124 | |
| 125 | INITSCRIPT_PACKAGES = "avahi-daemon avahi-dnsconfd" |
| 126 | INITSCRIPT_NAME_avahi-daemon = "avahi-daemon" |
| 127 | INITSCRIPT_PARAMS_avahi-daemon = "defaults 21 19" |
| 128 | INITSCRIPT_NAME_avahi-dnsconfd = "avahi-dnsconfd" |
| 129 | INITSCRIPT_PARAMS_avahi-dnsconfd = "defaults 22 19" |
| 130 | |
| 131 | do_install() { |
| 132 | autotools_do_install |
| 133 | |
| 134 | # don't install /var/run when populating rootfs. Do it through volatile |
| 135 | # /var/run of current version is empty, so just remove it. |
| 136 | # if /var/run become non-empty in the future, need to install it via volatile |
| 137 | rm -rf ${D}${localstatedir}/run |
| 138 | rmdir --ignore-fail-on-non-empty ${D}${localstatedir} |
| 139 | rm -rf ${D}${datadir}/dbus-1/interfaces |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 140 | 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] | 141 | rm -rf ${D}${libdir}/avahi |
| 142 | |
| 143 | install -d ${D}${sysconfdir}/udhcpc.d |
| 144 | install ${WORKDIR}/00avahi-autoipd ${D}${sysconfdir}/udhcpc.d |
| 145 | install ${WORKDIR}/99avahi-autoipd ${D}${sysconfdir}/udhcpc.d |
| 146 | } |
| 147 | |
| 148 | # At the time the postinst runs, dbus might not be setup so only restart if running |
| 149 | # Don't exit early, because update-rc.d needs to run subsequently. |
| 150 | |
| 151 | pkg_postinst_avahi-daemon () { |
| 152 | if [ -z "$D" ]; then |
| 153 | killall -q -HUP dbus-daemon || true |
| 154 | fi |
| 155 | } |