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/
Date: Wed, 01 Sep 2021 07:17:37
Message-Id: 1630480645.bd1923258d72209d4625e3bbcf0c94c73c23a2e6.polynomial-c@gentoo
1 commit: bd1923258d72209d4625e3bbcf0c94c73c23a2e6
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 1 07:13:45 2021 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 1 07:17:25 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bd192325
7
8 sys-apps/iproute2: Bump to version 5.14.0
9
10 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
11
12 sys-apps/iproute2/Manifest | 1 +
13 sys-apps/iproute2/iproute2-5.14.0.ebuild | 175 +++++++++++++++++++++++++++++++
14 2 files changed, 176 insertions(+)
15
16 diff --git a/sys-apps/iproute2/Manifest b/sys-apps/iproute2/Manifest
17 index b2d1dc32c1d..7d50a0780cd 100644
18 --- a/sys-apps/iproute2/Manifest
19 +++ b/sys-apps/iproute2/Manifest
20 @@ -1,3 +1,4 @@
21 DIST iproute2-5.10.0.tar.xz 798776 BLAKE2B 8c17e65f03427f45b71dc17b289b272545549a6687257498676a23e4fdc4a590a7215bfdba3c7ac4b1ccde6c38ba8e3eb222eea2532374fa9680633aa198d347 SHA512 a468eefa797898b6de452212aa432c0a931434defacae5fb4335754c1292c5d86a8c8dbf3017f90cec266d71a2a17ae469aac17e1a85a5cbddc70814313e4c13
22 DIST iproute2-5.12.0.tar.xz 835880 BLAKE2B 8e3e1b7188d7ab5014d06d7edaae2cb0c1dc65862999a2ca9f31902256d7f3d166de8a1c76e4e137acce2b445d72ea6850bfec3640d1919cb82351d45dd3e47e SHA512 9249beb67b30ceef178b60b2b61a5e6c45277e747ae4c865e739b7ab84192549e8e94ebaee43c0a87c0291037746ffb6936346245220786e369201ee13d60fac
23 DIST iproute2-5.13.0.tar.xz 845236 BLAKE2B e1c148e2a720236163e7f4d46aa38d244a02ae36ad86571c5606d54c9ccfd8d0363e2fb793d48cf39aae322b3c36b9f8a43eaf570dbdb8243092926cef3d2786 SHA512 a3286639fb303a7c3c553cb5df0a7336c4c67e53eb05e872d2776b771dbfa36ffdf2df140f570275db6785c882992f469f8eb34a5b506aac876216df7dde245d
24 +DIST iproute2-5.14.0.tar.xz 853572 BLAKE2B 52544021798f2cb716a57998d98dadc2441142b02d38c7e274bc17a6e5f994bdb5bd3ebf0b896bfd7e327a44f00f92c2af8e67367cdc0aac70769d563082f543 SHA512 e2b9b0a2c3e6fc4c67cb50b0a9bf710e749648b83369a49bf905edd7e519d76c50c2cc818bb63cc605c409c66075d4d371f2371796e5f7a8f9d04101b80ef75c
25
26 diff --git a/sys-apps/iproute2/iproute2-5.14.0.ebuild b/sys-apps/iproute2/iproute2-5.14.0.ebuild
27 new file mode 100644
28 index 00000000000..367b3541cbf
29 --- /dev/null
30 +++ b/sys-apps/iproute2/iproute2-5.14.0.ebuild
31 @@ -0,0 +1,175 @@
32 +# Copyright 1999-2021 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +
37 +inherit toolchain-funcs flag-o-matic multilib
38 +
39 +if [[ ${PV} == "9999" ]] ; then
40 + EGIT_REPO_URI="https://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
41 + inherit git-r3
42 +else
43 + SRC_URI="https://www.kernel.org/pub/linux/utils/net/${PN}/${P}.tar.xz"
44 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
45 +fi
46 +
47 +DESCRIPTION="kernel routing and traffic control utilities"
48 +HOMEPAGE="https://wiki.linuxfoundation.org/networking/iproute2"
49 +
50 +LICENSE="GPL-2"
51 +SLOT="0"
52 +IUSE="atm berkdb bpf caps elf +iptables ipv6 libbsd minimal selinux"
53 +
54 +# We could make libmnl optional, but it's tiny, so eh
55 +RDEPEND="
56 + !net-misc/arpd
57 + !minimal? ( net-libs/libmnl:= )
58 + atm? ( net-dialup/linux-atm )
59 + berkdb? ( sys-libs/db:= )
60 + bpf? ( dev-libs/libbpf:= )
61 + caps? ( sys-libs/libcap )
62 + elf? ( virtual/libelf:= )
63 + iptables? ( >=net-firewall/iptables-1.4.20:= )
64 + libbsd? ( dev-libs/libbsd )
65 + selinux? ( sys-libs/libselinux )
66 +"
67 +# We require newer linux-headers for ipset support #549948 and some defines #553876
68 +DEPEND="
69 + ${RDEPEND}
70 + >=sys-kernel/linux-headers-3.16
71 +"
72 +BDEPEND="
73 + app-arch/xz-utils
74 + >=sys-devel/bison-2.4
75 + sys-devel/flex
76 + virtual/pkgconfig
77 +"
78 +
79 +PATCHES=(
80 + "${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
81 + "${FILESDIR}"/${PN}-5.12.0-configure-nomagic.patch # bug 643722
82 + #"${FILESDIR}"/${PN}-5.1.0-portability.patch
83 + "${FILESDIR}"/${PN}-5.7.0-mix-signal.h-include.patch
84 +)
85 +
86 +doecho() {
87 + echo "${@}"
88 + "${@}" || die
89 +}
90 +
91 +src_prepare() {
92 + if ! use ipv6 ; then
93 + PATCHES+=(
94 + "${FILESDIR}"/${PN}-4.20.0-no-ipv6.patch #326849
95 + )
96 + fi
97 +
98 + default
99 +
100 + # Fix version if necessary
101 + local versionfile="include/version.h"
102 + if [[ "${PV}" != 9999 ]] && ! grep -Fq "${PV}" ${versionfile} ; then
103 + einfo "Fixing version string"
104 + sed "s@\"[[:digit:]\.]\+\"@\"${PV}\"@" \
105 + -i ${versionfile} || die
106 + fi
107 +
108 + # echo -n is not POSIX compliant
109 + sed 's@echo -n@printf@' -i configure || die
110 +
111 + sed -i \
112 + -e '/^CC :\?=/d' \
113 + -e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
114 + -e "s|-O2|${CFLAGS} ${CPPFLAGS}|" \
115 + -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
116 + -e "/^DBM_INCLUDE/s:=.*:=${T}:" \
117 + Makefile || die
118 +
119 + # build against system headers
120 + rm -r include/netinet || die #include/linux include/ip{,6}tables{,_common}.h include/libiptc
121 + sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
122 +
123 + if use minimal ; then
124 + sed -i -e '/^SUBDIRS=/s:=.*:=lib tc ip:' Makefile || die
125 + fi
126 +}
127 +
128 +src_configure() {
129 + tc-export AR CC PKG_CONFIG
130 +
131 + # This sure is ugly. Should probably move into toolchain-funcs at some point.
132 + local setns
133 + pushd "${T}" >/dev/null
134 + printf '#include <sched.h>\nint main(){return setns(0, 0);}\n' > test.c
135 + ${CC} ${CFLAGS} ${CPPFLAGS} -D_GNU_SOURCE ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
136 + echo 'int main(){return 0;}' > test.c
137 + ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
138 + popd >/dev/null
139 +
140 + # run "configure" script first which will create "config.mk"...
141 + # Using econf breaks since 5.14.0 (a9c3d70d902a0473ee5c13336317006a52ce8242)
142 + doecho ./configure --libbpf_force $(usex bpf on off)
143 +
144 + # ...now switch on/off requested features via USE flags
145 + # this is only useful if the test did not set other things, per bug #643722
146 + cat <<-EOF >> config.mk
147 + TC_CONFIG_ATM := $(usex atm y n)
148 + TC_CONFIG_XT := $(usex iptables y n)
149 + TC_CONFIG_NO_XT := $(usex iptables n y)
150 + # We've locked in recent enough kernel headers #549948
151 + TC_CONFIG_IPSET := y
152 + HAVE_BERKELEY_DB := $(usex berkdb y n)
153 + HAVE_CAP := $(usex caps y n)
154 + HAVE_MNL := $(usex minimal n y)
155 + HAVE_ELF := $(usex elf y n)
156 + HAVE_SELINUX := $(usex selinux y n)
157 + IP_CONFIG_SETNS := ${setns}
158 + # Use correct iptables dir, #144265 #293709
159 + IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
160 + HAVE_LIBBSD := $(usex libbsd y n)
161 + EOF
162 +}
163 +
164 +src_compile() {
165 + emake V=1 NETNS_RUN_DIR=/run/netns
166 +}
167 +
168 +src_install() {
169 + if use minimal ; then
170 + into /
171 + dosbin tc/tc
172 + dobin ip/ip
173 + return 0
174 + fi
175 +
176 + emake \
177 + DESTDIR="${D}" \
178 + PREFIX="${EPREFIX}/usr" \
179 + LIBDIR="${EPREFIX}"/$(get_libdir) \
180 + SBINDIR="${EPREFIX}"/sbin \
181 + CONFDIR="${EPREFIX}"/etc/iproute2 \
182 + DOCDIR="${EPREFIX}"/usr/share/doc/${PF} \
183 + MANDIR="${EPREFIX}"/usr/share/man \
184 + ARPDDIR="${EPREFIX}"/var/lib/arpd \
185 + install
186 +
187 + dodir /bin
188 + mv "${ED}"/{s,}bin/ip || die #330115
189 +
190 + dolib.a lib/libnetlink.a
191 + insinto /usr/include
192 + doins include/libnetlink.h
193 + # This local header pulls in a lot of linux headers it
194 + # doesn't directly need. Delete this header that requires
195 + # linux-headers-3.8 until that goes stable. #467716
196 + sed -i '/linux\/netconf.h/d' "${ED}"/usr/include/libnetlink.h || die
197 +
198 + if use berkdb ; then
199 + keepdir /var/lib/arpd
200 + # bug 47482, arpd doesn't need to be in /sbin
201 + dodir /usr/bin
202 + mv "${ED}"/sbin/arpd "${ED}"/usr/bin/ || die
203 + elif [[ -d "${ED}"/var/lib/arpd ]]; then
204 + rmdir --ignore-fail-on-non-empty -p "${ED}"/var/lib/arpd || die
205 + fi
206 +}