bind_9.11.4.bb 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. SUMMARY = "ISC Internet Domain Name Server"
  2. HOMEPAGE = "http://www.isc.org/sw/bind/"
  3. SECTION = "console/network"
  4. LICENSE = "ISC & BSD"
  5. LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=6ba7c9fe0c888a943c79c93e6de744fb"
  6. DEPENDS = "openssl libcap zlib"
  7. SRC_URI = "https://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.gz \
  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-gen.c-extend-DIRNAMESIZE-from-256-to-512.patch \
  16. file://0001-lib-dns-gen.c-fix-too-long-error.patch \
  17. "
  18. SRC_URI[md5sum] = "9b4834d78f30cdb796ce437262272a36"
  19. SRC_URI[sha256sum] = "595070b031f869f8939656b5a5d11b121211967f15f6afeafa895df745279617"
  20. UPSTREAM_CHECK_URI = "https://ftp.isc.org/isc/bind9/"
  21. UPSTREAM_CHECK_REGEX = "(?P<pver>9(\.\d+)+(-P\d+)*)/"
  22. inherit autotools update-rc.d systemd useradd pkgconfig
  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[urandom] = "--with-randomdev=/dev/urandom,--with-randomdev=/dev/random,,"
  29. PACKAGECONFIG[python3] = "--with-python=${PYTHON} --with-python-install-dir=${D}/${PYTHON_SITEPACKAGES_DIR} , --without-python, python3-ply-native,"
  30. ENABLE_IPV6 = "--enable-ipv6=${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)}"
  31. EXTRA_OECONF = " ${ENABLE_IPV6} --with-libtool --enable-threads \
  32. --disable-devpoll --enable-epoll --with-gost=no \
  33. --with-gssapi=no --with-ecdsa=yes --with-eddsa=no \
  34. --with-lmdb=no \
  35. --sysconfdir=${sysconfdir}/bind \
  36. --with-openssl=${STAGING_DIR_HOST}${prefix} \
  37. "
  38. inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3native distutils3-base', '', d)}
  39. # dhcp needs .la so keep them
  40. REMOVE_LIBTOOL_LA = "0"
  41. USERADD_PACKAGES = "${PN}"
  42. USERADD_PARAM_${PN} = "--system --home ${localstatedir}/cache/bind --no-create-home \
  43. --user-group bind"
  44. INITSCRIPT_NAME = "bind"
  45. INITSCRIPT_PARAMS = "defaults"
  46. SYSTEMD_SERVICE_${PN} = "named.service"
  47. do_install_prepend() {
  48. # clean host path in isc-config.sh before the hardlink created
  49. # by "make install":
  50. # bind9-config -> isc-config.sh
  51. sed -i -e "s,${STAGING_LIBDIR},${libdir}," ${B}/isc-config.sh
  52. }
  53. do_install_append() {
  54. rm "${D}${bindir}/nslookup"
  55. rm "${D}${mandir}/man1/nslookup.1"
  56. rmdir "${D}${localstatedir}/run"
  57. rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
  58. install -d -o bind "${D}${localstatedir}/cache/bind"
  59. install -d "${D}${sysconfdir}/bind"
  60. install -d "${D}${sysconfdir}/init.d"
  61. install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/"
  62. install -m 755 "${S}/init.d" "${D}${sysconfdir}/init.d/bind"
  63. if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then
  64. sed -i -e '1s,#!.*python3,#! /usr/bin/python3,' \
  65. ${D}${sbindir}/dnssec-coverage \
  66. ${D}${sbindir}/dnssec-checkds \
  67. ${D}${sbindir}/dnssec-keymgr
  68. fi
  69. # Install systemd related files
  70. install -d ${D}${sbindir}
  71. install -m 755 ${WORKDIR}/generate-rndc-key.sh ${D}${sbindir}
  72. install -d ${D}${systemd_unitdir}/system
  73. install -m 0644 ${WORKDIR}/named.service ${D}${systemd_unitdir}/system
  74. sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
  75. -e 's,@SBINDIR@,${sbindir},g' \
  76. ${D}${systemd_unitdir}/system/named.service
  77. install -d ${D}${sysconfdir}/default
  78. install -m 0644 ${WORKDIR}/bind9 ${D}${sysconfdir}/default
  79. if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
  80. install -d ${D}${sysconfdir}/tmpfiles.d
  81. echo "d /run/named 0755 bind bind - -" > ${D}${sysconfdir}/tmpfiles.d/bind.conf
  82. fi
  83. }
  84. CONFFILES_${PN} = " \
  85. ${sysconfdir}/bind/named.conf \
  86. ${sysconfdir}/bind/named.conf.local \
  87. ${sysconfdir}/bind/named.conf.options \
  88. ${sysconfdir}/bind/db.0 \
  89. ${sysconfdir}/bind/db.127 \
  90. ${sysconfdir}/bind/db.empty \
  91. ${sysconfdir}/bind/db.local \
  92. ${sysconfdir}/bind/db.root \
  93. "
  94. PACKAGE_BEFORE_PN += "${PN}-utils"
  95. FILES_${PN}-utils = "${bindir}/host ${bindir}/dig ${bindir}/mdig"
  96. FILES_${PN}-dev += "${bindir}/isc-config.h"
  97. FILES_${PN} += "${sbindir}/generate-rndc-key.sh"
  98. PACKAGE_BEFORE_PN += "${PN}-libs"
  99. FILES_${PN}-libs = "${libdir}/*.so*"
  100. FILES_${PN}-staticdev += "${libdir}/*.la"
  101. PACKAGE_BEFORE_PN += "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-bind', '', d)}"
  102. FILES_python3-bind = "${sbindir}/dnssec-coverage ${sbindir}/dnssec-checkds \
  103. ${sbindir}/dnssec-keymgr ${PYTHON_SITEPACKAGES_DIR}"
  104. RDEPENDS_${PN} = "bash"
  105. RDEPENDS_${PN}-utils = "bash"
  106. RDEPENDS_${PN}-dev = ""
  107. RDEPENDS_python3-bind = "python3-core python3-ply"