blob: 3e2412dfa464ad41bff4a61ed2387e6f7fd33afd [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
40inherit autotools update-rc.d systemd useradd pkgconfig multilib_script
41
42MULTILIB_SCRIPTS = "${PN}:${bindir}/bind9-config ${PN}:${bindir}/isc-config.sh"
43
44# PACKAGECONFIGs readline and libedit should NOT be set at same time
45PACKAGECONFIG ?= "readline"
46PACKAGECONFIG[httpstats] = "--with-libxml2=${STAGING_DIR_HOST}${prefix},--without-libxml2,libxml2"
47PACKAGECONFIG[readline] = "--with-readline=-lreadline,,readline"
48PACKAGECONFIG[libedit] = "--with-readline=-ledit,,libedit"
49PACKAGECONFIG[urandom] = "--with-randomdev=/dev/urandom,--with-randomdev=/dev/random,,"
Brad Bishop79641f22019-09-10 07:20:22 -040050PACKAGECONFIG[python3] = "--with-python=yes --with-python-install-dir=${PYTHON_SITEPACKAGES_DIR} , --without-python, python3-ply-native,"
Brad Bishop19323692019-04-05 15:28:33 -040051
52ENABLE_IPV6 = "--enable-ipv6=${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)}"
53EXTRA_OECONF = " ${ENABLE_IPV6} --with-libtool --enable-threads \
54 --disable-devpoll --enable-epoll --with-gost=no \
55 --with-gssapi=no --with-ecdsa=yes --with-eddsa=no \
56 --with-lmdb=no \
57 --sysconfdir=${sysconfdir}/bind \
58 --with-openssl=${STAGING_DIR_HOST}${prefix} \
59 "
60
61inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3native distutils3-base', '', d)}
62
63# dhcp needs .la so keep them
64REMOVE_LIBTOOL_LA = "0"
65
66USERADD_PACKAGES = "${PN}"
67USERADD_PARAM_${PN} = "--system --home ${localstatedir}/cache/bind --no-create-home \
68 --user-group bind"
69
70INITSCRIPT_NAME = "bind"
71INITSCRIPT_PARAMS = "defaults"
72
73SYSTEMD_SERVICE_${PN} = "named.service"
74
75do_install_prepend() {
76 # clean host path in isc-config.sh before the hardlink created
77 # by "make install":
78 # bind9-config -> isc-config.sh
79 sed -i -e "s,${STAGING_LIBDIR},${libdir}," ${B}/isc-config.sh
80}
81
82do_install_append() {
83
84 rmdir "${D}${localstatedir}/run"
85 rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
86 install -d -o bind "${D}${localstatedir}/cache/bind"
87 install -d "${D}${sysconfdir}/bind"
88 install -d "${D}${sysconfdir}/init.d"
89 install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/"
90 install -m 755 "${S}/init.d" "${D}${sysconfdir}/init.d/bind"
91 if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then
92 sed -i -e '1s,#!.*python3,#! /usr/bin/python3,' \
93 ${D}${sbindir}/dnssec-coverage \
94 ${D}${sbindir}/dnssec-checkds \
95 ${D}${sbindir}/dnssec-keymgr
96 fi
97
98 # Install systemd related files
99 install -d ${D}${sbindir}
100 install -m 755 ${WORKDIR}/generate-rndc-key.sh ${D}${sbindir}
101 install -d ${D}${systemd_unitdir}/system
102 install -m 0644 ${WORKDIR}/named.service ${D}${systemd_unitdir}/system
103 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
104 -e 's,@SBINDIR@,${sbindir},g' \
105 ${D}${systemd_unitdir}/system/named.service
106
107 install -d ${D}${sysconfdir}/default
108 install -m 0644 ${WORKDIR}/bind9 ${D}${sysconfdir}/default
109
110 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
111 install -d ${D}${sysconfdir}/tmpfiles.d
112 echo "d /run/named 0755 bind bind - -" > ${D}${sysconfdir}/tmpfiles.d/bind.conf
113 fi
114}
115
116CONFFILES_${PN} = " \
117 ${sysconfdir}/bind/named.conf \
118 ${sysconfdir}/bind/named.conf.local \
119 ${sysconfdir}/bind/named.conf.options \
120 ${sysconfdir}/bind/db.0 \
121 ${sysconfdir}/bind/db.127 \
122 ${sysconfdir}/bind/db.empty \
123 ${sysconfdir}/bind/db.local \
124 ${sysconfdir}/bind/db.root \
125 "
126
127ALTERNATIVE_${PN}-utils = "nslookup"
128ALTERNATIVE_LINK_NAME[nslookup] = "${bindir}/nslookup"
129ALTERNATIVE_PRIORITY = "100"
130
131PACKAGE_BEFORE_PN += "${PN}-utils"
132FILES_${PN}-utils = "${bindir}/host ${bindir}/dig ${bindir}/mdig ${bindir}/nslookup ${bindir}/nsupdate"
133FILES_${PN}-dev += "${bindir}/isc-config.h"
134FILES_${PN} += "${sbindir}/generate-rndc-key.sh"
135
136PACKAGE_BEFORE_PN += "${PN}-libs"
137FILES_${PN}-libs = "${libdir}/*.so*"
138FILES_${PN}-staticdev += "${libdir}/*.la"
139
140PACKAGE_BEFORE_PN += "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-bind', '', d)}"
141FILES_python3-bind = "${sbindir}/dnssec-coverage ${sbindir}/dnssec-checkds \
142 ${sbindir}/dnssec-keymgr ${PYTHON_SITEPACKAGES_DIR}"
143
Brad Bishop19323692019-04-05 15:28:33 -0400144RDEPENDS_${PN}-dev = ""
145RDEPENDS_python3-bind = "python3-core python3-ply"