Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | SUMMARY = "ISC Internet Domain Name Server" |
| 2 | HOMEPAGE = "http://www.isc.org/sw/bind/" |
| 3 | SECTION = "console/network" |
| 4 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 5 | LICENSE = "MPL-2.0" |
| 6 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=188b8d0644bd6835df43b84e3f180be1" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 7 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 8 | DEPENDS = "openssl libcap zlib libuv" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 9 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 10 | 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] | 11 | 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 Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 18 | file://0001-named-lwresd-V-and-start-log-hide-build-options.patch \ |
| 19 | file://0001-avoid-start-failure-with-bind-user.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 20 | " |
| 21 | |
Andrew Geissler | c3d88e4 | 2020-10-02 09:45:00 -0500 | [diff] [blame] | 22 | SRC_URI[sha256sum] = "9f7d1812ebbd26a699f62b6fa8522d5dec57e4bf43af0042a0d60d39ed8314d1" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 23 | |
| 24 | UPSTREAM_CHECK_URI = "https://ftp.isc.org/isc/bind9/" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 25 | # stay at 9.16 follow the ESV versions divisible by 4 |
| 26 | 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] | 27 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 28 | inherit autotools update-rc.d systemd useradd pkgconfig multilib_header update-alternatives |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 29 | |
| 30 | # PACKAGECONFIGs readline and libedit should NOT be set at same time |
| 31 | PACKAGECONFIG ?= "readline" |
| 32 | PACKAGECONFIG[httpstats] = "--with-libxml2=${STAGING_DIR_HOST}${prefix},--without-libxml2,libxml2" |
| 33 | PACKAGECONFIG[readline] = "--with-readline=-lreadline,,readline" |
| 34 | PACKAGECONFIG[libedit] = "--with-readline=-ledit,,libedit" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 35 | PACKAGECONFIG[python3] = "--with-python=yes --with-python-install-dir=${PYTHON_SITEPACKAGES_DIR} , --without-python, python3-ply-native," |
| 36 | |
Andrew Geissler | c3d88e4 | 2020-10-02 09:45:00 -0500 | [diff] [blame] | 37 | EXTRA_OECONF = " --with-libtool --disable-devpoll --disable-auto-validation --enable-epoll \ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 38 | --with-gssapi=no --with-lmdb=no --with-zlib \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 39 | --sysconfdir=${sysconfdir}/bind \ |
| 40 | --with-openssl=${STAGING_DIR_HOST}${prefix} \ |
| 41 | " |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 42 | LDFLAGS_append = " -lz" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 43 | |
| 44 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3native distutils3-base', '', d)} |
| 45 | |
| 46 | # dhcp needs .la so keep them |
| 47 | REMOVE_LIBTOOL_LA = "0" |
| 48 | |
| 49 | USERADD_PACKAGES = "${PN}" |
| 50 | USERADD_PARAM_${PN} = "--system --home ${localstatedir}/cache/bind --no-create-home \ |
| 51 | --user-group bind" |
| 52 | |
| 53 | INITSCRIPT_NAME = "bind" |
| 54 | INITSCRIPT_PARAMS = "defaults" |
| 55 | |
| 56 | SYSTEMD_SERVICE_${PN} = "named.service" |
| 57 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 58 | do_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 | |
| 94 | CONFFILES_${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 | |
| 105 | ALTERNATIVE_${PN}-utils = "nslookup" |
| 106 | ALTERNATIVE_LINK_NAME[nslookup] = "${bindir}/nslookup" |
| 107 | ALTERNATIVE_PRIORITY = "100" |
| 108 | |
| 109 | PACKAGE_BEFORE_PN += "${PN}-utils" |
| 110 | FILES_${PN}-utils = "${bindir}/host ${bindir}/dig ${bindir}/mdig ${bindir}/nslookup ${bindir}/nsupdate" |
| 111 | FILES_${PN}-dev += "${bindir}/isc-config.h" |
| 112 | FILES_${PN} += "${sbindir}/generate-rndc-key.sh" |
| 113 | |
| 114 | PACKAGE_BEFORE_PN += "${PN}-libs" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 115 | FILES_${PN}-libs = "${libdir}/*.so* ${libdir}/named/*.so*" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 116 | FILES_${PN}-staticdev += "${libdir}/*.la" |
| 117 | |
| 118 | PACKAGE_BEFORE_PN += "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-bind', '', d)}" |
| 119 | FILES_python3-bind = "${sbindir}/dnssec-coverage ${sbindir}/dnssec-checkds \ |
| 120 | ${sbindir}/dnssec-keymgr ${PYTHON_SITEPACKAGES_DIR}" |
| 121 | |
| 122 | RDEPENDS_${PN}-dev = "" |
| 123 | RDEPENDS_python3-bind = "python3-core python3-ply" |