Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | SUMMARY = "ISC Internet Domain Name Server" |
| 2 | HOMEPAGE = "http://www.isc.org/sw/bind/" |
| 3 | SECTION = "console/network" |
| 4 | |
| 5 | LICENSE = "ISC & BSD" |
Andrew Geissler | d25ed32 | 2020-06-27 00:28:28 -0500 | [diff] [blame] | 6 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=bf39058a7f64b2a934ce14dc9ec1dd45" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 7 | |
| 8 | DEPENDS = "openssl libcap zlib" |
| 9 | |
| 10 | SRC_URI = "https://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.gz \ |
| 11 | file://conf.patch \ |
| 12 | file://named.service \ |
| 13 | file://bind9 \ |
| 14 | file://generate-rndc-key.sh \ |
| 15 | file://make-etc-initd-bind-stop-work.patch \ |
| 16 | file://init.d-add-support-for-read-only-rootfs.patch \ |
| 17 | file://bind-ensure-searching-for-json-headers-searches-sysr.patch \ |
| 18 | file://0001-configure.in-remove-useless-L-use_openssl-lib.patch \ |
| 19 | file://0001-named-lwresd-V-and-start-log-hide-build-options.patch \ |
| 20 | file://0001-avoid-start-failure-with-bind-user.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 21 | " |
| 22 | |
Andrew Geissler | d25ed32 | 2020-06-27 00:28:28 -0500 | [diff] [blame] | 23 | SRC_URI[sha256sum] = "0dee554a4caa368948b32da9a0c97b516c19103bc13ff5b3762c5d8552f52329" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 24 | |
| 25 | UPSTREAM_CHECK_URI = "https://ftp.isc.org/isc/bind9/" |
| 26 | # stay at 9.11 until 9.16, from 9.16 follow the ESV versions divisible by 4 |
| 27 | UPSTREAM_CHECK_REGEX = "(?P<pver>9.(11|16|20|24|28)(\.\d+)+(-P\d+)*)/" |
| 28 | |
| 29 | # BIND >= 9.11.2 need dhcpd >= 4.4.0, |
| 30 | # don't report it here since dhcpd is already recent enough. |
| 31 | CVE_CHECK_WHITELIST += "CVE-2019-6470" |
| 32 | |
| 33 | inherit autotools update-rc.d systemd useradd pkgconfig multilib_script multilib_header |
| 34 | |
| 35 | MULTILIB_SCRIPTS = "${PN}:${bindir}/bind9-config ${PN}:${bindir}/isc-config.sh" |
| 36 | |
| 37 | # PACKAGECONFIGs readline and libedit should NOT be set at same time |
| 38 | PACKAGECONFIG ?= "readline" |
| 39 | PACKAGECONFIG[httpstats] = "--with-libxml2=${STAGING_DIR_HOST}${prefix},--without-libxml2,libxml2" |
| 40 | PACKAGECONFIG[readline] = "--with-readline=-lreadline,,readline" |
| 41 | PACKAGECONFIG[libedit] = "--with-readline=-ledit,,libedit" |
| 42 | PACKAGECONFIG[urandom] = "--with-randomdev=/dev/urandom,--with-randomdev=/dev/random,," |
| 43 | PACKAGECONFIG[python3] = "--with-python=yes --with-python-install-dir=${PYTHON_SITEPACKAGES_DIR} , --without-python, python3-ply-native," |
| 44 | |
| 45 | ENABLE_IPV6 = "--enable-ipv6=${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)}" |
| 46 | EXTRA_OECONF = " ${ENABLE_IPV6} --with-libtool --enable-threads \ |
| 47 | --disable-devpoll --enable-epoll --with-gost=no \ |
| 48 | --with-gssapi=no --with-ecdsa=yes --with-eddsa=no \ |
| 49 | --with-lmdb=no \ |
| 50 | --sysconfdir=${sysconfdir}/bind \ |
| 51 | --with-openssl=${STAGING_DIR_HOST}${prefix} \ |
| 52 | " |
| 53 | |
| 54 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3native distutils3-base', '', d)} |
| 55 | |
| 56 | # dhcp needs .la so keep them |
| 57 | REMOVE_LIBTOOL_LA = "0" |
| 58 | |
| 59 | USERADD_PACKAGES = "${PN}" |
| 60 | USERADD_PARAM_${PN} = "--system --home ${localstatedir}/cache/bind --no-create-home \ |
| 61 | --user-group bind" |
| 62 | |
| 63 | INITSCRIPT_NAME = "bind" |
| 64 | INITSCRIPT_PARAMS = "defaults" |
| 65 | |
| 66 | SYSTEMD_SERVICE_${PN} = "named.service" |
| 67 | |
| 68 | do_install_prepend() { |
| 69 | # clean host path in isc-config.sh before the hardlink created |
| 70 | # by "make install": |
| 71 | # bind9-config -> isc-config.sh |
| 72 | sed -i -e "s,${STAGING_LIBDIR},${libdir}," ${B}/isc-config.sh |
| 73 | } |
| 74 | |
| 75 | do_install_append() { |
| 76 | |
| 77 | rmdir "${D}${localstatedir}/run" |
| 78 | rmdir --ignore-fail-on-non-empty "${D}${localstatedir}" |
| 79 | install -d -o bind "${D}${localstatedir}/cache/bind" |
| 80 | install -d "${D}${sysconfdir}/bind" |
| 81 | install -d "${D}${sysconfdir}/init.d" |
| 82 | install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/" |
| 83 | install -m 755 "${S}/init.d" "${D}${sysconfdir}/init.d/bind" |
| 84 | if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then |
| 85 | sed -i -e '1s,#!.*python3,#! /usr/bin/python3,' \ |
| 86 | ${D}${sbindir}/dnssec-coverage \ |
| 87 | ${D}${sbindir}/dnssec-checkds \ |
| 88 | ${D}${sbindir}/dnssec-keymgr |
| 89 | fi |
| 90 | |
| 91 | # Install systemd related files |
| 92 | install -d ${D}${sbindir} |
| 93 | install -m 755 ${WORKDIR}/generate-rndc-key.sh ${D}${sbindir} |
| 94 | install -d ${D}${systemd_unitdir}/system |
| 95 | install -m 0644 ${WORKDIR}/named.service ${D}${systemd_unitdir}/system |
| 96 | sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ |
| 97 | -e 's,@SBINDIR@,${sbindir},g' \ |
| 98 | ${D}${systemd_unitdir}/system/named.service |
| 99 | |
| 100 | install -d ${D}${sysconfdir}/default |
| 101 | install -m 0644 ${WORKDIR}/bind9 ${D}${sysconfdir}/default |
| 102 | |
| 103 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 104 | install -d ${D}${sysconfdir}/tmpfiles.d |
| 105 | echo "d /run/named 0755 bind bind - -" > ${D}${sysconfdir}/tmpfiles.d/bind.conf |
| 106 | fi |
| 107 | |
| 108 | oe_multilib_header isc/platform.h |
| 109 | } |
| 110 | |
| 111 | CONFFILES_${PN} = " \ |
| 112 | ${sysconfdir}/bind/named.conf \ |
| 113 | ${sysconfdir}/bind/named.conf.local \ |
| 114 | ${sysconfdir}/bind/named.conf.options \ |
| 115 | ${sysconfdir}/bind/db.0 \ |
| 116 | ${sysconfdir}/bind/db.127 \ |
| 117 | ${sysconfdir}/bind/db.empty \ |
| 118 | ${sysconfdir}/bind/db.local \ |
| 119 | ${sysconfdir}/bind/db.root \ |
| 120 | " |
| 121 | |
| 122 | ALTERNATIVE_${PN}-utils = "nslookup" |
| 123 | ALTERNATIVE_LINK_NAME[nslookup] = "${bindir}/nslookup" |
| 124 | ALTERNATIVE_PRIORITY = "100" |
| 125 | |
| 126 | PACKAGE_BEFORE_PN += "${PN}-utils" |
| 127 | FILES_${PN}-utils = "${bindir}/host ${bindir}/dig ${bindir}/mdig ${bindir}/nslookup ${bindir}/nsupdate" |
| 128 | FILES_${PN}-dev += "${bindir}/isc-config.h" |
| 129 | FILES_${PN} += "${sbindir}/generate-rndc-key.sh" |
| 130 | |
| 131 | PACKAGE_BEFORE_PN += "${PN}-libs" |
| 132 | FILES_${PN}-libs = "${libdir}/*.so*" |
| 133 | FILES_${PN}-staticdev += "${libdir}/*.la" |
| 134 | |
| 135 | PACKAGE_BEFORE_PN += "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-bind', '', d)}" |
| 136 | FILES_python3-bind = "${sbindir}/dnssec-coverage ${sbindir}/dnssec-checkds \ |
| 137 | ${sbindir}/dnssec-keymgr ${PYTHON_SITEPACKAGES_DIR}" |
| 138 | |
| 139 | RDEPENDS_${PN}-dev = "" |
| 140 | RDEPENDS_python3-bind = "python3-core python3-ply" |