blob: 6aa832f8f54a4837d439c26a1a7f2641365aeb58 [file] [log] [blame]
Andrew Geissler9aee5002022-03-30 16:27:02 +00001SUMMARY = "ISC Internet Domain Name Server"
2HOMEPAGE = "https://www.isc.org/bind/"
3DESCRIPTION = "BIND 9 provides a full-featured Domain Name Server system"
4SECTION = "console/network"
5
6LICENSE = "MPL-2.0"
7LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=9a4a897f202c0710e07f2f2836bc2b62"
8
9DEPENDS = "openssl libcap zlib libuv"
10
11SRC_URI = "https://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.xz \
12 file://conf.patch \
13 file://named.service \
14 file://bind9 \
15 file://generate-rndc-key.sh \
16 file://make-etc-initd-bind-stop-work.patch \
17 file://init.d-add-support-for-read-only-rootfs.patch \
18 file://bind-ensure-searching-for-json-headers-searches-sysr.patch \
19 file://0001-named-lwresd-V-and-start-log-hide-build-options.patch \
20 file://0001-avoid-start-failure-with-bind-user.patch \
21 "
22
23SRC_URI[sha256sum] = "57c7afd871694d615cb4defb1c1bd6ed023350943d7458414db8d493ef560427"
24
25UPSTREAM_CHECK_URI = "https://ftp.isc.org/isc/bind9/"
26# follow the ESV versions divisible by 2
27UPSTREAM_CHECK_REGEX = "(?P<pver>9.(\d*[02468])+(\.\d+)+(-P\d+)*)/"
28
29# Issue only affects dhcpd with recent bind versions. We don't ship dhcpd anymore
30# so the issue doesn't affect us.
31CVE_CHECK_IGNORE += "CVE-2019-6470"
32
33inherit autotools update-rc.d systemd useradd pkgconfig multilib_header update-alternatives
34
35# PACKAGECONFIGs readline and libedit should NOT be set at same time
36PACKAGECONFIG ?= "readline"
37PACKAGECONFIG[httpstats] = "--with-libxml2=${STAGING_DIR_HOST}${prefix},--without-libxml2,libxml2"
38PACKAGECONFIG[readline] = "--with-readline=readline,,readline"
39PACKAGECONFIG[libedit] = "--with-readline=libedit,,libedit"
40PACKAGECONFIG[dns-over-http] = "--enable-doh,--disable-doh,nghttp2"
41
42EXTRA_OECONF = " --disable-devpoll --disable-auto-validation --enable-epoll \
43 --with-gssapi=no --with-lmdb=no --with-zlib \
44 --sysconfdir=${sysconfdir}/bind \
45 --with-openssl=${STAGING_DIR_HOST}${prefix} \
46 "
47LDFLAGS:append = " -lz"
48
49inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3native setuptools3-base', '', d)}
50
51# dhcp needs .la so keep them
52REMOVE_LIBTOOL_LA = "0"
53
54USERADD_PACKAGES = "${PN}"
55USERADD_PARAM:${PN} = "--system --home ${localstatedir}/cache/bind --no-create-home \
56 --user-group bind"
57
58INITSCRIPT_NAME = "bind"
59INITSCRIPT_PARAMS = "defaults"
60
61SYSTEMD_SERVICE:${PN} = "named.service"
62
63do_install:append() {
64
65 install -d -o bind "${D}${localstatedir}/cache/bind"
66 install -d "${D}${sysconfdir}/bind"
67 install -d "${D}${sysconfdir}/init.d"
68 install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/"
69 install -m 755 "${S}/init.d" "${D}${sysconfdir}/init.d/bind"
70 if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then
71 sed -i -e '1s,#!.*python3,#! /usr/bin/python3,' \
72 ${D}${sbindir}/dnssec-coverage \
73 ${D}${sbindir}/dnssec-checkds \
74 ${D}${sbindir}/dnssec-keymgr
75 fi
76
77 # Install systemd related files
78 install -d ${D}${sbindir}
79 install -m 755 ${WORKDIR}/generate-rndc-key.sh ${D}${sbindir}
80 install -d ${D}${systemd_system_unitdir}
81 install -m 0644 ${WORKDIR}/named.service ${D}${systemd_system_unitdir}
82 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
83 -e 's,@SBINDIR@,${sbindir},g' \
84 ${D}${systemd_system_unitdir}/named.service
85
86 install -d ${D}${sysconfdir}/default
87 install -m 0644 ${WORKDIR}/bind9 ${D}${sysconfdir}/default
88
89 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
90 install -d ${D}${sysconfdir}/tmpfiles.d
91 echo "d /run/named 0755 bind bind - -" > ${D}${sysconfdir}/tmpfiles.d/bind.conf
92 fi
93}
94
95CONFFILES:${PN} = " \
96 ${sysconfdir}/bind/named.conf \
97 ${sysconfdir}/bind/named.conf.local \
98 ${sysconfdir}/bind/named.conf.options \
99 ${sysconfdir}/bind/db.0 \
100 ${sysconfdir}/bind/db.127 \
101 ${sysconfdir}/bind/db.empty \
102 ${sysconfdir}/bind/db.local \
103 ${sysconfdir}/bind/db.root \
104 "
105
106ALTERNATIVE:${PN}-utils = "nslookup"
107ALTERNATIVE_LINK_NAME[nslookup] = "${bindir}/nslookup"
108ALTERNATIVE_PRIORITY = "100"
109
110PACKAGE_BEFORE_PN += "${PN}-utils"
111FILES:${PN}-utils = "${bindir}/host ${bindir}/dig ${bindir}/mdig ${bindir}/nslookup ${bindir}/nsupdate"
112FILES:${PN}-dev += "${bindir}/isc-config.h"
113FILES:${PN} += "${sbindir}/generate-rndc-key.sh"
114
115PACKAGE_BEFORE_PN += "${PN}-libs"
116# special arrangement below due to
117# https://github.com/isc-projects/bind9/commit/0e25af628cd776f98c04fc4cc59048f5448f6c88
118FILES_SOLIBSDEV = "${libdir}/*[!0-9].so ${libdir}/libbind9.so"
119FILES:${PN}-libs = "${libdir}/named/*.so* ${libdir}/*-${PV}.so"
120FILES:${PN}-staticdev += "${libdir}/*.la"
121
122PACKAGE_BEFORE_PN += "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-bind', '', d)}"
123FILES:python3-bind = "${sbindir}/dnssec-coverage ${sbindir}/dnssec-checkds \
124 ${sbindir}/dnssec-keymgr ${PYTHON_SITEPACKAGES_DIR}"
125
126RDEPENDS:${PN}-dev = ""
127RDEPENDS:python3-bind = "python3-core python3-ply"