Skip to content

Commit 6088cec

Browse files
author
Flatcar Buildbot
committed
sys-apps/iproute2: Sync with Gentoo
It's from Gentoo commit cdef2f549249396d4b25a1c5068c849eafa8ea6e.
1 parent a189e94 commit 6088cec

File tree

3 files changed

+220
-5
lines changed

3 files changed

+220
-5
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
DIST iproute2-6.4.0.tar.xz 922164 BLAKE2B 76369d2a794afd13dba1a34ee9a7425775bb7b43c22164274749c01b18d061669aa5abd51d32a15d68f48e75f4837a887dfc28ea41e34d8e4c36b2ab865628dd SHA512 42330be6e061302694ea301765ff8d3cbfaeca4b1d06e39778861e4390ed211c03cb2d41498190202b659f7f5647b1ca4857410ef8c16fd601a35e7162788d21
22
DIST iproute2-6.5.0.tar.xz 925940 BLAKE2B 537a956c2fb59df25e90d7899a981e5408c5ee029df2bb87461b899ecf8fe4424a1db5d1b1b67a67bdb2555f6cc4aaf099b0544a2c92ffc3843adc3d17defb96 SHA512 615ba6924becdf08af3f491d347d84897ff0198426d65b194c87146c4527b0856fc51688b59834abe1cb6f9a70b93c66ff7ade6b7c305c1ece0fd6a29df6bc54
3+
DIST iproute2-6.6.0.tar.xz 917964 BLAKE2B 9d20f19c04c2bbde7a3ae53e61e4623b119570c8446f34b93ddadd64677caa432e00ee085498bc277e0842cc2124340c7100925106d0ef2c11dd8002aacac08f SHA512 21c99a3ba8e1d0047933e99b48fb00901eef18899cd5854000ae910d9d84d13aeafa48b32184775531285782909f4d283d0784491691a1f10462dab147de359d
Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
# Copyright 1999-2023 Gentoo Authors
2+
# Distributed under the terms of the GNU General Public License v2
3+
4+
EAPI=8
5+
6+
inherit edo toolchain-funcs
7+
8+
if [[ ${PV} == 9999 ]] ; then
9+
EGIT_REPO_URI="https://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
10+
inherit git-r3
11+
else
12+
SRC_URI="https://www.kernel.org/pub/linux/utils/net/${PN}/${P}.tar.xz"
13+
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
14+
fi
15+
16+
DESCRIPTION="kernel routing and traffic control utilities"
17+
HOMEPAGE="https://wiki.linuxfoundation.org/networking/iproute2"
18+
19+
LICENSE="GPL-2"
20+
SLOT="0"
21+
IUSE="atm berkdb bpf caps elf +iptables minimal nfs selinux split-usr"
22+
# Needs root
23+
RESTRICT="test"
24+
25+
# We could make libmnl optional, but it's tiny, so eh
26+
RDEPEND="
27+
!net-misc/arpd
28+
!minimal? ( net-libs/libmnl:= )
29+
atm? ( net-dialup/linux-atm )
30+
berkdb? ( sys-libs/db:= )
31+
bpf? ( dev-libs/libbpf:= )
32+
caps? ( sys-libs/libcap )
33+
elf? ( virtual/libelf:= )
34+
iptables? ( >=net-firewall/iptables-1.4.20:= )
35+
nfs? ( net-libs/libtirpc:= )
36+
selinux? ( sys-libs/libselinux )
37+
"
38+
# We require newer linux-headers for ipset support (bug #549948) and some defines (bug #553876)
39+
DEPEND="
40+
${RDEPEND}
41+
>=sys-kernel/linux-headers-3.16
42+
"
43+
BDEPEND="
44+
app-arch/xz-utils
45+
>=sys-devel/bison-2.4
46+
sys-devel/flex
47+
virtual/pkgconfig
48+
"
49+
50+
PATCHES=(
51+
"${FILESDIR}"/${PN}-6.5.0-mtu.patch # bug #291907
52+
"${FILESDIR}"/${PN}-6.5.0-configure-nomagic-nolibbsd.patch # bug #643722 & #911727
53+
"${FILESDIR}"/${PN}-5.7.0-mix-signal.h-include.patch
54+
"${FILESDIR}"/${PN}-6.4.0-disable-libbsd-fallback.patch # bug #911727
55+
)
56+
57+
src_prepare() {
58+
default
59+
60+
# Fix version if necessary
61+
local versionfile="include/version.h"
62+
if [[ ${PV} != 9999 ]] && ! grep -Fq "${PV}" ${versionfile} ; then
63+
einfo "Fixing version string"
64+
sed -i "s@\"[[:digit:]\.]\+\"@\"${PV}\"@" \
65+
${versionfile} || die
66+
fi
67+
68+
# echo -n is not POSIX compliant
69+
sed -i 's@echo -n@printf@' configure || die
70+
71+
sed -i \
72+
-e '/^CC :\?=/d' \
73+
-e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
74+
-e "s|-O2|${CFLAGS} ${CPPFLAGS}|" \
75+
-e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
76+
-e "/^DBM_INCLUDE/s:=.*:=${T}:" \
77+
Makefile || die
78+
79+
# Build against system headers
80+
rm -r include/netinet || die #include/linux include/ip{,6}tables{,_common}.h include/libiptc
81+
sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
82+
83+
if use minimal ; then
84+
sed -i -e '/^SUBDIRS=/s:=.*:=lib tc ip:' Makefile || die
85+
fi
86+
}
87+
88+
src_configure() {
89+
tc-export AR CC PKG_CONFIG
90+
91+
# This sure is ugly. Should probably move into toolchain-funcs at some point.
92+
local setns
93+
pushd "${T}" >/dev/null || die
94+
printf '#include <sched.h>\nint main(){return setns(0, 0);}\n' > test.c || die
95+
if ${CC} ${CFLAGS} ${CPPFLAGS} -D_GNU_SOURCE ${LDFLAGS} test.c >&/dev/null ; then
96+
setns=y
97+
else
98+
setns=n
99+
fi
100+
101+
echo 'int main(){return 0;}' > test.c || die
102+
if ! ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null ; then
103+
sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile || die
104+
fi
105+
popd >/dev/null || die
106+
107+
# run "configure" script first which will create "config.mk"...
108+
# Using econf breaks since 5.14.0 (a9c3d70d902a0473ee5c13336317006a52ce8242)
109+
edo ./configure --libbpf_force $(usex bpf on off)
110+
111+
# Remove the definitions made by configure and allow them to be overridden
112+
# by USE flags below.
113+
# We have to do the cheesy only-sed-if-disabled because otherwise
114+
# the *_FLAGS etc stuff found by configure will be used but result
115+
# in a broken build.
116+
if ! use berkdb ; then
117+
sed -i -e '/HAVE_BERKELEY_DB/d' config.mk || die
118+
fi
119+
120+
if ! use caps ; then
121+
sed -i -e '/HAVE_CAP/d' config.mk || die
122+
fi
123+
124+
if use minimal ; then
125+
sed -i -e '/HAVE_MNL/d' config.mk || die
126+
fi
127+
128+
if ! use elf ; then
129+
sed -i -e '/HAVE_ELF/d' config.mk || die
130+
fi
131+
132+
if ! use nfs ; then
133+
sed -i -e '/HAVE_RPC/d' config.mk || die
134+
fi
135+
136+
if ! use selinux ; then
137+
sed -i -e '/HAVE_SELINUX/d' config.mk || die
138+
fi
139+
140+
# ...Now switch on/off requested features via USE flags
141+
# this is only useful if the test did not set other things, per bug #643722
142+
# Keep in sync with ifs above, or refactor to be unified.
143+
cat <<-EOF >> config.mk
144+
TC_CONFIG_ATM := $(usex atm y n)
145+
TC_CONFIG_XT := $(usex iptables y n)
146+
TC_CONFIG_NO_XT := $(usex iptables n y)
147+
# We've locked in recent enough kernel headers, bug #549948
148+
TC_CONFIG_IPSET := y
149+
HAVE_BERKELEY_DB := $(usex berkdb y n)
150+
HAVE_CAP := $(usex caps y n)
151+
HAVE_MNL := $(usex minimal n y)
152+
HAVE_ELF := $(usex elf y n)
153+
HAVE_RPC := $(usex nfs y n)
154+
HAVE_SELINUX := $(usex selinux y n)
155+
IP_CONFIG_SETNS := ${setns}
156+
# Use correct iptables dir, bug #144265, bug #293709
157+
IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
158+
EOF
159+
}
160+
161+
src_compile() {
162+
emake V=1 NETNS_RUN_DIR=/run/netns
163+
}
164+
165+
src_test() {
166+
emake check
167+
}
168+
169+
src_install() {
170+
if use minimal ; then
171+
into /
172+
dosbin tc/tc
173+
dobin ip/ip
174+
return 0
175+
fi
176+
177+
emake \
178+
DESTDIR="${D}" \
179+
PREFIX="${EPREFIX}/usr" \
180+
LIBDIR="${EPREFIX}"/$(get_libdir) \
181+
SBINDIR="${EPREFIX}"/sbin \
182+
CONFDIR="${EPREFIX}"/etc/iproute2 \
183+
DOCDIR="${EPREFIX}"/usr/share/doc/${PF} \
184+
MANDIR="${EPREFIX}"/usr/share/man \
185+
ARPDDIR="${EPREFIX}"/var/lib/arpd \
186+
install
187+
188+
dodir /bin
189+
mv "${ED}"/{s,}bin/ip || die # bug #330115
190+
191+
dolib.a lib/libnetlink.a
192+
insinto /usr/include
193+
doins include/libnetlink.h
194+
195+
# Collides with net-analyzer/ifstat
196+
# https://bugs.gentoo.org/868321
197+
mv "${ED}"/sbin/ifstat{,-iproute2} || die
198+
199+
if use split-usr ; then
200+
# Can remove compatibility symlink in a year: 2023-05-28.
201+
# bug #547264
202+
mv "${ED}"/sbin/ss "${ED}"/bin/ss || die
203+
dosym -r /bin/ss /sbin/ss
204+
fi
205+
206+
if use berkdb ; then
207+
keepdir /var/lib/arpd
208+
# bug #47482, arpd doesn't need to be in /sbin
209+
dodir /usr/bin
210+
mv "${ED}"/sbin/arpd "${ED}"/usr/bin/ || die
211+
elif [[ -d "${ED}"/var/lib/arpd ]]; then
212+
rmdir --ignore-fail-on-non-empty -p "${ED}"/var/lib/arpd || die
213+
fi
214+
}

sdk_container/src/third_party/portage-stable/sys-apps/iproute2/iproute2-9999.ebuild

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ BDEPEND="
4848
"
4949

5050
PATCHES=(
51-
"${FILESDIR}"/${PN}-3.1.0-mtu.patch # bug #291907
52-
"${FILESDIR}"/${PN}-5.12.0-configure-nomagic-nolibbsd.patch # bug #643722 & 911727
51+
"${FILESDIR}"/${PN}-6.5.0-mtu.patch # bug #291907
52+
"${FILESDIR}"/${PN}-6.5.0-configure-nomagic-nolibbsd.patch # bug #643722 & #911727
5353
"${FILESDIR}"/${PN}-5.7.0-mix-signal.h-include.patch
5454
"${FILESDIR}"/${PN}-6.4.0-disable-libbsd-fallback.patch # bug #911727
5555
)
@@ -61,12 +61,12 @@ src_prepare() {
6161
local versionfile="include/version.h"
6262
if [[ ${PV} != 9999 ]] && ! grep -Fq "${PV}" ${versionfile} ; then
6363
einfo "Fixing version string"
64-
sed "s@\"[[:digit:]\.]\+\"@\"${PV}\"@" \
65-
-i ${versionfile} || die
64+
sed -i "s@\"[[:digit:]\.]\+\"@\"${PV}\"@" \
65+
${versionfile} || die
6666
fi
6767

6868
# echo -n is not POSIX compliant
69-
sed 's@echo -n@printf@' -i configure || die
69+
sed -i 's@echo -n@printf@' configure || die
7070

7171
sed -i \
7272
-e '/^CC :\?=/d' \

0 commit comments

Comments
 (0)