blob: 19f87d7934a54c5d44911d0cb8207a7b2a21d8e4 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -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 \
Patrick Williamsf1e5d692016-03-30 15:21:19 -050023 file://0001-lib-dns-gen.c-fix-too-long-error.patch \
24 file://CVE-2015-8704.patch \
25 file://CVE-2015-8705.patch \
26 file://CVE-2015-8000.patch \
27 file://CVE-2015-8461.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050028 "
29
30SRC_URI[md5sum] = "8b1f5064837756c938eadc1537dec5c7"
31SRC_URI[sha256sum] = "c00b21ec1def212957f28efe9d10aac52d6ec515e84fbf2c42143f5d71429cb8"
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
42PACKAGECONFIG ?= ""
43PACKAGECONFIG[httpstats] = "--with-libxml2,--without-libxml2,libxml2"
44
45USERADD_PACKAGES = "${PN}"
46USERADD_PARAM_${PN} = "--system --home /var/cache/bind --no-create-home \
47 --user-group bind"
48
49INITSCRIPT_NAME = "bind"
50INITSCRIPT_PARAMS = "defaults"
51
52SYSTEMD_SERVICE_${PN} = "named.service"
53
54PARALLEL_MAKE = ""
55
56RDEPENDS_${PN} = "python-core"
57RDEPENDS_${PN}-dev = ""
58
59PACKAGE_BEFORE_PN += "${PN}-utils"
60FILES_${PN}-utils = "${bindir}/host ${bindir}/dig"
61FILES_${PN}-dev += "${bindir}/isc-config.h"
62FILES_${PN} += "${sbindir}/generate-rndc-key.sh"
63
64do_install_prepend() {
65 # clean host path in isc-config.sh before the hardlink created
66 # by "make install":
67 # bind9-config -> isc-config.sh
68 sed -i -e "s,${STAGING_LIBDIR},${libdir}," ${B}/isc-config.sh
69}
70
71do_install_append() {
72 rm "${D}${bindir}/nslookup"
73 rm "${D}${mandir}/man1/nslookup.1"
74 rmdir "${D}${localstatedir}/run"
75 rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
76 install -d "${D}${localstatedir}/cache/bind"
77 install -d "${D}${sysconfdir}/bind"
78 install -d "${D}${sysconfdir}/init.d"
79 install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/"
80 install -m 755 "${S}/init.d" "${D}${sysconfdir}/init.d/bind"
81 sed -i -e '1s,#!.*python,#! /usr/bin/env python,' ${D}${sbindir}/dnssec-coverage ${D}${sbindir}/dnssec-checkds
82
83 # Install systemd related files
84 install -d ${D}${localstatedir}/cache/bind
85 install -d ${D}${sbindir}
86 install -m 755 ${WORKDIR}/generate-rndc-key.sh ${D}${sbindir}
87 install -d ${D}${systemd_unitdir}/system
88 install -m 0644 ${WORKDIR}/named.service ${D}${systemd_unitdir}/system
89 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
90 -e 's,@SBINDIR@,${sbindir},g' \
91 ${D}${systemd_unitdir}/system/named.service
92
93 install -d ${D}${sysconfdir}/default
94 install -m 0644 ${WORKDIR}/bind9 ${D}${sysconfdir}/default
95}
96
97CONFFILES_${PN} = " \
98 ${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