blob: 2afaa4841148ee36e8fdad1b2a67252b98a370d9 [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 \
Andrew Geissler748a4832020-07-24 16:24:21 -050021 file://radvd.default \
22 file://radvd.conf"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050023
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080024inherit autotools useradd pkgconfig systemd
Patrick Williamsb48b7b42016-08-17 15:04:38 -050025
Patrick Williams213cb262021-08-07 19:21:33 -050026SYSTEMD_SERVICE:${PN} = "radvd.service"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050027SYSTEMD_AUTO_ENABLE = "disable"
28
Patrick Williams213cb262021-08-07 19:21:33 -050029do_install:append () {
Patrick Williamsb48b7b42016-08-17 15:04:38 -050030 install -m 0755 -d ${D}${sysconfdir}/init.d \
31 ${D}${sysconfdir}/default/volatiles \
32 ${D}${docdir}/radvd
33 # Install init script and volatiles
34 install -m 0755 ${WORKDIR}/radvd.init ${D}${sysconfdir}/init.d/radvd
35 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/radvd
36 sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/radvd
37 sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/radvd
38 sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/radvd
39
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080040 install -m 0644 ${WORKDIR}/volatiles.03_radvd ${D}${sysconfdir}/default/volatiles/03_radvd
Patrick Williamsb48b7b42016-08-17 15:04:38 -050041
42 # Install systemd service files
43 install -d ${D}${systemd_unitdir}/system
44 install -m 0644 ${WORKDIR}/radvd.service ${D}${systemd_unitdir}/system
45 sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' \
46 -e 's#@SBINDIR@#${sbindir}#g' \
47 -e 's#@BASE_BINDIR@#${base_bindir}#g' ${D}${systemd_unitdir}/system/radvd.service
48
49 # Install default environment file
50 install -m 0644 ${WORKDIR}/radvd.default ${D}${sysconfdir}/default/radvd
51
52 # Documentation
53 for i in radvd.conf.example README; do \
54 install -m 0644 ${S}/$i ${D}${docdir}/radvd; \
55 done
Andrew Geissler748a4832020-07-24 16:24:21 -050056
57 install -m 0644 ${WORKDIR}/radvd.conf ${D}${sysconfdir}/radvd.conf
Patrick Williamsb48b7b42016-08-17 15:04:38 -050058}
59
Patrick Williamsb48b7b42016-08-17 15:04:38 -050060USERADD_PACKAGES = "${PN}"
Patrick Williams213cb262021-08-07 19:21:33 -050061USERADD_PARAM:${PN} = "--system --home ${localstatedir}/run/radvd/ -M -g nogroup radvd"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050062
Patrick Williams213cb262021-08-07 19:21:33 -050063pkg_postinst:${PN} () {
Patrick Williamsb48b7b42016-08-17 15:04:38 -050064 if [ -z "$D" -a -x /etc/init.d/populate-volatile.sh ]; then
Patrick Williamsddad1a12017-02-23 20:36:32 -060065 /etc/init.d/populate-volatile.sh update
Patrick Williamsb48b7b42016-08-17 15:04:38 -050066 fi
67}