Gentoo Archives: gentoo-commits

From: Marek Szuba <marecki@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/pdns/, profiles/
Date: Tue, 22 Dec 2020 22:47:41
Message-Id: 1608677233.2b3c5636d9985e073fd724e485ebdca9471b8d49.marecki@gentoo
1 commit: 2b3c5636d9985e073fd724e485ebdca9471b8d49
2 Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
3 AuthorDate: Tue Dec 22 22:08:28 2020 +0000
4 Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
5 CommitDate: Tue Dec 22 22:47:13 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2b3c5636
7
8 net-dns/pdns: migrate to lua-single.eclass
9
10 As nice and easy as dnsdist. Builds, fails tests in exactly the same way [1]
11 and installs fine against all implementations currently in the tree.
12
13 It also makes sure RDEPEND is only set once in the ebuild.
14
15 [1] One failure: "test-nameserver_cc.cc(46): error: in "test_nameserver_cc/test_AddressIsUs6": check AddressIsUs(local3) == true has failed [false != true]"
16
17 Closes: https://bugs.gentoo.org/752801
18 Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>
19
20 net-dns/pdns/pdns-4.4.0-r100.ebuild | 170 ++++++++++++++++++++++++++++++++++++
21 profiles/package.mask | 1 +
22 2 files changed, 171 insertions(+)
23
24 diff --git a/net-dns/pdns/pdns-4.4.0-r100.ebuild b/net-dns/pdns/pdns-4.4.0-r100.ebuild
25 new file mode 100644
26 index 00000000000..d40089bd954
27 --- /dev/null
28 +++ b/net-dns/pdns/pdns-4.4.0-r100.ebuild
29 @@ -0,0 +1,170 @@
30 +# Copyright 1999-2020 Gentoo Authors
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI=7
34 +
35 +LUA_COMPAT=( lua5-{1..4} luajit )
36 +
37 +inherit lua-single
38 +
39 +DESCRIPTION="The PowerDNS Daemon"
40 +HOMEPAGE="https://www.powerdns.com/"
41 +SRC_URI="https://downloads.powerdns.com/releases/${P/_/-}.tar.bz2"
42 +
43 +LICENSE="GPL-2"
44 +SLOT="0"
45 +KEYWORDS="~amd64 ~x86"
46 +
47 +# other possible flags:
48 +# db2: we lack the dep
49 +# oracle: dito (need Oracle Client Libraries)
50 +# xdb: (almost) dead, surely not supported
51 +
52 +IUSE="debug doc geoip ldap libressl lua-records mydns mysql postgres protobuf remote sodium sqlite systemd tools tinydns test"
53 +RESTRICT="!test? ( test )"
54 +
55 +REQUIRED_USE="${LUA_REQUIRED_USE}
56 + mydns? ( mysql )"
57 +
58 +DEPEND="${LUA_DEPS}
59 + libressl? ( dev-libs/libressl:= )
60 + !libressl? ( dev-libs/openssl:= )
61 + >=dev-libs/boost-1.35:=
62 + lua-records? ( >=net-misc/curl-7.21.3 )
63 + mysql? ( dev-db/mysql-connector-c:= )
64 + postgres? ( dev-db/postgresql:= )
65 + ldap? ( >=net-nds/openldap-2.0.27-r4 app-crypt/mit-krb5 )
66 + sqlite? ( dev-db/sqlite:3 )
67 + geoip? ( >=dev-cpp/yaml-cpp-0.5.1:= dev-libs/geoip )
68 + sodium? ( dev-libs/libsodium:= )
69 + tinydns? ( >=dev-db/tinycdb-0.77 )
70 + protobuf? ( dev-libs/protobuf )"
71 +RDEPEND="${DEPEND}
72 + acct-user/pdns
73 + acct-group/pdns"
74 +
75 +BDEPEND="virtual/pkgconfig
76 + doc? ( app-doc/doxygen )"
77 +
78 +S="${WORKDIR}"/${P/_/-}
79 +
80 +src_configure() {
81 + local dynmodules="pipe bind" # the default backends, always enabled
82 +
83 + #use db2 && dynmodules+=" db2"
84 + use ldap && dynmodules+=" ldap"
85 + use mydns && dynmodules+=" mydns"
86 + use mysql && dynmodules+=" gmysql"
87 + #use oracle && dynmodules+=" goracle oracle"
88 + use postgres && dynmodules+=" gpgsql"
89 + use remote && dynmodules+=" remote"
90 + use sqlite && dynmodules+=" gsqlite3"
91 + use tinydns && dynmodules+=" tinydns"
92 + use geoip && dynmodules+=" geoip"
93 + #use xdb && dynmodules+=" xdb"
94 +
95 + econf \
96 + --disable-static \
97 + --sysconfdir=/etc/powerdns \
98 + --libdir=/usr/$(get_libdir)/powerdns \
99 + --with-service-user=pdns \
100 + --with-service-group=pdns \
101 + --with-modules= \
102 + --with-dynmodules="${dynmodules}" \
103 + --with-mysql-lib=/usr/$(get_libdir) \
104 + --with-lua="${ELUA}" \
105 + $(use_enable debug verbose-logging) \
106 + $(use_enable lua-records) \
107 + $(use_enable test unit-tests) \
108 + $(use_enable tools) \
109 + $(use_enable systemd) \
110 + $(use_with sodium libsodium) \
111 + $(use_with protobuf) \
112 + ${myconf}
113 +}
114 +
115 +src_compile() {
116 + default
117 + use doc && emake -C codedocs codedocs
118 +}
119 +
120 +src_install() {
121 + default
122 +
123 + mv "${D}"/etc/powerdns/pdns.conf{-dist,}
124 +
125 + fperms 0700 /etc/powerdns
126 + fperms 0600 /etc/powerdns/pdns.conf
127 +
128 + # set defaults: setuid=pdns, setgid=pdns
129 + sed -i \
130 + -e 's/^# set\([ug]\)id=$/set\1id=pdns/g' \
131 + "${D}"/etc/powerdns/pdns.conf
132 +
133 + newinitd "${FILESDIR}"/pdns-r1 pdns
134 +
135 + keepdir /var/empty
136 +
137 + if use doc; then
138 + docinto html
139 + dodoc -r codedocs/html/.
140 + fi
141 +
142 + # Install development headers
143 + insinto /usr/include/pdns
144 + doins pdns/*.hh
145 + insinto /usr/include/pdns/backends/gsql
146 + doins pdns/backends/gsql/*.hh
147 +
148 + if use ldap ; then
149 + insinto /etc/openldap/schema
150 + doins "${FILESDIR}"/dnsdomain2.schema
151 + fi
152 +
153 + find "${D}" -name '*.la' -delete || die
154 +}
155 +
156 +pkg_postinst() {
157 + elog "PowerDNS provides multiple instances support. You can create more instances"
158 + elog "by symlinking the pdns init script to another name."
159 + elog
160 + elog "The name must be in the format pdns.<suffix> and PowerDNS will use the"
161 + elog "/etc/powerdns/pdns-<suffix>.conf configuration file instead of the default."
162 +
163 + if use ldap ; then
164 + echo
165 + ewarn "The official LDAP backend module is only compile-tested by upstream."
166 + ewarn "Try net-dns/pdns-ldap-backend if you have problems with it."
167 + fi
168 +
169 + local old
170 + for old in ${REPLACING_VERSIONS}; do
171 + ver_test ${old} -lt 3.2 || continue
172 +
173 + echo
174 + ewarn "To fix a security bug (bug #458018) had the following"
175 + ewarn "files/directories the world-readable bit removed (if set):"
176 + ewarn " ${EPREFIX}/etc/powerdns"
177 + ewarn " ${EPREFIX}/etc/powerdns/pdns.conf"
178 + ewarn "Check if this is correct for your setup"
179 + ewarn "This is a one-time change and will not happen on subsequent updates."
180 + chmod o-rwx "${EPREFIX}"/etc/powerdns/{,pdns.conf}
181 +
182 + break
183 + done
184 +
185 + if use postgres; then
186 + for old in ${REPLACING_VERSIONS}; do
187 + ver_test ${old} -lt 4.1.11-r1 || continue
188 +
189 + echo
190 + ewarn "PowerDNS 4.1.11 contains a security fix for the PostgreSQL backend."
191 + ewarn "This security fix needs to be applied manually to the database schema."
192 + ewarn "Please refer to the official security advisory for more information:"
193 + ewarn
194 + ewarn " https://doc.powerdns.com/authoritative/security-advisories/powerdns-advisory-2019-06.html"
195 +
196 + break
197 + done
198 + fi
199 +}
200
201 diff --git a/profiles/package.mask b/profiles/package.mask
202 index 8dc2c8267c6..2860cf13c43 100644
203 --- a/profiles/package.mask
204 +++ b/profiles/package.mask
205 @@ -561,6 +561,7 @@ kde-apps/kdebase-meta:5
206 >=net-dialup/accel-ppp-1.12.0_p20200913-r100
207 >=net-dns/dnsdist-1.5.1-r100
208 >=net-dns/dnsmasq-2.82-r100
209 +>=net-dns/pdns-4.4.0-r100
210 >=net-im/prosody-0.11.7-r100
211 >=net-im/swift-4.0.2-r100
212 >=net-irc/hexchat-2.14.3-r100