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