blob: 0897706346b97075c9566ffcacf76644a09b1712 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001SUMMARY = "ISC Internet Domain Name Server"
2HOMEPAGE = "http://www.isc.org/sw/bind/"
3SECTION = "console/network"
4
5LICENSE = "ISC & BSD"
Brad Bishopd89cb5f2019-04-10 09:02:41 -04006LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=8f17f64e47e83b60cd920a1e4b54419e"
Brad Bishop19323692019-04-05 15:28:33 -04007
8DEPENDS = "openssl libcap zlib"
9
10SRC_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 Bishop64c979e2019-11-04 13:55:29 -050023 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 Bishop19323692019-04-05 15:28:33 -040031"
32
Brad Bishopd89cb5f2019-04-10 09:02:41 -040033SRC_URI[md5sum] = "8ddab4b61fa4516fe404679c74e37960"
34SRC_URI[sha256sum] = "7e8c08192bcbaeb6e9f2391a70e67583b027b90e8c4bc1605da6eb126edde434"
Brad Bishop19323692019-04-05 15:28:33 -040035
36UPSTREAM_CHECK_URI = "https://ftp.isc.org/isc/bind9/"
Brad Bishop08902b02019-08-20 09:16:51 -040037# stay at 9.11 until 9.16, from 9.16 follow the ESV versions divisible by 4
38UPSTREAM_CHECK_REGEX = "(?P<pver>9.(11|16|20|24|28)(\.\d+)+(-P\d+)*)/"
Brad Bishop19323692019-04-05 15:28:33 -040039
Brad Bishop6dbb3162019-11-25 09:41:34 -050040# BIND >= 9.11.2 need dhcpd >= 4.4.0,
41# don't report it here since dhcpd is already recent enough.
42CVE_CHECK_WHITELIST += "CVE-2019-6470"
43
Brad Bishop19323692019-04-05 15:28:33 -040044inherit autotools update-rc.d systemd useradd pkgconfig multilib_script
45
46MULTILIB_SCRIPTS = "${PN}:${bindir}/bind9-config ${PN}:${bindir}/isc-config.sh"
47
48# PACKAGECONFIGs readline and libedit should NOT be set at same time
49PACKAGECONFIG ?= "readline"
50PACKAGECONFIG[httpstats] = "--with-libxml2=${STAGING_DIR_HOST}${prefix},--without-libxml2,libxml2"
51PACKAGECONFIG[readline] = "--with-readline=-lreadline,,readline"
52PACKAGECONFIG[libedit] = "--with-readline=-ledit,,libedit"
53PACKAGECONFIG[urandom] = "--with-randomdev=/dev/urandom,--with-randomdev=/dev/random,,"
Brad Bishop79641f22019-09-10 07:20:22 -040054PACKAGECONFIG[python3] = "--with-python=yes --with-python-install-dir=${PYTHON_SITEPACKAGES_DIR} , --without-python, python3-ply-native,"
Brad Bishop19323692019-04-05 15:28:33 -040055
56ENABLE_IPV6 = "--enable-ipv6=${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)}"
57EXTRA_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
65inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3native distutils3-base', '', d)}
66
67# dhcp needs .la so keep them
68REMOVE_LIBTOOL_LA = "0"
69
70USERADD_PACKAGES = "${PN}"
71USERADD_PARAM_${PN} = "--system --home ${localstatedir}/cache/bind --no-create-home \
72 --user-group bind"
73
74INITSCRIPT_NAME = "bind"
75INITSCRIPT_PARAMS = "defaults"
76
77SYSTEMD_SERVICE_${PN} = "named.service"
78
79do_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
86do_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
120CONFFILES_${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
131ALTERNATIVE_${PN}-utils = "nslookup"
132ALTERNATIVE_LINK_NAME[nslookup] = "${bindir}/nslookup"
133ALTERNATIVE_PRIORITY = "100"
134
135PACKAGE_BEFORE_PN += "${PN}-utils"
136FILES_${PN}-utils = "${bindir}/host ${bindir}/dig ${bindir}/mdig ${bindir}/nslookup ${bindir}/nsupdate"
137FILES_${PN}-dev += "${bindir}/isc-config.h"
138FILES_${PN} += "${sbindir}/generate-rndc-key.sh"
139
140PACKAGE_BEFORE_PN += "${PN}-libs"
141FILES_${PN}-libs = "${libdir}/*.so*"
142FILES_${PN}-staticdev += "${libdir}/*.la"
143
144PACKAGE_BEFORE_PN += "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-bind', '', d)}"
145FILES_python3-bind = "${sbindir}/dnssec-coverage ${sbindir}/dnssec-checkds \
146 ${sbindir}/dnssec-keymgr ${PYTHON_SITEPACKAGES_DIR}"
147
Brad Bishop19323692019-04-05 15:28:33 -0400148RDEPENDS_${PN}-dev = ""
149RDEPENDS_python3-bind = "python3-core python3-ply"