blob: 2e04d304c7ec545ea0f9f05345e2d9a202f2322f [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001require avahi.inc
2
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08003SRC_URI += "file://00avahi-autoipd \
4 file://99avahi-autoipd \
5 file://initscript.patch \
6 file://0001-Fix-opening-etc-resolv.conf-error.patch \
7 "
8
9inherit update-rc.d systemd useradd
10
11PACKAGES =+ "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.
15FILES_${PN} = ""
16FILES_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"
21FILES_libavahi-common = "${libdir}/libavahi-common.so.*"
22FILES_libavahi-core = "${libdir}/libavahi-core.so.* ${libdir}/girepository-1.0/AvahiCore*.typelib"
23FILES_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"
33FILES_libavahi-client = "${libdir}/libavahi-client.so.*"
34FILES_avahi-dnsconfd = "${sbindir}/avahi-dnsconfd \
35 ${sysconfdir}/avahi/avahi-dnsconfd.action \
36 ${sysconfdir}/init.d/avahi-dnsconfd"
37FILES_libavahi-glib = "${libdir}/libavahi-glib.so.*"
38FILES_libavahi-gobject = "${libdir}/libavahi-gobject.so.* ${libdir}/girepository-1.0/Avahi*.typelib"
39FILES_avahi-utils = "${bindir}/avahi-*"
40
Andrew Geissler99467da2019-02-25 18:54:23 -060041RDEPENDS_${PN}-dev = "avahi-daemon (= ${EXTENDPKGV}) libavahi-core (= ${EXTENDPKGV})"
42RDEPENDS_${PN}-dev += "${@["", " libavahi-client (= ${EXTENDPKGV})"][bb.utils.contains('PACKAGECONFIG', 'dbus', 1, 0, d)]}"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080043
44RRECOMMENDS_avahi-daemon_append_libc-glibc = " libnss-mdns"
45
46CONFFILES_avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf"
47
48USERADD_PACKAGES = "avahi-daemon avahi-autoipd"
49USERADD_PARAM_avahi-daemon = "--system --home /run/avahi-daemon \
50 --no-create-home --shell /bin/false \
51 --user-group avahi"
52
53USERADD_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
59INITSCRIPT_PACKAGES = "avahi-daemon avahi-dnsconfd"
60INITSCRIPT_NAME_avahi-daemon = "avahi-daemon"
61INITSCRIPT_PARAMS_avahi-daemon = "defaults 21 19"
62INITSCRIPT_NAME_avahi-dnsconfd = "avahi-dnsconfd"
63INITSCRIPT_PARAMS_avahi-dnsconfd = "defaults 22 19"
Brad Bishop316dfdd2018-06-25 12:45:53 -040064
65SYSTEMD_PACKAGES = "${PN}-daemon ${PN}-dnsconfd"
66SYSTEMD_SERVICE_${PN}-daemon = "avahi-daemon.service"
67SYSTEMD_SERVICE_${PN}-dnsconfd = "avahi-dnsconfd.service"
68
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080069do_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 Bishop316dfdd2018-06-25 12:45:53 -040074
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080075# 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.
77pkg_postinst_avahi-daemon () {
78if [ -z "$D" ]; then
79 killall -q -HUP dbus-daemon || true
80fi
81}