Skip to contentSkip to conversation

unbound: create recipe for version 1.9.1

PATCH In review Beniamin Sandu 3 participants 7 messages Apr 27, 2019 – May 29, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 unbound: create recipe for version 1.9.1

---
 .../recipes-support/unbound/unbound_1.9.1.bb  | 36 +++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 meta-networking/recipes-support/unbound/unbound_1.9.1.bb
meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +36 -0
new file mode 100644
index 000000000..84bbe6581
@@ -0,0 +1,36 @@
+SUMMARY = "Unbound is a validating, recursive, and caching DNS resolver"
+DESCRIPTION = "Unbound's design is a set of modular components which incorporate \
+	features including enhanced security (DNSSEC) validation, Internet Protocol \
+	Version 6 (IPv6), and a client resolver library API as an integral part of the \
+	architecture"
+
+HOMEPAGE = "https://www.unbound.net/"
+SECTION = "net"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=5308494bc0590c0cb036afd781d78f06"
+
+SRC_URI = "git://github.com/NLnetLabs/unbound.git;protocol=http;branch=master"
+SRCREV="16cc196bf28aec604ed2dae2b5af2ed82c8a58d6"
+
+inherit autotools pkgconfig systemd
+
+DEPENDS = "openssl libevent libtool-native bison-native expat"
+RDEPENDS_${PN} = "bash openssl-bin"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECONF = "libtool=${TARGET_PREFIX}libtool \
+		--with-ssl=${STAGING_EXECPREFIXDIR}"
+
+PACKAGECONFIG = "${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','',d)}"
+PACKAGECONFIG[systemd] = "--enable-systemd,,systemd"
+
+do_install_append() {
+	# systemd support
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+		install -d ${D}${systemd_unitdir}/system/
+		install -m 0644 ${B}/contrib/${BPN}.service ${D}${systemd_unitdir}/system/${BPN}.service
+	fi
+}
+
+SYSTEMD_SERVICE_${PN} = "${BPN}.service"
Signature · 1 line
2.17.1
#1 lore raw
Quoted 28 lines · Beniamin Sandu
---
 .../recipes-support/unbound/unbound_1.9.1.bb  | 36 +++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 meta-networking/recipes-support/unbound/unbound_1.9.1.bb
meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +16 -0
new file mode 100644
index 000000000..84bbe6581
@@ -0,0 +1,36 @@
+SUMMARY = "Unbound is a validating, recursive, and caching DNS resolver"
+DESCRIPTION = "Unbound's design is a set of modular components which incorporate \
+	features including enhanced security (DNSSEC) validation, Internet Protocol \
+	Version 6 (IPv6), and a client resolver library API as an integral part of the \
+	architecture"
+
+HOMEPAGE = "https://www.unbound.net/"
+SECTION = "net"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=5308494bc0590c0cb036afd781d78f06"
+
+SRC_URI = "git://github.com/NLnetLabs/unbound.git;protocol=http;branch=master"
+SRCREV="16cc196bf28aec604ed2dae2b5af2ed82c8a58d6"
+
+inherit autotools pkgconfig systemd
+

meta-networking/recipes-support/unbound/unbound_1.9.1.bb line 26

Quoted 10 lines
meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +10 -0
+DEPENDS = "openssl libevent libtool-native bison-native expat"
+RDEPENDS_${PN} = "bash openssl-bin"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECONF = "libtool=${TARGET_PREFIX}libtool \
+		--with-ssl=${STAGING_EXECPREFIXDIR}"
+
+PACKAGECONFIG = "${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','',d)}"
+PACKAGECONFIG[systemd] = "--enable-systemd,,systemd"

You should probably add:
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'largefile systemd', d)}" PACKAGECONFIG[dnscrypt] = "--enable-dnscrypt, --disable-dnscrypt, libsodium" PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile,," PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd"

meta-networking/recipes-support/unbound/unbound_1.9.1.bb line 36

Quoted 9 lines
meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +9 -0
+do_install_append() {
+	# systemd support
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+		install -d ${D}${systemd_unitdir}/system/
+		install -m 0644 ${B}/contrib/${BPN}.service ${D}${systemd_unitdir}/system/${BPN}.service
+	fi
+}
+
+SYSTEMD_SERVICE_${PN} = "${BPN}.service"

Then you're missing the sysvinit script too? You can just do:

do_install_append() {
    install -d ${D}${systemd_unitdir}/system
    install -m 0644 ${B}/contrib/unbound.service ${D}${systemd_unitdir}/system

    install -d ${D}${sysconfdir}/init.d
    install -m 0755 ${S}/contrib/unbound.init ${D}${sysconfdir}/init.d/unbound
}

And the right things are packaged or not.

I had a recipe for 1.9.0 locally that I didn't post as I ran into some other problem with unbound, and then ran out of time to re-visit, which is why I have these bits handy.

Signature · 1 line
Tom
author
#2 lore raw
Quoted 37 lines · Tom Rini
Quoted 35 lines · Beniamin Sandu
---
  .../recipes-support/unbound/unbound_1.9.1.bb  | 36 +++++++++++++++++++
  1 file changed, 36 insertions(+)

create mode 100644 meta-networking/recipes-support/unbound/unbound_1.9.1.bb

meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +23 -0
new file mode 100644
index 000000000..84bbe6581
@@ -0,0 +1,36 @@
+SUMMARY = "Unbound is a validating, recursive, and caching DNS resolver"
+DESCRIPTION = "Unbound's design is a set of modular components which incorporate \
+	features including enhanced security (DNSSEC) validation, Internet Protocol \
+	Version 6 (IPv6), and a client resolver library API as an integral part of the \
+	architecture"
+
+HOMEPAGE = "https://www.unbound.net/"
+SECTION = "net"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=5308494bc0590c0cb036afd781d78f06"
+
+SRC_URI = "git://github.com/NLnetLabs/unbound.git;protocol=http;branch=master"
+SRCREV="16cc196bf28aec604ed2dae2b5af2ed82c8a58d6"
+
+inherit autotools pkgconfig systemd
+
+DEPENDS = "openssl libevent libtool-native bison-native expat"
+RDEPENDS_${PN} = "bash openssl-bin"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECONF = "libtool=${TARGET_PREFIX}libtool \
+		--with-ssl=${STAGING_EXECPREFIXDIR}"
Quoted 8 lines

meta-networking/recipes-support/unbound/unbound_1.9.1.bb line 26

Quoted 3 lines
meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +3 -0
+
+PACKAGECONFIG = "${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','',d)}"
+PACKAGECONFIG[systemd] = "--enable-systemd,,systemd"

You should probably add:
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'largefile systemd', d)}" PACKAGECONFIG[dnscrypt] = "--enable-dnscrypt, --disable-dnscrypt, libsodium" PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile,," PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd"

Thanks, I will add those. I've only used unbound a bit and thought about sending a patch with a recipe for it since I noticed there is none, but I didn't look into many configuration options.

Quoted 19 lines

meta-networking/recipes-support/unbound/unbound_1.9.1.bb line 36

Quoted 10 lines
meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +9 -0
+do_install_append() {
+	# systemd support
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+		install -d ${D}${systemd_unitdir}/system/
+		install -m 0644 ${B}/contrib/${BPN}.service ${D}${systemd_unitdir}/system/${BPN}.service
+	fi
+}
+
+SYSTEMD_SERVICE_${PN} = "${BPN}.service"

Then you're missing the sysvinit script too? You can just do:

do_install_append() {
     install -d ${D}${systemd_unitdir}/system
     install -m 0644 ${B}/contrib/unbound.service ${D}${systemd_unitdir}/system

     install -d ${D}${sysconfdir}/init.d
     install -m 0755 ${S}/contrib/unbound.init ${D}${sysconfdir}/init.d/unbound
}
Quoted 1 line

And the right things are packaged or not.

Wouldn't be better to install these files under an if where we check DISTRO_FEATURES for systemd/sysvinit like in my initial patch?

Quoted 5 lines

I had a recipe for 1.9.0 locally that I didn't post as I ran into some other problem with unbound, and then ran out of time to re-visit, which is why I have these bits handy.

#3 lore raw
Quoted 47 lines · Ben
Quoted 37 lines · Tom Rini
Quoted 35 lines · Beniamin Sandu
---
 .../recipes-support/unbound/unbound_1.9.1.bb  | 36 +++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 meta-networking/recipes-support/unbound/unbound_1.9.1.bb
meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +23 -0
new file mode 100644
index 000000000..84bbe6581
@@ -0,0 +1,36 @@
+SUMMARY = "Unbound is a validating, recursive, and caching DNS resolver"
+DESCRIPTION = "Unbound's design is a set of modular components which incorporate \
+	features including enhanced security (DNSSEC) validation, Internet Protocol \
+	Version 6 (IPv6), and a client resolver library API as an integral part of the \
+	architecture"
+
+HOMEPAGE = "https://www.unbound.net/"
+SECTION = "net"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=5308494bc0590c0cb036afd781d78f06"
+
+SRC_URI = "git://github.com/NLnetLabs/unbound.git;protocol=http;branch=master"
+SRCREV="16cc196bf28aec604ed2dae2b5af2ed82c8a58d6"
+
+inherit autotools pkgconfig systemd
+
+DEPENDS = "openssl libevent libtool-native bison-native expat"
+RDEPENDS_${PN} = "bash openssl-bin"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECONF = "libtool=${TARGET_PREFIX}libtool \
+		--with-ssl=${STAGING_EXECPREFIXDIR}"
Quoted 8 lines

meta-networking/recipes-support/unbound/unbound_1.9.1.bb line 26

Quoted 3 lines
meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +3 -0
+
+PACKAGECONFIG = "${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','',d)}"
+PACKAGECONFIG[systemd] = "--enable-systemd,,systemd"

You should probably add:
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'largefile systemd', d)}" PACKAGECONFIG[dnscrypt] = "--enable-dnscrypt, --disable-dnscrypt, libsodium" PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile,," PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd"

Quoted 3 lines

Thanks, I will add those. I've only used unbound a bit and thought about sending a patch with a recipe for it since I noticed there is none, but I didn't look into many configuration options.

And thanks for your contribution! I only kinda stumbled on those others being possible myself.

Quoted 14 lines
Quoted 14 lines

meta-networking/recipes-support/unbound/unbound_1.9.1.bb line 36

Quoted 9 lines
meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +9 -0
+do_install_append() {
+	# systemd support
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+		install -d ${D}${systemd_unitdir}/system/
+		install -m 0644 ${B}/contrib/${BPN}.service ${D}${systemd_unitdir}/system/${BPN}.service
+	fi
+}
+
+SYSTEMD_SERVICE_${PN} = "${BPN}.service"

Then you're missing the sysvinit script too? You can just do:

do_install_append() {
    install -d ${D}${systemd_unitdir}/system
    install -m 0644 ${B}/contrib/unbound.service ${D}${systemd_unitdir}/system
Quoted 7 lines
Quoted 5 lines
    install -d ${D}${sysconfdir}/init.d
    install -m 0755 ${S}/contrib/unbound.init ${D}${sysconfdir}/init.d/unbound
}

And the right things are packaged or not.

Wouldn't be better to install these files under an if where we check DISTRO_FEATURES for systemd/sysvinit like in my initial patch?

No, that just adds more complexity to the recipe that we don't need to have. Oh, and since we're adding the sysvinit script too you need to inherit update-rc.d and add some appropriate lines too so it's installed right. The current best practice, iirc, is to do both if we can do both and then we have the right logic elsewhere to not do sysvinit stuff on systemd and vice-versa.

Signature · 1 line
Tom
author
#4 lore raw
Quoted 72 lines · Tom Rini
Quoted 46 lines · Ben
Quoted 37 lines · Tom Rini
Quoted 35 lines · Beniamin Sandu
---
  .../recipes-support/unbound/unbound_1.9.1.bb  | 36 +++++++++++++++++++
  1 file changed, 36 insertions(+)

create mode 100644 meta-networking/recipes-support/unbound/unbound_1.9.1.bb

meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +23 -0
new file mode 100644
index 000000000..84bbe6581
@@ -0,0 +1,36 @@
+SUMMARY = "Unbound is a validating, recursive, and caching DNS resolver"
+DESCRIPTION = "Unbound's design is a set of modular components which incorporate \
+	features including enhanced security (DNSSEC) validation, Internet Protocol \
+	Version 6 (IPv6), and a client resolver library API as an integral part of the \
+	architecture"
+
+HOMEPAGE = "https://www.unbound.net/"
+SECTION = "net"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=5308494bc0590c0cb036afd781d78f06"
+
+SRC_URI = "git://github.com/NLnetLabs/unbound.git;protocol=http;branch=master"
+SRCREV="16cc196bf28aec604ed2dae2b5af2ed82c8a58d6"
+
+inherit autotools pkgconfig systemd
+
+DEPENDS = "openssl libevent libtool-native bison-native expat"
+RDEPENDS_${PN} = "bash openssl-bin"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECONF = "libtool=${TARGET_PREFIX}libtool \
+		--with-ssl=${STAGING_EXECPREFIXDIR}"
Quoted 8 lines

meta-networking/recipes-support/unbound/unbound_1.9.1.bb line 26

Quoted 3 lines
meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +3 -0
+
+PACKAGECONFIG = "${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','',d)}"
+PACKAGECONFIG[systemd] = "--enable-systemd,,systemd"

You should probably add:
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'largefile systemd', d)}" PACKAGECONFIG[dnscrypt] = "--enable-dnscrypt, --disable-dnscrypt, libsodium" PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile,," PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd"

Quoted 3 lines

Thanks, I will add those. I've only used unbound a bit and thought about sending a patch with a recipe for it since I noticed there is none, but I didn't look into many configuration options.

And thanks for your contribution! I only kinda stumbled on those others being possible myself.

Quoted 19 lines
Quoted 19 lines

meta-networking/recipes-support/unbound/unbound_1.9.1.bb line 36

Quoted 9 lines
meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +9 -0
+do_install_append() {
+	# systemd support
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+		install -d ${D}${systemd_unitdir}/system/
+		install -m 0644 ${B}/contrib/${BPN}.service ${D}${systemd_unitdir}/system/${BPN}.service
+	fi
+}
+
+SYSTEMD_SERVICE_${PN} = "${BPN}.service"

Then you're missing the sysvinit script too? You can just do:

do_install_append() {
     install -d ${D}${systemd_unitdir}/system
     install -m 0644 ${B}/contrib/unbound.service ${D}${systemd_unitdir}/system

     install -d ${D}${sysconfdir}/init.d
     install -m 0755 ${S}/contrib/unbound.init ${D}${sysconfdir}/init.d/unbound
}

And the right things are packaged or not.

Quoted 9 lines
Quoted 2 lines

Wouldn't be better to install these files under an if where we check DISTRO_FEATURES for systemd/sysvinit like in my initial patch?

No, that just adds more complexity to the recipe that we don't need to have. Oh, and since we're adding the sysvinit script too you need to inherit update-rc.d and add some appropriate lines too so it's installed right. The current best practice, iirc, is to do both if we can do both and then we have the right logic elsewhere to not do sysvinit stuff on systemd and vice-versa.

Cool, I will send a v2 when I get to a proper machine.

author
#5 lore raw

Hi,

I got back to this and updated the recipe. Problem is the sysvinit script/systemd service file that come from the original package, don't work out of the box, they both require tinkering.

What is the best "oe approach" for this? Do we ship new files that work with our bitbake package? Is the end user supposed to adapt the config files to the needed environment?

Cheers,

Beni

Quoted 94 lines · Ben
Quoted 82 lines · Tom Rini
Quoted 54 lines · Ben
Quoted 45 lines · Tom Rini
Quoted 43 lines · Beniamin Sandu

---
  .../recipes-support/unbound/unbound_1.9.1.bb  | 36
+++++++++++++++++++

  1 file changed, 36 insertions(+)

  create mode 100644 meta-networking/recipes-support/unbound/unbound_1.9.1.bb

meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +1 -0
new file mode 100644
index 000000000..84bbe6581
@@ -0,0 +1,36 @@
+SUMMARY = "Unbound is a validating, recursive, and caching DNS 

resolver"
+DESCRIPTION = "Unbound's design is a set of modular components which incorporate \
+    features including enhanced security (DNSSEC) validation, Internet Protocol \
+    Version 6 (IPv6), and a client resolver library API as an integral part of the \
+    architecture"

meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +5 -0
+
+HOMEPAGE = "https://www.unbound.net/"
+SECTION = "net"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = 

"file://LICENSE;md5=5308494bc0590c0cb036afd781d78f06"

meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +2 -0
+
+SRC_URI = 

"git://github.com/NLnetLabs/unbound.git;protocol=http;branch=master"

meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +12 -0
+SRCREV="16cc196bf28aec604ed2dae2b5af2ed82c8a58d6"
+
+inherit autotools pkgconfig systemd
+
+DEPENDS = "openssl libevent libtool-native bison-native expat"
+RDEPENDS_${PN} = "bash openssl-bin"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECONF = "libtool=${TARGET_PREFIX}libtool \
+        --with-ssl=${STAGING_EXECPREFIXDIR}"
+
Quoted 8 lines
Quoted 3 lines

+PACKAGECONFIG = "${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','',d)}" +PACKAGECONFIG[systemd] = "--enable-systemd,,systemd"

You should probably add:
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'largefile systemd', d)}" PACKAGECONFIG[dnscrypt] = "--enable-dnscrypt, --disable-dnscrypt, libsodium" PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile,," PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd"

Quoted 3 lines

Thanks, I will add those. I've only used unbound a bit and thought about sending a patch with a recipe for it since I noticed there is none, but I didn't look into many configuration options.

And thanks for your contribution!  I only kinda stumbled on those others being possible myself.

Quoted 21 lines
Quoted 21 lines

meta-networking/recipes-support/unbound/unbound_1.9.1.bb line 36

Quoted 11 lines

+do_install_append() {
+    # systemd support
+    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then +        install -d ${D}${systemd_unitdir}/system/
+        install -m 0644 ${B}/contrib/${BPN}.service ${D}${systemd_unitdir}/system/${BPN}.service
+    fi

meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +3 -0
+}
+
+SYSTEMD_SERVICE_${PN} = "${BPN}.service"

Then you're missing the sysvinit script too?  You can just do:
do_install_append() {
     install -d ${D}${systemd_unitdir}/system
     install -m 0644 ${B}/contrib/unbound.service ${D}${systemd_unitdir}/system

     install -d ${D}${sysconfdir}/init.d
     install -m 0755 ${S}/contrib/unbound.init ${D}${sysconfdir}/init.d/unbound }

And the right things are packaged or not.

Quoted 9 lines
Quoted 2 lines

Wouldn't be better to install these files under an if where we check DISTRO_FEATURES for systemd/sysvinit like in my initial patch?

No, that just adds more complexity to the recipe that we don't need to have.  Oh, and since we're adding the sysvinit script too you need to inherit update-rc.d and add some appropriate lines too so it's installed right.  The current best practice, iirc, is to do both if we can do both and then we have the right logic elsewhere to not do sysvinit stuff on systemd and vice-versa.

Cool, I will send a v2 when I get to a proper machine.

#6 lore raw
Quoted 10 lines · Ben

Hi,

I got back to this and updated the recipe. Problem is the sysvinit script/systemd service file that come from the original package, don't work out of the box, they both require tinkering.

What is the best "oe approach" for this? Do we ship new files that work with our bitbake package? Is the end user supposed to adapt the config files to the needed environment?

Generate the diff on top of provided scripts and submit patch upstream to the package developers
and a patch to OE as well.

Quoted 115 lines

Cheers,

Beni

Quoted 96 lines · Ben
Quoted 94 lines · Tom Rini
Quoted 59 lines · Ben
Quoted 50 lines · Tom Rini
Quoted 48 lines · Beniamin Sandu
---
  .../recipes-support/unbound/unbound_1.9.1.bb  | 36
+++++++++++++++++++
  1 file changed, 36 insertions(+)

create mode 100644
meta-networking/recipes-support/unbound/unbound_1.9.1.bb

diff --git a/meta-networking/recipes-support/unbound/unbound_1.9.1.bb b/meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file mode 100644
index 000000000..84bbe6581

meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +1 -0
@@ -0,0 +1,36 @@
+SUMMARY = "Unbound is a validating, recursive, and caching DNS

resolver"
+DESCRIPTION = "Unbound's design is a set of modular components which incorporate \
+ features including enhanced security (DNSSEC) validation,
Internet Protocol \
+ Version 6 (IPv6), and a client resolver library API as an
integral part of the \

meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +6 -0
+    architecture"
+
+HOMEPAGE = "https://www.unbound.net/"
+SECTION = "net"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM =

"file://LICENSE;md5=5308494bc0590c0cb036afd781d78f06"

meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +2 -0
+
+SRC_URI =

"git://github.com/NLnetLabs/unbound.git;protocol=http;branch=master"

meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +13 -0
+SRCREV="16cc196bf28aec604ed2dae2b5af2ed82c8a58d6"
+
+inherit autotools pkgconfig systemd
+
+DEPENDS = "openssl libevent libtool-native bison-native expat"
+RDEPENDS_${PN} = "bash openssl-bin"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECONF = "libtool=${TARGET_PREFIX}libtool \
+        --with-ssl=${STAGING_EXECPREFIXDIR}"
+
+PACKAGECONFIG =

"${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','',d)}"

Quoted 8 lines
Quoted 1 line

+PACKAGECONFIG[systemd] = "--enable-systemd,,systemd"

You should probably add:
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'largefile systemd', d)}"
PACKAGECONFIG[dnscrypt] = "--enable-dnscrypt, --disable-dnscrypt, libsodium"
PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile,," PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd"

Quoted 5 lines

Thanks, I will add those. I've only used unbound a bit and thought about
sending a patch with a recipe for it since I noticed there is none, but I
didn't look into many configuration options.

And thanks for your contribution! I only kinda stumbled on those others being possible myself.

Quoted 26 lines
Quoted 16 lines

meta-networking/recipes-support/unbound/unbound_1.9.1.bb line 36

Quoted 12 lines
meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +3 -0
+do_install_append() {
+    # systemd support
+    if

${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then

meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +2 -0
+        install -d ${D}${systemd_unitdir}/system/
+        install -m 0644 ${B}/contrib/${BPN}.service

${D}${systemd_unitdir}/system/${BPN}.service

meta-networking/recipes-support/unbound/unbound_1.9.1.bb new file +4 -0
+    fi
+}
+
+SYSTEMD_SERVICE_${PN} = "${BPN}.service"

Then you're missing the sysvinit script too? You can just do:

do_install_append() {
     install -d ${D}${systemd_unitdir}/system
     install -m 0644 ${B}/contrib/unbound.service
Quoted 8 lines

${D}${systemd_unitdir}/system

     install -d ${D}${sysconfdir}/init.d
     install -m 0755 ${S}/contrib/unbound.init

${D}${sysconfdir}/init.d/unbound
}

And the right things are packaged or not.

Wouldn't be better to install these files under an if where we check DISTRO_FEATURES for systemd/sysvinit like in my initial patch?

Quoted 8 lines
Quoted 7 lines

No, that just adds more complexity to the recipe that we don't need to have. Oh, and since we're adding the sysvinit script too you need to inherit update-rc.d and add some appropriate lines too so it's installed right. The current best practice, iirc, is to do both if we can do both and then we have the right logic elsewhere to not do sysvinit stuff on systemd and vice-versa.

Cool, I will send a v2 when I get to a proper machine.

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel