blob: 24523c7f813c68de80fbb12da0596e05c2406796 [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
Andrew Geissler82c905d2020-04-13 13:39:40 -050013LICENSE_libavahi-gobject = "LGPLv2.1+"
14LICENSE_avahi-daemon = "LGPLv2.1+"
15LICENSE_libavahi-common = "LGPLv2.1+"
16LICENSE_libavahi-core = "LGPLv2.1+"
17LICENSE_avahi-client = "LGPLv2.1+"
18LICENSE_avahi-dnsconfd = "LGPLv2.1+"
19LICENSE_libavahi-glib = "LGPLv2.1+"
20LICENSE_avahi-autoipd = "LGPLv2.1+"
21LICENSE_avahi-utils = "LGPLv2.1+"
22
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080023# As avahi doesn't put any files into PN, clear the files list to avoid problems
24# if extra libraries appear.
25FILES_${PN} = ""
26FILES_avahi-autoipd = "${sbindir}/avahi-autoipd \
27 ${sysconfdir}/avahi/avahi-autoipd.action \
28 ${sysconfdir}/dhcp/*/avahi-autoipd \
29 ${sysconfdir}/udhcpc.d/00avahi-autoipd \
30 ${sysconfdir}/udhcpc.d/99avahi-autoipd"
31FILES_libavahi-common = "${libdir}/libavahi-common.so.*"
32FILES_libavahi-core = "${libdir}/libavahi-core.so.* ${libdir}/girepository-1.0/AvahiCore*.typelib"
33FILES_avahi-daemon = "${sbindir}/avahi-daemon \
34 ${sysconfdir}/avahi/avahi-daemon.conf \
35 ${sysconfdir}/avahi/hosts \
36 ${sysconfdir}/avahi/services \
37 ${sysconfdir}/dbus-1 \
38 ${sysconfdir}/init.d/avahi-daemon \
39 ${datadir}/avahi/introspection/*.introspect \
40 ${datadir}/avahi/avahi-service.dtd \
41 ${datadir}/avahi/service-types \
42 ${datadir}/dbus-1/system-services"
43FILES_libavahi-client = "${libdir}/libavahi-client.so.*"
44FILES_avahi-dnsconfd = "${sbindir}/avahi-dnsconfd \
45 ${sysconfdir}/avahi/avahi-dnsconfd.action \
46 ${sysconfdir}/init.d/avahi-dnsconfd"
47FILES_libavahi-glib = "${libdir}/libavahi-glib.so.*"
48FILES_libavahi-gobject = "${libdir}/libavahi-gobject.so.* ${libdir}/girepository-1.0/Avahi*.typelib"
49FILES_avahi-utils = "${bindir}/avahi-*"
50
Andrew Geissler99467da2019-02-25 18:54:23 -060051RDEPENDS_${PN}-dev = "avahi-daemon (= ${EXTENDPKGV}) libavahi-core (= ${EXTENDPKGV})"
52RDEPENDS_${PN}-dev += "${@["", " libavahi-client (= ${EXTENDPKGV})"][bb.utils.contains('PACKAGECONFIG', 'dbus', 1, 0, d)]}"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080053
54RRECOMMENDS_avahi-daemon_append_libc-glibc = " libnss-mdns"
55
56CONFFILES_avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf"
57
58USERADD_PACKAGES = "avahi-daemon avahi-autoipd"
59USERADD_PARAM_avahi-daemon = "--system --home /run/avahi-daemon \
60 --no-create-home --shell /bin/false \
61 --user-group avahi"
62
63USERADD_PARAM_avahi-autoipd = "--system --home /run/avahi-autoipd \
64 --no-create-home --shell /bin/false \
65 --user-group \
66 -c \"Avahi autoip daemon\" \
67 avahi-autoipd"
68
69INITSCRIPT_PACKAGES = "avahi-daemon avahi-dnsconfd"
70INITSCRIPT_NAME_avahi-daemon = "avahi-daemon"
71INITSCRIPT_PARAMS_avahi-daemon = "defaults 21 19"
72INITSCRIPT_NAME_avahi-dnsconfd = "avahi-dnsconfd"
73INITSCRIPT_PARAMS_avahi-dnsconfd = "defaults 22 19"
Brad Bishop316dfdd2018-06-25 12:45:53 -040074
75SYSTEMD_PACKAGES = "${PN}-daemon ${PN}-dnsconfd"
76SYSTEMD_SERVICE_${PN}-daemon = "avahi-daemon.service"
77SYSTEMD_SERVICE_${PN}-dnsconfd = "avahi-dnsconfd.service"
78
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080079do_install_append() {
80 install -d ${D}${sysconfdir}/udhcpc.d
81 install ${WORKDIR}/00avahi-autoipd ${D}${sysconfdir}/udhcpc.d
82 install ${WORKDIR}/99avahi-autoipd ${D}${sysconfdir}/udhcpc.d
83}
Brad Bishop316dfdd2018-06-25 12:45:53 -040084
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080085# At the time the postinst runs, dbus might not be setup so only restart if running
86# Don't exit early, because update-rc.d needs to run subsequently.
87pkg_postinst_avahi-daemon () {
88if [ -z "$D" ]; then
89 killall -q -HUP dbus-daemon || true
90fi
91}