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