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: Tue, 01 Aug 2017 22:45:26
Message-Id: 1501627516.06cd85532dc39498e24c0a3364e0fcf689219e3e.chutzpah@gentoo
1 commit: 06cd85532dc39498e24c0a3364e0fcf689219e3e
2 Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
3 AuthorDate: Tue Aug 1 22:44:58 2017 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 1 22:45:16 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=06cd8553
7
8 net-dns/dnsmasq: Revision bump on 2.77, unify idn/libidn2 USE semantics
9
10 Make the "libidn2" USE flag a sub-flag of "idn", as described in the
11 bug.
12
13 Gentoo-Bug: 625616
14 Package-Manager: Portage-2.3.6, Repoman-2.3.3
15
16 net-dns/dnsmasq/dnsmasq-2.77-r1.ebuild | 198 +++++++++++++++++++++++++++++++++
17 1 file changed, 198 insertions(+)
18
19 diff --git a/net-dns/dnsmasq/dnsmasq-2.77-r1.ebuild b/net-dns/dnsmasq/dnsmasq-2.77-r1.ebuild
20 new file mode 100644
21 index 00000000000..17e3d67699d
22 --- /dev/null
23 +++ b/net-dns/dnsmasq/dnsmasq-2.77-r1.ebuild
24 @@ -0,0 +1,198 @@
25 +# Copyright 1999-2017 Gentoo Foundation
26 +# Distributed under the terms of the GNU General Public License v2
27 +
28 +EAPI=6
29 +
30 +inherit toolchain-funcs flag-o-matic user systemd
31 +
32 +DESCRIPTION="Small forwarding DNS server"
33 +HOMEPAGE="http://www.thekelleys.org.uk/dnsmasq/doc.html"
34 +SRC_URI="http://www.thekelleys.org.uk/dnsmasq/${P}.tar.xz"
35 +
36 +LICENSE="|| ( GPL-2 GPL-3 )"
37 +SLOT="0"
38 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
39 +
40 +IUSE="auth-dns conntrack dbus +dhcp dhcp-tools dnssec +id idn libidn2 +inotify"
41 +IUSE+=" ipv6 lua nls script selinux static tftp"
42 +
43 +DM_LINGUAS=(de es fi fr id it no pl pt_BR ro)
44 +
45 +for dm_lingua in "${DM_LINGUAS[@]}"; do
46 + IUSE+=" linguas_${dm_lingua}"
47 +done
48 +
49 +CDEPEND="dbus? ( sys-apps/dbus )
50 + idn? (
51 + !libidn2? ( net-dns/libidn )
52 + libidn2? ( >=net-dns/libidn2-2.0 )
53 + )
54 + lua? ( dev-lang/lua:* )
55 + conntrack? ( net-libs/libnetfilter_conntrack )
56 + nls? ( sys-devel/gettext )
57 +"
58 +
59 +DEPEND="${CDEPEND}
60 + app-arch/xz-utils
61 + dnssec? (
62 + dev-libs/nettle[gmp]
63 + static? ( dev-libs/nettle[static-libs(+)] )
64 + )
65 + virtual/pkgconfig
66 +"
67 +
68 +RDEPEND="${CDEPEND}
69 + dnssec? (
70 + !static? (
71 + dev-libs/nettle[gmp]
72 + )
73 + )
74 + selinux? ( sec-policy/selinux-dnsmasq )
75 +"
76 +
77 +REQUIRED_USE="dhcp-tools? ( dhcp )
78 + lua? ( script )
79 + libidn2? ( idn )"
80 +
81 +use_have() {
82 + local useflag no_only uword
83 + if [[ $1 == '-n' ]]; then
84 + no_only=1
85 + shift
86 + fi
87 + useflag="${1}"
88 + shift
89 +
90 + uword="${1:-${useflag}}"
91 + shift
92 +
93 + while [[ ${uword} ]]; do
94 + uword="${uword^^}"
95 +
96 + if ! use "${useflag}"; then
97 + echo -n " -DNO_${uword}"
98 + elif [[ -z "${no_only}" ]]; then
99 + echo -n " -DHAVE_${uword}"
100 + fi
101 + uword="${1}"
102 + shift
103 + done
104 +}
105 +
106 +pkg_pretend() {
107 + if use static; then
108 + einfo "Only sys-libs/gmp and dev-libs/nettle are statically linked."
109 + use dnssec || einfo "Thus, ${P}[!dnssec,static] makes no sense; the static USE flag is ignored."
110 + fi
111 +}
112 +
113 +pkg_setup() {
114 + enewgroup dnsmasq
115 + enewuser dnsmasq -1 -1 /dev/null dnsmasq
116 +}
117 +
118 +src_prepare() {
119 + default
120 +
121 + sed -i -r 's:lua5.[0-9]+:lua:' Makefile
122 + sed -i "s:%%PREFIX%%:${EPREFIX}/usr:" dnsmasq.conf.example
123 +}
124 +
125 +src_configure() {
126 + COPTS="$(use_have -n auth-dns auth)"
127 + COPTS+="$(use_have conntrack)"
128 + COPTS+="$(use_have dbus)"
129 + COPTS+="$(use libidn2 || $(use_have idn))"
130 + COPTS+="$(use_have libidn2)"
131 + COPTS+="$(use_have -n inotify)"
132 + COPTS+="$(use_have -n dhcp dhcp dhcp6)"
133 + COPTS+="$(use_have -n ipv6 ipv6 dhcp6)"
134 + COPTS+="$(use_have -n id id)"
135 + COPTS+="$(use_have lua luascript)"
136 + COPTS+="$(use_have -n script)"
137 + COPTS+="$(use_have -n tftp)"
138 + COPTS+="$(use_have dnssec)"
139 + COPTS+="$(use_have static dnssec_static)"
140 +}
141 +
142 +src_compile() {
143 + emake \
144 + PREFIX=/usr \
145 + MANDIR=/usr/share/man \
146 + CC="$(tc-getCC)" \
147 + PKG_CONFIG="$(tc-getPKG_CONFIG)" \
148 + CFLAGS="${CFLAGS}" \
149 + LDFLAGS="${LDFLAGS}" \
150 + COPTS="${COPTS}" \
151 + CONFFILE="/etc/${PN}.conf" \
152 + all$(use nls && echo "-i18n")
153 +
154 + use dhcp-tools && emake -C contrib/lease-tools \
155 + PREFIX=/usr \
156 + MANDIR=/usr/share/man \
157 + CC="$(tc-getCC)" \
158 + PKG_CONFIG="$(tc-getPKG_CONFIG)" \
159 + CFLAGS="${CFLAGS}" \
160 + LDFLAGS="${LDFLAGS}" \
161 + all
162 +}
163 +
164 +src_install() {
165 + local lingua puid
166 + emake \
167 + PREFIX=/usr \
168 + MANDIR=/usr/share/man \
169 + COPTS="${COPTS}" \
170 + DESTDIR="${D}" \
171 + install$(use nls && echo "-i18n")
172 +
173 + for lingua in "${DM_LINGUAS[@]}"; do
174 + use linguas_${lingua} || rm -rf "${D}"/usr/share/locale/${lingua}
175 + done
176 + [[ -d "${D}"/usr/share/locale/ ]] && rmdir --ignore-fail-on-non-empty "${D}"/usr/share/locale/
177 +
178 + dodoc CHANGELOG CHANGELOG.archive FAQ dnsmasq.conf.example
179 + dodoc -r logo
180 +
181 + docinto html/
182 + dodoc *.html
183 +
184 + newinitd "${FILESDIR}"/dnsmasq-init-r2 ${PN}
185 + newconfd "${FILESDIR}"/dnsmasq.confd-r1 ${PN}
186 +
187 + insinto /etc
188 + newins dnsmasq.conf.example dnsmasq.conf
189 +
190 + insinto /usr/share/dnsmasq
191 + doins trust-anchors.conf
192 +
193 + if use dhcp; then
194 + dodir /var/lib/misc
195 + newinitd "${FILESDIR}"/dnsmasq-init-dhcp-r1 ${PN}
196 + fi
197 + if use dbus; then
198 + insinto /etc/dbus-1/system.d
199 + doins dbus/dnsmasq.conf
200 + fi
201 +
202 + if use dhcp-tools; then
203 + dosbin contrib/lease-tools/{dhcp_release,dhcp_lease_time}
204 + doman contrib/lease-tools/{dhcp_release,dhcp_lease_time}.1
205 + if use ipv6; then
206 + dosbin contrib/lease-tools/dhcp_release6
207 + doman contrib/lease-tools/dhcp_release6.1
208 + fi
209 + fi
210 +
211 + systemd_newunit "${FILESDIR}"/${PN}.service-r1 ${PN}.service
212 +}
213 +
214 +pkg_preinst() {
215 + # temporary workaround to (hopefully) prevent leases file from being removed
216 + [[ -f /var/lib/misc/dnsmasq.leases ]] && cp /var/lib/misc/dnsmasq.leases "${T}"
217 +}
218 +
219 +pkg_postinst() {
220 + # temporary workaround to (hopefully) prevent leases file from being removed
221 + [[ -f "${T}"/dnsmasq.leases ]] && cp "${T}"/dnsmasq.leases /var/lib/misc/dnsmasq.leases
222 +}