Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -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" |
| 6 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=dba46507446198119bcde32a4feaab43" |
| 7 | |
| 8 | DEPENDS = "openssl libcap" |
| 9 | |
| 10 | SRC_URI = "https://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://dont-test-on-host.patch \ |
| 14 | file://generate-rndc-key.sh \ |
| 15 | file://named.service \ |
| 16 | file://bind9 \ |
| 17 | file://init.d-add-support-for-read-only-rootfs.patch \ |
| 18 | file://bind-confgen-build-unix.o-once.patch \ |
| 19 | file://0001-build-use-pkg-config-to-find-libxml2.patch \ |
| 20 | file://bind-ensure-searching-for-json-headers-searches-sysr.patch \ |
| 21 | file://0001-gen.c-extend-DIRNAMESIZE-from-256-to-512.patch \ |
| 22 | file://0001-lib-dns-gen.c-fix-too-long-error.patch \ |
| 23 | file://use-python3-and-fix-install-lib-path.patch \ |
| 24 | " |
| 25 | |
| 26 | SRC_URI[md5sum] = "84e663284b17aee0df1ce6f248b137d7" |
| 27 | SRC_URI[sha256sum] = "17bbcd2bd7b1d32f5ba4b30d5dbe8a39bce200079048073d1e0d050fdf47e69d" |
| 28 | |
| 29 | UPSTREAM_CHECK_URI = "https://ftp.isc.org/isc/bind9/" |
| 30 | UPSTREAM_CHECK_REGEX = "(?P<pver>9(\.\d+)+(-P\d+)*)/" |
| 31 | |
| 32 | |
| 33 | ENABLE_IPV6 = "--enable-ipv6=${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)}" |
| 34 | EXTRA_OECONF = " ${ENABLE_IPV6} --with-libtool --enable-threads \ |
| 35 | --disable-devpoll --enable-epoll --with-gost=no \ |
| 36 | --with-gssapi=no --with-ecdsa=yes \ |
| 37 | --sysconfdir=${sysconfdir}/bind \ |
| 38 | --with-openssl=${STAGING_LIBDIR}/.. \ |
| 39 | " |
| 40 | |
| 41 | inherit autotools update-rc.d systemd useradd pkgconfig python3-dir |
| 42 | |
| 43 | export PYTHON_SITEPACKAGES_DIR |
| 44 | |
| 45 | # PACKAGECONFIGs readline and libedit should NOT be set at same time |
| 46 | PACKAGECONFIG ?= "readline" |
| 47 | PACKAGECONFIG[httpstats] = "--with-libxml2,--without-libxml2,libxml2" |
| 48 | PACKAGECONFIG[readline] = "--with-readline=-lreadline,,readline" |
| 49 | PACKAGECONFIG[libedit] = "--with-readline=-ledit,,libedit" |
| 50 | PACKAGECONFIG[urandom] = "--with-randomdev=/dev/urandom,--with-randomdev=/dev/random,," |
| 51 | |
| 52 | USERADD_PACKAGES = "${PN}" |
| 53 | USERADD_PARAM_${PN} = "--system --home ${localstatedir}/cache/bind --no-create-home \ |
| 54 | --user-group bind" |
| 55 | |
| 56 | INITSCRIPT_NAME = "bind" |
| 57 | INITSCRIPT_PARAMS = "defaults" |
| 58 | |
| 59 | SYSTEMD_SERVICE_${PN} = "named.service" |
| 60 | |
| 61 | PARALLEL_MAKE = "" |
| 62 | |
| 63 | RDEPENDS_${PN} = "python3-core" |
| 64 | RDEPENDS_${PN}-dev = "" |
| 65 | |
| 66 | PACKAGE_BEFORE_PN += "${PN}-utils" |
| 67 | FILES_${PN}-utils = "${bindir}/host ${bindir}/dig" |
| 68 | FILES_${PN}-dev += "${bindir}/isc-config.h" |
| 69 | FILES_${PN} += "${sbindir}/generate-rndc-key.sh ${PYTHON_SITEPACKAGES_DIR}" |
| 70 | |
| 71 | PACKAGE_BEFORE_PN += "${PN}-libs" |
| 72 | FILES_${PN}-libs = "${libdir}/*.so*" |
| 73 | |
| 74 | do_install_prepend() { |
| 75 | # clean host path in isc-config.sh before the hardlink created |
| 76 | # by "make install": |
| 77 | # bind9-config -> isc-config.sh |
| 78 | sed -i -e "s,${STAGING_LIBDIR},${libdir}," ${B}/isc-config.sh |
| 79 | } |
| 80 | |
| 81 | do_install_append() { |
| 82 | rm "${D}${bindir}/nslookup" |
| 83 | rm "${D}${mandir}/man1/nslookup.1" |
| 84 | rmdir "${D}${localstatedir}/run" |
| 85 | rmdir --ignore-fail-on-non-empty "${D}${localstatedir}" |
| 86 | install -d -o bind "${D}${localstatedir}/cache/bind" |
| 87 | install -d "${D}${sysconfdir}/bind" |
| 88 | install -d "${D}${sysconfdir}/init.d" |
| 89 | install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/" |
| 90 | install -m 755 "${S}/init.d" "${D}${sysconfdir}/init.d/bind" |
| 91 | sed -i -e '1s,#!.*python3,#! /usr/bin/python3,' ${D}${sbindir}/dnssec-coverage ${D}${sbindir}/dnssec-checkds |
| 92 | |
| 93 | # Install systemd related files |
| 94 | install -d ${D}${sbindir} |
| 95 | install -m 755 ${WORKDIR}/generate-rndc-key.sh ${D}${sbindir} |
| 96 | install -d ${D}${systemd_unitdir}/system |
| 97 | install -m 0644 ${WORKDIR}/named.service ${D}${systemd_unitdir}/system |
| 98 | sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ |
| 99 | -e 's,@SBINDIR@,${sbindir},g' \ |
| 100 | ${D}${systemd_unitdir}/system/named.service |
| 101 | |
| 102 | install -d ${D}${sysconfdir}/default |
| 103 | install -m 0644 ${WORKDIR}/bind9 ${D}${sysconfdir}/default |
| 104 | |
| 105 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 106 | install -d ${D}${sysconfdir}/tmpfiles.d |
| 107 | echo "d /run/named 0755 bind bind - -" > ${D}${sysconfdir}/tmpfiles.d/bind.conf |
| 108 | fi |
| 109 | |
| 110 | rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/isc/*.pyc |
| 111 | } |
| 112 | |
| 113 | CONFFILES_${PN} = " \ |
| 114 | ${sysconfdir}/bind/named.conf \ |
| 115 | ${sysconfdir}/bind/named.conf.local \ |
| 116 | ${sysconfdir}/bind/named.conf.options \ |
| 117 | ${sysconfdir}/bind/db.0 \ |
| 118 | ${sysconfdir}/bind/db.127 \ |
| 119 | ${sysconfdir}/bind/db.empty \ |
| 120 | ${sysconfdir}/bind/db.local \ |
| 121 | ${sysconfdir}/bind/db.root \ |
| 122 | " |
| 123 | |