blob: cb4a21a9af708be0c23b5bf4d7ed8ae6a25fa104 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001SUMMARY = "ISC Internet Domain Name Server"
2HOMEPAGE = "http://www.isc.org/sw/bind/"
3SECTION = "console/network"
4
5LICENSE = "ISC & BSD"
6LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=6ba7c9fe0c888a943c79c93e6de744fb"
7
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 file://CVE-2018-5740.patch \
24"
25
26SRC_URI[md5sum] = "9b4834d78f30cdb796ce437262272a36"
27SRC_URI[sha256sum] = "595070b031f869f8939656b5a5d11b121211967f15f6afeafa895df745279617"
28
29UPSTREAM_CHECK_URI = "https://ftp.isc.org/isc/bind9/"
30UPSTREAM_CHECK_REGEX = "(?P<pver>9(\.\d+)+(-P\d+)*)/"
31
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 rm "${D}${bindir}/nslookup"
77 rm "${D}${mandir}/man1/nslookup.1"
78 rmdir "${D}${localstatedir}/run"
79 rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
80 install -d -o bind "${D}${localstatedir}/cache/bind"
81 install -d "${D}${sysconfdir}/bind"
82 install -d "${D}${sysconfdir}/init.d"
83 install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/"
84 install -m 755 "${S}/init.d" "${D}${sysconfdir}/init.d/bind"
85 if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then
86 sed -i -e '1s,#!.*python3,#! /usr/bin/python3,' \
87 ${D}${sbindir}/dnssec-coverage \
88 ${D}${sbindir}/dnssec-checkds \
89 ${D}${sbindir}/dnssec-keymgr
90 fi
91
92 # Install systemd related files
93 install -d ${D}${sbindir}
94 install -m 755 ${WORKDIR}/generate-rndc-key.sh ${D}${sbindir}
95 install -d ${D}${systemd_unitdir}/system
96 install -m 0644 ${WORKDIR}/named.service ${D}${systemd_unitdir}/system
97 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
98 -e 's,@SBINDIR@,${sbindir},g' \
99 ${D}${systemd_unitdir}/system/named.service
100
101 install -d ${D}${sysconfdir}/default
102 install -m 0644 ${WORKDIR}/bind9 ${D}${sysconfdir}/default
103
104 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
105 install -d ${D}${sysconfdir}/tmpfiles.d
106 echo "d /run/named 0755 bind bind - -" > ${D}${sysconfdir}/tmpfiles.d/bind.conf
107 fi
108}
109
110CONFFILES_${PN} = " \
111 ${sysconfdir}/bind/named.conf \
112 ${sysconfdir}/bind/named.conf.local \
113 ${sysconfdir}/bind/named.conf.options \
114 ${sysconfdir}/bind/db.0 \
115 ${sysconfdir}/bind/db.127 \
116 ${sysconfdir}/bind/db.empty \
117 ${sysconfdir}/bind/db.local \
118 ${sysconfdir}/bind/db.root \
119 "
120
121PACKAGE_BEFORE_PN += "${PN}-utils"
122FILES_${PN}-utils = "${bindir}/host ${bindir}/dig ${bindir}/mdig"
123FILES_${PN}-dev += "${bindir}/isc-config.h"
124FILES_${PN} += "${sbindir}/generate-rndc-key.sh"
125
126PACKAGE_BEFORE_PN += "${PN}-libs"
127FILES_${PN}-libs = "${libdir}/*.so*"
128FILES_${PN}-staticdev += "${libdir}/*.la"
129
130PACKAGE_BEFORE_PN += "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-bind', '', d)}"
131FILES_python3-bind = "${sbindir}/dnssec-coverage ${sbindir}/dnssec-checkds \
132 ${sbindir}/dnssec-keymgr ${PYTHON_SITEPACKAGES_DIR}"
133
134RDEPENDS_${PN} = "bash"
135RDEPENDS_${PN}-utils = "bash"
136RDEPENDS_${PN}-dev = ""
137RDEPENDS_python3-bind = "python3-core python3-ply"