blob: ddf323fb9cd08c2eba117f1175a9c5c69c52ccf0 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "ISC Internet Domain Name Server"
Andrew Geissler6ce62a22020-11-30 19:58:47 -06002HOMEPAGE = "https://www.isc.org/bind/"
Andrew Geissler90fd73c2021-03-05 15:25:55 -06003DESCRIPTION = "BIND 9 provides a full-featured Domain Name Server system"
Andrew Geissler82c905d2020-04-13 13:39:40 -05004SECTION = "console/network"
5
Andrew Geisslerc9f78652020-09-18 14:11:35 -05006LICENSE = "MPL-2.0"
Andrew Geisslerd1e89492021-02-12 15:35:20 -06007LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=ef10b4de6371115dcecdc38ca2af4561"
Andrew Geissler82c905d2020-04-13 13:39:40 -05008
Andrew Geisslerc9f78652020-09-18 14:11:35 -05009DEPENDS = "openssl libcap zlib libuv"
Andrew Geissler82c905d2020-04-13 13:39:40 -050010
Andrew Geisslerc9f78652020-09-18 14:11:35 -050011SRC_URI = "https://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.xz \
Andrew Geissler82c905d2020-04-13 13:39:40 -050012 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 \
Andrew Geissler82c905d2020-04-13 13:39:40 -050019 file://0001-named-lwresd-V-and-start-log-hide-build-options.patch \
20 file://0001-avoid-start-failure-with-bind-user.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050021 "
22
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050023SRC_URI[sha256sum] = "4d0d93c0d0b63080609e84625f24ff8777f8d164e78a75b1c19c334ce42d5b58"
Andrew Geissler82c905d2020-04-13 13:39:40 -050024
25UPSTREAM_CHECK_URI = "https://ftp.isc.org/isc/bind9/"
Andrew Geisslerc9f78652020-09-18 14:11:35 -050026# stay at 9.16 follow the ESV versions divisible by 4
27UPSTREAM_CHECK_REGEX = "(?P<pver>9.(16|20|24|28)(\.\d+)+(-P\d+)*)/"
Andrew Geissler82c905d2020-04-13 13:39:40 -050028
William A. Kennington IIIac69b482021-06-02 12:28:27 -070029# Issue only affects dhcpd with recent bind versions. We don't ship dhcpd anymore
30# so the issue doesn't affect us.
31CVE_CHECK_WHITELIST += "CVE-2019-6470"
32
Andrew Geisslerc9f78652020-09-18 14:11:35 -050033inherit autotools update-rc.d systemd useradd pkgconfig multilib_header update-alternatives
Andrew Geissler82c905d2020-04-13 13:39:40 -050034
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=-lreadline,,readline"
39PACKAGECONFIG[libedit] = "--with-readline=-ledit,,libedit"
Andrew Geissler82c905d2020-04-13 13:39:40 -050040PACKAGECONFIG[python3] = "--with-python=yes --with-python-install-dir=${PYTHON_SITEPACKAGES_DIR} , --without-python, python3-ply-native,"
41
Andrew Geisslerc3d88e42020-10-02 09:45:00 -050042EXTRA_OECONF = " --with-libtool --disable-devpoll --disable-auto-validation --enable-epoll \
Andrew Geisslerc9f78652020-09-18 14:11:35 -050043 --with-gssapi=no --with-lmdb=no --with-zlib \
Andrew Geissler82c905d2020-04-13 13:39:40 -050044 --sysconfdir=${sysconfdir}/bind \
45 --with-openssl=${STAGING_DIR_HOST}${prefix} \
46 "
Patrick Williams213cb262021-08-07 19:21:33 -050047LDFLAGS:append = " -lz"
Andrew Geissler82c905d2020-04-13 13:39:40 -050048
49inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3native distutils3-base', '', d)}
50
51# dhcp needs .la so keep them
52REMOVE_LIBTOOL_LA = "0"
53
54USERADD_PACKAGES = "${PN}"
Patrick Williams213cb262021-08-07 19:21:33 -050055USERADD_PARAM:${PN} = "--system --home ${localstatedir}/cache/bind --no-create-home \
Andrew Geissler82c905d2020-04-13 13:39:40 -050056 --user-group bind"
57
58INITSCRIPT_NAME = "bind"
59INITSCRIPT_PARAMS = "defaults"
60
Patrick Williams213cb262021-08-07 19:21:33 -050061SYSTEMD_SERVICE:${PN} = "named.service"
Andrew Geissler82c905d2020-04-13 13:39:40 -050062
Patrick Williams213cb262021-08-07 19:21:33 -050063do_install:append() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050064
Andrew Geissler82c905d2020-04-13 13:39:40 -050065 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}
Andrew Geissler5199d832021-09-24 16:47:35 -050080 install -d ${D}${systemd_system_unitdir}
81 install -m 0644 ${WORKDIR}/named.service ${D}${systemd_system_unitdir}
Andrew Geissler82c905d2020-04-13 13:39:40 -050082 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
83 -e 's,@SBINDIR@,${sbindir},g' \
Andrew Geissler5199d832021-09-24 16:47:35 -050084 ${D}${systemd_system_unitdir}/named.service
Andrew Geissler82c905d2020-04-13 13:39:40 -050085
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 oe_multilib_header isc/platform.h
95}
96
Patrick Williams213cb262021-08-07 19:21:33 -050097CONFFILES:${PN} = " \
Andrew Geissler82c905d2020-04-13 13:39:40 -050098 ${sysconfdir}/bind/named.conf \
99 ${sysconfdir}/bind/named.conf.local \
100 ${sysconfdir}/bind/named.conf.options \
101 ${sysconfdir}/bind/db.0 \
102 ${sysconfdir}/bind/db.127 \
103 ${sysconfdir}/bind/db.empty \
104 ${sysconfdir}/bind/db.local \
105 ${sysconfdir}/bind/db.root \
106 "
107
Patrick Williams213cb262021-08-07 19:21:33 -0500108ALTERNATIVE:${PN}-utils = "nslookup"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500109ALTERNATIVE_LINK_NAME[nslookup] = "${bindir}/nslookup"
110ALTERNATIVE_PRIORITY = "100"
111
112PACKAGE_BEFORE_PN += "${PN}-utils"
Patrick Williams213cb262021-08-07 19:21:33 -0500113FILES:${PN}-utils = "${bindir}/host ${bindir}/dig ${bindir}/mdig ${bindir}/nslookup ${bindir}/nsupdate"
114FILES:${PN}-dev += "${bindir}/isc-config.h"
115FILES:${PN} += "${sbindir}/generate-rndc-key.sh"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500116
117PACKAGE_BEFORE_PN += "${PN}-libs"
Andrew Geissler95ac1b82021-03-31 14:34:31 -0500118# special arrangement below due to
119# https://github.com/isc-projects/bind9/commit/0e25af628cd776f98c04fc4cc59048f5448f6c88
120FILES_SOLIBSDEV = "${libdir}/*[!0-9].so ${libdir}/libbind9.so"
Patrick Williams213cb262021-08-07 19:21:33 -0500121FILES:${PN}-libs = "${libdir}/named/*.so* ${libdir}/*-${PV}.so"
122FILES:${PN}-staticdev += "${libdir}/*.la"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500123
124PACKAGE_BEFORE_PN += "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-bind', '', d)}"
Patrick Williams213cb262021-08-07 19:21:33 -0500125FILES:python3-bind = "${sbindir}/dnssec-coverage ${sbindir}/dnssec-checkds \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500126 ${sbindir}/dnssec-keymgr ${PYTHON_SITEPACKAGES_DIR}"
127
Patrick Williams213cb262021-08-07 19:21:33 -0500128RDEPENDS:${PN}-dev = ""
129RDEPENDS:python3-bind = "python3-core python3-ply"