Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | SUMMARY = "ISC Internet Domain Name Server" |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 2 | HOMEPAGE = "https://www.isc.org/bind/" |
Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame^] | 3 | DESCRIPTION = "BIND 9 provides a full-featured Domain Name Server system" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 4 | SECTION = "console/network" |
| 5 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 6 | LICENSE = "MPL-2.0" |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 7 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=ef10b4de6371115dcecdc38ca2af4561" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 8 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 9 | DEPENDS = "openssl libcap zlib libuv" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 10 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 11 | SRC_URI = "https://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.xz \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 12 | file://conf.patch \ |
| 13 | file://named.service \ |
| 14 | file://bind9 \ |
| 15 | file://generate-rndc-key.sh \ |
| 16 | file://make-etc-initd-bind-stop-work.patch \ |
| 17 | file://init.d-add-support-for-read-only-rootfs.patch \ |
| 18 | file://bind-ensure-searching-for-json-headers-searches-sysr.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 19 | file://0001-named-lwresd-V-and-start-log-hide-build-options.patch \ |
| 20 | file://0001-avoid-start-failure-with-bind-user.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 21 | " |
| 22 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 23 | SRC_URI[sha256sum] = "0111f64dd7d8f515cfa129e181cce96ff82070d1b27f11a21f6856110d0699c1" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 24 | |
| 25 | UPSTREAM_CHECK_URI = "https://ftp.isc.org/isc/bind9/" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 26 | # stay at 9.16 follow the ESV versions divisible by 4 |
| 27 | UPSTREAM_CHECK_REGEX = "(?P<pver>9.(16|20|24|28)(\.\d+)+(-P\d+)*)/" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 28 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 29 | inherit autotools update-rc.d systemd useradd pkgconfig multilib_header update-alternatives |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 30 | |
| 31 | # PACKAGECONFIGs readline and libedit should NOT be set at same time |
| 32 | PACKAGECONFIG ?= "readline" |
| 33 | PACKAGECONFIG[httpstats] = "--with-libxml2=${STAGING_DIR_HOST}${prefix},--without-libxml2,libxml2" |
| 34 | PACKAGECONFIG[readline] = "--with-readline=-lreadline,,readline" |
| 35 | PACKAGECONFIG[libedit] = "--with-readline=-ledit,,libedit" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 36 | PACKAGECONFIG[python3] = "--with-python=yes --with-python-install-dir=${PYTHON_SITEPACKAGES_DIR} , --without-python, python3-ply-native," |
| 37 | |
Andrew Geissler | c3d88e4 | 2020-10-02 09:45:00 -0500 | [diff] [blame] | 38 | EXTRA_OECONF = " --with-libtool --disable-devpoll --disable-auto-validation --enable-epoll \ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 39 | --with-gssapi=no --with-lmdb=no --with-zlib \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 40 | --sysconfdir=${sysconfdir}/bind \ |
| 41 | --with-openssl=${STAGING_DIR_HOST}${prefix} \ |
| 42 | " |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 43 | LDFLAGS_append = " -lz" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 44 | |
| 45 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3native distutils3-base', '', d)} |
| 46 | |
| 47 | # dhcp needs .la so keep them |
| 48 | REMOVE_LIBTOOL_LA = "0" |
| 49 | |
| 50 | USERADD_PACKAGES = "${PN}" |
| 51 | USERADD_PARAM_${PN} = "--system --home ${localstatedir}/cache/bind --no-create-home \ |
| 52 | --user-group bind" |
| 53 | |
| 54 | INITSCRIPT_NAME = "bind" |
| 55 | INITSCRIPT_PARAMS = "defaults" |
| 56 | |
| 57 | SYSTEMD_SERVICE_${PN} = "named.service" |
| 58 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 59 | do_install_append() { |
| 60 | |
| 61 | rmdir "${D}${localstatedir}/run" |
| 62 | rmdir --ignore-fail-on-non-empty "${D}${localstatedir}" |
| 63 | install -d -o bind "${D}${localstatedir}/cache/bind" |
| 64 | install -d "${D}${sysconfdir}/bind" |
| 65 | install -d "${D}${sysconfdir}/init.d" |
| 66 | install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/" |
| 67 | install -m 755 "${S}/init.d" "${D}${sysconfdir}/init.d/bind" |
| 68 | if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then |
| 69 | sed -i -e '1s,#!.*python3,#! /usr/bin/python3,' \ |
| 70 | ${D}${sbindir}/dnssec-coverage \ |
| 71 | ${D}${sbindir}/dnssec-checkds \ |
| 72 | ${D}${sbindir}/dnssec-keymgr |
| 73 | fi |
| 74 | |
| 75 | # Install systemd related files |
| 76 | install -d ${D}${sbindir} |
| 77 | install -m 755 ${WORKDIR}/generate-rndc-key.sh ${D}${sbindir} |
| 78 | install -d ${D}${systemd_unitdir}/system |
| 79 | install -m 0644 ${WORKDIR}/named.service ${D}${systemd_unitdir}/system |
| 80 | sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ |
| 81 | -e 's,@SBINDIR@,${sbindir},g' \ |
| 82 | ${D}${systemd_unitdir}/system/named.service |
| 83 | |
| 84 | install -d ${D}${sysconfdir}/default |
| 85 | install -m 0644 ${WORKDIR}/bind9 ${D}${sysconfdir}/default |
| 86 | |
| 87 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 88 | install -d ${D}${sysconfdir}/tmpfiles.d |
| 89 | echo "d /run/named 0755 bind bind - -" > ${D}${sysconfdir}/tmpfiles.d/bind.conf |
| 90 | fi |
| 91 | |
| 92 | oe_multilib_header isc/platform.h |
| 93 | } |
| 94 | |
| 95 | CONFFILES_${PN} = " \ |
| 96 | ${sysconfdir}/bind/named.conf \ |
| 97 | ${sysconfdir}/bind/named.conf.local \ |
| 98 | ${sysconfdir}/bind/named.conf.options \ |
| 99 | ${sysconfdir}/bind/db.0 \ |
| 100 | ${sysconfdir}/bind/db.127 \ |
| 101 | ${sysconfdir}/bind/db.empty \ |
| 102 | ${sysconfdir}/bind/db.local \ |
| 103 | ${sysconfdir}/bind/db.root \ |
| 104 | " |
| 105 | |
| 106 | ALTERNATIVE_${PN}-utils = "nslookup" |
| 107 | ALTERNATIVE_LINK_NAME[nslookup] = "${bindir}/nslookup" |
| 108 | ALTERNATIVE_PRIORITY = "100" |
| 109 | |
| 110 | PACKAGE_BEFORE_PN += "${PN}-utils" |
| 111 | FILES_${PN}-utils = "${bindir}/host ${bindir}/dig ${bindir}/mdig ${bindir}/nslookup ${bindir}/nsupdate" |
| 112 | FILES_${PN}-dev += "${bindir}/isc-config.h" |
| 113 | FILES_${PN} += "${sbindir}/generate-rndc-key.sh" |
| 114 | |
| 115 | PACKAGE_BEFORE_PN += "${PN}-libs" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 116 | FILES_${PN}-libs = "${libdir}/*.so* ${libdir}/named/*.so*" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 117 | FILES_${PN}-staticdev += "${libdir}/*.la" |
| 118 | |
| 119 | PACKAGE_BEFORE_PN += "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-bind', '', d)}" |
| 120 | FILES_python3-bind = "${sbindir}/dnssec-coverage ${sbindir}/dnssec-checkds \ |
| 121 | ${sbindir}/dnssec-keymgr ${PYTHON_SITEPACKAGES_DIR}" |
| 122 | |
| 123 | RDEPENDS_${PN}-dev = "" |
| 124 | RDEPENDS_python3-bind = "python3-core python3-ply" |