blob: efae289b3d5454d5aeb1c2841691b357b8bc9582 [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 \
23 "
24
25SRC_URI[md5sum] = "8b1f5064837756c938eadc1537dec5c7"
26SRC_URI[sha256sum] = "c00b21ec1def212957f28efe9d10aac52d6ec515e84fbf2c42143f5d71429cb8"
27
28ENABLE_IPV6 = "--enable-ipv6=${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)}"
29EXTRA_OECONF = " ${ENABLE_IPV6} --with-randomdev=/dev/random --disable-threads \
30 --disable-devpoll --disable-epoll --with-gost=no \
31 --with-gssapi=no --with-ecdsa=yes \
32 --sysconfdir=${sysconfdir}/bind \
33 --with-openssl=${STAGING_LIBDIR}/.. \
34 "
35inherit autotools update-rc.d systemd useradd pkgconfig
36
37PACKAGECONFIG ?= ""
38PACKAGECONFIG[httpstats] = "--with-libxml2,--without-libxml2,libxml2"
39
40USERADD_PACKAGES = "${PN}"
41USERADD_PARAM_${PN} = "--system --home /var/cache/bind --no-create-home \
42 --user-group bind"
43
44INITSCRIPT_NAME = "bind"
45INITSCRIPT_PARAMS = "defaults"
46
47SYSTEMD_SERVICE_${PN} = "named.service"
48
49PARALLEL_MAKE = ""
50
51RDEPENDS_${PN} = "python-core"
52RDEPENDS_${PN}-dev = ""
53
54PACKAGE_BEFORE_PN += "${PN}-utils"
55FILES_${PN}-utils = "${bindir}/host ${bindir}/dig"
56FILES_${PN}-dev += "${bindir}/isc-config.h"
57FILES_${PN} += "${sbindir}/generate-rndc-key.sh"
58
59do_install_prepend() {
60 # clean host path in isc-config.sh before the hardlink created
61 # by "make install":
62 # bind9-config -> isc-config.sh
63 sed -i -e "s,${STAGING_LIBDIR},${libdir}," ${B}/isc-config.sh
64}
65
66do_install_append() {
67 rm "${D}${bindir}/nslookup"
68 rm "${D}${mandir}/man1/nslookup.1"
69 rmdir "${D}${localstatedir}/run"
70 rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
71 install -d "${D}${localstatedir}/cache/bind"
72 install -d "${D}${sysconfdir}/bind"
73 install -d "${D}${sysconfdir}/init.d"
74 install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/"
75 install -m 755 "${S}/init.d" "${D}${sysconfdir}/init.d/bind"
76 sed -i -e '1s,#!.*python,#! /usr/bin/env python,' ${D}${sbindir}/dnssec-coverage ${D}${sbindir}/dnssec-checkds
77
78 # Install systemd related files
79 install -d ${D}${localstatedir}/cache/bind
80 install -d ${D}${sbindir}
81 install -m 755 ${WORKDIR}/generate-rndc-key.sh ${D}${sbindir}
82 install -d ${D}${systemd_unitdir}/system
83 install -m 0644 ${WORKDIR}/named.service ${D}${systemd_unitdir}/system
84 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
85 -e 's,@SBINDIR@,${sbindir},g' \
86 ${D}${systemd_unitdir}/system/named.service
87
88 install -d ${D}${sysconfdir}/default
89 install -m 0644 ${WORKDIR}/bind9 ${D}${sysconfdir}/default
90}
91
92CONFFILES_${PN} = " \
93 ${sysconfdir}/bind/named.conf \
94 ${sysconfdir}/bind/named.conf.local \
95 ${sysconfdir}/bind/named.conf.options \
96 ${sysconfdir}/bind/db.0 \
97 ${sysconfdir}/bind/db.127 \
98 ${sysconfdir}/bind/db.empty \
99 ${sysconfdir}/bind/db.local \
100 ${sysconfdir}/bind/db.root \
101 "
102