diff options
author | Beniamin Sandu <beniaminsandu@gmail.com> | 2019-07-17 21:43:51 +0300 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2019-07-18 11:21:57 -0700 |
commit | 3221fc4f28b79e2654ae4e82ab8f1c9a222c93ab (patch) | |
tree | a07c502418d49f1d0a5d119b694685657272c197 | |
parent | 27d1d3dfa6be859d92bdc3ce87a34b68f7e10804 (diff) | |
download | meta-openembedded-3221fc4f28b79e2654ae4e82ab8f1c9a222c93ab.tar.gz |
unbound: create recipe for version 1.9.2
Signed-off-by: Beniamin Sandu <beniaminsandu@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | meta-networking/recipes-support/unbound/unbound/0001-contrib-add-yocto-compatible-startup-scripts.patch | 78 | ||||
-rw-r--r-- | meta-networking/recipes-support/unbound/unbound_1.9.2.bb | 46 |
2 files changed, 124 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/unbound/unbound/0001-contrib-add-yocto-compatible-startup-scripts.patch b/meta-networking/recipes-support/unbound/unbound/0001-contrib-add-yocto-compatible-startup-scripts.patch new file mode 100644 index 0000000000..46f6a7b3fc --- /dev/null +++ b/meta-networking/recipes-support/unbound/unbound/0001-contrib-add-yocto-compatible-startup-scripts.patch | |||
@@ -0,0 +1,78 @@ | |||
1 | From 186ac39de8eb9aedcf3d87cdbe389d10cde03d66 Mon Sep 17 00:00:00 2001 | ||
2 | From: Beniamin Sandu <beniaminsandu@gmail.com> | ||
3 | Date: Tue, 16 Jul 2019 19:59:23 +0300 | ||
4 | Subject: [PATCH] contrib: add yocto compatible startup scripts | ||
5 | |||
6 | Signed-off-by: Beniamin Sandu <beniaminsandu@gmail.com> | ||
7 | --- | ||
8 | contrib/unbound.init | 10 +++++----- | ||
9 | contrib/unbound.service.in | 4 ++-- | ||
10 | 2 files changed, 7 insertions(+), 7 deletions(-) | ||
11 | mode change 100644 => 100755 contrib/unbound.init | ||
12 | |||
13 | diff --git a/contrib/unbound.init b/contrib/unbound.init | ||
14 | old mode 100644 | ||
15 | new mode 100755 | ||
16 | index cccadecc..4eba752b | ||
17 | --- a/contrib/unbound.init | ||
18 | +++ b/contrib/unbound.init | ||
19 | @@ -19,11 +19,11 @@ | ||
20 | ### END INIT INFO | ||
21 | |||
22 | # Source function library. | ||
23 | -. /etc/rc.d/init.d/functions | ||
24 | +. /etc/init.d/functions | ||
25 | |||
26 | exec="/usr/sbin/unbound" | ||
27 | prog="unbound" | ||
28 | -config="/var/unbound/unbound.conf" | ||
29 | +config="/etc/unbound/unbound.conf" | ||
30 | pidfile="/var/unbound/unbound.pid" | ||
31 | rootdir="/var/unbound" | ||
32 | |||
33 | @@ -61,7 +61,7 @@ start() { | ||
34 | fi; | ||
35 | |||
36 | # if not running, start it up here | ||
37 | - daemon $exec | ||
38 | + daemonize $exec | ||
39 | retval=$? | ||
40 | echo | ||
41 | [ $retval -eq 0 ] && touch $lockfile | ||
42 | @@ -71,7 +71,7 @@ start() { | ||
43 | stop() { | ||
44 | echo -n $"Stopping $prog: " | ||
45 | # stop it here, often "killproc $prog" | ||
46 | - killproc -p $pidfile $prog | ||
47 | + killproc $prog | ||
48 | retval=$? | ||
49 | echo | ||
50 | [ $retval -eq 0 ] && rm -f $lockfile | ||
51 | @@ -99,7 +99,7 @@ force_reload() { | ||
52 | |||
53 | rh_status() { | ||
54 | # run checks to determine if the service is running or use generic status | ||
55 | - status -p $pidfile $prog | ||
56 | + status $prog | ||
57 | } | ||
58 | |||
59 | rh_status_q() { | ||
60 | diff --git a/contrib/unbound.service.in b/contrib/unbound.service.in | ||
61 | index 95976dd9..0e7f79a9 100644 | ||
62 | --- a/contrib/unbound.service.in | ||
63 | +++ b/contrib/unbound.service.in | ||
64 | @@ -10,9 +10,9 @@ WantedBy=multi-user.target | ||
65 | |||
66 | [Service] | ||
67 | ExecReload=/bin/kill -HUP $MAINPID | ||
68 | -ExecStart=@UNBOUND_SBIN_DIR@/unbound | ||
69 | +ExecStart=@UNBOUND_SBIN_DIR@/unbound -d | ||
70 | NotifyAccess=main | ||
71 | -Type=notify | ||
72 | +Type=simple | ||
73 | CapabilityBoundingSet=CAP_IPC_LOCK CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID CAP_SYS_CHROOT CAP_SYS_RESOURCE | ||
74 | MemoryDenyWriteExecute=true | ||
75 | NoNewPrivileges=true | ||
76 | -- | ||
77 | 2.17.1 | ||
78 | |||
diff --git a/meta-networking/recipes-support/unbound/unbound_1.9.2.bb b/meta-networking/recipes-support/unbound/unbound_1.9.2.bb new file mode 100644 index 0000000000..0607c9d774 --- /dev/null +++ b/meta-networking/recipes-support/unbound/unbound_1.9.2.bb | |||
@@ -0,0 +1,46 @@ | |||
1 | SUMMARY = "Unbound is a validating, recursive, and caching DNS resolver" | ||
2 | DESCRIPTION = "Unbound's design is a set of modular components which incorporate \ | ||
3 | features including enhanced security (DNSSEC) validation, Internet Protocol \ | ||
4 | Version 6 (IPv6), and a client resolver library API as an integral part of the \ | ||
5 | architecture" | ||
6 | |||
7 | HOMEPAGE = "https://www.unbound.net/" | ||
8 | SECTION = "net" | ||
9 | LICENSE = "BSD-3-Clause" | ||
10 | LIC_FILES_CHKSUM = "file://LICENSE;md5=5308494bc0590c0cb036afd781d78f06" | ||
11 | |||
12 | SRC_URI = "git://github.com/NLnetLabs/unbound.git;protocol=http;branch=master \ | ||
13 | file://0001-contrib-add-yocto-compatible-startup-scripts.patch \ | ||
14 | " | ||
15 | SRCREV="ee06aaaad99dc4d6b73f915d98f05c506885b98a" | ||
16 | |||
17 | inherit autotools pkgconfig systemd update-rc.d | ||
18 | |||
19 | DEPENDS = "openssl libevent libtool-native bison-native expat" | ||
20 | RDEPENDS_${PN} = "bash openssl-bin daemonize" | ||
21 | |||
22 | S = "${WORKDIR}/git" | ||
23 | |||
24 | EXTRA_OECONF = "--with-libexpat=${STAGING_EXECPREFIXDIR} \ | ||
25 | --with-ssl=${STAGING_EXECPREFIXDIR} \ | ||
26 | libtool=${TARGET_PREFIX}libtool \ | ||
27 | " | ||
28 | |||
29 | |||
30 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'largefile systemd', d)}" | ||
31 | PACKAGECONFIG[dnscrypt] = "--enable-dnscrypt, --disable-dnscrypt, libsodium" | ||
32 | PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile,," | ||
33 | PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd" | ||
34 | |||
35 | do_install_append() { | ||
36 | install -d ${D}${systemd_unitdir}/system | ||
37 | install -m 0644 ${B}/contrib/unbound.service ${D}${systemd_unitdir}/system | ||
38 | |||
39 | install -d ${D}${sysconfdir}/init.d | ||
40 | install -m 0755 ${S}/contrib/unbound.init ${D}${sysconfdir}/init.d/unbound | ||
41 | } | ||
42 | |||
43 | SYSTEMD_SERVICE_${PN} = "${BPN}.service" | ||
44 | |||
45 | INITSCRIPT_NAME = "unbound" | ||
46 | INITSCRIPT_PARAMS = "defaults" | ||