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: sys-apps/iproute2/, sys-apps/iproute2/files/
Date: Tue, 08 Jan 2019 10:52:18
Message-Id: 1546944718.b7e2c129c2c3fdd467ddaccd85b5adcecbffefdc.polynomial-c@gentoo
1 commit: b7e2c129c2c3fdd467ddaccd85b5adcecbffefdc
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 8 10:51:58 2019 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 8 10:51:58 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b7e2c129
7
8 sys-apps/iproute2: Bump to version 4.20.0
9
10 Package-Manager: Portage-2.3.54, Repoman-2.3.12
11 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
12
13 sys-apps/iproute2/Manifest | 1 +
14 .../files/iproute2-4.20.0-configure-nomagic.patch | 208 +++++++++++++++++++++
15 .../iproute2/files/iproute2-4.20.0-no-ipv6.patch | 38 ++++
16 sys-apps/iproute2/iproute2-4.20.0.ebuild | 155 +++++++++++++++
17 4 files changed, 402 insertions(+)
18
19 diff --git a/sys-apps/iproute2/Manifest b/sys-apps/iproute2/Manifest
20 index 0c3e61bbdad..683c8dc8668 100644
21 --- a/sys-apps/iproute2/Manifest
22 +++ b/sys-apps/iproute2/Manifest
23 @@ -1,3 +1,4 @@
24 DIST iproute2-4.14.1.tar.xz 636876 BLAKE2B 232dbe29b9af516d8345c86c044359d3b0cfe73fb88a2ba1dcd05534b52dea37c9155d2b273a4a0d40b55fba8b5503a0fbe5bc71f37864c0a2ba9d6f08b6bf41 SHA512 e593b68c46ef5f98bd6911ee7beb38388a14935a29fefabdeccc96aa012593b6f3a49b3bb1baed7d77e54f1f4a857172e058b73407f4070f158b8713f44f5d2c
25 DIST iproute2-4.17.0.tar.xz 675268 BLAKE2B 3d1455c119c9c56b11a64092c152fcea2b161f571006878215425b95deef779fed523368252ce672a1a70251c019edbe6ff2bdac8c3ee8abab1fb29e2a3c669c SHA512 ccd7fb70afd58f1fcd4e17c38a24607207da853c4d6118fda423efa6e51faad3ad03c4d6d58a579c40ef9c68aaf13b1c455e12b0c36e155712d3d4db3c2ff4b5
26 DIST iproute2-4.19.0.tar.xz 720408 BLAKE2B 2d0ece5dd8f1beb7912d025c269a9edd2ecd87aea04971a28eca9f9b7ea82d0e4aa397c9338c0cb6cb463887678a541a5407644e82244ffbbae0eb8f6ac088e8 SHA512 47c750da2247705b1b1d1621f58987333e54370d0fff2f24106194022de793ff35dfd67fd1be127ce019008705702092d31dac49abf930a7c0dc5c7e7c0665b8
27 +DIST iproute2-4.20.0.tar.xz 707016 BLAKE2B d62c6b995c4c1f79617e2f8149ff2ed297d741965e81bffebfa475514f5e96f0c9300e65d12bdd14ab492ce66675677eb41af6816876d5e1360218e4f32f4bc8 SHA512 ed29638c864062e199152c7b3b24b6495987ca6f79cc9ab1b529dab37a8a840fa2b5858d5db2b94eeefa1c0d72ff666a790107e27d11a597b189bfb7a01a4b8b
28
29 diff --git a/sys-apps/iproute2/files/iproute2-4.20.0-configure-nomagic.patch b/sys-apps/iproute2/files/iproute2-4.20.0-configure-nomagic.patch
30 new file mode 100644
31 index 00000000000..94df85017df
32 --- /dev/null
33 +++ b/sys-apps/iproute2/files/iproute2-4.20.0-configure-nomagic.patch
34 @@ -0,0 +1,208 @@
35 +The hand-rolled configure script, for multiple options (selinux,mnl,elf), sets
36 +a variable as well as modifying CFLAGS & LDLIBS.
37 +
38 +If config.mk is later amended to disable a feature, the CFLAGS/LDLIBS tweaks
39 +are still in place.
40 +
41 +Push the CFLAGS/LDLIBS changes into new conditional Makefile code, so that they
42 +are only passed when correctly needed.
43 +
44 +Prior Gentoo testcase for reproduction:
45 +USE=minimal ebuild ... compile.
46 +- Linking with libelf, libmnl & libcap based only on presence.
47 +- Links based on libselinux based only on presence.
48 +
49 +Closes: https://bugs.gentoo.org/643722
50 +Signed-off-by: Robin H. Johnson <robbat2@g.o>
51 +
52 +Forward-ported from v4.14.1 to v4.16.0 by Lars Wendler <polynomial-c@g.o>
53 +Added libcap to v4.17.0 by Lars Wendler <polynomial-c@g.o>
54 +Forward-ported from v4.17.0 to v4.20.0 by Lars Wendler <polynomial-c@g.o>
55 +
56 +--- iproute2-4.20.0/bridge/Makefile
57 ++++ iproute2-4.20.0/bridge/Makefile
58 +@@ -2,6 +2,7 @@
59 + BROBJ = bridge.o fdb.o monitor.o link.o mdb.o vlan.o
60 +
61 + include ../config.mk
62 ++include ../config.include
63 +
64 + all: bridge
65 +
66 +--- iproute2-4.20.0/config.include
67 ++++ iproute2-4.20.0/config.include
68 +@@ -0,0 +1,26 @@
69 ++# We can only modify CFLAGS/LDLIBS after all the config options are known.
70 ++ifeq ($(IP_CONFIG_SETNS),y)
71 ++ CFLAGS += $(IP_CONFIG_SETNS_CFLAGS)
72 ++endif
73 ++ifeq ($(HAVE_ELF),y)
74 ++ CFLAGS += $(HAVE_ELF_CFLAGS)
75 ++ LDLIBS += $(HAVE_ELF_LDLIBS)
76 ++endif
77 ++ifeq ($(HAVE_SELINUX),y)
78 ++ CFLAGS += $(HAVE_SELINUX_CFLAGS)
79 ++ LDLIBS += $(HAVE_SELINUX_LDLIBS)
80 ++endif
81 ++ifeq ($(HAVE_MNL),y)
82 ++ CFLAGS += $(HAVE_MNL_CFLAGS)
83 ++ LDLIBS += $(HAVE_MNL_LDLIBS)
84 ++endif
85 ++ifeq ($(HAVE_CAP),y)
86 ++ CFLAGS += $(HAVE_CAP_CFLAGS)
87 ++ LDLIBS += $(HAVE_CAP_LDLIBS)
88 ++endif
89 ++
90 ++# Rules can only be declared after all variables in them are known.
91 ++%.o: %.c
92 ++ $(QUIET_CC)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CPPFLAGS) -c -o $@ $<
93 ++
94 ++# vim: ft=make:
95 +--- iproute2-4.20.0/configure
96 ++++ iproute2-4.20.0/configure
97 +@@ -188,7 +188,7 @@
98 + if $CC -I$INCLUDE -o $TMPDIR/setnstest $TMPDIR/setnstest.c >/dev/null 2>&1; then
99 + echo "IP_CONFIG_SETNS:=y" >>$CONFIG
100 + echo "yes"
101 +- echo "CFLAGS += -DHAVE_SETNS" >>$CONFIG
102 ++ echo "IP_CONFIG_SETNS_CFLAGS += -DHAVE_SETNS" >>$CONFIG
103 + else
104 + echo "no"
105 + fi
106 +@@ -231,8 +231,8 @@
107 + echo "HAVE_ELF:=y" >>$CONFIG
108 + echo "yes"
109 +
110 +- echo 'CFLAGS += -DHAVE_ELF' `${PKG_CONFIG} libelf --cflags` >> $CONFIG
111 +- echo 'LDLIBS += ' `${PKG_CONFIG} libelf --libs` >>$CONFIG
112 ++ echo 'HAVE_ELF_CFLAGS += -DHAVE_ELF' `${PKG_CONFIG} libelf --cflags` >> $CONFIG
113 ++ echo 'HAVE_ELF_LDLIBS += ' `${PKG_CONFIG} libelf --libs` >>$CONFIG
114 + else
115 + echo "no"
116 + fi
117 +@@ -245,8 +245,8 @@
118 + echo "HAVE_SELINUX:=y" >>$CONFIG
119 + echo "yes"
120 +
121 +- echo 'LDLIBS +=' `${PKG_CONFIG} --libs libselinux` >>$CONFIG
122 +- echo 'CFLAGS += -DHAVE_SELINUX' `${PKG_CONFIG} --cflags libselinux` >>$CONFIG
123 ++ echo 'HAVE_SELINUX_CFLAGS += -DHAVE_SELINUX' `${PKG_CONFIG} --cflags libselinux` >>$CONFIG
124 ++ echo 'HAVE_SELINUX_LDLIBS +=' `${PKG_CONFIG} --libs libselinux` >>$CONFIG
125 + else
126 + echo "no"
127 + fi
128 +@@ -258,8 +258,8 @@
129 + echo "HAVE_MNL:=y" >>$CONFIG
130 + echo "yes"
131 +
132 +- echo 'CFLAGS += -DHAVE_LIBMNL' `${PKG_CONFIG} libmnl --cflags` >>$CONFIG
133 +- echo 'LDLIBS +=' `${PKG_CONFIG} libmnl --libs` >> $CONFIG
134 ++ echo 'HAVE_MNL_CFLAGS += -DHAVE_LIBMNL' `${PKG_CONFIG} libmnl --cflags` >>$CONFIG
135 ++ echo 'HAVE_MNL_LDLIBS +=' `${PKG_CONFIG} libmnl --libs` >> $CONFIG
136 + else
137 + echo "no"
138 + fi
139 +@@ -316,8 +316,8 @@
140 + echo "HAVE_CAP:=y" >>$CONFIG
141 + echo "yes"
142 +
143 +- echo 'CFLAGS += -DHAVE_LIBCAP' `${PKG_CONFIG} libcap --cflags` >>$CONFIG
144 +- echo 'LDLIBS +=' `${PKG_CONFIG} libcap --libs` >> $CONFIG
145 ++ echo 'HAVE_CAP_CFLAGS += -DHAVE_LIBCAP' `${PKG_CONFIG} libcap --cflags` >>$CONFIG
146 ++ echo 'HAVE_CAP_LDLIBS +=' `${PKG_CONFIG} libcap --libs` >> $CONFIG
147 + else
148 + echo "no"
149 + fi
150 +@@ -397,7 +397,3 @@
151 +
152 + echo -n "libcap support: "
153 + check_cap
154 +-
155 +-echo >> $CONFIG
156 +-echo "%.o: %.c" >> $CONFIG
157 +-echo ' $(QUIET_CC)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CPPFLAGS) -c -o $@ $<' >> $CONFIG
158 +--- iproute2-4.20.0/devlink/Makefile
159 ++++ iproute2-4.20.0/devlink/Makefile
160 +@@ -1,5 +1,6 @@
161 + # SPDX-License-Identifier: GPL-2.0
162 + include ../config.mk
163 ++include ../config.include
164 +
165 + TARGETS :=
166 +
167 +--- iproute2-4.20.0/genl/Makefile
168 ++++ iproute2-4.20.0/genl/Makefile
169 +@@ -2,6 +2,7 @@
170 + GENLOBJ=genl.o
171 +
172 + include ../config.mk
173 ++include ../config.include
174 + SHARED_LIBS ?= y
175 +
176 + CFLAGS += -fno-strict-aliasing
177 +--- iproute2-4.20.0/ip/Makefile
178 ++++ iproute2-4.20.0/ip/Makefile
179 +@@ -15,6 +15,7 @@
180 + RTMONOBJ=rtmon.o
181 +
182 + include ../config.mk
183 ++include ../config.include
184 +
185 + ALLOBJ=$(IPOBJ) $(RTMONOBJ)
186 + SCRIPTS=ifcfg rtpr routel routef
187 +--- iproute2-4.20.0/lib/Makefile
188 ++++ iproute2-4.20.0/lib/Makefile
189 +@@ -1,5 +1,6 @@
190 + # SPDX-License-Identifier: GPL-2.0
191 + include ../config.mk
192 ++include ../config.include
193 +
194 + CFLAGS += -fPIC
195 +
196 +--- iproute2-4.20.0/misc/Makefile
197 ++++ iproute2-4.20.0/misc/Makefile
198 +@@ -5,6 +5,7 @@
199 + TARGETS=ss nstat ifstat rtacct lnstat
200 +
201 + include ../config.mk
202 ++include ../config.include
203 +
204 + ifeq ($(HAVE_BERKELEY_DB),y)
205 + TARGETS += arpd
206 +--- iproute2-4.20.0/netem/Makefile
207 ++++ iproute2-4.20.0/netem/Makefile
208 +@@ -1,5 +1,6 @@
209 + # SPDX-License-Identifier: GPL-2.0
210 + include ../config.mk
211 ++include ../config.include
212 +
213 + DISTGEN = maketable normal pareto paretonormal
214 + DISTDATA = normal.dist pareto.dist paretonormal.dist experimental.dist
215 +--- iproute2-4.20.0/rdma/Makefile
216 ++++ iproute2-4.20.0/rdma/Makefile
217 +@@ -1,5 +1,6 @@
218 + # SPDX-License-Identifier: GPL-2.0
219 + include ../config.mk
220 ++include ../config.include
221 +
222 + TARGETS :=
223 +
224 +--- iproute2-4.20.0/tc/Makefile
225 ++++ iproute2-4.20.0/tc/Makefile
226 +@@ -4,6 +4,7 @@
227 + emp_ematch.yacc.o emp_ematch.lex.o
228 +
229 + include ../config.mk
230 ++include ../config.include
231 +
232 + SHARED_LIBS ?= y
233 +
234 +--- iproute2-4.20.0/tipc/Makefile
235 ++++ iproute2-4.20.0/tipc/Makefile
236 +@@ -1,5 +1,6 @@
237 + # SPDX-License-Identifier: GPL-2.0
238 + include ../config.mk
239 ++include ../config.include
240 +
241 + TARGETS :=
242 +
243
244 diff --git a/sys-apps/iproute2/files/iproute2-4.20.0-no-ipv6.patch b/sys-apps/iproute2/files/iproute2-4.20.0-no-ipv6.patch
245 new file mode 100644
246 index 00000000000..31733e99f72
247 --- /dev/null
248 +++ b/sys-apps/iproute2/files/iproute2-4.20.0-no-ipv6.patch
249 @@ -0,0 +1,38 @@
250 +--- iproute2-4.20.0/ip/ipmonitor.c
251 ++++ iproute2-4.20.0/ip/ipmonitor.c
252 +@@ -118,7 +118,6 @@
253 +
254 + case RTM_NEWPREFIX:
255 + print_headers(fp, "[PREFIX]", ctrl);
256 +- print_prefix(n, arg);
257 + return 0;
258 +
259 + case RTM_NEWRULE:
260 +--- iproute2-4.20.0/ip/iptunnel.c
261 ++++ iproute2-4.20.0/ip/iptunnel.c
262 +@@ -549,13 +549,6 @@
263 + break;
264 + case AF_INET:
265 + break;
266 +- /*
267 +- * This is silly enough but we have no easy way to make it
268 +- * protocol-independent because of unarranged structure between
269 +- * IPv4 and IPv6.
270 +- */
271 +- case AF_INET6:
272 +- return do_ip6tunnel(argc, argv);
273 + default:
274 + fprintf(stderr, "Unsupported protocol family: %d\n", preferred_family);
275 + exit(-1);
276 +--- iproute2-4.20.0/ip/Makefile
277 ++++ iproute2-4.20.0/ip/Makefile
278 +@@ -1,7 +1,7 @@
279 + # SPDX-License-Identifier: GPL-2.0
280 + IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \
281 +- rtm_map.o iptunnel.o ip6tunnel.o tunnel.o ipneigh.o ipntable.o iplink.o \
282 +- ipmaddr.o ipmonitor.o ipmroute.o ipprefix.o iptuntap.o iptoken.o \
283 ++ rtm_map.o iptunnel.o tunnel.o ipneigh.o ipntable.o iplink.o \
284 ++ ipmaddr.o ipmonitor.o ipmroute.o iptuntap.o iptoken.o \
285 + ipxfrm.o xfrm_state.o xfrm_policy.o xfrm_monitor.o iplink_dummy.o \
286 + iplink_ifb.o iplink_nlmon.o iplink_team.o iplink_vcan.o iplink_vxcan.o \
287 + iplink_vlan.o link_veth.o link_gre.o iplink_can.o iplink_xdp.o \
288
289 diff --git a/sys-apps/iproute2/iproute2-4.20.0.ebuild b/sys-apps/iproute2/iproute2-4.20.0.ebuild
290 new file mode 100644
291 index 00000000000..aa41574d98b
292 --- /dev/null
293 +++ b/sys-apps/iproute2/iproute2-4.20.0.ebuild
294 @@ -0,0 +1,155 @@
295 +# Copyright 1999-2019 Gentoo Authors
296 +# Distributed under the terms of the GNU General Public License v2
297 +
298 +EAPI=6
299 +
300 +inherit toolchain-funcs flag-o-matic multilib
301 +
302 +if [[ ${PV} == "9999" ]] ; then
303 + EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
304 + inherit git-r3
305 +else
306 + SRC_URI="mirror://kernel/linux/utils/net/${PN}/${P}.tar.xz"
307 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
308 +fi
309 +
310 +DESCRIPTION="kernel routing and traffic control utilities"
311 +HOMEPAGE="https://wiki.linuxfoundation.org/networking/iproute2"
312 +
313 +LICENSE="GPL-2"
314 +SLOT="0"
315 +IUSE="atm berkdb caps elf +iptables ipv6 minimal selinux"
316 +
317 +# We could make libmnl optional, but it's tiny, so eh
318 +RDEPEND="
319 + !net-misc/arpd
320 + dev-libs/libbsd
321 + !minimal? ( net-libs/libmnl )
322 + caps? ( sys-libs/libcap )
323 + elf? ( virtual/libelf )
324 + iptables? ( >=net-firewall/iptables-1.4.20:= )
325 + berkdb? ( sys-libs/db:= )
326 + atm? ( net-dialup/linux-atm )
327 + selinux? ( sys-libs/libselinux )
328 +"
329 +# We require newer linux-headers for ipset support #549948 and some defines #553876
330 +DEPEND="
331 + ${RDEPEND}
332 + app-arch/xz-utils
333 + iptables? ( virtual/pkgconfig )
334 + >=sys-devel/bison-2.4
335 + sys-devel/flex
336 + >=sys-kernel/linux-headers-3.16
337 + virtual/pkgconfig
338 + elibc_glibc? ( >=sys-libs/glibc-2.7 )
339 +"
340 +
341 +PATCHES=(
342 + "${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
343 + "${FILESDIR}"/${PN}-4.20.0-configure-nomagic.patch # bug 643722
344 +)
345 +
346 +src_prepare() {
347 + if ! use ipv6 ; then
348 + PATCHES+=(
349 + "${FILESDIR}"/${PN}-4.20.0-no-ipv6.patch #326849
350 + )
351 + fi
352 +
353 + default
354 +
355 + sed -i \
356 + -e '/^CC :\?=/d' \
357 + -e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
358 + -e "s:-O2:${CFLAGS} ${CPPFLAGS}:" \
359 + -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
360 + -e "/^DBM_INCLUDE/s:=.*:=${T}:" \
361 + Makefile || die
362 +
363 + # Use /run instead of /var/run.
364 + sed -i \
365 + -e 's:/var/run:/run:g' \
366 + include/namespace.h \
367 + man/man8/ip-netns.8 || die
368 +
369 + # build against system headers
370 + rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
371 + sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
372 +
373 + use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc ip:' Makefile
374 +}
375 +
376 +src_configure() {
377 + tc-export AR CC PKG_CONFIG
378 +
379 + # This sure is ugly. Should probably move into toolchain-funcs at some point.
380 + local setns
381 + pushd "${T}" >/dev/null
382 + printf '#include <sched.h>\nint main(){return setns(0, 0);}\n' > test.c
383 + ${CC} ${CFLAGS} ${CPPFLAGS} -D_GNU_SOURCE ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
384 + echo 'int main(){return 0;}' > test.c
385 + ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
386 + popd >/dev/null
387 +
388 + # run "configure" script first which will create "config.mk"...
389 + econf
390 +
391 + # ...now switch on/off requested features via USE flags
392 + # this is only useful if the test did not set other things, per bug #643722
393 + cat <<-EOF >> config.mk
394 + TC_CONFIG_ATM := $(usex atm y n)
395 + TC_CONFIG_XT := $(usex iptables y n)
396 + TC_CONFIG_NO_XT := $(usex iptables n y)
397 + # We've locked in recent enough kernel headers #549948
398 + TC_CONFIG_IPSET := y
399 + HAVE_BERKELEY_DB := $(usex berkdb y n)
400 + HAVE_CAP := $(usex caps y n)
401 + HAVE_MNL := $(usex minimal n y)
402 + HAVE_ELF := $(usex elf y n)
403 + HAVE_SELINUX := $(usex selinux y n)
404 + IP_CONFIG_SETNS := ${setns}
405 + # Use correct iptables dir, #144265 #293709
406 + IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
407 + EOF
408 +}
409 +
410 +src_compile() {
411 + emake V=1
412 +}
413 +
414 +src_install() {
415 + if use minimal ; then
416 + into /
417 + dosbin tc/tc
418 + dobin ip/ip
419 + return 0
420 + fi
421 +
422 + emake \
423 + DESTDIR="${D}" \
424 + LIBDIR="${EPREFIX%/}"/$(get_libdir) \
425 + SBINDIR="${EPREFIX%/}"/sbin \
426 + CONFDIR="${EPREFIX%/}"/etc/iproute2 \
427 + DOCDIR="${EPREFIX%/}"/usr/share/doc/${PF} \
428 + MANDIR="${EPREFIX%/}"/usr/share/man \
429 + ARPDDIR="${EPREFIX%/}"/var/lib/arpd \
430 + install
431 +
432 + dodir /bin
433 + mv "${ED%/}"/{s,}bin/ip || die #330115
434 +
435 + dolib.a lib/libnetlink.a
436 + insinto /usr/include
437 + doins include/libnetlink.h
438 + # This local header pulls in a lot of linux headers it
439 + # doesn't directly need. Delete this header that requires
440 + # linux-headers-3.8 until that goes stable. #467716
441 + sed -i '/linux\/netconf.h/d' "${ED%/}"/usr/include/libnetlink.h || die
442 +
443 + if use berkdb ; then
444 + dodir /var/lib/arpd
445 + # bug 47482, arpd doesn't need to be in /sbin
446 + dodir /usr/bin
447 + mv "${ED%/}"/sbin/arpd "${ED%/}"/usr/bin/ || die
448 + fi
449 +}