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