Gentoo Archives: gentoo-commits

From: Sven Wegener <swegener@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/pdns/
Date: Sat, 08 Jan 2022 16:21:02
Message-Id: 1641658339.1d1de341e1404a46b15ae3e84bc400d474cf1a2c.swegener@gentoo
1 commit: 1d1de341e1404a46b15ae3e84bc400d474cf1a2c
2 Author: Sven Wegener <swegener <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jan 8 15:58:23 2022 +0000
4 Commit: Sven Wegener <swegener <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 8 16:12:19 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d1de341
7
8 net-dns/pdns: Enable 64bit time_t support, bug #793722
9
10 Closes: https://bugs.gentoo.org/793722
11 Package-Manager: Portage-3.0.28, Repoman-3.0.3
12 Signed-off-by: Sven Wegener <swegener <AT> gentoo.org>
13
14 net-dns/pdns/pdns-4.5.2-r1.ebuild | 167 ++++++++++++++++++++++++++++++++++++++
15 1 file changed, 167 insertions(+)
16
17 diff --git a/net-dns/pdns/pdns-4.5.2-r1.ebuild b/net-dns/pdns/pdns-4.5.2-r1.ebuild
18 new file mode 100644
19 index 000000000000..b5bfd57800c4
20 --- /dev/null
21 +++ b/net-dns/pdns/pdns-4.5.2-r1.ebuild
22 @@ -0,0 +1,167 @@
23 +# Copyright 1999-2022 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=7
27 +
28 +LUA_COMPAT=( lua5-{1..4} luajit )
29 +
30 +inherit flag-o-matic lua-single
31 +
32 +DESCRIPTION="The PowerDNS Daemon"
33 +HOMEPAGE="https://www.powerdns.com/"
34 +SRC_URI="https://downloads.powerdns.com/releases/${P/_/-}.tar.bz2"
35 +
36 +LICENSE="GPL-2"
37 +SLOT="0"
38 +KEYWORDS="~amd64 ~x86"
39 +
40 +# other possible flags:
41 +# db2: we lack the dep
42 +# oracle: dito (need Oracle Client Libraries)
43 +# xdb: (almost) dead, surely not supported
44 +
45 +IUSE="debug doc geoip ldap lua-records mydns mysql postgres remote sodium sqlite systemd tools tinydns test"
46 +RESTRICT="!test? ( test )"
47 +
48 +REQUIRED_USE="${LUA_REQUIRED_USE}
49 + mydns? ( mysql )"
50 +
51 +DEPEND="${LUA_DEPS}
52 + dev-libs/openssl:=
53 + >=dev-libs/boost-1.35:=
54 + lua-records? ( >=net-misc/curl-7.21.3 )
55 + mysql? ( dev-db/mysql-connector-c:= )
56 + postgres? ( dev-db/postgresql:= )
57 + ldap? ( >=net-nds/openldap-2.0.27-r4 app-crypt/mit-krb5 )
58 + sqlite? ( dev-db/sqlite:3 )
59 + geoip? ( >=dev-cpp/yaml-cpp-0.5.1:= dev-libs/geoip )
60 + sodium? ( dev-libs/libsodium:= )
61 + tinydns? ( >=dev-db/tinycdb-0.77 )"
62 +RDEPEND="${DEPEND}
63 + acct-user/pdns
64 + acct-group/pdns"
65 +
66 +BDEPEND="virtual/pkgconfig
67 + doc? ( app-doc/doxygen[dot] )"
68 +
69 +S="${WORKDIR}"/${P/_/-}
70 +
71 +pkg_setup() {
72 + lua-single_pkg_setup
73 + append-lfs-flags
74 + append-cppflags -D_TIME_BITS=64
75 +}
76 +
77 +src_configure() {
78 + local dynmodules="pipe bind" # the default backends, always enabled
79 +
80 + #use db2 && dynmodules+=" db2"
81 + use ldap && dynmodules+=" ldap"
82 + use mydns && dynmodules+=" mydns"
83 + use mysql && dynmodules+=" gmysql"
84 + #use oracle && dynmodules+=" goracle oracle"
85 + use postgres && dynmodules+=" gpgsql"
86 + use remote && dynmodules+=" remote"
87 + use sqlite && dynmodules+=" gsqlite3"
88 + use tinydns && dynmodules+=" tinydns"
89 + use geoip && dynmodules+=" geoip"
90 + #use xdb && dynmodules+=" xdb"
91 +
92 + econf \
93 + --disable-static \
94 + --sysconfdir=/etc/powerdns \
95 + --libdir=/usr/$(get_libdir)/powerdns \
96 + --with-service-user=pdns \
97 + --with-service-group=pdns \
98 + --with-modules= \
99 + --with-dynmodules="${dynmodules}" \
100 + --with-mysql-lib=/usr/$(get_libdir) \
101 + --with-lua="${ELUA}" \
102 + $(use_enable debug verbose-logging) \
103 + $(use_enable lua-records) \
104 + $(use_enable test unit-tests) \
105 + $(use_enable tools) \
106 + $(use_enable systemd) \
107 + $(use_with sodium libsodium) \
108 + ${myconf}
109 +}
110 +
111 +src_compile() {
112 + default
113 + use doc && emake -C codedocs codedocs
114 +}
115 +
116 +src_install() {
117 + default
118 +
119 + mv "${D}"/etc/powerdns/pdns.conf{-dist,}
120 +
121 + fperms 0700 /etc/powerdns
122 + fperms 0600 /etc/powerdns/pdns.conf
123 +
124 + # set defaults: setuid=pdns, setgid=pdns
125 + sed -i \
126 + -e 's/^# set\([ug]\)id=$/set\1id=pdns/g' \
127 + "${D}"/etc/powerdns/pdns.conf
128 +
129 + newinitd "${FILESDIR}"/pdns-r1 pdns
130 +
131 + keepdir /var/empty
132 +
133 + if use doc; then
134 + docinto html
135 + dodoc -r codedocs/html/.
136 + fi
137 +
138 + # Install development headers
139 + insinto /usr/include/pdns
140 + doins pdns/*.hh
141 + insinto /usr/include/pdns/backends/gsql
142 + doins pdns/backends/gsql/*.hh
143 +
144 + if use ldap ; then
145 + insinto /etc/openldap/schema
146 + doins "${FILESDIR}"/dnsdomain2.schema
147 + fi
148 +
149 + find "${D}" -name '*.la' -delete || die
150 +}
151 +
152 +pkg_postinst() {
153 + elog "PowerDNS provides multiple instances support. You can create more instances"
154 + elog "by symlinking the pdns init script to another name."
155 + elog
156 + elog "The name must be in the format pdns.<suffix> and PowerDNS will use the"
157 + elog "/etc/powerdns/pdns-<suffix>.conf configuration file instead of the default."
158 +
159 + local old
160 + for old in ${REPLACING_VERSIONS}; do
161 + ver_test ${old} -lt 3.2 || continue
162 +
163 + echo
164 + ewarn "To fix a security bug (bug #458018) had the following"
165 + ewarn "files/directories the world-readable bit removed (if set):"
166 + ewarn " ${EPREFIX}/etc/powerdns"
167 + ewarn " ${EPREFIX}/etc/powerdns/pdns.conf"
168 + ewarn "Check if this is correct for your setup"
169 + ewarn "This is a one-time change and will not happen on subsequent updates."
170 + chmod o-rwx "${EPREFIX}"/etc/powerdns/{,pdns.conf}
171 +
172 + break
173 + done
174 +
175 + if use postgres; then
176 + for old in ${REPLACING_VERSIONS}; do
177 + ver_test ${old} -lt 4.1.11-r1 || continue
178 +
179 + echo
180 + ewarn "PowerDNS 4.1.11 contains a security fix for the PostgreSQL backend."
181 + ewarn "This security fix needs to be applied manually to the database schema."
182 + ewarn "Please refer to the official security advisory for more information:"
183 + ewarn
184 + ewarn " https://doc.powerdns.com/authoritative/security-advisories/powerdns-advisory-2019-06.html"
185 +
186 + break
187 + done
188 + fi
189 +}