blob: 1e3a20f9a36738ba21c2fdcf7e232f786376ac45 [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 \
28 "
29
30SRC_URI[md5sum] = "bcf7e772b616f7259420a3edc5df350a"
31SRC_URI[sha256sum] = "690810d1fbb72afa629e74638d19cd44e28d2b2e5eb63f55c705ad85d1a4cb83"
32
33ENABLE_IPV6 = "--enable-ipv6=${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)}"
34EXTRA_OECONF = " ${ENABLE_IPV6} --with-randomdev=/dev/random --disable-threads \
35 --disable-devpoll --disable-epoll --with-gost=no \
36 --with-gssapi=no --with-ecdsa=yes \
37 --sysconfdir=${sysconfdir}/bind \
38 --with-openssl=${STAGING_LIBDIR}/.. \
39 "
40inherit autotools update-rc.d systemd useradd pkgconfig
41
42# PACKAGECONFIGs readline and libedit should NOT be set at same time
43PACKAGECONFIG ?= "readline"
44PACKAGECONFIG[httpstats] = "--with-libxml2,--without-libxml2,libxml2"
45PACKAGECONFIG[readline] = "--with-readline=-lreadline,,readline"
46PACKAGECONFIG[libedit] = "--with-readline=-ledit,,libedit"
47
48USERADD_PACKAGES = "${PN}"
49USERADD_PARAM_${PN} = "--system --home ${localstatedir}/cache/bind --no-create-home \
50 --user-group bind"
51
52INITSCRIPT_NAME = "bind"
53INITSCRIPT_PARAMS = "defaults"
54
55SYSTEMD_SERVICE_${PN} = "named.service"
56
57PARALLEL_MAKE = ""
58
59RDEPENDS_${PN} = "python-core"
60RDEPENDS_${PN}-dev = ""
61
62PACKAGE_BEFORE_PN += "${PN}-utils"
63FILES_${PN}-utils = "${bindir}/host ${bindir}/dig"
64FILES_${PN}-dev += "${bindir}/isc-config.h"
65FILES_${PN} += "${sbindir}/generate-rndc-key.sh"
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 rm "${D}${bindir}/nslookup"
76 rm "${D}${mandir}/man1/nslookup.1"
77 rmdir "${D}${localstatedir}/run"
78 rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
79 install -d -o bind "${D}${localstatedir}/cache/bind"
80 install -d "${D}${sysconfdir}/bind"
81 install -d "${D}${sysconfdir}/init.d"
82 install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/"
83 install -m 755 "${S}/init.d" "${D}${sysconfdir}/init.d/bind"
84 sed -i -e '1s,#!.*python,#! /usr/bin/env python,' ${D}${sbindir}/dnssec-coverage ${D}${sbindir}/dnssec-checkds
85
86 # Install systemd related files
87 install -d ${D}${sbindir}
88 install -m 755 ${WORKDIR}/generate-rndc-key.sh ${D}${sbindir}
89 install -d ${D}${systemd_unitdir}/system
90 install -m 0644 ${WORKDIR}/named.service ${D}${systemd_unitdir}/system
91 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
92 -e 's,@SBINDIR@,${sbindir},g' \
93 ${D}${systemd_unitdir}/system/named.service
94
95 install -d ${D}${sysconfdir}/default
96 install -m 0644 ${WORKDIR}/bind9 ${D}${sysconfdir}/default
97}
98
99CONFFILES_${PN} = " \
100 ${sysconfdir}/bind/named.conf \
101 ${sysconfdir}/bind/named.conf.local \
102 ${sysconfdir}/bind/named.conf.options \
103 ${sysconfdir}/bind/db.0 \
104 ${sysconfdir}/bind/db.127 \
105 ${sysconfdir}/bind/db.empty \
106 ${sysconfdir}/bind/db.local \
107 ${sysconfdir}/bind/db.root \
108 "
109