blob: 103192490a85244468baa32fe2fcf9a51c90dbe3 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "ISC Internet Domain Name Server"
2HOMEPAGE = "http://www.isc.org/sw/bind/"
3SECTION = "console/network"
4
Andrew Geisslerc9f78652020-09-18 14:11:35 -05005LICENSE = "MPL-2.0"
6LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=188b8d0644bd6835df43b84e3f180be1"
Andrew Geissler82c905d2020-04-13 13:39:40 -05007
Andrew Geisslerc9f78652020-09-18 14:11:35 -05008DEPENDS = "openssl libcap zlib libuv"
Andrew Geissler82c905d2020-04-13 13:39:40 -05009
Andrew Geisslerc9f78652020-09-18 14:11:35 -050010SRC_URI = "https://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.xz \
Andrew Geissler82c905d2020-04-13 13:39:40 -050011 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 \
Andrew Geissler82c905d2020-04-13 13:39:40 -050018 file://0001-named-lwresd-V-and-start-log-hide-build-options.patch \
19 file://0001-avoid-start-failure-with-bind-user.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050020 "
21
Andrew Geisslerc9f78652020-09-18 14:11:35 -050022SRC_URI[sha256sum] = "6378b3e51fef11a8be4794dc48e8111ba92d211c0dfd129a0c296ed06a3dc075"
Andrew Geissler82c905d2020-04-13 13:39:40 -050023
24UPSTREAM_CHECK_URI = "https://ftp.isc.org/isc/bind9/"
Andrew Geisslerc9f78652020-09-18 14:11:35 -050025# stay at 9.16 follow the ESV versions divisible by 4
26UPSTREAM_CHECK_REGEX = "(?P<pver>9.(16|20|24|28)(\.\d+)+(-P\d+)*)/"
Andrew Geissler82c905d2020-04-13 13:39:40 -050027
Andrew Geisslerc9f78652020-09-18 14:11:35 -050028inherit autotools update-rc.d systemd useradd pkgconfig multilib_header update-alternatives
Andrew Geissler82c905d2020-04-13 13:39:40 -050029
30# PACKAGECONFIGs readline and libedit should NOT be set at same time
31PACKAGECONFIG ?= "readline"
32PACKAGECONFIG[httpstats] = "--with-libxml2=${STAGING_DIR_HOST}${prefix},--without-libxml2,libxml2"
33PACKAGECONFIG[readline] = "--with-readline=-lreadline,,readline"
34PACKAGECONFIG[libedit] = "--with-readline=-ledit,,libedit"
Andrew Geissler82c905d2020-04-13 13:39:40 -050035PACKAGECONFIG[python3] = "--with-python=yes --with-python-install-dir=${PYTHON_SITEPACKAGES_DIR} , --without-python, python3-ply-native,"
36
Andrew Geisslerc9f78652020-09-18 14:11:35 -050037EXTRA_OECONF = " --with-libtool --disable-devpoll --enable-epoll \
38 --with-gssapi=no --with-lmdb=no --with-zlib \
Andrew Geissler82c905d2020-04-13 13:39:40 -050039 --sysconfdir=${sysconfdir}/bind \
40 --with-openssl=${STAGING_DIR_HOST}${prefix} \
41 "
Andrew Geisslerc9f78652020-09-18 14:11:35 -050042LDFLAGS_append = " -lz"
Andrew Geissler82c905d2020-04-13 13:39:40 -050043
44inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3native distutils3-base', '', d)}
45
46# dhcp needs .la so keep them
47REMOVE_LIBTOOL_LA = "0"
48
49USERADD_PACKAGES = "${PN}"
50USERADD_PARAM_${PN} = "--system --home ${localstatedir}/cache/bind --no-create-home \
51 --user-group bind"
52
53INITSCRIPT_NAME = "bind"
54INITSCRIPT_PARAMS = "defaults"
55
56SYSTEMD_SERVICE_${PN} = "named.service"
57
Andrew Geissler82c905d2020-04-13 13:39:40 -050058do_install_append() {
59
60 rmdir "${D}${localstatedir}/run"
61 rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
62 install -d -o bind "${D}${localstatedir}/cache/bind"
63 install -d "${D}${sysconfdir}/bind"
64 install -d "${D}${sysconfdir}/init.d"
65 install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/"
66 install -m 755 "${S}/init.d" "${D}${sysconfdir}/init.d/bind"
67 if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then
68 sed -i -e '1s,#!.*python3,#! /usr/bin/python3,' \
69 ${D}${sbindir}/dnssec-coverage \
70 ${D}${sbindir}/dnssec-checkds \
71 ${D}${sbindir}/dnssec-keymgr
72 fi
73
74 # Install systemd related files
75 install -d ${D}${sbindir}
76 install -m 755 ${WORKDIR}/generate-rndc-key.sh ${D}${sbindir}
77 install -d ${D}${systemd_unitdir}/system
78 install -m 0644 ${WORKDIR}/named.service ${D}${systemd_unitdir}/system
79 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
80 -e 's,@SBINDIR@,${sbindir},g' \
81 ${D}${systemd_unitdir}/system/named.service
82
83 install -d ${D}${sysconfdir}/default
84 install -m 0644 ${WORKDIR}/bind9 ${D}${sysconfdir}/default
85
86 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
87 install -d ${D}${sysconfdir}/tmpfiles.d
88 echo "d /run/named 0755 bind bind - -" > ${D}${sysconfdir}/tmpfiles.d/bind.conf
89 fi
90
91 oe_multilib_header isc/platform.h
92}
93
94CONFFILES_${PN} = " \
95 ${sysconfdir}/bind/named.conf \
96 ${sysconfdir}/bind/named.conf.local \
97 ${sysconfdir}/bind/named.conf.options \
98 ${sysconfdir}/bind/db.0 \
99 ${sysconfdir}/bind/db.127 \
100 ${sysconfdir}/bind/db.empty \
101 ${sysconfdir}/bind/db.local \
102 ${sysconfdir}/bind/db.root \
103 "
104
105ALTERNATIVE_${PN}-utils = "nslookup"
106ALTERNATIVE_LINK_NAME[nslookup] = "${bindir}/nslookup"
107ALTERNATIVE_PRIORITY = "100"
108
109PACKAGE_BEFORE_PN += "${PN}-utils"
110FILES_${PN}-utils = "${bindir}/host ${bindir}/dig ${bindir}/mdig ${bindir}/nslookup ${bindir}/nsupdate"
111FILES_${PN}-dev += "${bindir}/isc-config.h"
112FILES_${PN} += "${sbindir}/generate-rndc-key.sh"
113
114PACKAGE_BEFORE_PN += "${PN}-libs"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500115FILES_${PN}-libs = "${libdir}/*.so* ${libdir}/named/*.so*"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500116FILES_${PN}-staticdev += "${libdir}/*.la"
117
118PACKAGE_BEFORE_PN += "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-bind', '', d)}"
119FILES_python3-bind = "${sbindir}/dnssec-coverage ${sbindir}/dnssec-checkds \
120 ${sbindir}/dnssec-keymgr ${PYTHON_SITEPACKAGES_DIR}"
121
122RDEPENDS_${PN}-dev = ""
123RDEPENDS_python3-bind = "python3-core python3-ply"