Gentoo Archives: gentoo-commits

From: Patrick McLean <chutzpah@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/dnsmasq/
Date: Thu, 15 Apr 2021 23:37:42
Message-Id: 1618529837.ee7be1b8c8d143b052c2d0c00974e039430cdc37.chutzpah@gentoo
1 commit: ee7be1b8c8d143b052c2d0c00974e039430cdc37
2 Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
3 AuthorDate: Thu Apr 15 23:37:17 2021 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Thu Apr 15 23:37:17 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee7be1b8
7
8 net-dns/dnsmasq-2.85: Version bump (bug #782130)
9
10 Bug: https://bugs.gentoo.org/782130
11 Package-Manager: Portage-3.0.18, Repoman-3.0.3
12 Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
13
14 net-dns/dnsmasq/Manifest | 1 +
15 net-dns/dnsmasq/dnsmasq-2.85.ebuild | 217 ++++++++++++++++++++++++++++++++++++
16 2 files changed, 218 insertions(+)
17
18 diff --git a/net-dns/dnsmasq/Manifest b/net-dns/dnsmasq/Manifest
19 index 8d32f2d0f7f..f65dc2f4d6e 100644
20 --- a/net-dns/dnsmasq/Manifest
21 +++ b/net-dns/dnsmasq/Manifest
22 @@ -1,2 +1,3 @@
23 DIST dnsmasq-2.83.tar.xz 513880 BLAKE2B 16220fd7eac03f3ba70b014ace3c9775a85b31cdbabd7680d88a87697453a54bfec4c553207477f416032e679dbdaf3ca6c8bb56b72ee423540e0bedf0621865 SHA512 1eaade775dc19658afe825407c10456ab954b82034644bb19af2594d737ceae17ff2cee7f1f917e8e8b2dadbfbcb83dd8b842c0693fcac71487a5fade1eb4b05
24 DIST dnsmasq-2.84.tar.xz 514216 BLAKE2B 2bca97c16bcf32e0126eb50dc14b82a1f37e1635ebd1dc205e9a92455640fcbb98c093be725768ba9ced84443e451775f8556a164c82967e09e1df4bf7fc901b SHA512 e84bdcdf3cf35f08e8492eb5aa89ee6543233bdb821d01f164783bd6d0913ec01c513e85e2109352c77e77142a1a94bedcd3361f37d7b2a9a5d35a02448e85c6
25 +DIST dnsmasq-2.85.tar.xz 518316 BLAKE2B b7c081132c65d67b65f797bdbc603930c1509717bc1b5209b12f72fa3f01b4bae2f26a5387f95ef20317cd3d60e097c0b8bef5e019a35013f3ed2acce9fe9e89 SHA512 8beefe76b46f7d561f40d0900ba68b260a199cb62ab5b653746e3a1104c04fb8899b9e7a160a1be4fe8782bfb1607b556e9ffb9c25c4e99653e4bc74fcc03b09
26
27 diff --git a/net-dns/dnsmasq/dnsmasq-2.85.ebuild b/net-dns/dnsmasq/dnsmasq-2.85.ebuild
28 new file mode 100644
29 index 00000000000..018e108669b
30 --- /dev/null
31 +++ b/net-dns/dnsmasq/dnsmasq-2.85.ebuild
32 @@ -0,0 +1,217 @@
33 +# Copyright 1999-2021 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +
38 +LUA_COMPAT=( lua5-{1..4} luajit )
39 +
40 +inherit toolchain-funcs flag-o-matic lua-single systemd
41 +
42 +DESCRIPTION="Small forwarding DNS server"
43 +HOMEPAGE="http://www.thekelleys.org.uk/dnsmasq/doc.html"
44 +SRC_URI="http://www.thekelleys.org.uk/dnsmasq/${P}.tar.xz"
45 +
46 +LICENSE="|| ( GPL-2 GPL-3 )"
47 +SLOT="0"
48 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
49 +
50 +IUSE="auth-dns conntrack dbus +dhcp dhcp-tools dnssec +dumpfile id idn libidn2"
51 +IUSE+=" +inotify ipv6 lua nettlehash nls script selinux static tftp"
52 +
53 +DM_LINGUAS=(de es fi fr id it no pl pt_BR ro)
54 +
55 +BDEPEND="
56 + app-arch/xz-utils
57 + virtual/pkgconfig
58 + nls? ( sys-devel/gettext )
59 +"
60 +
61 +COMMON_DEPEND="
62 + acct-group/dnsmasq
63 + acct-user/dnsmasq
64 + dbus? ( sys-apps/dbus:= )
65 + idn? (
66 + !libidn2? ( net-dns/libidn:0= )
67 + libidn2? ( >=net-dns/libidn2-2.0:= )
68 + )
69 + lua? ( ${LUA_DEPS} )
70 + conntrack? ( net-libs/libnetfilter_conntrack:= )
71 + nls? ( sys-devel/gettext )
72 +"
73 +
74 +DEPEND="${COMMON_DEPEND}
75 + dnssec? (
76 + dev-libs/nettle:=[gmp]
77 + static? ( >=dev-libs/nettle-3.4[static-libs(+)] )
78 + )
79 +"
80 +
81 +RDEPEND="${COMMON_DEPEND}
82 + dnssec? (
83 + !static? ( >=dev-libs/nettle-3.4:=[gmp] )
84 + )
85 + selinux? ( sec-policy/selinux-dnsmasq )
86 +"
87 +
88 +REQUIRED_USE="
89 + dhcp-tools? ( dhcp )
90 + dnssec? ( !nettlehash )
91 + lua? (
92 + script
93 + ${LUA_REQUIRED_USE}
94 + )
95 + libidn2? ( idn )
96 +"
97 +
98 +use_have() {
99 + local no_only
100 + if [[ ${1} == '-n' ]]; then
101 + no_only=1
102 + shift
103 + fi
104 + local useflag="${1}"
105 + shift
106 +
107 + local uword="${1:-${useflag}}"
108 + shift
109 +
110 + while [[ ${uword} ]]; do
111 + uword="${uword^^}"
112 +
113 + if ! use "${useflag}"; then
114 + printf -- " -DNO_%s" "${uword}"
115 + elif [[ -z "${no_only}" ]]; then
116 + printf -- " -DHAVE_%s" "${uword}"
117 + fi
118 + uword="${1}"
119 + shift
120 + done
121 +}
122 +
123 +pkg_setup() {
124 + use lua && lua-single_pkg_setup
125 +}
126 +
127 +pkg_pretend() {
128 + if use static; then
129 + einfo "Only sys-libs/gmp and dev-libs/nettle are statically linked."
130 + use dnssec || einfo "Thus, ${P}[!dnssec,static] makes no sense;" \
131 + "in this case the static USE flag does nothing."
132 + fi
133 +}
134 +
135 +src_prepare() {
136 + default
137 +
138 + sed -i -r 's:lua5.[0-9]+:lua:' Makefile || die
139 + sed -i "s:%%PREFIX%%:${EPREFIX}/usr:" \
140 + dnsmasq.conf.example || die
141 +}
142 +
143 +src_configure() {
144 + COPTS=(
145 + $(use_have -n auth-dns auth)
146 + $(use_have conntrack)
147 + $(use_have dbus)
148 + $(use libidn2 || use_have idn)
149 + $(use_have libidn2)
150 + $(use_have -n inotify)
151 + $(use_have -n dhcp dhcp dhcp6)
152 + $(use_have -n ipv6 ipv6 dhcp6)
153 + $(use_have -n id id)
154 + $(use_have lua luascript)
155 + $(use_have -n script)
156 + $(use_have -n tftp)
157 + $(use_have dnssec)
158 + $(use_have nettlehash)
159 + $(use_have static dnssec_static)
160 + $(use_have -n dumpfile)
161 + )
162 +}
163 +
164 +src_compile() {
165 + emake \
166 + PREFIX=/usr \
167 + MANDIR=/usr/share/man \
168 + CC="$(tc-getCC)" \
169 + PKG_CONFIG="$(tc-getPKG_CONFIG)" \
170 + CFLAGS="${CFLAGS}" \
171 + LDFLAGS="${LDFLAGS}" \
172 + COPTS="${COPTS[*]}" \
173 + CONFFILE="/etc/${PN}.conf" \
174 + all$(use nls && printf -- "-i18n\n")
175 +
176 + use dhcp-tools && emake -C contrib/lease-tools \
177 + PREFIX=/usr \
178 + MANDIR=/usr/share/man \
179 + CC="$(tc-getCC)" \
180 + PKG_CONFIG="$(tc-getPKG_CONFIG)" \
181 + CFLAGS="${CFLAGS}" \
182 + LDFLAGS="${LDFLAGS}" \
183 + all
184 +}
185 +
186 +src_install() {
187 + local lingua puid
188 + emake \
189 + PREFIX=/usr \
190 + MANDIR=/usr/share/man \
191 + COPTS="${COPTS[*]}" \
192 + DESTDIR="${ED}" \
193 + install$(use nls && printf -- "-i18n\n")
194 +
195 + for lingua in "${DM_LINGUAS[@]}"; do
196 + has ${lingua} ${LINGUAS-${lingua}} \
197 + || rm -rf "${ED}"/usr/share/locale/${lingua}
198 + done
199 + [[ -d "${D}"/usr/share/locale/ ]] && \
200 + rmdir --ignore-fail-on-non-empty "${ED}"/usr/share/locale/
201 +
202 + dodoc CHANGELOG CHANGELOG.archive FAQ dnsmasq.conf.example
203 + dodoc -r logo
204 +
205 + docinto html/
206 + dodoc *.html
207 +
208 + newinitd "${FILESDIR}"/dnsmasq-init-r4 ${PN}
209 + newconfd "${FILESDIR}"/dnsmasq.confd-r1 ${PN}
210 +
211 + insinto /etc/logrotate.d
212 + newins "${FILESDIR}"/dnsmasq.logrotate ${PN}
213 +
214 + insinto /etc
215 + newins dnsmasq.conf.example dnsmasq.conf
216 +
217 + insinto /usr/share/dnsmasq
218 + doins trust-anchors.conf
219 +
220 + if use dhcp; then
221 + keepdir /var/lib/misc
222 + newinitd "${FILESDIR}"/dnsmasq-init-dhcp-r3 ${PN}
223 + fi
224 + if use dbus; then
225 + insinto /etc/dbus-1/system.d
226 + doins dbus/dnsmasq.conf
227 + fi
228 +
229 + if use dhcp-tools; then
230 + dosbin contrib/lease-tools/{dhcp_release,dhcp_lease_time}
231 + doman contrib/lease-tools/{dhcp_release,dhcp_lease_time}.1
232 + if use ipv6; then
233 + dosbin contrib/lease-tools/dhcp_release6
234 + doman contrib/lease-tools/dhcp_release6.1
235 + fi
236 + fi
237 +
238 + systemd_newunit "${FILESDIR}"/${PN}.service-r1 ${PN}.service
239 +}
240 +
241 +pkg_preinst() {
242 + [[ -f /var/lib/misc/dnsmasq.leases ]] && \
243 + cp /var/lib/misc/dnsmasq.leases "${T}"
244 +}
245 +
246 +pkg_postinst() {
247 + [[ -f "${T}"/dnsmasq.leases ]] && \
248 + cp "${T}"/dnsmasq.leases /var/lib/misc/dnsmasq.leases
249 +}