Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/dhcp/, net-misc/dhcp/files/
Date: Fri, 02 Feb 2018 11:20:16
Message-Id: 1517570363.fd2fce14c2b61e2baac6feff9be545c4940f09f4.polynomial-c@gentoo
1 commit: fd2fce14c2b61e2baac6feff9be545c4940f09f4
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Fri Feb 2 11:19:23 2018 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Fri Feb 2 11:19:23 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fd2fce14
7
8 net-misc/dhcp: Bump to version 4.4.0
9
10 Package-Manager: Portage-2.3.23, Repoman-2.3.6
11
12 net-misc/dhcp/Manifest | 1 +
13 net-misc/dhcp/dhcp-4.4.0.ebuild | 264 +++++++++++++++++++++
14 .../dhcp/files/dhcp-4.4.0-always-accept-4.patch | 29 +++
15 net-misc/dhcp/files/dhcp-4.4.0-bind-disable.patch | 22 ++
16 4 files changed, 316 insertions(+)
17
18 diff --git a/net-misc/dhcp/Manifest b/net-misc/dhcp/Manifest
19 index 7f8bf667d55..a0c93eb7fa5 100644
20 --- a/net-misc/dhcp/Manifest
21 +++ b/net-misc/dhcp/Manifest
22 @@ -1,3 +1,4 @@
23 DIST dhcp-4.3.4.tar.gz 9302513 BLAKE2B eb7fb7d7d46d5a706b4f22b4add98619709f7ac1ecf8244564f043fd56adb6e2f54a0e01b573abcd7e054a82f74279c8134802380ee2d02c1cab1118d48a4965 SHA512 411c3f0e1effedb2a95f00539d13164530a56b50830008eb78906b3c8bf4070c331cf54a431770aed5d1b6ba214840446964210060674f746781cc97842ad706
24 DIST dhcp-4.3.5.tar.gz 10075147 BLAKE2B ffce896cfafe17a412030d0a1cb4a92323be175ecbb35061fe0538ed13a9f91d604daed89b5f282c92ef161944e9f18557545d95c9fbbd29e1f6a31485ef3b11 SHA512 aba0e1d361eb9e7ed33fc48c0b0b9288057af9ec51775e40e27feb9ababc182506706fcf39079236ce36b0f7ded391e107474dc29de2e60ed45d37753505e1f0
25 DIST dhcp-4.3.6.tar.gz 10182593 BLAKE2B 2b6324c63446a5cbded9a7cdd4455b6c880aabd282dfd19d44fe2fafe684a991b4afa87ec04ee3fc131437c8efdddbe2777d70586c2e8b2b4319e786325dc398 SHA512 de4962dc2aa174df17a3a1456719a777a42d238c3d6ad1771ccc460fa70c9e9cefcce52c7437f7acde61b9c3a2e84e9d49fd2dc33c7e9243053ceed5b247be03
26 +DIST dhcp-4.4.0.tar.gz 11158069 BLAKE2B c554e15f549bdf6342bfa4337ab54f2a259a1c212700a69b56d795b1c91230759e254b050087ad09cf065d9dcc380e6110a95d63c3d2ba982c567dd381889d3e SHA512 0dcddfe803db0cea49204f71c9fbc3b1a55496acc83e344d9147893410bbb5f96874ff6457037ee9f759d701cea4bab98dc51ad5d7b23926254e25e5e421eabd
27
28 diff --git a/net-misc/dhcp/dhcp-4.4.0.ebuild b/net-misc/dhcp/dhcp-4.4.0.ebuild
29 new file mode 100644
30 index 00000000000..ff83c6a59ab
31 --- /dev/null
32 +++ b/net-misc/dhcp/dhcp-4.4.0.ebuild
33 @@ -0,0 +1,264 @@
34 +# Copyright 1999-2018 Gentoo Foundation
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=6
38 +
39 +inherit systemd toolchain-funcs user
40 +
41 +MY_PV="${PV//_alpha/a}"
42 +MY_PV="${MY_PV//_beta/b}"
43 +MY_PV="${MY_PV//_rc/rc}"
44 +MY_PV="${MY_PV//_p/-P}"
45 +MY_P="${PN}-${MY_PV}"
46 +DESCRIPTION="ISC Dynamic Host Configuration Protocol (DHCP) client/server"
47 +HOMEPAGE="http://www.isc.org/products/DHCP"
48 +SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz
49 + ftp://ftp.isc.org/isc/dhcp/${MY_PV}/${MY_P}.tar.gz"
50 +
51 +LICENSE="ISC BSD SSLeay GPL-2" # GPL-2 only for init script
52 +SLOT="0"
53 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
54 +IUSE="+client ipv6 kernel_linux ldap libressl selinux +server ssl vim-syntax"
55 +
56 +DEPEND="
57 + client? (
58 + kernel_linux? (
59 + ipv6? ( sys-apps/iproute2 )
60 + sys-apps/net-tools
61 + )
62 + )
63 + ldap? (
64 + net-nds/openldap
65 + ssl? (
66 + !libressl? ( dev-libs/openssl:0 )
67 + libressl? ( dev-libs/libressl )
68 + )
69 + )"
70 +RDEPEND="${DEPEND}
71 + selinux? ( sec-policy/selinux-dhcp )
72 + vim-syntax? ( app-vim/dhcpd-syntax )"
73 +
74 +S="${WORKDIR}/${MY_P}"
75 +
76 +src_unpack() {
77 + unpack ${A}
78 + # handle local bind hell
79 + cd "${S}"/bind
80 + unpack ./bind.tar.gz
81 +}
82 +
83 +PATCHES=(
84 + # Gentoo patches - these will probably never be accepted upstream
85 + # Fix some permission issues
86 + "${FILESDIR}/${PN}-3.0-fix-perms.patch"
87 +
88 + # Enable dhclient to equery NTP servers
89 + "${FILESDIR}/${PN}-4.3.6-dhclient-ntp.patch"
90 + "${FILESDIR}/${PN}-4.3.6-dhclient-resolvconf.patch"
91 +
92 + # Enable dhclient to get extra configuration from stdin
93 + "${FILESDIR}/${PN}-4.2.2-dhclient-stdin-conf.patch"
94 + "${FILESDIR}/${PN}-4.3.6-nogateway.patch" #265531
95 + "${FILESDIR}/${PN}-4.3.6-quieter-ping.patch" #296921
96 + "${FILESDIR}/${PN}-4.4.0-always-accept-4.patch" #437108
97 + "${FILESDIR}/${PN}-4.3.6-iproute2-path.patch" #480636
98 + "${FILESDIR}/${PN}-4.2.5-bindtodevice-inet6.patch" #471142
99 + "${FILESDIR}/${PN}-4.3.3-ldap-ipv6-client-id.patch" #559832
100 +)
101 +
102 +src_prepare() {
103 + default
104 +
105 + # Brand the version with Gentoo
106 + sed -i \
107 + -e "/VERSION=/s:'$: Gentoo-${PR}':" \
108 + configure || die
109 +
110 + # Change the hook script locations of the scripts
111 + sed -i \
112 + -e 's,/etc/dhclient-exit-hooks,/etc/dhcp/dhclient-exit-hooks,g' \
113 + -e 's,/etc/dhclient-enter-hooks,/etc/dhcp/dhclient-enter-hooks,g' \
114 + client/scripts/* || die
115 +
116 + # No need for the linux script to force bash #158540
117 + sed -i -e 's,#!/bin/bash,#!/bin/sh,' client/scripts/linux || die
118 +
119 + # Quiet the freebsd logger a little
120 + sed -i -e '/LOGGER=/ s/-s -p user.notice //g' client/scripts/freebsd || die
121 +
122 + # Remove these options from the sample config
123 + sed -i -r \
124 + -e "/(script|host-name|domain-name) /d" \
125 + client/dhclient.conf.example || die
126 +
127 + if use client && ! use server ; then
128 + sed -i -r \
129 + -e '/^SUBDIRS/s:\<(dhcpctl|relay|server)\>::g' \
130 + Makefile.in || die
131 + elif ! use client && use server ; then
132 + sed -i -r \
133 + -e '/^SUBDIRS/s:\<client\>::' \
134 + Makefile.in || die
135 + fi
136 +
137 + # Only install different man pages if we don't have en
138 + if [[ " ${LINGUAS} " != *" en "* ]]; then
139 + # Install Japanese man pages
140 + if [[ " ${LINGUAS} " == *" ja "* && -d doc/ja_JP.eucJP ]]; then
141 + einfo "Installing Japanese documention"
142 + cp doc/ja_JP.eucJP/dhclient* client || die
143 + cp doc/ja_JP.eucJP/dhcp* common || die
144 + fi
145 + fi
146 + # Now remove the non-english docs so there are no errors later
147 + rm -r doc/ja_JP.eucJP || die
148 +
149 + # make the bind build work
150 + binddir="${S}/bind"
151 + cd "${binddir}" || die
152 + cat <<-EOF > bindvar.tmp
153 + binddir=${binddir}
154 + GMAKE=${MAKE:-gmake}
155 + EOF
156 + eapply -p2 "${FILESDIR}"/${PN}-4.4.0-bind-disable.patch
157 + # Only use the relevant subdirs now that ISC
158 + #removed the lib/export structure in bind.
159 + sed '/^SUBDIRS/s@=.*$@= isc dns isccfg irs samples@' \
160 + -i bind-*/lib/Makefile.in || die
161 +}
162 +
163 +src_configure() {
164 + # bind defaults to stupid `/usr/bin/ar`
165 + tc-export AR BUILD_CC
166 + export ac_cv_path_AR=${AR}
167 +
168 + # this is tested for by the bind build system, and can cause trouble
169 + # when cross-building; since dhcp itself doesn't make use of libcap,
170 + # simply disable it.
171 + export ac_cv_lib_cap_cap_set_proc=no
172 +
173 + # Use FHS sane paths ... some of these have configure options,
174 + # but not all, so just do it all here.
175 + local e="/etc/dhcp" r="/var/run/dhcp" l="/var/lib/dhcp"
176 + cat <<-EOF >> includes/site.h
177 + #define _PATH_DHCPD_CONF "${e}/dhcpd.conf"
178 + #define _PATH_DHCLIENT_CONF "${e}/dhclient.conf"
179 + #define _PATH_DHCPD_DB "${l}/dhcpd.leases"
180 + #define _PATH_DHCPD6_DB "${l}/dhcpd6.leases"
181 + #define _PATH_DHCLIENT_DB "${l}/dhclient.leases"
182 + #define _PATH_DHCLIENT6_DB "${l}/dhclient6.leases"
183 + #define _PATH_DHCPD_PID "${r}/dhcpd.pid"
184 + #define _PATH_DHCPD6_PID "${r}/dhcpd6.pid"
185 + #define _PATH_DHCLIENT_PID "${r}/dhcpclient.pid"
186 + #define _PATH_DHCLIENT6_PID "${r}/dhcpclient6.pid"
187 + #define _PATH_DHCRELAY_PID "${r}/dhcrelay.pid"
188 + #define _PATH_DHCRELAY6_PID "${r}/dhcrelay6.pid"
189 + EOF
190 +
191 + local myeconfargs=(
192 + --enable-paranoia
193 + --enable-early-chroot
194 + --sysconfdir=${e}
195 + $(use_enable ipv6 dhcpv6)
196 + $(use_with ldap)
197 + $(use ldap && use_with ssl ldapcrypto || echo --without-ldapcrypto)
198 + )
199 + econf "${myeconfargs[@]}"
200 +
201 + # configure local bind cruft. symtable option requires
202 + # perl and we don't want to require that #383837.
203 + cd bind/bind-*/ || die
204 + eval econf \
205 + $(for el in $(awk '/^bindconfig/,/^$/ {print}' ../Makefile.in) ; do if [[ ${el} =~ ^-- ]] ; then printf ' %s' ${el}; fi; done | sed 's,@\([[:alpha:]]\+\)dir@,${binddir}/\1,g') \
206 + --disable-symtable \
207 + --without-make-clean
208 +}
209 +
210 +src_compile() {
211 + # build local bind cruft first
212 + emake -C bind/bind-*/lib install
213 + # then build standard dhcp code
214 + emake AR="$(tc-getAR)"
215 +}
216 +
217 +src_install() {
218 + default
219 +
220 + dodoc README RELNOTES doc/{api+protocol,IANA-arp-parameters}
221 + docinto html
222 + dodoc doc/References.html
223 +
224 + if [[ -e client/dhclient ]] ; then
225 + # move the client to /
226 + dodir /sbin
227 + mv "${D}"/usr/sbin/dhclient "${D}"/sbin/ || die
228 +
229 + exeinto /sbin
230 + if use kernel_linux ; then
231 + newexe "${S}"/client/scripts/linux dhclient-script
232 + else
233 + newexe "${S}"/client/scripts/freebsd dhclient-script
234 + fi
235 + fi
236 +
237 + if [[ -e server/dhcpd ]] ; then
238 + if use ldap ; then
239 + insinto /etc/openldap/schema
240 + doins contrib/ldap/dhcp.*
241 + dosbin contrib/ldap/dhcpd-conf-to-ldap
242 + fi
243 +
244 + newinitd "${FILESDIR}"/dhcpd.init5 dhcpd
245 + newconfd "${FILESDIR}"/dhcpd.conf2 dhcpd
246 + newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay
247 + newconfd "${FILESDIR}"/dhcrelay.conf dhcrelay
248 + newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay6
249 + newconfd "${FILESDIR}"/dhcrelay6.conf dhcrelay6
250 +
251 + systemd_newtmpfilesd "${FILESDIR}"/dhcpd.tmpfiles dhcpd.conf
252 + systemd_dounit "${FILESDIR}"/dhcpd4.service
253 + systemd_dounit "${FILESDIR}"/dhcpd6.service
254 + systemd_dounit "${FILESDIR}"/dhcrelay4.service
255 + systemd_dounit "${FILESDIR}"/dhcrelay6.service
256 + systemd_install_serviced "${FILESDIR}"/dhcrelay4.service.conf
257 + systemd_install_serviced "${FILESDIR}"/dhcrelay6.service.conf
258 +
259 + sed -i "s:#@slapd@:$(usex ldap slapd ''):" "${ED}"/etc/init.d/* || die #442560
260 + fi
261 +
262 + # the default config files aren't terribly useful #384087
263 + local f
264 + for f in "${ED}"/etc/dhcp/*.conf.example ; do
265 + mv "${f}" "${f%.example}" || die
266 + done
267 + sed -i '/^[^#]/s:^:#:' "${ED}"/etc/dhcp/*.conf || die
268 +}
269 +
270 +pkg_preinst() {
271 + enewgroup dhcp
272 + enewuser dhcp -1 -1 /var/lib/dhcp dhcp
273 +
274 + # Keep the user files over the sample ones. The
275 + # hashing is to ignore the crappy defaults #384087.
276 + local f h
277 + for f in dhclient:da7c8496a96452190aecf9afceef4510 dhcpd:10979e7b71134bd7f04d2a60bd58f070 ; do
278 + h=${f#*:}
279 + f="/etc/dhcp/${f%:*}.conf"
280 + if [ -e "${EROOT}"${f} ] ; then
281 + case $(md5sum "${EROOT}"${f}) in
282 + ${h}*) ;;
283 + *) cp -p "${EROOT}"${f} "${ED}"${f};;
284 + esac
285 + fi
286 + done
287 +}
288 +
289 +pkg_postinst() {
290 + if [[ -e "${ROOT}"/etc/init.d/dhcp ]] ; then
291 + ewarn
292 + ewarn "WARNING: The dhcp init script has been renamed to dhcpd"
293 + ewarn "/etc/init.d/dhcp and /etc/conf.d/dhcp need to be removed and"
294 + ewarn "and dhcp should be removed from the default runlevel"
295 + ewarn
296 + fi
297 +}
298
299 diff --git a/net-misc/dhcp/files/dhcp-4.4.0-always-accept-4.patch b/net-misc/dhcp/files/dhcp-4.4.0-always-accept-4.patch
300 new file mode 100644
301 index 00000000000..bbb25eb194b
302 --- /dev/null
303 +++ b/net-misc/dhcp/files/dhcp-4.4.0-always-accept-4.patch
304 @@ -0,0 +1,29 @@
305 +https://bugs.gentoo.org/437108
306 +
307 +Always accept the -4 option even if we don't have IPv6 support enabled.
308 +The relay code does this already.
309 +
310 +--- dhcp-4.4.0/client/dhclient.c
311 ++++ dhcp-4.4.0/client/dhclient.c
312 +@@ -353,8 +353,8 @@
313 + if (!strcmp(argv[i], "-r")) {
314 + release_mode = 1;
315 + /* no_daemon = 1; */
316 +-#ifdef DHCPv6
317 + } else if (!strcmp(argv[i], "-4")) {
318 ++#ifdef DHCPv6
319 + if (local_family_set && local_family != AF_INET)
320 + log_fatal("Client can only do v4 or v6, not "
321 + "both.");
322 +--- dhcp-4.4.0/server/dhcpd.c
323 ++++ dhcp-4.4.0/server/dhcpd.c
324 +@@ -495,8 +495,8 @@
325 + } else if (!strcmp (argv [i], "-q")) {
326 + quiet = 1;
327 + quiet_interface_discovery = 1;
328 +-#ifdef DHCPv6
329 + } else if (!strcmp(argv[i], "-4")) {
330 ++#ifdef DHCPv6
331 + if (local_family_set && (local_family != AF_INET)) {
332 + log_fatal("Server cannot run in both IPv4 and "
333 + "IPv6 mode at the same time.");
334
335 diff --git a/net-misc/dhcp/files/dhcp-4.4.0-bind-disable.patch b/net-misc/dhcp/files/dhcp-4.4.0-bind-disable.patch
336 new file mode 100644
337 index 00000000000..b74255ca4e9
338 --- /dev/null
339 +++ b/net-misc/dhcp/files/dhcp-4.4.0-bind-disable.patch
340 @@ -0,0 +1,22 @@
341 +--- dhcp-4.4.0/bind/Makefile.in
342 ++++ dhcp-4.4.0/bind/Makefile.in
343 +@@ -37,6 +37,7 @@
344 + @BIND_ATF_TRUE@all: bind1 atf bind2
345 +
346 + bind1:
347 ++disable:
348 + # Extract the source from the tarball, if it hasn't been already.
349 + @if test -d ${bindsrcdir} ; then \
350 + echo ${bindsrcdir} already unpacked... ; \
351 +@@ -60,6 +61,7 @@
352 + fi
353 +
354 + atf:
355 ++disable:
356 + # Build and copy the ATF support if not yet installed.
357 + @if test -d ./atf ; then \
358 + echo ATF support already installed ; \
359 +--- dhcp-4.4.0/bind/test
360 ++++ dhcp-4.4.0/bind/test
361 +@@ -0,0 +1 @@
362 ++--disable-kqueue --disable-epoll --disable-devpoll --without-openssl --without-libxml2 --enable-exportlib --with-gssapi=no --enable-threads=no @BINDCONFIG@ --includedir=${binddir}/include --libdir=${binddir}/lib