blob: 4e2e856b72546ccfbd427c2e5173c8e7873f4b0f [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001SUMMARY = "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=0a95f52a0ab6c5f52dedc9a45e7abb3f"
7
8DEPENDS = "openssl libcap"
9
10SRC_URI = "ftp://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.gz \
11 file://conf.patch \
12 file://make-etc-initd-bind-stop-work.patch \
13 file://mips1-not-support-opcode.diff \
14 file://dont-test-on-host.patch \
15 file://generate-rndc-key.sh \
16 file://named.service \
17 file://bind9 \
18 file://init.d-add-support-for-read-only-rootfs.patch \
19 file://bind-confgen-build-unix.o-once.patch \
20 file://0001-build-use-pkg-config-to-find-libxml2.patch \
21 file://bind-ensure-searching-for-json-headers-searches-sysr.patch \
22 file://0001-gen.c-extend-DIRNAMESIZE-from-256-to-512.patch \
23 file://0001-lib-dns-gen.c-fix-too-long-error.patch \
24 file://CVE-2016-1285.patch \
25 file://CVE-2016-1286_1.patch \
26 file://CVE-2016-1286_2.patch \
27 file://CVE-2016-2088.patch \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060028 file://CVE-2016-2775.patch \
29 file://CVE-2016-2776.patch \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050030 "
31
32SRC_URI[md5sum] = "bcf7e772b616f7259420a3edc5df350a"
33SRC_URI[sha256sum] = "690810d1fbb72afa629e74638d19cd44e28d2b2e5eb63f55c705ad85d1a4cb83"
34
35ENABLE_IPV6 = "--enable-ipv6=${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)}"
36EXTRA_OECONF = " ${ENABLE_IPV6} --with-randomdev=/dev/random --disable-threads \
37 --disable-devpoll --disable-epoll --with-gost=no \
38 --with-gssapi=no --with-ecdsa=yes \
39 --sysconfdir=${sysconfdir}/bind \
40 --with-openssl=${STAGING_LIBDIR}/.. \
41 "
42inherit autotools update-rc.d systemd useradd pkgconfig
43
44# PACKAGECONFIGs readline and libedit should NOT be set at same time
45PACKAGECONFIG ?= "readline"
46PACKAGECONFIG[httpstats] = "--with-libxml2,--without-libxml2,libxml2"
47PACKAGECONFIG[readline] = "--with-readline=-lreadline,,readline"
48PACKAGECONFIG[libedit] = "--with-readline=-ledit,,libedit"
49
50USERADD_PACKAGES = "${PN}"
51USERADD_PARAM_${PN} = "--system --home ${localstatedir}/cache/bind --no-create-home \
52 --user-group bind"
53
54INITSCRIPT_NAME = "bind"
55INITSCRIPT_PARAMS = "defaults"
56
57SYSTEMD_SERVICE_${PN} = "named.service"
58
59PARALLEL_MAKE = ""
60
Patrick Williamsc0f7c042017-02-23 20:41:17 -060061RDEPENDS_${PN} = "python3-core"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050062RDEPENDS_${PN}-dev = ""
63
64PACKAGE_BEFORE_PN += "${PN}-utils"
65FILES_${PN}-utils = "${bindir}/host ${bindir}/dig"
66FILES_${PN}-dev += "${bindir}/isc-config.h"
67FILES_${PN} += "${sbindir}/generate-rndc-key.sh"
68
69do_install_prepend() {
70 # clean host path in isc-config.sh before the hardlink created
71 # by "make install":
72 # bind9-config -> isc-config.sh
73 sed -i -e "s,${STAGING_LIBDIR},${libdir}," ${B}/isc-config.sh
74}
75
76do_install_append() {
77 rm "${D}${bindir}/nslookup"
78 rm "${D}${mandir}/man1/nslookup.1"
79 rmdir "${D}${localstatedir}/run"
80 rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
81 install -d -o bind "${D}${localstatedir}/cache/bind"
82 install -d "${D}${sysconfdir}/bind"
83 install -d "${D}${sysconfdir}/init.d"
84 install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/"
85 install -m 755 "${S}/init.d" "${D}${sysconfdir}/init.d/bind"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060086 sed -i -e '1s,#!.*python,#! /usr/bin/python3,' ${D}${sbindir}/dnssec-coverage ${D}${sbindir}/dnssec-checkds
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050087
88 # Install systemd related files
89 install -d ${D}${sbindir}
90 install -m 755 ${WORKDIR}/generate-rndc-key.sh ${D}${sbindir}
91 install -d ${D}${systemd_unitdir}/system
92 install -m 0644 ${WORKDIR}/named.service ${D}${systemd_unitdir}/system
93 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
94 -e 's,@SBINDIR@,${sbindir},g' \
95 ${D}${systemd_unitdir}/system/named.service
96
97 install -d ${D}${sysconfdir}/default
98 install -m 0644 ${WORKDIR}/bind9 ${D}${sysconfdir}/default
99}
100
101CONFFILES_${PN} = " \
102 ${sysconfdir}/bind/named.conf \
103 ${sysconfdir}/bind/named.conf.local \
104 ${sysconfdir}/bind/named.conf.options \
105 ${sysconfdir}/bind/db.0 \
106 ${sysconfdir}/bind/db.127 \
107 ${sysconfdir}/bind/db.empty \
108 ${sysconfdir}/bind/db.local \
109 ${sysconfdir}/bind/db.root \
110 "
111