Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | require avahi.inc |
| 2 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 3 | SRC_URI += "file://00avahi-autoipd \ |
| 4 | file://99avahi-autoipd \ |
| 5 | file://initscript.patch \ |
| 6 | file://0001-Fix-opening-etc-resolv.conf-error.patch \ |
| 7 | " |
| 8 | |
| 9 | inherit update-rc.d systemd useradd |
| 10 | |
| 11 | PACKAGES =+ "libavahi-gobject avahi-daemon libavahi-common libavahi-core libavahi-client avahi-dnsconfd libavahi-glib avahi-autoipd avahi-utils" |
| 12 | |
| 13 | # As avahi doesn't put any files into PN, clear the files list to avoid problems |
| 14 | # if extra libraries appear. |
| 15 | FILES_${PN} = "" |
| 16 | FILES_avahi-autoipd = "${sbindir}/avahi-autoipd \ |
| 17 | ${sysconfdir}/avahi/avahi-autoipd.action \ |
| 18 | ${sysconfdir}/dhcp/*/avahi-autoipd \ |
| 19 | ${sysconfdir}/udhcpc.d/00avahi-autoipd \ |
| 20 | ${sysconfdir}/udhcpc.d/99avahi-autoipd" |
| 21 | FILES_libavahi-common = "${libdir}/libavahi-common.so.*" |
| 22 | FILES_libavahi-core = "${libdir}/libavahi-core.so.* ${libdir}/girepository-1.0/AvahiCore*.typelib" |
| 23 | FILES_avahi-daemon = "${sbindir}/avahi-daemon \ |
| 24 | ${sysconfdir}/avahi/avahi-daemon.conf \ |
| 25 | ${sysconfdir}/avahi/hosts \ |
| 26 | ${sysconfdir}/avahi/services \ |
| 27 | ${sysconfdir}/dbus-1 \ |
| 28 | ${sysconfdir}/init.d/avahi-daemon \ |
| 29 | ${datadir}/avahi/introspection/*.introspect \ |
| 30 | ${datadir}/avahi/avahi-service.dtd \ |
| 31 | ${datadir}/avahi/service-types \ |
| 32 | ${datadir}/dbus-1/system-services" |
| 33 | FILES_libavahi-client = "${libdir}/libavahi-client.so.*" |
| 34 | FILES_avahi-dnsconfd = "${sbindir}/avahi-dnsconfd \ |
| 35 | ${sysconfdir}/avahi/avahi-dnsconfd.action \ |
| 36 | ${sysconfdir}/init.d/avahi-dnsconfd" |
| 37 | FILES_libavahi-glib = "${libdir}/libavahi-glib.so.*" |
| 38 | FILES_libavahi-gobject = "${libdir}/libavahi-gobject.so.* ${libdir}/girepository-1.0/Avahi*.typelib" |
| 39 | FILES_avahi-utils = "${bindir}/avahi-*" |
| 40 | |
Andrew Geissler | 99467da | 2019-02-25 18:54:23 -0600 | [diff] [blame] | 41 | RDEPENDS_${PN}-dev = "avahi-daemon (= ${EXTENDPKGV}) libavahi-core (= ${EXTENDPKGV})" |
| 42 | RDEPENDS_${PN}-dev += "${@["", " libavahi-client (= ${EXTENDPKGV})"][bb.utils.contains('PACKAGECONFIG', 'dbus', 1, 0, d)]}" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 43 | |
| 44 | RRECOMMENDS_avahi-daemon_append_libc-glibc = " libnss-mdns" |
| 45 | |
| 46 | CONFFILES_avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf" |
| 47 | |
| 48 | USERADD_PACKAGES = "avahi-daemon avahi-autoipd" |
| 49 | USERADD_PARAM_avahi-daemon = "--system --home /run/avahi-daemon \ |
| 50 | --no-create-home --shell /bin/false \ |
| 51 | --user-group avahi" |
| 52 | |
| 53 | USERADD_PARAM_avahi-autoipd = "--system --home /run/avahi-autoipd \ |
| 54 | --no-create-home --shell /bin/false \ |
| 55 | --user-group \ |
| 56 | -c \"Avahi autoip daemon\" \ |
| 57 | avahi-autoipd" |
| 58 | |
| 59 | INITSCRIPT_PACKAGES = "avahi-daemon avahi-dnsconfd" |
| 60 | INITSCRIPT_NAME_avahi-daemon = "avahi-daemon" |
| 61 | INITSCRIPT_PARAMS_avahi-daemon = "defaults 21 19" |
| 62 | INITSCRIPT_NAME_avahi-dnsconfd = "avahi-dnsconfd" |
| 63 | INITSCRIPT_PARAMS_avahi-dnsconfd = "defaults 22 19" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 64 | |
| 65 | SYSTEMD_PACKAGES = "${PN}-daemon ${PN}-dnsconfd" |
| 66 | SYSTEMD_SERVICE_${PN}-daemon = "avahi-daemon.service" |
| 67 | SYSTEMD_SERVICE_${PN}-dnsconfd = "avahi-dnsconfd.service" |
| 68 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 69 | do_install_append() { |
| 70 | install -d ${D}${sysconfdir}/udhcpc.d |
| 71 | install ${WORKDIR}/00avahi-autoipd ${D}${sysconfdir}/udhcpc.d |
| 72 | install ${WORKDIR}/99avahi-autoipd ${D}${sysconfdir}/udhcpc.d |
| 73 | } |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 74 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 75 | # At the time the postinst runs, dbus might not be setup so only restart if running |
| 76 | # Don't exit early, because update-rc.d needs to run subsequently. |
| 77 | pkg_postinst_avahi-daemon () { |
| 78 | if [ -z "$D" ]; then |
| 79 | killall -q -HUP dbus-daemon || true |
| 80 | fi |
| 81 | } |