Gentoo Archives: gentoo-commits

From: Marc Schiffbauer <mschiff@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/unbound/
Date: Fri, 23 Feb 2018 20:10:54
Message-Id: 1519416638.6f3d0c2027034767f2acf1b52940c15ec137d6c0.mschiff@gentoo
1 commit: 6f3d0c2027034767f2acf1b52940c15ec137d6c0
2 Author: Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
3 AuthorDate: Fri Feb 23 20:08:37 2018 +0000
4 Commit: Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
5 CommitDate: Fri Feb 23 20:10:38 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6f3d0c20
7
8 net-dns/unbound: fix owner of /etc/unbound, fixes #641042
9
10 Package-Manager: Portage-2.3.24, Repoman-2.3.6
11
12 net-dns/unbound/unbound-1.6.8-r1.ebuild | 135 ++++++++++++++++++++++++++++++++
13 1 file changed, 135 insertions(+)
14
15 diff --git a/net-dns/unbound/unbound-1.6.8-r1.ebuild b/net-dns/unbound/unbound-1.6.8-r1.ebuild
16 new file mode 100644
17 index 00000000000..07379f933b5
18 --- /dev/null
19 +++ b/net-dns/unbound/unbound-1.6.8-r1.ebuild
20 @@ -0,0 +1,135 @@
21 +# Copyright 1999-2018 Gentoo Foundation
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI=5
25 +PYTHON_COMPAT=( python2_7 )
26 +
27 +inherit eutils flag-o-matic multilib-minimal python-single-r1 systemd user
28 +
29 +MY_P=${PN}-${PV/_/}
30 +DESCRIPTION="A validating, recursive and caching DNS resolver"
31 +HOMEPAGE="http://unbound.net/"
32 +SRC_URI="http://unbound.net/downloads/${MY_P}.tar.gz"
33 +
34 +LICENSE="BSD GPL-2"
35 +SLOT="0"
36 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~x86"
37 +IUSE="debug dnscrypt dnstap +ecdsa gost libressl python selinux static-libs systemd test threads"
38 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
39 +
40 +# Note: expat is needed by executable only but the Makefile is custom
41 +# and doesn't make it possible to easily install the library without
42 +# the executables. MULTILIB_USEDEP may be dropped once build system
43 +# is fixed.
44 +
45 +CDEPEND=">=dev-libs/expat-2.1.0-r3[${MULTILIB_USEDEP}]
46 + >=dev-libs/libevent-2.0.21:0=[${MULTILIB_USEDEP}]
47 + libressl? ( >=dev-libs/libressl-2.2.4:0[${MULTILIB_USEDEP}] )
48 + !libressl? ( >=dev-libs/openssl-1.0.1h-r2:0[${MULTILIB_USEDEP}] )
49 + dnscrypt? ( dev-libs/libsodium )
50 + dnstap? (
51 + dev-libs/fstrm[${MULTILIB_USEDEP}]
52 + >=dev-libs/protobuf-c-1.0.2-r1[${MULTILIB_USEDEP}]
53 + )
54 + ecdsa? (
55 + !libressl? ( dev-libs/openssl:0[-bindist] )
56 + )
57 + python? ( ${PYTHON_DEPS} )"
58 +
59 +DEPEND="${CDEPEND}
60 + python? ( dev-lang/swig )
61 + test? (
62 + net-dns/ldns-utils[examples]
63 + dev-util/splint
64 + app-text/wdiff
65 + )
66 + systemd? ( sys-apps/systemd )
67 + virtual/pkgconfig"
68 +
69 +RDEPEND="${CDEPEND}
70 + selinux? ( sec-policy/selinux-bind )"
71 +
72 +# bug #347415
73 +RDEPEND="${RDEPEND}
74 + net-dns/dnssec-root"
75 +
76 +S=${WORKDIR}/${MY_P}
77 +
78 +pkg_setup() {
79 + enewgroup unbound
80 + enewuser unbound -1 -1 /etc/unbound unbound
81 + # improve security on existing installs (bug #641042)
82 + # as well as new installs where unbound homedir has just been created
83 + if [[ -d "${ROOT}/etc/unbound" ]]; then
84 + chown --no-dereference --from=unbound root "${ROOT}/etc/unbound"
85 + fi
86 +
87 + use python && python-single-r1_pkg_setup
88 +}
89 +
90 +src_prepare() {
91 + # To avoid below error messages, set 'trust-anchor-file' to same value in
92 + # 'auto-trust-anchor-file'.
93 + # [23109:0] error: Could not open autotrust file for writing,
94 + # /etc/dnssec/root-anchors.txt: Permission denied
95 + epatch "${FILESDIR}"/${PN}-1.5.7-trust-anchor-file.patch
96 +
97 + # required for the python part
98 + multilib_copy_sources
99 +}
100 +
101 +src_configure() {
102 + [[ ${CHOST} == *-darwin* ]] || append-ldflags -Wl,-z,noexecstack
103 + multilib-minimal_src_configure
104 +}
105 +
106 +multilib_src_configure() {
107 + econf \
108 + $(use_enable debug) \
109 + $(use_enable gost) \
110 + $(use_enable dnscrypt) \
111 + $(use_enable dnstap) \
112 + $(use_enable ecdsa) \
113 + $(use_enable static-libs static) \
114 + $(use_enable systemd) \
115 + $(multilib_native_use_with python pythonmodule) \
116 + $(multilib_native_use_with python pyunbound) \
117 + $(use_with threads pthreads) \
118 + --disable-flto \
119 + --disable-rpath \
120 + --with-libevent="${EPREFIX}"/usr \
121 + --with-pidfile="${EPREFIX}"/var/run/unbound.pid \
122 + --with-rootkey-file="${EPREFIX}"/etc/dnssec/root-anchors.txt \
123 + --with-ssl="${EPREFIX}"/usr \
124 + --with-libexpat="${EPREFIX}"/usr
125 +
126 + # http://unbound.nlnetlabs.nl/pipermail/unbound-users/2011-April/001801.html
127 + # $(use_enable debug lock-checks) \
128 + # $(use_enable debug alloc-checks) \
129 + # $(use_enable debug alloc-lite) \
130 + # $(use_enable debug alloc-nonregional) \
131 +}
132 +
133 +multilib_src_install_all() {
134 + prune_libtool_files --modules
135 + use python && python_optimize
136 +
137 + newinitd "${FILESDIR}"/unbound.initd unbound
138 + newconfd "${FILESDIR}"/unbound.confd unbound
139 +
140 + systemd_dounit "${FILESDIR}"/unbound.service
141 + systemd_dounit "${FILESDIR}"/unbound.socket
142 + systemd_newunit "${FILESDIR}"/unbound_at.service "unbound@.service"
143 + systemd_dounit "${FILESDIR}"/unbound-anchor.service
144 +
145 + dodoc doc/{README,CREDITS,TODO,Changelog,FEATURES}
146 +
147 + # bug #315519
148 + dodoc contrib/unbound_munin_
149 +
150 + docinto selinux
151 + dodoc contrib/selinux/*
152 +
153 + exeinto /usr/share/${PN}
154 + doexe contrib/update-anchor.sh
155 +}