blob: 3d5f334a8886b9d13b9adecd56dc2c7281123718 [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
41RDEPENDS_${PN}-dev = "avahi-daemon (= ${EXTENDPKGV}) libavahi-core (= ${EXTENDPKGV}) libavahi-client (= ${EXTENDPKGV})"
42
43RRECOMMENDS_avahi-daemon_append_libc-glibc = " libnss-mdns"
44
45CONFFILES_avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf"
46
47USERADD_PACKAGES = "avahi-daemon avahi-autoipd"
48USERADD_PARAM_avahi-daemon = "--system --home /run/avahi-daemon \
49 --no-create-home --shell /bin/false \
50 --user-group avahi"
51
52USERADD_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
58INITSCRIPT_PACKAGES = "avahi-daemon avahi-dnsconfd"
59INITSCRIPT_NAME_avahi-daemon = "avahi-daemon"
60INITSCRIPT_PARAMS_avahi-daemon = "defaults 21 19"
61INITSCRIPT_NAME_avahi-dnsconfd = "avahi-dnsconfd"
62INITSCRIPT_PARAMS_avahi-dnsconfd = "defaults 22 19"
Brad Bishop316dfdd2018-06-25 12:45:53 -040063
64SYSTEMD_PACKAGES = "${PN}-daemon ${PN}-dnsconfd"
65SYSTEMD_SERVICE_${PN}-daemon = "avahi-daemon.service"
66SYSTEMD_SERVICE_${PN}-dnsconfd = "avahi-dnsconfd.service"
67
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080068do_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 Bishop316dfdd2018-06-25 12:45:53 -040073
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080074# 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.
76pkg_postinst_avahi-daemon () {
77if [ -z "$D" ]; then
78 killall -q -HUP dbus-daemon || true
79fi
80}