Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [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" |
Brad Bishop | d89cb5f | 2019-04-10 09:02:41 -0400 | [diff] [blame] | 6 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=8f17f64e47e83b60cd920a1e4b54419e" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [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-gen.c-extend-DIRNAMESIZE-from-256-to-512.patch \ |
| 19 | file://0001-lib-dns-gen.c-fix-too-long-error.patch \ |
| 20 | file://0001-configure.in-remove-useless-L-use_openssl-lib.patch \ |
| 21 | file://0001-named-lwresd-V-and-start-log-hide-build-options.patch \ |
| 22 | file://0001-avoid-start-failure-with-bind-user.patch \ |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame] | 23 | file://0001-bind-fix-CVE-2019-6471.patch \ |
| 24 | file://0001-fix-enforcement-of-tcp-clients-v1.patch \ |
| 25 | file://0002-tcp-clients-could-still-be-exceeded-v2.patch \ |
| 26 | file://0003-use-reference-counter-for-pipeline-groups-v3.patch \ |
| 27 | file://0004-better-tcpquota-accounting-and-client-mortality-chec.patch \ |
| 28 | file://0005-refactor-tcpquota-and-pipeline-refs-allow-special-ca.patch \ |
| 29 | file://0006-restore-allowance-for-tcp-clients-interfaces.patch \ |
| 30 | file://0007-Replace-atomic-operations-in-bin-named-client.c-with.patch \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 31 | " |
| 32 | |
Brad Bishop | d89cb5f | 2019-04-10 09:02:41 -0400 | [diff] [blame] | 33 | SRC_URI[md5sum] = "8ddab4b61fa4516fe404679c74e37960" |
| 34 | SRC_URI[sha256sum] = "7e8c08192bcbaeb6e9f2391a70e67583b027b90e8c4bc1605da6eb126edde434" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 35 | |
| 36 | UPSTREAM_CHECK_URI = "https://ftp.isc.org/isc/bind9/" |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 37 | # stay at 9.11 until 9.16, from 9.16 follow the ESV versions divisible by 4 |
| 38 | UPSTREAM_CHECK_REGEX = "(?P<pver>9.(11|16|20|24|28)(\.\d+)+(-P\d+)*)/" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 39 | |
Brad Bishop | 6dbb316 | 2019-11-25 09:41:34 -0500 | [diff] [blame] | 40 | # BIND >= 9.11.2 need dhcpd >= 4.4.0, |
| 41 | # don't report it here since dhcpd is already recent enough. |
| 42 | CVE_CHECK_WHITELIST += "CVE-2019-6470" |
| 43 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 44 | inherit autotools update-rc.d systemd useradd pkgconfig multilib_script |
| 45 | |
| 46 | MULTILIB_SCRIPTS = "${PN}:${bindir}/bind9-config ${PN}:${bindir}/isc-config.sh" |
| 47 | |
| 48 | # PACKAGECONFIGs readline and libedit should NOT be set at same time |
| 49 | PACKAGECONFIG ?= "readline" |
| 50 | PACKAGECONFIG[httpstats] = "--with-libxml2=${STAGING_DIR_HOST}${prefix},--without-libxml2,libxml2" |
| 51 | PACKAGECONFIG[readline] = "--with-readline=-lreadline,,readline" |
| 52 | PACKAGECONFIG[libedit] = "--with-readline=-ledit,,libedit" |
| 53 | PACKAGECONFIG[urandom] = "--with-randomdev=/dev/urandom,--with-randomdev=/dev/random,," |
Brad Bishop | 79641f2 | 2019-09-10 07:20:22 -0400 | [diff] [blame] | 54 | PACKAGECONFIG[python3] = "--with-python=yes --with-python-install-dir=${PYTHON_SITEPACKAGES_DIR} , --without-python, python3-ply-native," |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 55 | |
| 56 | ENABLE_IPV6 = "--enable-ipv6=${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)}" |
| 57 | EXTRA_OECONF = " ${ENABLE_IPV6} --with-libtool --enable-threads \ |
| 58 | --disable-devpoll --enable-epoll --with-gost=no \ |
| 59 | --with-gssapi=no --with-ecdsa=yes --with-eddsa=no \ |
| 60 | --with-lmdb=no \ |
| 61 | --sysconfdir=${sysconfdir}/bind \ |
| 62 | --with-openssl=${STAGING_DIR_HOST}${prefix} \ |
| 63 | " |
| 64 | |
| 65 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3native distutils3-base', '', d)} |
| 66 | |
| 67 | # dhcp needs .la so keep them |
| 68 | REMOVE_LIBTOOL_LA = "0" |
| 69 | |
| 70 | USERADD_PACKAGES = "${PN}" |
| 71 | USERADD_PARAM_${PN} = "--system --home ${localstatedir}/cache/bind --no-create-home \ |
| 72 | --user-group bind" |
| 73 | |
| 74 | INITSCRIPT_NAME = "bind" |
| 75 | INITSCRIPT_PARAMS = "defaults" |
| 76 | |
| 77 | SYSTEMD_SERVICE_${PN} = "named.service" |
| 78 | |
| 79 | do_install_prepend() { |
| 80 | # clean host path in isc-config.sh before the hardlink created |
| 81 | # by "make install": |
| 82 | # bind9-config -> isc-config.sh |
| 83 | sed -i -e "s,${STAGING_LIBDIR},${libdir}," ${B}/isc-config.sh |
| 84 | } |
| 85 | |
| 86 | do_install_append() { |
| 87 | |
| 88 | rmdir "${D}${localstatedir}/run" |
| 89 | rmdir --ignore-fail-on-non-empty "${D}${localstatedir}" |
| 90 | install -d -o bind "${D}${localstatedir}/cache/bind" |
| 91 | install -d "${D}${sysconfdir}/bind" |
| 92 | install -d "${D}${sysconfdir}/init.d" |
| 93 | install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/" |
| 94 | install -m 755 "${S}/init.d" "${D}${sysconfdir}/init.d/bind" |
| 95 | if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then |
| 96 | sed -i -e '1s,#!.*python3,#! /usr/bin/python3,' \ |
| 97 | ${D}${sbindir}/dnssec-coverage \ |
| 98 | ${D}${sbindir}/dnssec-checkds \ |
| 99 | ${D}${sbindir}/dnssec-keymgr |
| 100 | fi |
| 101 | |
| 102 | # Install systemd related files |
| 103 | install -d ${D}${sbindir} |
| 104 | install -m 755 ${WORKDIR}/generate-rndc-key.sh ${D}${sbindir} |
| 105 | install -d ${D}${systemd_unitdir}/system |
| 106 | install -m 0644 ${WORKDIR}/named.service ${D}${systemd_unitdir}/system |
| 107 | sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ |
| 108 | -e 's,@SBINDIR@,${sbindir},g' \ |
| 109 | ${D}${systemd_unitdir}/system/named.service |
| 110 | |
| 111 | install -d ${D}${sysconfdir}/default |
| 112 | install -m 0644 ${WORKDIR}/bind9 ${D}${sysconfdir}/default |
| 113 | |
| 114 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 115 | install -d ${D}${sysconfdir}/tmpfiles.d |
| 116 | echo "d /run/named 0755 bind bind - -" > ${D}${sysconfdir}/tmpfiles.d/bind.conf |
| 117 | fi |
| 118 | } |
| 119 | |
| 120 | CONFFILES_${PN} = " \ |
| 121 | ${sysconfdir}/bind/named.conf \ |
| 122 | ${sysconfdir}/bind/named.conf.local \ |
| 123 | ${sysconfdir}/bind/named.conf.options \ |
| 124 | ${sysconfdir}/bind/db.0 \ |
| 125 | ${sysconfdir}/bind/db.127 \ |
| 126 | ${sysconfdir}/bind/db.empty \ |
| 127 | ${sysconfdir}/bind/db.local \ |
| 128 | ${sysconfdir}/bind/db.root \ |
| 129 | " |
| 130 | |
| 131 | ALTERNATIVE_${PN}-utils = "nslookup" |
| 132 | ALTERNATIVE_LINK_NAME[nslookup] = "${bindir}/nslookup" |
| 133 | ALTERNATIVE_PRIORITY = "100" |
| 134 | |
| 135 | PACKAGE_BEFORE_PN += "${PN}-utils" |
| 136 | FILES_${PN}-utils = "${bindir}/host ${bindir}/dig ${bindir}/mdig ${bindir}/nslookup ${bindir}/nsupdate" |
| 137 | FILES_${PN}-dev += "${bindir}/isc-config.h" |
| 138 | FILES_${PN} += "${sbindir}/generate-rndc-key.sh" |
| 139 | |
| 140 | PACKAGE_BEFORE_PN += "${PN}-libs" |
| 141 | FILES_${PN}-libs = "${libdir}/*.so*" |
| 142 | FILES_${PN}-staticdev += "${libdir}/*.la" |
| 143 | |
| 144 | PACKAGE_BEFORE_PN += "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-bind', '', d)}" |
| 145 | FILES_python3-bind = "${sbindir}/dnssec-coverage ${sbindir}/dnssec-checkds \ |
| 146 | ${sbindir}/dnssec-keymgr ${PYTHON_SITEPACKAGES_DIR}" |
| 147 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 148 | RDEPENDS_${PN}-dev = "" |
| 149 | RDEPENDS_python3-bind = "python3-core python3-ply" |