Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 1 | SUMMARY = "ISC Internet Domain Name Server" |
| 2 | HOMEPAGE = "http://www.isc.org/sw/bind/" |
| 3 | SECTION = "console/network" |
| 4 | |
| 5 | LICENSE = "ISC & BSD" |
Brad Bishop | d89cb5f | 2019-04-10 09:02:41 -0400 | [diff] [blame] | 6 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=8f17f64e47e83b60cd920a1e4b54419e" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 7 | |
| 8 | DEPENDS = "openssl libcap zlib" |
| 9 | |
| 10 | SRC_URI = "https://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.gz \ |
| 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 \ |
| 18 | file://0001-gen.c-extend-DIRNAMESIZE-from-256-to-512.patch \ |
| 19 | file://0001-lib-dns-gen.c-fix-too-long-error.patch \ |
| 20 | file://0001-configure.in-remove-useless-L-use_openssl-lib.patch \ |
| 21 | file://0001-named-lwresd-V-and-start-log-hide-build-options.patch \ |
| 22 | file://0001-avoid-start-failure-with-bind-user.patch \ |
| 23 | " |
| 24 | |
Brad Bishop | d89cb5f | 2019-04-10 09:02:41 -0400 | [diff] [blame] | 25 | SRC_URI[md5sum] = "8ddab4b61fa4516fe404679c74e37960" |
| 26 | SRC_URI[sha256sum] = "7e8c08192bcbaeb6e9f2391a70e67583b027b90e8c4bc1605da6eb126edde434" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 27 | |
| 28 | UPSTREAM_CHECK_URI = "https://ftp.isc.org/isc/bind9/" |
| 29 | UPSTREAM_CHECK_REGEX = "(?P<pver>9(\.\d+)+(-P\d+)*)/" |
| 30 | RECIPE_NO_UPDATE_REASON = "9.11 is LTS 2021" |
| 31 | |
| 32 | inherit autotools update-rc.d systemd useradd pkgconfig multilib_script |
| 33 | |
| 34 | MULTILIB_SCRIPTS = "${PN}:${bindir}/bind9-config ${PN}:${bindir}/isc-config.sh" |
| 35 | |
| 36 | # PACKAGECONFIGs readline and libedit should NOT be set at same time |
| 37 | PACKAGECONFIG ?= "readline" |
| 38 | PACKAGECONFIG[httpstats] = "--with-libxml2=${STAGING_DIR_HOST}${prefix},--without-libxml2,libxml2" |
| 39 | PACKAGECONFIG[readline] = "--with-readline=-lreadline,,readline" |
| 40 | PACKAGECONFIG[libedit] = "--with-readline=-ledit,,libedit" |
| 41 | PACKAGECONFIG[urandom] = "--with-randomdev=/dev/urandom,--with-randomdev=/dev/random,," |
| 42 | PACKAGECONFIG[python3] = "--with-python=${PYTHON} --with-python-install-dir=${D}/${PYTHON_SITEPACKAGES_DIR} , --without-python, python3-ply-native," |
| 43 | |
| 44 | ENABLE_IPV6 = "--enable-ipv6=${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)}" |
| 45 | EXTRA_OECONF = " ${ENABLE_IPV6} --with-libtool --enable-threads \ |
| 46 | --disable-devpoll --enable-epoll --with-gost=no \ |
| 47 | --with-gssapi=no --with-ecdsa=yes --with-eddsa=no \ |
| 48 | --with-lmdb=no \ |
| 49 | --sysconfdir=${sysconfdir}/bind \ |
| 50 | --with-openssl=${STAGING_DIR_HOST}${prefix} \ |
| 51 | " |
| 52 | |
| 53 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3native distutils3-base', '', d)} |
| 54 | |
| 55 | # dhcp needs .la so keep them |
| 56 | REMOVE_LIBTOOL_LA = "0" |
| 57 | |
| 58 | USERADD_PACKAGES = "${PN}" |
| 59 | USERADD_PARAM_${PN} = "--system --home ${localstatedir}/cache/bind --no-create-home \ |
| 60 | --user-group bind" |
| 61 | |
| 62 | INITSCRIPT_NAME = "bind" |
| 63 | INITSCRIPT_PARAMS = "defaults" |
| 64 | |
| 65 | SYSTEMD_SERVICE_${PN} = "named.service" |
| 66 | |
| 67 | do_install_prepend() { |
| 68 | # clean host path in isc-config.sh before the hardlink created |
| 69 | # by "make install": |
| 70 | # bind9-config -> isc-config.sh |
| 71 | sed -i -e "s,${STAGING_LIBDIR},${libdir}," ${B}/isc-config.sh |
| 72 | } |
| 73 | |
| 74 | do_install_append() { |
| 75 | |
| 76 | rmdir "${D}${localstatedir}/run" |
| 77 | rmdir --ignore-fail-on-non-empty "${D}${localstatedir}" |
| 78 | install -d -o bind "${D}${localstatedir}/cache/bind" |
| 79 | install -d "${D}${sysconfdir}/bind" |
| 80 | install -d "${D}${sysconfdir}/init.d" |
| 81 | install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/" |
| 82 | install -m 755 "${S}/init.d" "${D}${sysconfdir}/init.d/bind" |
| 83 | if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then |
| 84 | sed -i -e '1s,#!.*python3,#! /usr/bin/python3,' \ |
| 85 | ${D}${sbindir}/dnssec-coverage \ |
| 86 | ${D}${sbindir}/dnssec-checkds \ |
| 87 | ${D}${sbindir}/dnssec-keymgr |
| 88 | fi |
| 89 | |
| 90 | # Install systemd related files |
| 91 | install -d ${D}${sbindir} |
| 92 | install -m 755 ${WORKDIR}/generate-rndc-key.sh ${D}${sbindir} |
| 93 | install -d ${D}${systemd_unitdir}/system |
| 94 | install -m 0644 ${WORKDIR}/named.service ${D}${systemd_unitdir}/system |
| 95 | sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ |
| 96 | -e 's,@SBINDIR@,${sbindir},g' \ |
| 97 | ${D}${systemd_unitdir}/system/named.service |
| 98 | |
| 99 | install -d ${D}${sysconfdir}/default |
| 100 | install -m 0644 ${WORKDIR}/bind9 ${D}${sysconfdir}/default |
| 101 | |
| 102 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 103 | install -d ${D}${sysconfdir}/tmpfiles.d |
| 104 | echo "d /run/named 0755 bind bind - -" > ${D}${sysconfdir}/tmpfiles.d/bind.conf |
| 105 | fi |
| 106 | } |
| 107 | |
| 108 | CONFFILES_${PN} = " \ |
| 109 | ${sysconfdir}/bind/named.conf \ |
| 110 | ${sysconfdir}/bind/named.conf.local \ |
| 111 | ${sysconfdir}/bind/named.conf.options \ |
| 112 | ${sysconfdir}/bind/db.0 \ |
| 113 | ${sysconfdir}/bind/db.127 \ |
| 114 | ${sysconfdir}/bind/db.empty \ |
| 115 | ${sysconfdir}/bind/db.local \ |
| 116 | ${sysconfdir}/bind/db.root \ |
| 117 | " |
| 118 | |
| 119 | ALTERNATIVE_${PN}-utils = "nslookup" |
| 120 | ALTERNATIVE_LINK_NAME[nslookup] = "${bindir}/nslookup" |
| 121 | ALTERNATIVE_PRIORITY = "100" |
| 122 | |
| 123 | PACKAGE_BEFORE_PN += "${PN}-utils" |
| 124 | FILES_${PN}-utils = "${bindir}/host ${bindir}/dig ${bindir}/mdig ${bindir}/nslookup ${bindir}/nsupdate" |
| 125 | FILES_${PN}-dev += "${bindir}/isc-config.h" |
| 126 | FILES_${PN} += "${sbindir}/generate-rndc-key.sh" |
| 127 | |
| 128 | PACKAGE_BEFORE_PN += "${PN}-libs" |
| 129 | FILES_${PN}-libs = "${libdir}/*.so*" |
| 130 | FILES_${PN}-staticdev += "${libdir}/*.la" |
| 131 | |
| 132 | PACKAGE_BEFORE_PN += "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-bind', '', d)}" |
| 133 | FILES_python3-bind = "${sbindir}/dnssec-coverage ${sbindir}/dnssec-checkds \ |
| 134 | ${sbindir}/dnssec-keymgr ${PYTHON_SITEPACKAGES_DIR}" |
| 135 | |
| 136 | RDEPENDS_${PN} = "bash" |
| 137 | RDEPENDS_${PN}-utils = "bash" |
| 138 | RDEPENDS_${PN}-dev = "" |
| 139 | RDEPENDS_python3-bind = "python3-core python3-ply" |