blob: 59a07d78dc98806dea27a8e59df5512dfc9c8242 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001SUMMARY = "IPv6 router advertisement daemon"
2DESCRIPTION = "radvd is the router advertisement daemon for IPv6. It \
3listens to router solicitations and sends router \
4advertisements as described in RFC 2461, Neighbor \
5Discovery for IP Version 6 (IPv6). With these \
6advertisements hosts can automatically configure their \
7addresses and some other parameters. They also can \
8choose a default router based on these advertisements."
9HOMEPAGE = "http://www.litech.org/radvd/"
10SECTION = "net"
Brad Bishop316dfdd2018-06-25 12:45:53 -040011DEPENDS = "flex-native bison-native libdaemon "
Patrick Williamsb48b7b42016-08-17 15:04:38 -050012
13# License is BSD-Style (with advertising clause) but also has an additional 0th clause
14LICENSE = "radvd"
15LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=73ebbf7182ae996e65e8fadc9a8c45db"
16
17SRC_URI = "http://v6web.litech.org/radvd/dist/radvd-${PV}.tar.gz \
18 file://radvd.init \
19 file://radvd.service \
20 file://volatiles.03_radvd \
21 file://radvd.default"
22
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080023inherit autotools useradd pkgconfig systemd
Patrick Williamsb48b7b42016-08-17 15:04:38 -050024
25SYSTEMD_SERVICE_${PN} = "radvd.service"
26SYSTEMD_AUTO_ENABLE = "disable"
27
28do_install_append () {
29 install -m 0755 -d ${D}${sysconfdir}/init.d \
30 ${D}${sysconfdir}/default/volatiles \
31 ${D}${docdir}/radvd
32 # Install init script and volatiles
33 install -m 0755 ${WORKDIR}/radvd.init ${D}${sysconfdir}/init.d/radvd
34 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/radvd
35 sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/radvd
36 sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/radvd
37 sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/radvd
38
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080039 install -m 0644 ${WORKDIR}/volatiles.03_radvd ${D}${sysconfdir}/default/volatiles/03_radvd
Patrick Williamsb48b7b42016-08-17 15:04:38 -050040
41 # Install systemd service files
42 install -d ${D}${systemd_unitdir}/system
43 install -m 0644 ${WORKDIR}/radvd.service ${D}${systemd_unitdir}/system
44 sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' \
45 -e 's#@SBINDIR@#${sbindir}#g' \
46 -e 's#@BASE_BINDIR@#${base_bindir}#g' ${D}${systemd_unitdir}/system/radvd.service
47
48 # Install default environment file
49 install -m 0644 ${WORKDIR}/radvd.default ${D}${sysconfdir}/default/radvd
50
51 # Documentation
52 for i in radvd.conf.example README; do \
53 install -m 0644 ${S}/$i ${D}${docdir}/radvd; \
54 done
55}
56
Patrick Williamsb48b7b42016-08-17 15:04:38 -050057USERADD_PACKAGES = "${PN}"
58USERADD_PARAM_${PN} = "--system --home ${localstatedir}/run/radvd/ -M -g nogroup radvd"
59
60pkg_postinst_${PN} () {
61 if [ -z "$D" -a -x /etc/init.d/populate-volatile.sh ]; then
Patrick Williamsddad1a12017-02-23 20:36:32 -060062 /etc/init.d/populate-volatile.sh update
Patrick Williamsb48b7b42016-08-17 15:04:38 -050063 fi
64}