bind_9.16.7.bb 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. SUMMARY = "ISC Internet Domain Name Server"
  2. HOMEPAGE = "https://www.isc.org/bind/"
  3. SECTION = "console/network"
  4. LICENSE = "MPL-2.0"
  5. LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=188b8d0644bd6835df43b84e3f180be1"
  6. DEPENDS = "openssl libcap zlib libuv"
  7. SRC_URI = "https://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.xz \
  8. file://conf.patch \
  9. file://named.service \
  10. file://bind9 \
  11. file://generate-rndc-key.sh \
  12. file://make-etc-initd-bind-stop-work.patch \
  13. file://init.d-add-support-for-read-only-rootfs.patch \
  14. file://bind-ensure-searching-for-json-headers-searches-sysr.patch \
  15. file://0001-named-lwresd-V-and-start-log-hide-build-options.patch \
  16. file://0001-avoid-start-failure-with-bind-user.patch \
  17. "
  18. SRC_URI[sha256sum] = "9f7d1812ebbd26a699f62b6fa8522d5dec57e4bf43af0042a0d60d39ed8314d1"
  19. UPSTREAM_CHECK_URI = "https://ftp.isc.org/isc/bind9/"
  20. # stay at 9.16 follow the ESV versions divisible by 4
  21. UPSTREAM_CHECK_REGEX = "(?P<pver>9.(16|20|24|28)(\.\d+)+(-P\d+)*)/"
  22. inherit autotools update-rc.d systemd useradd pkgconfig multilib_header update-alternatives
  23. # PACKAGECONFIGs readline and libedit should NOT be set at same time
  24. PACKAGECONFIG ?= "readline"
  25. PACKAGECONFIG[httpstats] = "--with-libxml2=${STAGING_DIR_HOST}${prefix},--without-libxml2,libxml2"
  26. PACKAGECONFIG[readline] = "--with-readline=-lreadline,,readline"
  27. PACKAGECONFIG[libedit] = "--with-readline=-ledit,,libedit"
  28. PACKAGECONFIG[python3] = "--with-python=yes --with-python-install-dir=${PYTHON_SITEPACKAGES_DIR} , --without-python, python3-ply-native,"
  29. EXTRA_OECONF = " --with-libtool --disable-devpoll --disable-auto-validation --enable-epoll \
  30. --with-gssapi=no --with-lmdb=no --with-zlib \
  31. --sysconfdir=${sysconfdir}/bind \
  32. --with-openssl=${STAGING_DIR_HOST}${prefix} \
  33. "
  34. LDFLAGS_append = " -lz"
  35. inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3native distutils3-base', '', d)}
  36. # dhcp needs .la so keep them
  37. REMOVE_LIBTOOL_LA = "0"
  38. USERADD_PACKAGES = "${PN}"
  39. USERADD_PARAM_${PN} = "--system --home ${localstatedir}/cache/bind --no-create-home \
  40. --user-group bind"
  41. INITSCRIPT_NAME = "bind"
  42. INITSCRIPT_PARAMS = "defaults"
  43. SYSTEMD_SERVICE_${PN} = "named.service"
  44. do_install_append() {
  45. rmdir "${D}${localstatedir}/run"
  46. rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
  47. install -d -o bind "${D}${localstatedir}/cache/bind"
  48. install -d "${D}${sysconfdir}/bind"
  49. install -d "${D}${sysconfdir}/init.d"
  50. install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/"
  51. install -m 755 "${S}/init.d" "${D}${sysconfdir}/init.d/bind"
  52. if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then
  53. sed -i -e '1s,#!.*python3,#! /usr/bin/python3,' \
  54. ${D}${sbindir}/dnssec-coverage \
  55. ${D}${sbindir}/dnssec-checkds \
  56. ${D}${sbindir}/dnssec-keymgr
  57. fi
  58. # Install systemd related files
  59. install -d ${D}${sbindir}
  60. install -m 755 ${WORKDIR}/generate-rndc-key.sh ${D}${sbindir}
  61. install -d ${D}${systemd_unitdir}/system
  62. install -m 0644 ${WORKDIR}/named.service ${D}${systemd_unitdir}/system
  63. sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
  64. -e 's,@SBINDIR@,${sbindir},g' \
  65. ${D}${systemd_unitdir}/system/named.service
  66. install -d ${D}${sysconfdir}/default
  67. install -m 0644 ${WORKDIR}/bind9 ${D}${sysconfdir}/default
  68. if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
  69. install -d ${D}${sysconfdir}/tmpfiles.d
  70. echo "d /run/named 0755 bind bind - -" > ${D}${sysconfdir}/tmpfiles.d/bind.conf
  71. fi
  72. oe_multilib_header isc/platform.h
  73. }
  74. CONFFILES_${PN} = " \
  75. ${sysconfdir}/bind/named.conf \
  76. ${sysconfdir}/bind/named.conf.local \
  77. ${sysconfdir}/bind/named.conf.options \
  78. ${sysconfdir}/bind/db.0 \
  79. ${sysconfdir}/bind/db.127 \
  80. ${sysconfdir}/bind/db.empty \
  81. ${sysconfdir}/bind/db.local \
  82. ${sysconfdir}/bind/db.root \
  83. "
  84. ALTERNATIVE_${PN}-utils = "nslookup"
  85. ALTERNATIVE_LINK_NAME[nslookup] = "${bindir}/nslookup"
  86. ALTERNATIVE_PRIORITY = "100"
  87. PACKAGE_BEFORE_PN += "${PN}-utils"
  88. FILES_${PN}-utils = "${bindir}/host ${bindir}/dig ${bindir}/mdig ${bindir}/nslookup ${bindir}/nsupdate"
  89. FILES_${PN}-dev += "${bindir}/isc-config.h"
  90. FILES_${PN} += "${sbindir}/generate-rndc-key.sh"
  91. PACKAGE_BEFORE_PN += "${PN}-libs"
  92. FILES_${PN}-libs = "${libdir}/*.so* ${libdir}/named/*.so*"
  93. FILES_${PN}-staticdev += "${libdir}/*.la"
  94. PACKAGE_BEFORE_PN += "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-bind', '', d)}"
  95. FILES_python3-bind = "${sbindir}/dnssec-coverage ${sbindir}/dnssec-checkds \
  96. ${sbindir}/dnssec-keymgr ${PYTHON_SITEPACKAGES_DIR}"
  97. RDEPENDS_${PN}-dev = ""
  98. RDEPENDS_python3-bind = "python3-core python3-ply"