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 | |
| 41 | RDEPENDS_${PN}-dev = "avahi-daemon (= ${EXTENDPKGV}) libavahi-core (= ${EXTENDPKGV}) libavahi-client (= ${EXTENDPKGV})" |
| 42 | |
| 43 | RRECOMMENDS_avahi-daemon_append_libc-glibc = " libnss-mdns" |
| 44 | |
| 45 | CONFFILES_avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf" |
| 46 | |
| 47 | USERADD_PACKAGES = "avahi-daemon avahi-autoipd" |
| 48 | USERADD_PARAM_avahi-daemon = "--system --home /run/avahi-daemon \ |
| 49 | --no-create-home --shell /bin/false \ |
| 50 | --user-group avahi" |
| 51 | |
| 52 | USERADD_PARAM_avahi-autoipd = "--system --home /run/avahi-autoipd \ |
| 53 | --no-create-home --shell /bin/false \ |
| 54 | --user-group \ |
| 55 | -c \"Avahi autoip daemon\" \ |
| 56 | avahi-autoipd" |
| 57 | |
| 58 | INITSCRIPT_PACKAGES = "avahi-daemon avahi-dnsconfd" |
| 59 | INITSCRIPT_NAME_avahi-daemon = "avahi-daemon" |
| 60 | INITSCRIPT_PARAMS_avahi-daemon = "defaults 21 19" |
| 61 | INITSCRIPT_NAME_avahi-dnsconfd = "avahi-dnsconfd" |
| 62 | INITSCRIPT_PARAMS_avahi-dnsconfd = "defaults 22 19" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 63 | |
| 64 | SYSTEMD_PACKAGES = "${PN}-daemon ${PN}-dnsconfd" |
| 65 | SYSTEMD_SERVICE_${PN}-daemon = "avahi-daemon.service" |
| 66 | SYSTEMD_SERVICE_${PN}-dnsconfd = "avahi-dnsconfd.service" |
| 67 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 68 | do_install_append() { |
| 69 | install -d ${D}${sysconfdir}/udhcpc.d |
| 70 | install ${WORKDIR}/00avahi-autoipd ${D}${sysconfdir}/udhcpc.d |
| 71 | install ${WORKDIR}/99avahi-autoipd ${D}${sysconfdir}/udhcpc.d |
| 72 | } |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 73 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 74 | # At the time the postinst runs, dbus might not be setup so only restart if running |
| 75 | # Don't exit early, because update-rc.d needs to run subsequently. |
| 76 | pkg_postinst_avahi-daemon () { |
| 77 | if [ -z "$D" ]; then |
| 78 | killall -q -HUP dbus-daemon || true |
| 79 | fi |
| 80 | } |