radvd.inc 2.6 KB

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