mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-16 09:26:58 +02:00
sys-apps/iproute2: Sync with gentoo
It's from gentoo commit 9bed110cfca15256b3850d2318527a6590e64253.
This commit is contained in:
parent
0e7b9ab914
commit
e66a96c5a4
@ -1,11 +1,3 @@
|
|||||||
DIST iproute2-4.10.0.tar.xz 626944 SHA256 22b1e1c1fc704ad35837e5a66103739727b8b48ac90b48c13f79b7367ff0a9a8 SHA512 e54477e167455e7ef5da4adc168d63eaa96091b63dc987fffe918cbb005eceed18a62283ca99ee2512dc0e960f47ae21b39ffbe399c1612fd9cea147c34c581b WHIRLPOOL 7034f87835b13d275d2e065ee00d869060ae20c7dd325d8974da414db20328195e5968ede2f0b6925ddf67de3712b5945f54276c6ce5c8367ba28520c2adb859
|
DIST iproute2-5.13.0.tar.xz 845236 BLAKE2B e1c148e2a720236163e7f4d46aa38d244a02ae36ad86571c5606d54c9ccfd8d0363e2fb793d48cf39aae322b3c36b9f8a43eaf570dbdb8243092926cef3d2786 SHA512 a3286639fb303a7c3c553cb5df0a7336c4c67e53eb05e872d2776b771dbfa36ffdf2df140f570275db6785c882992f469f8eb34a5b506aac876216df7dde245d
|
||||||
DIST iproute2-4.11.0.tar.xz 657100 SHA256 72671028bda696d0cb8f48ec8e702581c3a501caeed33eec3a81d7041cbc8026 SHA512 e6cc3dbe2779670a752ab346c1a432b496033448d1645aa0161b3f7b683b3f9939ab09db12199b794cc64dff257faaf0d151046feea9031a6139176e08b4f4fa WHIRLPOOL 9bf25b018d3f392a2e2f4faf4c3877f52ec4b0aebb082d9c2e2c3e80c0c8f3885c122c5d211c4c6ef014506d786213b36938728f63b581079274a3116fc85581
|
DIST iproute2-5.14.0.tar.xz 853572 BLAKE2B 52544021798f2cb716a57998d98dadc2441142b02d38c7e274bc17a6e5f994bdb5bd3ebf0b896bfd7e327a44f00f92c2af8e67367cdc0aac70769d563082f543 SHA512 e2b9b0a2c3e6fc4c67cb50b0a9bf710e749648b83369a49bf905edd7e519d76c50c2cc818bb63cc605c409c66075d4d371f2371796e5f7a8f9d04101b80ef75c
|
||||||
DIST iproute2-4.12.0.tar.xz 662424 SHA256 2e0a4c4262d9f6c169885a6e16c4c5c5f1ef6fd57b6a0e7b41f42be5bb6ebd7d SHA512 275147f71e7c4698654f0d6d0981ab42f6f108066508c15cfcd5d9e0d3aaf8d33291968d9f06cb03f5494d801cfabf8d53308aaf56fc4fa92c52b137e970a3b0 WHIRLPOOL 590cc191e96ff0b777373603186e4416f064931d529878ec783759f31fd99e1119bb0604e8a89dc98d350f80eca2bfef05a13bca7ce24302408072002c0b17b2
|
DIST iproute2-5.15.0.tar.xz 858068 BLAKE2B bca20ac53e1b2b3ae06186f655ad5073a0e691ed7b3aab25c4fbc118847b72a8a522175732cd22d8ec27480d1ab142319e80a5c3628434bec21260e585e1591d SHA512 e94918fa10e523224b965c7cb5303a101745e89c90d149d2d9876a002b2a894b1c689c519dc22168f3d334c3ee0810c59ec43223baab3d5f4c56f017d6281f22
|
||||||
DIST iproute2-4.13.0.tar.xz 670340 SHA256 9cfb81edf8c8509e03daa77cf62aead01c4a827132f6c506578f94cc19415c50 SHA512 f96d2839aec1f439bfac504c8e3881c063dacbf4c67b15f0e3da9882d2fa013cba33c23602de3eab624e0eecbb911a13967d60bddcdf097f47a580a5a77b5e3a WHIRLPOOL 757247f1356eef49b299019f6d1809e5d781471665daedce885201b7034a6138def73c84ba2f0453f2f0f5d55cc2edf778992b3d79d06e01364c511373ea4644
|
|
||||||
DIST iproute2-4.4.0.tar.xz 528552 SHA256 bc91c367288a19f78ef800cd6840363be1f22da8436fbae88e1a7250490d6514 SHA512 48236fc6103a55d977efa4f93ad7fdfc0944df975ce771d57fd3dcfb13b761b0c05dbe749978ac86c7a471d023bee62a2f1648a6ca75f50da9252acfde174b69 WHIRLPOOL 7e90c98805e12b28de284bb998e5a27cf524a78d0bd7632c0d49a7ddff8f11f5229ac6867076e9fea6f21b6b31360bddb21138673d94de766bdf7324a09bc013
|
|
||||||
DIST iproute2-4.5.0.tar.xz 554500 SHA256 3f15292f53e465cb5bd6652961343ca64eb6936309ae75be5d5a541435bc494a SHA512 d12be24cf7a1102be8e449d1e95fa67b784d505e98fcf2f18caedf0136fb378dc439f74a75bc0d6ef5b2893e5ca1968e122054404c1f4d1a212aeb0fba1c5860 WHIRLPOOL dc660bde36fed126b27fb69a59c02405b5299b92a6b519ebdce74d817f88be82114bb10217ca34bbc26a89e664ff243e606a84bcb00db41088bce824542def40
|
|
||||||
DIST iproute2-4.6.0.tar.xz 570960 SHA256 74fc6a8ad085be095a159f8158bbaf385b42af9e101619f233f1ae466829d406 SHA512 1e3868ced65012da6724744eb15e6bb8e2c5bf8d7a46cf2b655526de1a9e1224c7b7e9bd4a88e40516b5648955987eb9001600ca5afbd507bc664f92b51ede9f WHIRLPOOL 1b0ff7988d6d5567137aca9d41e2cc3183f3620f8b874113ff9e6ca9508349550e388e423c54b165e73ed54ccb7a366ef8d032a930f27722eccbd5ff6879032e
|
|
||||||
DIST iproute2-4.7.0.tar.xz 589928 SHA256 8f60dbcfb33a79daae0638f53bdcaa4310c0aa59ae39af8a234020dc69bb7b92 SHA512 dd884b192ede7f165d565dce6819fb7280eda880d4d53e06a604ab20e7ce343ba37847750172fd52061892e9db3d18bd8ae13d37bd4410e50a8f704cb3fe4ece WHIRLPOOL 191335f76f816ec1c86b2b9cac398129a475993e5a6366d0d0a35287eb07ae61d873e1a8a25a0083b28953011d8dfd492e7a718bacfd7f872130cdb2e3a5729d
|
|
||||||
DIST iproute2-4.8.0.tar.xz 594636 SHA256 a30959c8421bc8ef42719bed41d14e1d7cfdbad80d7d70c5c42ad31f2c2cb389 SHA512 9b9db053e5d6ae2e7dd17870a3081ef61788a7eeb07473430e1a26c3c948123d33840bd6bb81b4a553ac6913ea89f02ac2a1b7d52ced65523a43991f03e84f49 WHIRLPOOL 83015c0bcfc6739ce688307a6824047910d453265883d4fbb9bec67c8720a5f478d2d72e5095ffc75191e64f3525a25f019032f20fc428b622e4a5c1b8fcbe3d
|
|
||||||
DIST iproute2-4.9.0.tar.xz 613032 SHA256 c0f30f043f7767cc1b2cd2197b08d4e9b2392c95823fabe30bbce308c30116c4 SHA512 0d974d7c001eac75def0d90b628e432d9847024843d02a6cd27266ff30e3f7a9c874fa91115da74db5f321c2e815b486a847059ca6df3aa8ea49432ffa39a889 WHIRLPOOL 83c8d42ef43f42a58835ff3b1df7460c67db4de1ae9d5df775d8aa15bfe2c488a626dd40c4327c2772436ed88bea1a1f57a953cd6bf650955465e76aec9476a2
|
|
||||||
DIST iproute2-5.8.0.tar.xz 780612 BLAKE2B 5d86af8d981f5e9582d5eb0aaffbe15891964a86f3a1da408ce2f46101b1bb6beac8d4492dab1865391c212ef596c9256b680bdcb346d440e38cbb636a23cdc1 SHA512 f2a3f7dcf5cb39ca7cd14f0e40e45641eccf4b93427c527a09fd789ac8621c5c3359769ca61fcc8bab7e915edd943c39b7c3e15cbfc497187aa6271eed0a9152
|
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
From 2ac2f416072d9968a9ea2dd9f48168223a1147b0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Baruch Siach <baruch@tkos.co.il>
|
|
||||||
Date: Tue, 18 Jul 2017 14:09:06 +0300
|
|
||||||
Subject: [PATCH] Fix build with uClibc-ng
|
|
||||||
|
|
||||||
Add a local definition for IPPROTO_MH to fix build with uClibc-ng. As of
|
|
||||||
version 1.0.25, the uClibc-ng netinet/in.h header does not provide this
|
|
||||||
definition. The kernel provided definition is masked by libc-compat.h. Add
|
|
||||||
this local fix until uClibc-ng syncs netinet/in.h with glibc.
|
|
||||||
|
|
||||||
This partially reverts upstream commit a9ae195a2169 (xfrm: get #define's from
|
|
||||||
linux includes)
|
|
||||||
|
|
||||||
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
|
|
||||||
---
|
|
||||||
Upstream status: non upstreamable; local uClibc-ng compatibility fix
|
|
||||||
---
|
|
||||||
ip/xfrm.h | 4 ++++
|
|
||||||
1 file changed, 4 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/ip/xfrm.h b/ip/xfrm.h
|
|
||||||
index 54d80ce5e949..50b85550fb45 100644
|
|
||||||
--- a/ip/xfrm.h
|
|
||||||
+++ b/ip/xfrm.h
|
|
||||||
@@ -30,6 +30,10 @@
|
|
||||||
#include <linux/xfrm.h>
|
|
||||||
#include <linux/ipsec.h>
|
|
||||||
|
|
||||||
+#ifndef IPPROTO_MH
|
|
||||||
+# define IPPROTO_MH 135
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
#define XFRMS_RTA(x) ((struct rtattr*)(((char*)(x)) + NLMSG_ALIGN(sizeof(struct xfrm_usersa_info))))
|
|
||||||
#define XFRMS_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct xfrm_usersa_info))
|
|
||||||
|
|
||||||
--
|
|
||||||
2.13.2
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
|||||||
--- iproute2-4.2.0/ip/ipmonitor.c
|
|
||||||
+++ iproute2-4.2.0/ip/ipmonitor.c
|
|
||||||
@@ -115,7 +115,6 @@
|
|
||||||
}
|
|
||||||
if (n->nlmsg_type == RTM_NEWPREFIX) {
|
|
||||||
print_headers(fp, "[PREFIX]", ctrl);
|
|
||||||
- print_prefix(who, n, arg);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (n->nlmsg_type == RTM_NEWRULE || n->nlmsg_type == RTM_DELRULE) {
|
|
||||||
--- iproute2-4.2.0/ip/iptunnel.c
|
|
||||||
+++ iproute2-4.2.0/ip/iptunnel.c
|
|
||||||
@@ -637,13 +637,6 @@
|
|
||||||
break;
|
|
||||||
case AF_INET:
|
|
||||||
break;
|
|
||||||
- /*
|
|
||||||
- * This is silly enough but we have no easy way to make it
|
|
||||||
- * protocol-independent because of unarranged structure between
|
|
||||||
- * IPv4 and IPv6.
|
|
||||||
- */
|
|
||||||
- case AF_INET6:
|
|
||||||
- return do_ip6tunnel(argc, argv);
|
|
||||||
default:
|
|
||||||
fprintf(stderr, "Unsupported protocol family: %d\n", preferred_family);
|
|
||||||
exit(-1);
|
|
||||||
--- iproute2-4.2.0/ip/Makefile
|
|
||||||
+++ iproute2-4.2.0/ip/Makefile
|
|
||||||
@@ -1,6 +1,6 @@
|
|
||||||
IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \
|
|
||||||
- rtm_map.o iptunnel.o ip6tunnel.o tunnel.o ipneigh.o ipntable.o iplink.o \
|
|
||||||
- ipmaddr.o ipmonitor.o ipmroute.o ipprefix.o iptuntap.o iptoken.o \
|
|
||||||
+ rtm_map.o iptunnel.o tunnel.o ipneigh.o ipntable.o iplink.o \
|
|
||||||
+ ipmaddr.o ipmonitor.o ipmroute.o iptuntap.o iptoken.o \
|
|
||||||
ipxfrm.o xfrm_state.o xfrm_policy.o xfrm_monitor.o \
|
|
||||||
iplink_vlan.o link_veth.o link_gre.o iplink_can.o \
|
|
||||||
iplink_macvlan.o iplink_macvtap.o ipl2tp.o link_vti.o link_vti6.o \
|
|
@ -1,16 +1,16 @@
|
|||||||
--- iproute2-4.11.0/ip/ipmonitor.c
|
--- iproute2-4.20.0/ip/ipmonitor.c
|
||||||
+++ iproute2-4.11.0/ip/ipmonitor.c
|
+++ iproute2-4.20.0/ip/ipmonitor.c
|
||||||
@@ -114,7 +114,6 @@
|
@@ -118,7 +118,6 @@
|
||||||
}
|
|
||||||
if (n->nlmsg_type == RTM_NEWPREFIX) {
|
case RTM_NEWPREFIX:
|
||||||
print_headers(fp, "[PREFIX]", ctrl);
|
print_headers(fp, "[PREFIX]", ctrl);
|
||||||
- print_prefix(who, n, arg);
|
- print_prefix(n, arg);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
if (n->nlmsg_type == RTM_NEWRULE || n->nlmsg_type == RTM_DELRULE) {
|
case RTM_NEWRULE:
|
||||||
--- iproute2-4.11.0/ip/iptunnel.c
|
--- iproute2-4.20.0/ip/iptunnel.c
|
||||||
+++ iproute2-4.11.0/ip/iptunnel.c
|
+++ iproute2-4.20.0/ip/iptunnel.c
|
||||||
@@ -589,13 +589,6 @@
|
@@ -549,13 +549,6 @@
|
||||||
break;
|
break;
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
break;
|
break;
|
||||||
@ -24,14 +24,15 @@
|
|||||||
default:
|
default:
|
||||||
fprintf(stderr, "Unsupported protocol family: %d\n", preferred_family);
|
fprintf(stderr, "Unsupported protocol family: %d\n", preferred_family);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
--- iproute2-4.11.0/ip/Makefile
|
--- iproute2-4.20.0/ip/Makefile
|
||||||
+++ iproute2-4.11.0/ip/Makefile
|
+++ iproute2-4.20.0/ip/Makefile
|
||||||
@@ -1,6 +1,6 @@
|
@@ -1,7 +1,7 @@
|
||||||
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \
|
IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \
|
||||||
- rtm_map.o iptunnel.o ip6tunnel.o tunnel.o ipneigh.o ipntable.o iplink.o \
|
- rtm_map.o iptunnel.o ip6tunnel.o tunnel.o ipneigh.o ipntable.o iplink.o \
|
||||||
- ipmaddr.o ipmonitor.o ipmroute.o ipprefix.o iptuntap.o iptoken.o \
|
- ipmaddr.o ipmonitor.o ipmroute.o ipprefix.o iptuntap.o iptoken.o \
|
||||||
+ rtm_map.o iptunnel.o tunnel.o ipneigh.o ipntable.o iplink.o \
|
+ rtm_map.o iptunnel.o tunnel.o ipneigh.o ipntable.o iplink.o \
|
||||||
+ ipmaddr.o ipmonitor.o ipmroute.o iptuntap.o iptoken.o \
|
+ ipmaddr.o ipmonitor.o ipmroute.o iptuntap.o iptoken.o \
|
||||||
ipxfrm.o xfrm_state.o xfrm_policy.o xfrm_monitor.o iplink_dummy.o \
|
ipxfrm.o xfrm_state.o xfrm_policy.o xfrm_monitor.o iplink_dummy.o \
|
||||||
iplink_ifb.o iplink_nlmon.o iplink_team.o iplink_vcan.o \
|
iplink_ifb.o iplink_nlmon.o iplink_team.o iplink_vcan.o iplink_vxcan.o \
|
||||||
iplink_vlan.o link_veth.o link_gre.o iplink_can.o iplink_xdp.o \
|
iplink_vlan.o link_veth.o link_gre.o iplink_can.o iplink_xdp.o \
|
@ -1,42 +0,0 @@
|
|||||||
--- iproute2-4.5.0/configure~ 2016-03-14 23:02:31.000000000 +0000
|
|
||||||
+++ iproute2-4.5.0/configure 2016-03-17 13:24:17.634743197 +0000
|
|
||||||
@@ -169,10 +169,25 @@
|
|
||||||
|
|
||||||
check_ipt()
|
|
||||||
{
|
|
||||||
- if ! grep TC_CONFIG_XT Config > /dev/null
|
|
||||||
+ if grep -q TC_CONFIG_XT Config
|
|
||||||
then
|
|
||||||
+ return
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
+ cat >$TMPDIR/ipttest.c <<EOF
|
|
||||||
+#include <iptables.h>
|
|
||||||
+int main() { return 0; }
|
|
||||||
+EOF
|
|
||||||
+
|
|
||||||
+ if $CC -std=c90 -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL \
|
|
||||||
+ $(${PKG_CONFIG} libiptc --cflags --libs 2>/dev/null) -ldl >/dev/null 2>&1
|
|
||||||
+ then
|
|
||||||
+ echo "TC_CONFIG_IPT:=y" >>Config
|
|
||||||
echo "using iptables"
|
|
||||||
+ else
|
|
||||||
+ echo "no"
|
|
||||||
fi
|
|
||||||
+ rm -f $TMPDIR/ipttest.c $TMPDIR/ipttest
|
|
||||||
}
|
|
||||||
|
|
||||||
check_ipt_lib_dir()
|
|
||||||
--- iproute2-4.5.0/tc/Makefile~ 2016-03-14 23:02:31.000000000 +0000
|
|
||||||
+++ iproute2-4.5.0/tc/Makefile 2016-03-17 13:18:18.686689985 +0000
|
|
||||||
@@ -88,7 +88,9 @@
|
|
||||||
CFLAGS += -DTC_CONFIG_XT_H
|
|
||||||
TCSO += m_xt_old.so
|
|
||||||
else
|
|
||||||
- TCMODULES += m_ipt.o
|
|
||||||
+ ifeq ($(TC_CONFIG_IPT),y)
|
|
||||||
+ TCMODULES += m_ipt.o
|
|
||||||
+ endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
@ -1,32 +0,0 @@
|
|||||||
From 202d79fcf4e184818bd074f8c06e94e700670898 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jory Pratt <anarchy@gentoo.org>
|
|
||||||
Date: Tue, 11 Jun 2019 01:48:01 -0500
|
|
||||||
Subject: [PATCH] including sysinfo.h from kernel.h makes no sense whatsoever,
|
|
||||||
but removing it breaks glibc's userspace header, which includes kernel.h
|
|
||||||
instead of sysinfo.h from their sys/sysinfo.h. this seems to be a historical
|
|
||||||
mistake. on musl, including any header that uses kernel.h directly or
|
|
||||||
indirectly plus sys/sysinfo.h will produce a compile error due to
|
|
||||||
redefinition of struct sysinfo. so for now, only include it on glibc in order
|
|
||||||
not to break their headers.
|
|
||||||
|
|
||||||
Signed-off-by: Jory Pratt <anarchy@gentoo.org>
|
|
||||||
---
|
|
||||||
include/uapi/linux/kernel.h | 2 ++
|
|
||||||
1 file changed, 2 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/include/uapi/linux/kernel.h b/include/uapi/linux/kernel.h
|
|
||||||
index d99ffa1..f917115 100644
|
|
||||||
--- a/include/uapi/linux/kernel.h
|
|
||||||
+++ b/include/uapi/linux/kernel.h
|
|
||||||
@@ -2,7 +2,9 @@
|
|
||||||
#ifndef _LINUX_KERNEL_H
|
|
||||||
#define _LINUX_KERNEL_H
|
|
||||||
|
|
||||||
+#ifdef __GLIBC__
|
|
||||||
#include <linux/sysinfo.h>
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 'kernel.h' contains some often-used function prototypes etc
|
|
||||||
--
|
|
||||||
2.22.0
|
|
@ -9,7 +9,7 @@ are only passed when correctly needed.
|
|||||||
|
|
||||||
Prior Gentoo testcase for reproduction:
|
Prior Gentoo testcase for reproduction:
|
||||||
USE=minimal ebuild ... compile.
|
USE=minimal ebuild ... compile.
|
||||||
- Linking with libelf, libmnl & libcap based only on presence.
|
- Linking with libbsd, libelf, libmnl & libcap based only on presence.
|
||||||
- Links based on libselinux based only on presence.
|
- Links based on libselinux based only on presence.
|
||||||
|
|
||||||
Closes: https://bugs.gentoo.org/643722
|
Closes: https://bugs.gentoo.org/643722
|
||||||
@ -18,9 +18,11 @@ Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
|
|||||||
Forward-ported from v4.14.1 to v4.16.0 by Lars Wendler <polynomial-c@gentoo.org>
|
Forward-ported from v4.14.1 to v4.16.0 by Lars Wendler <polynomial-c@gentoo.org>
|
||||||
Added libcap to v4.17.0 by Lars Wendler <polynomial-c@gentoo.org>
|
Added libcap to v4.17.0 by Lars Wendler <polynomial-c@gentoo.org>
|
||||||
Forward-ported from v4.17.0 to v4.20.0 by Lars Wendler <polynomial-c@gentoo.org>
|
Forward-ported from v4.17.0 to v4.20.0 by Lars Wendler <polynomial-c@gentoo.org>
|
||||||
|
Forward-ported from v4.20.0 to v5.11.0 by Lars Wendler <polynomial-c@gentoo.org>
|
||||||
|
Forward-ported from v5.11.0 to v5.12.0 by Lars Wendler <polynomial-c@gentoo.org>
|
||||||
|
|
||||||
--- iproute2-4.20.0/bridge/Makefile
|
--- iproute2-5.12.0/bridge/Makefile
|
||||||
+++ iproute2-4.20.0/bridge/Makefile
|
+++ iproute2-5.12.0/bridge/Makefile
|
||||||
@@ -2,6 +2,7 @@
|
@@ -2,6 +2,7 @@
|
||||||
BROBJ = bridge.o fdb.o monitor.o link.o mdb.o vlan.o
|
BROBJ = bridge.o fdb.o monitor.o link.o mdb.o vlan.o
|
||||||
|
|
||||||
@ -29,9 +31,9 @@ Forward-ported from v4.17.0 to v4.20.0 by Lars Wendler <polynomial-c@gentoo.org>
|
|||||||
|
|
||||||
all: bridge
|
all: bridge
|
||||||
|
|
||||||
--- iproute2-4.20.0/config.include
|
--- iproute2-5.12.0/config.include
|
||||||
+++ iproute2-4.20.0/config.include
|
+++ iproute2-5.12.0/config.include
|
||||||
@@ -0,0 +1,26 @@
|
@@ -0,0 +1,32 @@
|
||||||
+# We can only modify CFLAGS/LDLIBS after all the config options are known.
|
+# We can only modify CFLAGS/LDLIBS after all the config options are known.
|
||||||
+ifeq ($(IP_CONFIG_SETNS),y)
|
+ifeq ($(IP_CONFIG_SETNS),y)
|
||||||
+ CFLAGS += $(IP_CONFIG_SETNS_CFLAGS)
|
+ CFLAGS += $(IP_CONFIG_SETNS_CFLAGS)
|
||||||
@ -52,15 +54,21 @@ Forward-ported from v4.17.0 to v4.20.0 by Lars Wendler <polynomial-c@gentoo.org>
|
|||||||
+ CFLAGS += $(HAVE_CAP_CFLAGS)
|
+ CFLAGS += $(HAVE_CAP_CFLAGS)
|
||||||
+ LDLIBS += $(HAVE_CAP_LDLIBS)
|
+ LDLIBS += $(HAVE_CAP_LDLIBS)
|
||||||
+endif
|
+endif
|
||||||
|
+ifeq ($(HAVE_LIBBSD),y)
|
||||||
|
+ CFLAGS += $(HAVE_LIBBSD_CFLAGS)
|
||||||
|
+ LDLIBS += $(HAVE_LIBBSD_LDLIBS)
|
||||||
|
+else
|
||||||
|
+ CFLAGS += -DNEED_STRLCPY
|
||||||
|
+endif
|
||||||
+
|
+
|
||||||
+# Rules can only be declared after all variables in them are known.
|
+# Rules can only be declared after all variables in them are known.
|
||||||
+%.o: %.c
|
+%.o: %.c
|
||||||
+ $(QUIET_CC)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CPPFLAGS) -c -o $@ $<
|
+ $(QUIET_CC)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CPPFLAGS) -c -o $@ $<
|
||||||
+
|
+
|
||||||
+# vim: ft=make:
|
+# vim: ft=make:
|
||||||
--- iproute2-4.20.0/configure
|
--- iproute2-5.12.0/configure
|
||||||
+++ iproute2-4.20.0/configure
|
+++ iproute2-5.12.0/configure
|
||||||
@@ -188,7 +188,7 @@
|
@@ -195,7 +195,7 @@
|
||||||
if $CC -I$INCLUDE -o $TMPDIR/setnstest $TMPDIR/setnstest.c >/dev/null 2>&1; then
|
if $CC -I$INCLUDE -o $TMPDIR/setnstest $TMPDIR/setnstest.c >/dev/null 2>&1; then
|
||||||
echo "IP_CONFIG_SETNS:=y" >>$CONFIG
|
echo "IP_CONFIG_SETNS:=y" >>$CONFIG
|
||||||
echo "yes"
|
echo "yes"
|
||||||
@ -69,7 +77,7 @@ Forward-ported from v4.17.0 to v4.20.0 by Lars Wendler <polynomial-c@gentoo.org>
|
|||||||
else
|
else
|
||||||
echo "no"
|
echo "no"
|
||||||
fi
|
fi
|
||||||
@@ -231,8 +231,8 @@
|
@@ -238,8 +238,8 @@
|
||||||
echo "HAVE_ELF:=y" >>$CONFIG
|
echo "HAVE_ELF:=y" >>$CONFIG
|
||||||
echo "yes"
|
echo "yes"
|
||||||
|
|
||||||
@ -80,7 +88,7 @@ Forward-ported from v4.17.0 to v4.20.0 by Lars Wendler <polynomial-c@gentoo.org>
|
|||||||
else
|
else
|
||||||
echo "no"
|
echo "no"
|
||||||
fi
|
fi
|
||||||
@@ -245,8 +245,8 @@
|
@@ -357,8 +357,8 @@
|
||||||
echo "HAVE_SELINUX:=y" >>$CONFIG
|
echo "HAVE_SELINUX:=y" >>$CONFIG
|
||||||
echo "yes"
|
echo "yes"
|
||||||
|
|
||||||
@ -91,7 +99,7 @@ Forward-ported from v4.17.0 to v4.20.0 by Lars Wendler <polynomial-c@gentoo.org>
|
|||||||
else
|
else
|
||||||
echo "no"
|
echo "no"
|
||||||
fi
|
fi
|
||||||
@@ -258,8 +258,8 @@
|
@@ -370,8 +370,8 @@
|
||||||
echo "HAVE_MNL:=y" >>$CONFIG
|
echo "HAVE_MNL:=y" >>$CONFIG
|
||||||
echo "yes"
|
echo "yes"
|
||||||
|
|
||||||
@ -102,7 +110,18 @@ Forward-ported from v4.17.0 to v4.20.0 by Lars Wendler <polynomial-c@gentoo.org>
|
|||||||
else
|
else
|
||||||
echo "no"
|
echo "no"
|
||||||
fi
|
fi
|
||||||
@@ -316,8 +316,8 @@
|
@@ -411,8 +411,8 @@
|
||||||
|
echo "no"
|
||||||
|
else
|
||||||
|
if ${PKG_CONFIG} libbsd --exists; then
|
||||||
|
- echo 'CFLAGS += -DHAVE_LIBBSD' `${PKG_CONFIG} libbsd --cflags` >>$CONFIG
|
||||||
|
- echo 'LDLIBS +=' `${PKG_CONFIG} libbsd --libs` >> $CONFIG
|
||||||
|
+ echo 'HAVE_LIBBSD_CFLAGS += -DHAVE_LIBBSD' `${PKG_CONFIG} libbsd --cflags` >>$CONFIG
|
||||||
|
+ echo 'HAVE_LIBBSD_LDLIBS +=' `${PKG_CONFIG} libbsd --libs` >> $CONFIG
|
||||||
|
echo "no"
|
||||||
|
else
|
||||||
|
echo 'CFLAGS += -DNEED_STRLCPY' >>$CONFIG
|
||||||
|
@@ -428,8 +428,8 @@
|
||||||
echo "HAVE_CAP:=y" >>$CONFIG
|
echo "HAVE_CAP:=y" >>$CONFIG
|
||||||
echo "yes"
|
echo "yes"
|
||||||
|
|
||||||
@ -113,7 +132,7 @@ Forward-ported from v4.17.0 to v4.20.0 by Lars Wendler <polynomial-c@gentoo.org>
|
|||||||
else
|
else
|
||||||
echo "no"
|
echo "no"
|
||||||
fi
|
fi
|
||||||
@@ -397,7 +397,3 @@
|
@@ -512,7 +512,3 @@
|
||||||
|
|
||||||
echo -n "libcap support: "
|
echo -n "libcap support: "
|
||||||
check_cap
|
check_cap
|
||||||
@ -121,8 +140,8 @@ Forward-ported from v4.17.0 to v4.20.0 by Lars Wendler <polynomial-c@gentoo.org>
|
|||||||
-echo >> $CONFIG
|
-echo >> $CONFIG
|
||||||
-echo "%.o: %.c" >> $CONFIG
|
-echo "%.o: %.c" >> $CONFIG
|
||||||
-echo ' $(QUIET_CC)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CPPFLAGS) -c -o $@ $<' >> $CONFIG
|
-echo ' $(QUIET_CC)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CPPFLAGS) -c -o $@ $<' >> $CONFIG
|
||||||
--- iproute2-4.20.0/devlink/Makefile
|
--- iproute2-5.12.0/dcb/Makefile
|
||||||
+++ iproute2-4.20.0/devlink/Makefile
|
+++ iproute2-5.12.0/dcb/Makefile
|
||||||
@@ -1,5 +1,6 @@
|
@@ -1,5 +1,6 @@
|
||||||
# SPDX-License-Identifier: GPL-2.0
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
include ../config.mk
|
include ../config.mk
|
||||||
@ -130,8 +149,17 @@ Forward-ported from v4.17.0 to v4.20.0 by Lars Wendler <polynomial-c@gentoo.org>
|
|||||||
|
|
||||||
TARGETS :=
|
TARGETS :=
|
||||||
|
|
||||||
--- iproute2-4.20.0/genl/Makefile
|
--- iproute2-5.12.0/devlink/Makefile
|
||||||
+++ iproute2-4.20.0/genl/Makefile
|
+++ iproute2-5.12.0/devlink/Makefile
|
||||||
|
@@ -1,5 +1,6 @@
|
||||||
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
|
include ../config.mk
|
||||||
|
+include ../config.include
|
||||||
|
|
||||||
|
TARGETS :=
|
||||||
|
|
||||||
|
--- iproute2-5.12.0/genl/Makefile
|
||||||
|
+++ iproute2-5.12.0/genl/Makefile
|
||||||
@@ -2,6 +2,7 @@
|
@@ -2,6 +2,7 @@
|
||||||
GENLOBJ=genl.o
|
GENLOBJ=genl.o
|
||||||
|
|
||||||
@ -140,9 +168,9 @@ Forward-ported from v4.17.0 to v4.20.0 by Lars Wendler <polynomial-c@gentoo.org>
|
|||||||
SHARED_LIBS ?= y
|
SHARED_LIBS ?= y
|
||||||
|
|
||||||
CFLAGS += -fno-strict-aliasing
|
CFLAGS += -fno-strict-aliasing
|
||||||
--- iproute2-4.20.0/ip/Makefile
|
--- iproute2-5.12.0/ip/Makefile
|
||||||
+++ iproute2-4.20.0/ip/Makefile
|
+++ iproute2-5.12.0/ip/Makefile
|
||||||
@@ -15,6 +15,7 @@
|
@@ -16,6 +16,7 @@
|
||||||
RTMONOBJ=rtmon.o
|
RTMONOBJ=rtmon.o
|
||||||
|
|
||||||
include ../config.mk
|
include ../config.mk
|
||||||
@ -150,8 +178,8 @@ Forward-ported from v4.17.0 to v4.20.0 by Lars Wendler <polynomial-c@gentoo.org>
|
|||||||
|
|
||||||
ALLOBJ=$(IPOBJ) $(RTMONOBJ)
|
ALLOBJ=$(IPOBJ) $(RTMONOBJ)
|
||||||
SCRIPTS=ifcfg rtpr routel routef
|
SCRIPTS=ifcfg rtpr routel routef
|
||||||
--- iproute2-4.20.0/lib/Makefile
|
--- iproute2-5.12.0/lib/Makefile
|
||||||
+++ iproute2-4.20.0/lib/Makefile
|
+++ iproute2-5.12.0/lib/Makefile
|
||||||
@@ -1,5 +1,6 @@
|
@@ -1,5 +1,6 @@
|
||||||
# SPDX-License-Identifier: GPL-2.0
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
include ../config.mk
|
include ../config.mk
|
||||||
@ -159,8 +187,8 @@ Forward-ported from v4.17.0 to v4.20.0 by Lars Wendler <polynomial-c@gentoo.org>
|
|||||||
|
|
||||||
CFLAGS += -fPIC
|
CFLAGS += -fPIC
|
||||||
|
|
||||||
--- iproute2-4.20.0/misc/Makefile
|
--- iproute2-5.12.0/misc/Makefile
|
||||||
+++ iproute2-4.20.0/misc/Makefile
|
+++ iproute2-5.12.0/misc/Makefile
|
||||||
@@ -5,6 +5,7 @@
|
@@ -5,6 +5,7 @@
|
||||||
TARGETS=ss nstat ifstat rtacct lnstat
|
TARGETS=ss nstat ifstat rtacct lnstat
|
||||||
|
|
||||||
@ -169,8 +197,8 @@ Forward-ported from v4.17.0 to v4.20.0 by Lars Wendler <polynomial-c@gentoo.org>
|
|||||||
|
|
||||||
ifeq ($(HAVE_BERKELEY_DB),y)
|
ifeq ($(HAVE_BERKELEY_DB),y)
|
||||||
TARGETS += arpd
|
TARGETS += arpd
|
||||||
--- iproute2-4.20.0/netem/Makefile
|
--- iproute2-5.12.0/netem/Makefile
|
||||||
+++ iproute2-4.20.0/netem/Makefile
|
+++ iproute2-5.12.0/netem/Makefile
|
||||||
@@ -1,5 +1,6 @@
|
@@ -1,5 +1,6 @@
|
||||||
# SPDX-License-Identifier: GPL-2.0
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
include ../config.mk
|
include ../config.mk
|
||||||
@ -178,27 +206,36 @@ Forward-ported from v4.17.0 to v4.20.0 by Lars Wendler <polynomial-c@gentoo.org>
|
|||||||
|
|
||||||
DISTGEN = maketable normal pareto paretonormal
|
DISTGEN = maketable normal pareto paretonormal
|
||||||
DISTDATA = normal.dist pareto.dist paretonormal.dist experimental.dist
|
DISTDATA = normal.dist pareto.dist paretonormal.dist experimental.dist
|
||||||
--- iproute2-4.20.0/rdma/Makefile
|
--- iproute2-5.12.0/rdma/Makefile
|
||||||
+++ iproute2-4.20.0/rdma/Makefile
|
+++ iproute2-5.12.0/rdma/Makefile
|
||||||
@@ -1,5 +1,6 @@
|
@@ -1,5 +1,6 @@
|
||||||
# SPDX-License-Identifier: GPL-2.0
|
# SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
|
||||||
include ../config.mk
|
include ../config.mk
|
||||||
+include ../config.include
|
+include ../config.include
|
||||||
|
|
||||||
TARGETS :=
|
TARGETS :=
|
||||||
|
|
||||||
--- iproute2-4.20.0/tc/Makefile
|
--- iproute2-5.12.0/tc/Makefile
|
||||||
+++ iproute2-4.20.0/tc/Makefile
|
+++ iproute2-5.12.0/tc/Makefile
|
||||||
@@ -4,6 +4,7 @@
|
@@ -4,6 +4,7 @@
|
||||||
emp_ematch.yacc.o emp_ematch.lex.o
|
emp_ematch.tab.o emp_ematch.lex.o
|
||||||
|
|
||||||
include ../config.mk
|
include ../config.mk
|
||||||
+include ../config.include
|
+include ../config.include
|
||||||
|
|
||||||
SHARED_LIBS ?= y
|
SHARED_LIBS ?= y
|
||||||
|
|
||||||
--- iproute2-4.20.0/tipc/Makefile
|
--- iproute2-5.12.0/tipc/Makefile
|
||||||
+++ iproute2-4.20.0/tipc/Makefile
|
+++ iproute2-5.12.0/tipc/Makefile
|
||||||
|
@@ -1,5 +1,6 @@
|
||||||
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
|
include ../config.mk
|
||||||
|
+include ../config.include
|
||||||
|
|
||||||
|
TARGETS :=
|
||||||
|
|
||||||
|
--- iproute2-5.12.0/vdpa/Makefile
|
||||||
|
+++ iproute2-5.12.0/vdpa/Makefile
|
||||||
@@ -1,5 +1,6 @@
|
@@ -1,5 +1,6 @@
|
||||||
# SPDX-License-Identifier: GPL-2.0
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
include ../config.mk
|
include ../config.mk
|
@ -1,138 +0,0 @@
|
|||||||
# Copyright 1999-2017 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
|
|
||||||
EAPI="5"
|
|
||||||
|
|
||||||
inherit eutils toolchain-funcs flag-o-matic multilib
|
|
||||||
|
|
||||||
if [[ ${PV} == "9999" ]] ; then
|
|
||||||
EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
|
|
||||||
inherit git-2
|
|
||||||
else
|
|
||||||
SRC_URI="https://www.kernel.org/pub/linux/utils/net/${PN}/${P}.tar.xz"
|
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
|
|
||||||
fi
|
|
||||||
|
|
||||||
DESCRIPTION="kernel routing and traffic control utilities"
|
|
||||||
HOMEPAGE="https://wiki.linuxfoundation.org/networking/iproute2"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
SLOT="0"
|
|
||||||
IUSE="atm berkdb +iptables ipv6 minimal selinux"
|
|
||||||
|
|
||||||
# We could make libmnl optional, but it's tiny, so eh
|
|
||||||
RDEPEND="!net-misc/arpd
|
|
||||||
!minimal? ( net-libs/libmnl )
|
|
||||||
iptables? ( >=net-firewall/iptables-1.4.20:= )
|
|
||||||
berkdb? ( sys-libs/db:= )
|
|
||||||
atm? ( net-dialup/linux-atm )
|
|
||||||
selinux? ( sys-libs/libselinux )"
|
|
||||||
# We require newer linux-headers for ipset support #549948 and some defines #553876
|
|
||||||
DEPEND="${RDEPEND}
|
|
||||||
app-arch/xz-utils
|
|
||||||
iptables? ( virtual/pkgconfig )
|
|
||||||
sys-devel/bison
|
|
||||||
sys-devel/flex
|
|
||||||
>=sys-kernel/linux-headers-3.16
|
|
||||||
elibc_glibc? ( >=sys-libs/glibc-2.7 )"
|
|
||||||
|
|
||||||
PATCHES=(
|
|
||||||
"${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
|
|
||||||
)
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
if ! use ipv6 ; then
|
|
||||||
PATCHES+=(
|
|
||||||
"${FILESDIR}"/${PN}-4.2.0-no-ipv6.patch #326849
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
||||||
epatch "${PATCHES[@]}"
|
|
||||||
|
|
||||||
sed -i \
|
|
||||||
-e '/^CC :=/d' \
|
|
||||||
-e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
|
|
||||||
-e "s:-O2:${CFLAGS} ${CPPFLAGS}:" \
|
|
||||||
-e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
|
|
||||||
-e "/^WFLAGS/s:-Werror::" \
|
|
||||||
-e "/^DBM_INCLUDE/s:=.*:=${T}:" \
|
|
||||||
Makefile || die
|
|
||||||
|
|
||||||
# Use /run instead of /var/run.
|
|
||||||
sed -i \
|
|
||||||
-e 's:/var/run:/run:g' \
|
|
||||||
include/namespace.h \
|
|
||||||
man/man8/ip-netns.8 || die
|
|
||||||
|
|
||||||
# build against system headers
|
|
||||||
rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
|
|
||||||
sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
|
|
||||||
|
|
||||||
use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc ip:' Makefile
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
tc-export AR CC PKG_CONFIG
|
|
||||||
|
|
||||||
# This sure is ugly. Should probably move into toolchain-funcs at some point.
|
|
||||||
local setns
|
|
||||||
pushd "${T}" >/dev/null
|
|
||||||
printf '#include <sched.h>\nint main(){return setns(0, 0);}\n' > test.c
|
|
||||||
${CC} ${CFLAGS} ${CPPFLAGS} -D_GNU_SOURCE ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
|
|
||||||
echo 'int main(){return 0;}' > test.c
|
|
||||||
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
|
|
||||||
popd >/dev/null
|
|
||||||
|
|
||||||
cat <<-EOF > Config
|
|
||||||
TC_CONFIG_ATM := $(usex atm y n)
|
|
||||||
TC_CONFIG_XT := $(usex iptables y n)
|
|
||||||
TC_CONFIG_NO_XT := $(usex iptables n y)
|
|
||||||
# We've locked in recent enough kernel headers #549948
|
|
||||||
TC_CONFIG_IPSET := y
|
|
||||||
HAVE_BERKELEY_DB := $(usex berkdb y n)
|
|
||||||
HAVE_MNL := $(usex minimal n y)
|
|
||||||
HAVE_SELINUX := $(usex selinux y n)
|
|
||||||
IP_CONFIG_SETNS := ${setns}
|
|
||||||
# Use correct iptables dir, #144265 #293709
|
|
||||||
IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
if use minimal ; then
|
|
||||||
into /
|
|
||||||
dosbin tc/tc
|
|
||||||
dobin ip/ip
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
emake \
|
|
||||||
DESTDIR="${D}" \
|
|
||||||
LIBDIR="${EPREFIX}"/$(get_libdir) \
|
|
||||||
SBINDIR="${EPREFIX}"/sbin \
|
|
||||||
CONFDIR="${EPREFIX}"/etc/iproute2 \
|
|
||||||
DOCDIR="${EPREFIX}"/usr/share/doc/${PF} \
|
|
||||||
MANDIR="${EPREFIX}"/usr/share/man \
|
|
||||||
ARPDDIR="${EPREFIX}"/var/lib/arpd \
|
|
||||||
install
|
|
||||||
|
|
||||||
rm "${ED}"/usr/share/doc/${PF}/*.{sgml,tex} || die #455988
|
|
||||||
|
|
||||||
dodir /bin
|
|
||||||
mv "${ED}"/{s,}bin/ip || die #330115
|
|
||||||
|
|
||||||
dolib.a lib/libnetlink.a
|
|
||||||
insinto /usr/include
|
|
||||||
doins include/libnetlink.h
|
|
||||||
# This local header pulls in a lot of linux headers it
|
|
||||||
# doesn't directly need. Delete this header that requires
|
|
||||||
# linux-headers-3.8 until that goes stable. #467716
|
|
||||||
sed -i '/linux\/netconf.h/d' "${ED}"/usr/include/libnetlink.h || die
|
|
||||||
|
|
||||||
if use berkdb ; then
|
|
||||||
dodir /var/lib/arpd
|
|
||||||
# bug 47482, arpd doesn't need to be in /sbin
|
|
||||||
dodir /usr/bin
|
|
||||||
mv "${ED}"/sbin/arpd "${ED}"/usr/bin/ || die
|
|
||||||
fi
|
|
||||||
}
|
|
@ -1,150 +0,0 @@
|
|||||||
# Copyright 1999-2017 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
|
|
||||||
EAPI=6
|
|
||||||
|
|
||||||
inherit toolchain-funcs flag-o-matic multilib
|
|
||||||
|
|
||||||
if [[ ${PV} == "9999" ]] ; then
|
|
||||||
EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
|
|
||||||
inherit git-r3
|
|
||||||
else
|
|
||||||
SRC_URI="https://www.kernel.org/pub/linux/utils/net/${PN}/${P}.tar.xz"
|
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
|
|
||||||
fi
|
|
||||||
|
|
||||||
DESCRIPTION="kernel routing and traffic control utilities"
|
|
||||||
HOMEPAGE="https://wiki.linuxfoundation.org/networking/iproute2"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
SLOT="0"
|
|
||||||
IUSE="atm berkdb +iptables ipv6 minimal selinux"
|
|
||||||
|
|
||||||
# We could make libmnl optional, but it's tiny, so eh
|
|
||||||
RDEPEND="
|
|
||||||
!net-misc/arpd
|
|
||||||
!minimal? ( net-libs/libmnl )
|
|
||||||
iptables? ( >=net-firewall/iptables-1.4.20:= )
|
|
||||||
berkdb? ( sys-libs/db:= )
|
|
||||||
atm? ( net-dialup/linux-atm )
|
|
||||||
selinux? ( sys-libs/libselinux )
|
|
||||||
"
|
|
||||||
# We require newer linux-headers for ipset support #549948 and some defines #553876
|
|
||||||
DEPEND="
|
|
||||||
${RDEPEND}
|
|
||||||
app-arch/xz-utils
|
|
||||||
iptables? ( virtual/pkgconfig )
|
|
||||||
sys-devel/bison
|
|
||||||
sys-devel/flex
|
|
||||||
>=sys-kernel/linux-headers-3.16
|
|
||||||
elibc_glibc? ( >=sys-libs/glibc-2.7 )
|
|
||||||
"
|
|
||||||
|
|
||||||
PATCHES=(
|
|
||||||
"${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
|
|
||||||
)
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
if ! use ipv6 ; then
|
|
||||||
PATCHES+=(
|
|
||||||
"${FILESDIR}"/${PN}-4.11.0-no-ipv6.patch #326849
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Local uclibc-ng compat fix until uclibc-ng upstream can sync
|
|
||||||
# netinet/in.h with glibc. Resolves #626546.
|
|
||||||
if use elibc_uclibc ; then
|
|
||||||
PATCHES+=(
|
|
||||||
"${FILESDIR}"/${PN}-4.12.0-uclibc-ng-add-ipproto_mh.patch
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
||||||
default
|
|
||||||
|
|
||||||
sed -i \
|
|
||||||
-e '/^CC :=/d' \
|
|
||||||
-e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
|
|
||||||
-e "s:-O2:${CFLAGS} ${CPPFLAGS}:" \
|
|
||||||
-e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
|
|
||||||
-e "/^WFLAGS/s:-Werror::" \
|
|
||||||
-e "/^DBM_INCLUDE/s:=.*:=${T}:" \
|
|
||||||
Makefile || die
|
|
||||||
|
|
||||||
# Use /run instead of /var/run.
|
|
||||||
sed -i \
|
|
||||||
-e 's:/var/run:/run:g' \
|
|
||||||
include/namespace.h \
|
|
||||||
man/man8/ip-netns.8 || die
|
|
||||||
|
|
||||||
# build against system headers
|
|
||||||
rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
|
|
||||||
sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
|
|
||||||
|
|
||||||
use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc ip:' Makefile
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
tc-export AR CC PKG_CONFIG
|
|
||||||
|
|
||||||
# This sure is ugly. Should probably move into toolchain-funcs at some point.
|
|
||||||
local setns
|
|
||||||
pushd "${T}" >/dev/null
|
|
||||||
printf '#include <sched.h>\nint main(){return setns(0, 0);}\n' > test.c
|
|
||||||
${CC} ${CFLAGS} ${CPPFLAGS} -D_GNU_SOURCE ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
|
|
||||||
echo 'int main(){return 0;}' > test.c
|
|
||||||
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
|
|
||||||
popd >/dev/null
|
|
||||||
|
|
||||||
cat <<-EOF > Config
|
|
||||||
TC_CONFIG_ATM := $(usex atm y n)
|
|
||||||
TC_CONFIG_XT := $(usex iptables y n)
|
|
||||||
TC_CONFIG_NO_XT := $(usex iptables n y)
|
|
||||||
# We've locked in recent enough kernel headers #549948
|
|
||||||
TC_CONFIG_IPSET := y
|
|
||||||
HAVE_BERKELEY_DB := $(usex berkdb y n)
|
|
||||||
HAVE_MNL := $(usex minimal n y)
|
|
||||||
HAVE_SELINUX := $(usex selinux y n)
|
|
||||||
IP_CONFIG_SETNS := ${setns}
|
|
||||||
# Use correct iptables dir, #144265 #293709
|
|
||||||
IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
if use minimal ; then
|
|
||||||
into /
|
|
||||||
dosbin tc/tc
|
|
||||||
dobin ip/ip
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
emake \
|
|
||||||
DESTDIR="${D}" \
|
|
||||||
LIBDIR="${EPREFIX%/}"/$(get_libdir) \
|
|
||||||
SBINDIR="${EPREFIX%/}"/sbin \
|
|
||||||
CONFDIR="${EPREFIX%/}"/etc/iproute2 \
|
|
||||||
DOCDIR="${EPREFIX%/}"/usr/share/doc/${PF} \
|
|
||||||
MANDIR="${EPREFIX%/}"/usr/share/man \
|
|
||||||
ARPDDIR="${EPREFIX%/}"/var/lib/arpd \
|
|
||||||
install
|
|
||||||
|
|
||||||
rm "${ED%/}"/usr/share/doc/${PF}/*.{sgml,tex} || die #455988
|
|
||||||
|
|
||||||
dodir /bin
|
|
||||||
mv "${ED%/}"/{s,}bin/ip || die #330115
|
|
||||||
|
|
||||||
dolib.a lib/libnetlink.a
|
|
||||||
insinto /usr/include
|
|
||||||
doins include/libnetlink.h
|
|
||||||
# This local header pulls in a lot of linux headers it
|
|
||||||
# doesn't directly need. Delete this header that requires
|
|
||||||
# linux-headers-3.8 until that goes stable. #467716
|
|
||||||
sed -i '/linux\/netconf.h/d' "${ED%/}"/usr/include/libnetlink.h || die
|
|
||||||
|
|
||||||
if use berkdb ; then
|
|
||||||
dodir /var/lib/arpd
|
|
||||||
# bug 47482, arpd doesn't need to be in /sbin
|
|
||||||
dodir /usr/bin
|
|
||||||
mv "${ED%/}"/sbin/arpd "${ED%/}"/usr/bin/ || die
|
|
||||||
fi
|
|
||||||
}
|
|
@ -1,128 +0,0 @@
|
|||||||
# Copyright 1999-2016 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
|
|
||||||
EAPI="5"
|
|
||||||
|
|
||||||
inherit eutils toolchain-funcs flag-o-matic multilib
|
|
||||||
|
|
||||||
if [[ ${PV} == "9999" ]] ; then
|
|
||||||
EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
|
|
||||||
inherit git-2
|
|
||||||
else
|
|
||||||
SRC_URI="https://www.kernel.org/pub/linux/utils/net/${PN}/${P}.tar.xz"
|
|
||||||
KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
|
|
||||||
fi
|
|
||||||
|
|
||||||
DESCRIPTION="kernel routing and traffic control utilities"
|
|
||||||
HOMEPAGE="https://wiki.linuxfoundation.org/networking/iproute2"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
SLOT="0"
|
|
||||||
IUSE="atm berkdb +iptables ipv6 minimal selinux"
|
|
||||||
|
|
||||||
# We could make libmnl optional, but it's tiny, so eh
|
|
||||||
RDEPEND="!net-misc/arpd
|
|
||||||
!minimal? ( net-libs/libmnl )
|
|
||||||
iptables? ( >=net-firewall/iptables-1.4.20:= )
|
|
||||||
berkdb? ( sys-libs/db:= )
|
|
||||||
atm? ( net-dialup/linux-atm )
|
|
||||||
selinux? ( sys-libs/libselinux )"
|
|
||||||
# We require newer linux-headers for ipset support #549948 and some defines #553876
|
|
||||||
DEPEND="${RDEPEND}
|
|
||||||
app-arch/xz-utils
|
|
||||||
iptables? ( virtual/pkgconfig )
|
|
||||||
sys-devel/bison
|
|
||||||
sys-devel/flex
|
|
||||||
>=sys-kernel/linux-headers-3.16
|
|
||||||
elibc_glibc? ( >=sys-libs/glibc-2.7 )"
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
epatch "${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
|
|
||||||
use ipv6 || epatch "${FILESDIR}"/${PN}-4.2.0-no-ipv6.patch #326849
|
|
||||||
|
|
||||||
sed -i \
|
|
||||||
-e '/^CC =/d' \
|
|
||||||
-e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
|
|
||||||
-e "s:-O2:${CFLAGS} ${CPPFLAGS}:" \
|
|
||||||
-e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
|
|
||||||
-e "/^WFLAGS/s:-Werror::" \
|
|
||||||
-e "/^DBM_INCLUDE/s:=.*:=${T}:" \
|
|
||||||
Makefile || die
|
|
||||||
|
|
||||||
# Use /run instead of /var/run.
|
|
||||||
sed -i \
|
|
||||||
-e 's:/var/run:/run:g' \
|
|
||||||
include/namespace.h \
|
|
||||||
man/man8/ip-netns.8 || die
|
|
||||||
|
|
||||||
# build against system headers
|
|
||||||
rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
|
|
||||||
sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
|
|
||||||
|
|
||||||
use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc ip:' Makefile
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
tc-export AR CC PKG_CONFIG
|
|
||||||
|
|
||||||
# This sure is ugly. Should probably move into toolchain-funcs at some point.
|
|
||||||
local setns
|
|
||||||
pushd "${T}" >/dev/null
|
|
||||||
printf '#include <sched.h>\nint main(){return setns(0, 0);}\n' > test.c
|
|
||||||
${CC} ${CFLAGS} ${CPPFLAGS} -D_GNU_SOURCE ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
|
|
||||||
echo 'int main(){return 0;}' > test.c
|
|
||||||
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
|
|
||||||
popd >/dev/null
|
|
||||||
|
|
||||||
cat <<-EOF > Config
|
|
||||||
TC_CONFIG_ATM := $(usex atm y n)
|
|
||||||
TC_CONFIG_XT := $(usex iptables y n)
|
|
||||||
# We've locked in recent enough kernel headers #549948
|
|
||||||
TC_CONFIG_IPSET := y
|
|
||||||
HAVE_BERKELEY_DB := $(usex berkdb y n)
|
|
||||||
HAVE_MNL := $(usex minimal n y)
|
|
||||||
HAVE_SELINUX := $(usex selinux y n)
|
|
||||||
IP_CONFIG_SETNS := ${setns}
|
|
||||||
# Use correct iptables dir, #144265 #293709
|
|
||||||
IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
if use minimal ; then
|
|
||||||
into /
|
|
||||||
dosbin tc/tc
|
|
||||||
dobin ip/ip
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
emake \
|
|
||||||
DESTDIR="${D}" \
|
|
||||||
LIBDIR="${EPREFIX}"/$(get_libdir) \
|
|
||||||
SBINDIR="${EPREFIX}"/sbin \
|
|
||||||
CONFDIR="${EPREFIX}"/etc/iproute2 \
|
|
||||||
DOCDIR="${EPREFIX}"/usr/share/doc/${PF} \
|
|
||||||
MANDIR="${EPREFIX}"/usr/share/man \
|
|
||||||
ARPDDIR="${EPREFIX}"/var/lib/arpd \
|
|
||||||
install
|
|
||||||
|
|
||||||
rm "${ED}"/usr/share/doc/${PF}/*.{sgml,tex} || die #455988
|
|
||||||
|
|
||||||
dodir /bin
|
|
||||||
mv "${ED}"/{s,}bin/ip || die #330115
|
|
||||||
|
|
||||||
dolib.a lib/libnetlink.a
|
|
||||||
insinto /usr/include
|
|
||||||
doins include/libnetlink.h
|
|
||||||
# This local header pulls in a lot of linux headers it
|
|
||||||
# doesn't directly need. Delete this header that requires
|
|
||||||
# linux-headers-3.8 until that goes stable. #467716
|
|
||||||
sed -i '/linux\/netconf.h/d' "${ED}"/usr/include/libnetlink.h || die
|
|
||||||
|
|
||||||
if use berkdb ; then
|
|
||||||
dodir /var/lib/arpd
|
|
||||||
# bug 47482, arpd doesn't need to be in /sbin
|
|
||||||
dodir /usr/bin
|
|
||||||
mv "${ED}"/sbin/arpd "${ED}"/usr/bin/ || die
|
|
||||||
fi
|
|
||||||
}
|
|
@ -1,128 +0,0 @@
|
|||||||
# Copyright 1999-2016 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
|
|
||||||
EAPI="5"
|
|
||||||
|
|
||||||
inherit eutils toolchain-funcs flag-o-matic multilib
|
|
||||||
|
|
||||||
if [[ ${PV} == "9999" ]] ; then
|
|
||||||
EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
|
|
||||||
inherit git-2
|
|
||||||
else
|
|
||||||
SRC_URI="https://www.kernel.org/pub/linux/utils/net/${PN}/${P}.tar.xz"
|
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
|
|
||||||
fi
|
|
||||||
|
|
||||||
DESCRIPTION="kernel routing and traffic control utilities"
|
|
||||||
HOMEPAGE="https://wiki.linuxfoundation.org/networking/iproute2"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
SLOT="0"
|
|
||||||
IUSE="atm berkdb +iptables ipv6 minimal selinux"
|
|
||||||
|
|
||||||
# We could make libmnl optional, but it's tiny, so eh
|
|
||||||
RDEPEND="!net-misc/arpd
|
|
||||||
!minimal? ( net-libs/libmnl )
|
|
||||||
iptables? ( >=net-firewall/iptables-1.4.20:= )
|
|
||||||
berkdb? ( sys-libs/db:= )
|
|
||||||
atm? ( net-dialup/linux-atm )
|
|
||||||
selinux? ( sys-libs/libselinux )"
|
|
||||||
# We require newer linux-headers for ipset support #549948 and some defines #553876
|
|
||||||
DEPEND="${RDEPEND}
|
|
||||||
app-arch/xz-utils
|
|
||||||
iptables? ( virtual/pkgconfig )
|
|
||||||
sys-devel/bison
|
|
||||||
sys-devel/flex
|
|
||||||
>=sys-kernel/linux-headers-3.16
|
|
||||||
elibc_glibc? ( >=sys-libs/glibc-2.7 )"
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
epatch "${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
|
|
||||||
use ipv6 || epatch "${FILESDIR}"/${PN}-4.2.0-no-ipv6.patch #326849
|
|
||||||
|
|
||||||
sed -i \
|
|
||||||
-e '/^CC =/d' \
|
|
||||||
-e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
|
|
||||||
-e "s:-O2:${CFLAGS} ${CPPFLAGS}:" \
|
|
||||||
-e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
|
|
||||||
-e "/^WFLAGS/s:-Werror::" \
|
|
||||||
-e "/^DBM_INCLUDE/s:=.*:=${T}:" \
|
|
||||||
Makefile || die
|
|
||||||
|
|
||||||
# Use /run instead of /var/run.
|
|
||||||
sed -i \
|
|
||||||
-e 's:/var/run:/run:g' \
|
|
||||||
include/namespace.h \
|
|
||||||
man/man8/ip-netns.8 || die
|
|
||||||
|
|
||||||
# build against system headers
|
|
||||||
rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
|
|
||||||
sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
|
|
||||||
|
|
||||||
use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc ip:' Makefile
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
tc-export AR CC PKG_CONFIG
|
|
||||||
|
|
||||||
# This sure is ugly. Should probably move into toolchain-funcs at some point.
|
|
||||||
local setns
|
|
||||||
pushd "${T}" >/dev/null
|
|
||||||
printf '#include <sched.h>\nint main(){return setns(0, 0);}\n' > test.c
|
|
||||||
${CC} ${CFLAGS} ${CPPFLAGS} -D_GNU_SOURCE ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
|
|
||||||
echo 'int main(){return 0;}' > test.c
|
|
||||||
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
|
|
||||||
popd >/dev/null
|
|
||||||
|
|
||||||
cat <<-EOF > Config
|
|
||||||
TC_CONFIG_ATM := $(usex atm y n)
|
|
||||||
TC_CONFIG_XT := $(usex iptables y n)
|
|
||||||
# We've locked in recent enough kernel headers #549948
|
|
||||||
TC_CONFIG_IPSET := y
|
|
||||||
HAVE_BERKELEY_DB := $(usex berkdb y n)
|
|
||||||
HAVE_MNL := $(usex minimal n y)
|
|
||||||
HAVE_SELINUX := $(usex selinux y n)
|
|
||||||
IP_CONFIG_SETNS := ${setns}
|
|
||||||
# Use correct iptables dir, #144265 #293709
|
|
||||||
IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
if use minimal ; then
|
|
||||||
into /
|
|
||||||
dosbin tc/tc
|
|
||||||
dobin ip/ip
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
emake \
|
|
||||||
DESTDIR="${D}" \
|
|
||||||
LIBDIR="${EPREFIX}"/$(get_libdir) \
|
|
||||||
SBINDIR="${EPREFIX}"/sbin \
|
|
||||||
CONFDIR="${EPREFIX}"/etc/iproute2 \
|
|
||||||
DOCDIR="${EPREFIX}"/usr/share/doc/${PF} \
|
|
||||||
MANDIR="${EPREFIX}"/usr/share/man \
|
|
||||||
ARPDDIR="${EPREFIX}"/var/lib/arpd \
|
|
||||||
install
|
|
||||||
|
|
||||||
rm "${ED}"/usr/share/doc/${PF}/*.{sgml,tex} || die #455988
|
|
||||||
|
|
||||||
dodir /bin
|
|
||||||
mv "${ED}"/{s,}bin/ip || die #330115
|
|
||||||
|
|
||||||
dolib.a lib/libnetlink.a
|
|
||||||
insinto /usr/include
|
|
||||||
doins include/libnetlink.h
|
|
||||||
# This local header pulls in a lot of linux headers it
|
|
||||||
# doesn't directly need. Delete this header that requires
|
|
||||||
# linux-headers-3.8 until that goes stable. #467716
|
|
||||||
sed -i '/linux\/netconf.h/d' "${ED}"/usr/include/libnetlink.h || die
|
|
||||||
|
|
||||||
if use berkdb ; then
|
|
||||||
dodir /var/lib/arpd
|
|
||||||
# bug 47482, arpd doesn't need to be in /sbin
|
|
||||||
dodir /usr/bin
|
|
||||||
mv "${ED}"/sbin/arpd "${ED}"/usr/bin/ || die
|
|
||||||
fi
|
|
||||||
}
|
|
@ -1,138 +0,0 @@
|
|||||||
# Copyright 1999-2016 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
|
|
||||||
EAPI="5"
|
|
||||||
|
|
||||||
inherit eutils toolchain-funcs flag-o-matic multilib
|
|
||||||
|
|
||||||
if [[ ${PV} == "9999" ]] ; then
|
|
||||||
EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
|
|
||||||
inherit git-2
|
|
||||||
else
|
|
||||||
SRC_URI="https://www.kernel.org/pub/linux/utils/net/${PN}/${P}.tar.xz"
|
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
|
|
||||||
fi
|
|
||||||
|
|
||||||
DESCRIPTION="kernel routing and traffic control utilities"
|
|
||||||
HOMEPAGE="https://wiki.linuxfoundation.org/networking/iproute2"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
SLOT="0"
|
|
||||||
IUSE="atm berkdb +iptables ipv6 minimal selinux"
|
|
||||||
|
|
||||||
# We could make libmnl optional, but it's tiny, so eh
|
|
||||||
RDEPEND="!net-misc/arpd
|
|
||||||
!minimal? ( net-libs/libmnl )
|
|
||||||
iptables? ( >=net-firewall/iptables-1.4.20:= )
|
|
||||||
berkdb? ( sys-libs/db:= )
|
|
||||||
atm? ( net-dialup/linux-atm )
|
|
||||||
selinux? ( sys-libs/libselinux )"
|
|
||||||
# We require newer linux-headers for ipset support #549948 and some defines #553876
|
|
||||||
DEPEND="${RDEPEND}
|
|
||||||
app-arch/xz-utils
|
|
||||||
iptables? ( virtual/pkgconfig )
|
|
||||||
sys-devel/bison
|
|
||||||
sys-devel/flex
|
|
||||||
>=sys-kernel/linux-headers-3.16
|
|
||||||
elibc_glibc? ( >=sys-libs/glibc-2.7 )"
|
|
||||||
|
|
||||||
PATCHES=(
|
|
||||||
"${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
|
|
||||||
"${FILESDIR}"/${PN}-4.5.0-no-iptables.patch #577464
|
|
||||||
)
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
if ! use ipv6 ; then
|
|
||||||
PATCHES+=(
|
|
||||||
"${FILESDIR}"/${PN}-4.2.0-no-ipv6.patch #326849
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
||||||
epatch "${PATCHES[@]}"
|
|
||||||
|
|
||||||
sed -i \
|
|
||||||
-e '/^CC =/d' \
|
|
||||||
-e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
|
|
||||||
-e "s:-O2:${CFLAGS} ${CPPFLAGS}:" \
|
|
||||||
-e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
|
|
||||||
-e "/^WFLAGS/s:-Werror::" \
|
|
||||||
-e "/^DBM_INCLUDE/s:=.*:=${T}:" \
|
|
||||||
Makefile || die
|
|
||||||
|
|
||||||
# Use /run instead of /var/run.
|
|
||||||
sed -i \
|
|
||||||
-e 's:/var/run:/run:g' \
|
|
||||||
include/namespace.h \
|
|
||||||
man/man8/ip-netns.8 || die
|
|
||||||
|
|
||||||
# build against system headers
|
|
||||||
rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
|
|
||||||
sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
|
|
||||||
|
|
||||||
use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc ip:' Makefile
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
tc-export AR CC PKG_CONFIG
|
|
||||||
|
|
||||||
# This sure is ugly. Should probably move into toolchain-funcs at some point.
|
|
||||||
local setns
|
|
||||||
pushd "${T}" >/dev/null
|
|
||||||
printf '#include <sched.h>\nint main(){return setns(0, 0);}\n' > test.c
|
|
||||||
${CC} ${CFLAGS} ${CPPFLAGS} -D_GNU_SOURCE ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
|
|
||||||
echo 'int main(){return 0;}' > test.c
|
|
||||||
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
|
|
||||||
popd >/dev/null
|
|
||||||
|
|
||||||
cat <<-EOF > Config
|
|
||||||
TC_CONFIG_ATM := $(usex atm y n)
|
|
||||||
TC_CONFIG_XT := $(usex iptables y n)
|
|
||||||
# We've locked in recent enough kernel headers #549948
|
|
||||||
TC_CONFIG_IPSET := y
|
|
||||||
HAVE_BERKELEY_DB := $(usex berkdb y n)
|
|
||||||
HAVE_MNL := $(usex minimal n y)
|
|
||||||
HAVE_SELINUX := $(usex selinux y n)
|
|
||||||
IP_CONFIG_SETNS := ${setns}
|
|
||||||
# Use correct iptables dir, #144265 #293709
|
|
||||||
IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
if use minimal ; then
|
|
||||||
into /
|
|
||||||
dosbin tc/tc
|
|
||||||
dobin ip/ip
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
emake \
|
|
||||||
DESTDIR="${D}" \
|
|
||||||
LIBDIR="${EPREFIX}"/$(get_libdir) \
|
|
||||||
SBINDIR="${EPREFIX}"/sbin \
|
|
||||||
CONFDIR="${EPREFIX}"/etc/iproute2 \
|
|
||||||
DOCDIR="${EPREFIX}"/usr/share/doc/${PF} \
|
|
||||||
MANDIR="${EPREFIX}"/usr/share/man \
|
|
||||||
ARPDDIR="${EPREFIX}"/var/lib/arpd \
|
|
||||||
install
|
|
||||||
|
|
||||||
rm "${ED}"/usr/share/doc/${PF}/*.{sgml,tex} || die #455988
|
|
||||||
|
|
||||||
dodir /bin
|
|
||||||
mv "${ED}"/{s,}bin/ip || die #330115
|
|
||||||
|
|
||||||
dolib.a lib/libnetlink.a
|
|
||||||
insinto /usr/include
|
|
||||||
doins include/libnetlink.h
|
|
||||||
# This local header pulls in a lot of linux headers it
|
|
||||||
# doesn't directly need. Delete this header that requires
|
|
||||||
# linux-headers-3.8 until that goes stable. #467716
|
|
||||||
sed -i '/linux\/netconf.h/d' "${ED}"/usr/include/libnetlink.h || die
|
|
||||||
|
|
||||||
if use berkdb ; then
|
|
||||||
dodir /var/lib/arpd
|
|
||||||
# bug 47482, arpd doesn't need to be in /sbin
|
|
||||||
dodir /usr/bin
|
|
||||||
mv "${ED}"/sbin/arpd "${ED}"/usr/bin/ || die
|
|
||||||
fi
|
|
||||||
}
|
|
@ -1,138 +0,0 @@
|
|||||||
# Copyright 1999-2016 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
|
|
||||||
EAPI="5"
|
|
||||||
|
|
||||||
inherit eutils toolchain-funcs flag-o-matic multilib
|
|
||||||
|
|
||||||
if [[ ${PV} == "9999" ]] ; then
|
|
||||||
EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
|
|
||||||
inherit git-2
|
|
||||||
else
|
|
||||||
SRC_URI="https://www.kernel.org/pub/linux/utils/net/${PN}/${P}.tar.xz"
|
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
|
|
||||||
fi
|
|
||||||
|
|
||||||
DESCRIPTION="kernel routing and traffic control utilities"
|
|
||||||
HOMEPAGE="https://wiki.linuxfoundation.org/networking/iproute2"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
SLOT="0"
|
|
||||||
IUSE="atm berkdb +iptables ipv6 minimal selinux"
|
|
||||||
|
|
||||||
# We could make libmnl optional, but it's tiny, so eh
|
|
||||||
RDEPEND="!net-misc/arpd
|
|
||||||
!minimal? ( net-libs/libmnl )
|
|
||||||
iptables? ( >=net-firewall/iptables-1.4.20:= )
|
|
||||||
berkdb? ( sys-libs/db:= )
|
|
||||||
atm? ( net-dialup/linux-atm )
|
|
||||||
selinux? ( sys-libs/libselinux )"
|
|
||||||
# We require newer linux-headers for ipset support #549948 and some defines #553876
|
|
||||||
DEPEND="${RDEPEND}
|
|
||||||
app-arch/xz-utils
|
|
||||||
iptables? ( virtual/pkgconfig )
|
|
||||||
sys-devel/bison
|
|
||||||
sys-devel/flex
|
|
||||||
>=sys-kernel/linux-headers-3.16
|
|
||||||
elibc_glibc? ( >=sys-libs/glibc-2.7 )"
|
|
||||||
|
|
||||||
PATCHES=(
|
|
||||||
"${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
|
|
||||||
"${FILESDIR}"/${PN}-4.5.0-no-iptables.patch #577464
|
|
||||||
)
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
if ! use ipv6 ; then
|
|
||||||
PATCHES+=(
|
|
||||||
"${FILESDIR}"/${PN}-4.2.0-no-ipv6.patch #326849
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
||||||
epatch "${PATCHES[@]}"
|
|
||||||
|
|
||||||
sed -i \
|
|
||||||
-e '/^CC :=/d' \
|
|
||||||
-e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
|
|
||||||
-e "s:-O2:${CFLAGS} ${CPPFLAGS}:" \
|
|
||||||
-e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
|
|
||||||
-e "/^WFLAGS/s:-Werror::" \
|
|
||||||
-e "/^DBM_INCLUDE/s:=.*:=${T}:" \
|
|
||||||
Makefile || die
|
|
||||||
|
|
||||||
# Use /run instead of /var/run.
|
|
||||||
sed -i \
|
|
||||||
-e 's:/var/run:/run:g' \
|
|
||||||
include/namespace.h \
|
|
||||||
man/man8/ip-netns.8 || die
|
|
||||||
|
|
||||||
# build against system headers
|
|
||||||
rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
|
|
||||||
sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
|
|
||||||
|
|
||||||
use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc ip:' Makefile
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
tc-export AR CC PKG_CONFIG
|
|
||||||
|
|
||||||
# This sure is ugly. Should probably move into toolchain-funcs at some point.
|
|
||||||
local setns
|
|
||||||
pushd "${T}" >/dev/null
|
|
||||||
printf '#include <sched.h>\nint main(){return setns(0, 0);}\n' > test.c
|
|
||||||
${CC} ${CFLAGS} ${CPPFLAGS} -D_GNU_SOURCE ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
|
|
||||||
echo 'int main(){return 0;}' > test.c
|
|
||||||
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
|
|
||||||
popd >/dev/null
|
|
||||||
|
|
||||||
cat <<-EOF > Config
|
|
||||||
TC_CONFIG_ATM := $(usex atm y n)
|
|
||||||
TC_CONFIG_XT := $(usex iptables y n)
|
|
||||||
# We've locked in recent enough kernel headers #549948
|
|
||||||
TC_CONFIG_IPSET := y
|
|
||||||
HAVE_BERKELEY_DB := $(usex berkdb y n)
|
|
||||||
HAVE_MNL := $(usex minimal n y)
|
|
||||||
HAVE_SELINUX := $(usex selinux y n)
|
|
||||||
IP_CONFIG_SETNS := ${setns}
|
|
||||||
# Use correct iptables dir, #144265 #293709
|
|
||||||
IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
if use minimal ; then
|
|
||||||
into /
|
|
||||||
dosbin tc/tc
|
|
||||||
dobin ip/ip
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
emake \
|
|
||||||
DESTDIR="${D}" \
|
|
||||||
LIBDIR="${EPREFIX}"/$(get_libdir) \
|
|
||||||
SBINDIR="${EPREFIX}"/sbin \
|
|
||||||
CONFDIR="${EPREFIX}"/etc/iproute2 \
|
|
||||||
DOCDIR="${EPREFIX}"/usr/share/doc/${PF} \
|
|
||||||
MANDIR="${EPREFIX}"/usr/share/man \
|
|
||||||
ARPDDIR="${EPREFIX}"/var/lib/arpd \
|
|
||||||
install
|
|
||||||
|
|
||||||
rm "${ED}"/usr/share/doc/${PF}/*.{sgml,tex} || die #455988
|
|
||||||
|
|
||||||
dodir /bin
|
|
||||||
mv "${ED}"/{s,}bin/ip || die #330115
|
|
||||||
|
|
||||||
dolib.a lib/libnetlink.a
|
|
||||||
insinto /usr/include
|
|
||||||
doins include/libnetlink.h
|
|
||||||
# This local header pulls in a lot of linux headers it
|
|
||||||
# doesn't directly need. Delete this header that requires
|
|
||||||
# linux-headers-3.8 until that goes stable. #467716
|
|
||||||
sed -i '/linux\/netconf.h/d' "${ED}"/usr/include/libnetlink.h || die
|
|
||||||
|
|
||||||
if use berkdb ; then
|
|
||||||
dodir /var/lib/arpd
|
|
||||||
# bug 47482, arpd doesn't need to be in /sbin
|
|
||||||
dodir /usr/bin
|
|
||||||
mv "${ED}"/sbin/arpd "${ED}"/usr/bin/ || die
|
|
||||||
fi
|
|
||||||
}
|
|
@ -1,138 +0,0 @@
|
|||||||
# Copyright 1999-2016 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
|
|
||||||
EAPI="5"
|
|
||||||
|
|
||||||
inherit eutils toolchain-funcs flag-o-matic multilib
|
|
||||||
|
|
||||||
if [[ ${PV} == "9999" ]] ; then
|
|
||||||
EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
|
|
||||||
inherit git-2
|
|
||||||
else
|
|
||||||
SRC_URI="https://www.kernel.org/pub/linux/utils/net/${PN}/${P}.tar.xz"
|
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
|
|
||||||
fi
|
|
||||||
|
|
||||||
DESCRIPTION="kernel routing and traffic control utilities"
|
|
||||||
HOMEPAGE="https://wiki.linuxfoundation.org/networking/iproute2"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
SLOT="0"
|
|
||||||
IUSE="atm berkdb +iptables ipv6 minimal selinux"
|
|
||||||
|
|
||||||
# We could make libmnl optional, but it's tiny, so eh
|
|
||||||
RDEPEND="!net-misc/arpd
|
|
||||||
!minimal? ( net-libs/libmnl )
|
|
||||||
iptables? ( >=net-firewall/iptables-1.4.20:= )
|
|
||||||
berkdb? ( sys-libs/db:= )
|
|
||||||
atm? ( net-dialup/linux-atm )
|
|
||||||
selinux? ( sys-libs/libselinux )"
|
|
||||||
# We require newer linux-headers for ipset support #549948 and some defines #553876
|
|
||||||
DEPEND="${RDEPEND}
|
|
||||||
app-arch/xz-utils
|
|
||||||
iptables? ( virtual/pkgconfig )
|
|
||||||
sys-devel/bison
|
|
||||||
sys-devel/flex
|
|
||||||
>=sys-kernel/linux-headers-3.16
|
|
||||||
elibc_glibc? ( >=sys-libs/glibc-2.7 )"
|
|
||||||
|
|
||||||
PATCHES=(
|
|
||||||
"${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
|
|
||||||
"${FILESDIR}"/${PN}-4.5.0-no-iptables.patch #577464
|
|
||||||
)
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
if ! use ipv6 ; then
|
|
||||||
PATCHES+=(
|
|
||||||
"${FILESDIR}"/${PN}-4.2.0-no-ipv6.patch #326849
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
||||||
epatch "${PATCHES[@]}"
|
|
||||||
|
|
||||||
sed -i \
|
|
||||||
-e '/^CC :=/d' \
|
|
||||||
-e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
|
|
||||||
-e "s:-O2:${CFLAGS} ${CPPFLAGS}:" \
|
|
||||||
-e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
|
|
||||||
-e "/^WFLAGS/s:-Werror::" \
|
|
||||||
-e "/^DBM_INCLUDE/s:=.*:=${T}:" \
|
|
||||||
Makefile || die
|
|
||||||
|
|
||||||
# Use /run instead of /var/run.
|
|
||||||
sed -i \
|
|
||||||
-e 's:/var/run:/run:g' \
|
|
||||||
include/namespace.h \
|
|
||||||
man/man8/ip-netns.8 || die
|
|
||||||
|
|
||||||
# build against system headers
|
|
||||||
rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
|
|
||||||
sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
|
|
||||||
|
|
||||||
use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc ip:' Makefile
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
tc-export AR CC PKG_CONFIG
|
|
||||||
|
|
||||||
# This sure is ugly. Should probably move into toolchain-funcs at some point.
|
|
||||||
local setns
|
|
||||||
pushd "${T}" >/dev/null
|
|
||||||
printf '#include <sched.h>\nint main(){return setns(0, 0);}\n' > test.c
|
|
||||||
${CC} ${CFLAGS} ${CPPFLAGS} -D_GNU_SOURCE ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
|
|
||||||
echo 'int main(){return 0;}' > test.c
|
|
||||||
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
|
|
||||||
popd >/dev/null
|
|
||||||
|
|
||||||
cat <<-EOF > Config
|
|
||||||
TC_CONFIG_ATM := $(usex atm y n)
|
|
||||||
TC_CONFIG_XT := $(usex iptables y n)
|
|
||||||
# We've locked in recent enough kernel headers #549948
|
|
||||||
TC_CONFIG_IPSET := y
|
|
||||||
HAVE_BERKELEY_DB := $(usex berkdb y n)
|
|
||||||
HAVE_MNL := $(usex minimal n y)
|
|
||||||
HAVE_SELINUX := $(usex selinux y n)
|
|
||||||
IP_CONFIG_SETNS := ${setns}
|
|
||||||
# Use correct iptables dir, #144265 #293709
|
|
||||||
IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
if use minimal ; then
|
|
||||||
into /
|
|
||||||
dosbin tc/tc
|
|
||||||
dobin ip/ip
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
emake \
|
|
||||||
DESTDIR="${D}" \
|
|
||||||
LIBDIR="${EPREFIX}"/$(get_libdir) \
|
|
||||||
SBINDIR="${EPREFIX}"/sbin \
|
|
||||||
CONFDIR="${EPREFIX}"/etc/iproute2 \
|
|
||||||
DOCDIR="${EPREFIX}"/usr/share/doc/${PF} \
|
|
||||||
MANDIR="${EPREFIX}"/usr/share/man \
|
|
||||||
ARPDDIR="${EPREFIX}"/var/lib/arpd \
|
|
||||||
install
|
|
||||||
|
|
||||||
rm "${ED}"/usr/share/doc/${PF}/*.{sgml,tex} || die #455988
|
|
||||||
|
|
||||||
dodir /bin
|
|
||||||
mv "${ED}"/{s,}bin/ip || die #330115
|
|
||||||
|
|
||||||
dolib.a lib/libnetlink.a
|
|
||||||
insinto /usr/include
|
|
||||||
doins include/libnetlink.h
|
|
||||||
# This local header pulls in a lot of linux headers it
|
|
||||||
# doesn't directly need. Delete this header that requires
|
|
||||||
# linux-headers-3.8 until that goes stable. #467716
|
|
||||||
sed -i '/linux\/netconf.h/d' "${ED}"/usr/include/libnetlink.h || die
|
|
||||||
|
|
||||||
if use berkdb ; then
|
|
||||||
dodir /var/lib/arpd
|
|
||||||
# bug 47482, arpd doesn't need to be in /sbin
|
|
||||||
dodir /usr/bin
|
|
||||||
mv "${ED}"/sbin/arpd "${ED}"/usr/bin/ || die
|
|
||||||
fi
|
|
||||||
}
|
|
@ -1,138 +0,0 @@
|
|||||||
# Copyright 1999-2016 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
|
|
||||||
EAPI="5"
|
|
||||||
|
|
||||||
inherit eutils toolchain-funcs flag-o-matic multilib
|
|
||||||
|
|
||||||
if [[ ${PV} == "9999" ]] ; then
|
|
||||||
EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
|
|
||||||
inherit git-2
|
|
||||||
else
|
|
||||||
SRC_URI="https://www.kernel.org/pub/linux/utils/net/${PN}/${P}.tar.xz"
|
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
|
|
||||||
fi
|
|
||||||
|
|
||||||
DESCRIPTION="kernel routing and traffic control utilities"
|
|
||||||
HOMEPAGE="https://wiki.linuxfoundation.org/networking/iproute2"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
SLOT="0"
|
|
||||||
IUSE="atm berkdb +iptables ipv6 minimal selinux"
|
|
||||||
|
|
||||||
# We could make libmnl optional, but it's tiny, so eh
|
|
||||||
RDEPEND="!net-misc/arpd
|
|
||||||
!minimal? ( net-libs/libmnl )
|
|
||||||
iptables? ( >=net-firewall/iptables-1.4.20:= )
|
|
||||||
berkdb? ( sys-libs/db:= )
|
|
||||||
atm? ( net-dialup/linux-atm )
|
|
||||||
selinux? ( sys-libs/libselinux )"
|
|
||||||
# We require newer linux-headers for ipset support #549948 and some defines #553876
|
|
||||||
DEPEND="${RDEPEND}
|
|
||||||
app-arch/xz-utils
|
|
||||||
iptables? ( virtual/pkgconfig )
|
|
||||||
sys-devel/bison
|
|
||||||
sys-devel/flex
|
|
||||||
>=sys-kernel/linux-headers-3.16
|
|
||||||
elibc_glibc? ( >=sys-libs/glibc-2.7 )"
|
|
||||||
|
|
||||||
PATCHES=(
|
|
||||||
"${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
|
|
||||||
)
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
if ! use ipv6 ; then
|
|
||||||
PATCHES+=(
|
|
||||||
"${FILESDIR}"/${PN}-4.2.0-no-ipv6.patch #326849
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
||||||
epatch "${PATCHES[@]}"
|
|
||||||
|
|
||||||
sed -i \
|
|
||||||
-e '/^CC :=/d' \
|
|
||||||
-e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
|
|
||||||
-e "s:-O2:${CFLAGS} ${CPPFLAGS}:" \
|
|
||||||
-e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
|
|
||||||
-e "/^WFLAGS/s:-Werror::" \
|
|
||||||
-e "/^DBM_INCLUDE/s:=.*:=${T}:" \
|
|
||||||
Makefile || die
|
|
||||||
|
|
||||||
# Use /run instead of /var/run.
|
|
||||||
sed -i \
|
|
||||||
-e 's:/var/run:/run:g' \
|
|
||||||
include/namespace.h \
|
|
||||||
man/man8/ip-netns.8 || die
|
|
||||||
|
|
||||||
# build against system headers
|
|
||||||
rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
|
|
||||||
sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
|
|
||||||
|
|
||||||
use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc ip:' Makefile
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
tc-export AR CC PKG_CONFIG
|
|
||||||
|
|
||||||
# This sure is ugly. Should probably move into toolchain-funcs at some point.
|
|
||||||
local setns
|
|
||||||
pushd "${T}" >/dev/null
|
|
||||||
printf '#include <sched.h>\nint main(){return setns(0, 0);}\n' > test.c
|
|
||||||
${CC} ${CFLAGS} ${CPPFLAGS} -D_GNU_SOURCE ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
|
|
||||||
echo 'int main(){return 0;}' > test.c
|
|
||||||
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
|
|
||||||
popd >/dev/null
|
|
||||||
|
|
||||||
cat <<-EOF > Config
|
|
||||||
TC_CONFIG_ATM := $(usex atm y n)
|
|
||||||
TC_CONFIG_XT := $(usex iptables y n)
|
|
||||||
TC_CONFIG_NO_XT := $(usex iptables n y)
|
|
||||||
# We've locked in recent enough kernel headers #549948
|
|
||||||
TC_CONFIG_IPSET := y
|
|
||||||
HAVE_BERKELEY_DB := $(usex berkdb y n)
|
|
||||||
HAVE_MNL := $(usex minimal n y)
|
|
||||||
HAVE_SELINUX := $(usex selinux y n)
|
|
||||||
IP_CONFIG_SETNS := ${setns}
|
|
||||||
# Use correct iptables dir, #144265 #293709
|
|
||||||
IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
if use minimal ; then
|
|
||||||
into /
|
|
||||||
dosbin tc/tc
|
|
||||||
dobin ip/ip
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
emake \
|
|
||||||
DESTDIR="${D}" \
|
|
||||||
LIBDIR="${EPREFIX}"/$(get_libdir) \
|
|
||||||
SBINDIR="${EPREFIX}"/sbin \
|
|
||||||
CONFDIR="${EPREFIX}"/etc/iproute2 \
|
|
||||||
DOCDIR="${EPREFIX}"/usr/share/doc/${PF} \
|
|
||||||
MANDIR="${EPREFIX}"/usr/share/man \
|
|
||||||
ARPDDIR="${EPREFIX}"/var/lib/arpd \
|
|
||||||
install
|
|
||||||
|
|
||||||
rm "${ED}"/usr/share/doc/${PF}/*.{sgml,tex} || die #455988
|
|
||||||
|
|
||||||
dodir /bin
|
|
||||||
mv "${ED}"/{s,}bin/ip || die #330115
|
|
||||||
|
|
||||||
dolib.a lib/libnetlink.a
|
|
||||||
insinto /usr/include
|
|
||||||
doins include/libnetlink.h
|
|
||||||
# This local header pulls in a lot of linux headers it
|
|
||||||
# doesn't directly need. Delete this header that requires
|
|
||||||
# linux-headers-3.8 until that goes stable. #467716
|
|
||||||
sed -i '/linux\/netconf.h/d' "${ED}"/usr/include/libnetlink.h || die
|
|
||||||
|
|
||||||
if use berkdb ; then
|
|
||||||
dodir /var/lib/arpd
|
|
||||||
# bug 47482, arpd doesn't need to be in /sbin
|
|
||||||
dodir /usr/bin
|
|
||||||
mv "${ED}"/sbin/arpd "${ED}"/usr/bin/ || die
|
|
||||||
fi
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
# Copyright 1999-2020 Gentoo Authors
|
# Copyright 1999-2021 Gentoo Authors
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
EAPI=7
|
EAPI=7
|
||||||
@ -10,7 +10,7 @@ if [[ ${PV} == "9999" ]] ; then
|
|||||||
inherit git-r3
|
inherit git-r3
|
||||||
else
|
else
|
||||||
SRC_URI="https://www.kernel.org/pub/linux/utils/net/${PN}/${P}.tar.xz"
|
SRC_URI="https://www.kernel.org/pub/linux/utils/net/${PN}/${P}.tar.xz"
|
||||||
KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
|
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DESCRIPTION="kernel routing and traffic control utilities"
|
DESCRIPTION="kernel routing and traffic control utilities"
|
||||||
@ -18,18 +18,19 @@ HOMEPAGE="https://wiki.linuxfoundation.org/networking/iproute2"
|
|||||||
|
|
||||||
LICENSE="GPL-2"
|
LICENSE="GPL-2"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
IUSE="atm berkdb caps elf +iptables ipv6 minimal selinux"
|
IUSE="atm berkdb bpf caps elf +iptables ipv6 libbsd minimal selinux"
|
||||||
|
|
||||||
# We could make libmnl optional, but it's tiny, so eh
|
# We could make libmnl optional, but it's tiny, so eh
|
||||||
RDEPEND="
|
RDEPEND="
|
||||||
!net-misc/arpd
|
!net-misc/arpd
|
||||||
dev-libs/libbsd
|
!minimal? ( net-libs/libmnl:= )
|
||||||
!minimal? ( net-libs/libmnl )
|
|
||||||
caps? ( sys-libs/libcap )
|
|
||||||
elf? ( virtual/libelf )
|
|
||||||
iptables? ( >=net-firewall/iptables-1.4.20:= )
|
|
||||||
berkdb? ( sys-libs/db:= )
|
|
||||||
atm? ( net-dialup/linux-atm )
|
atm? ( net-dialup/linux-atm )
|
||||||
|
berkdb? ( sys-libs/db:= )
|
||||||
|
bpf? ( dev-libs/libbpf:= )
|
||||||
|
caps? ( sys-libs/libcap )
|
||||||
|
elf? ( virtual/libelf:= )
|
||||||
|
iptables? ( >=net-firewall/iptables-1.4.20:= )
|
||||||
|
libbsd? ( dev-libs/libbsd )
|
||||||
selinux? ( sys-libs/libselinux )
|
selinux? ( sys-libs/libselinux )
|
||||||
"
|
"
|
||||||
# We require newer linux-headers for ipset support #549948 and some defines #553876
|
# We require newer linux-headers for ipset support #549948 and some defines #553876
|
||||||
@ -46,8 +47,8 @@ BDEPEND="
|
|||||||
|
|
||||||
PATCHES=(
|
PATCHES=(
|
||||||
"${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
|
"${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
|
||||||
"${FILESDIR}"/${PN}-4.20.0-configure-nomagic.patch # bug 643722
|
"${FILESDIR}"/${PN}-5.12.0-configure-nomagic.patch # bug 643722
|
||||||
"${FILESDIR}"/${PN}-5.1.0-portability.patch
|
#"${FILESDIR}"/${PN}-5.1.0-portability.patch
|
||||||
"${FILESDIR}"/${PN}-5.7.0-mix-signal.h-include.patch
|
"${FILESDIR}"/${PN}-5.7.0-mix-signal.h-include.patch
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -60,6 +61,14 @@ src_prepare() {
|
|||||||
|
|
||||||
default
|
default
|
||||||
|
|
||||||
|
# Fix version if necessary
|
||||||
|
local versionfile="include/version.h"
|
||||||
|
if [[ "${PV}" != 9999 ]] && ! grep -Fq "${PV}" ${versionfile} ; then
|
||||||
|
einfo "Fixing version string"
|
||||||
|
sed "s@\"[[:digit:]\.]\+\"@\"${PV}\"@" \
|
||||||
|
-i ${versionfile} || die
|
||||||
|
fi
|
||||||
|
|
||||||
# echo -n is not POSIX compliant
|
# echo -n is not POSIX compliant
|
||||||
sed 's@echo -n@printf@' -i configure || die
|
sed 's@echo -n@printf@' -i configure || die
|
||||||
|
|
||||||
@ -93,6 +102,7 @@ src_configure() {
|
|||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
|
|
||||||
# run "configure" script first which will create "config.mk"...
|
# run "configure" script first which will create "config.mk"...
|
||||||
|
LIBBPF_FORCE="$(usex bpf on off)" \
|
||||||
econf
|
econf
|
||||||
|
|
||||||
# ...now switch on/off requested features via USE flags
|
# ...now switch on/off requested features via USE flags
|
||||||
@ -111,6 +121,7 @@ src_configure() {
|
|||||||
IP_CONFIG_SETNS := ${setns}
|
IP_CONFIG_SETNS := ${setns}
|
||||||
# Use correct iptables dir, #144265 #293709
|
# Use correct iptables dir, #144265 #293709
|
||||||
IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
|
IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
|
||||||
|
HAVE_LIBBSD := $(usex libbsd y n)
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
@ -1,16 +1,16 @@
|
|||||||
# Copyright 1999-2017 Gentoo Foundation
|
# Copyright 1999-2021 Gentoo Authors
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
EAPI=5
|
EAPI=7
|
||||||
|
|
||||||
inherit eutils toolchain-funcs flag-o-matic multilib
|
inherit toolchain-funcs flag-o-matic multilib
|
||||||
|
|
||||||
if [[ ${PV} == "9999" ]] ; then
|
if [[ ${PV} == "9999" ]] ; then
|
||||||
EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
|
EGIT_REPO_URI="https://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
|
||||||
inherit git-2
|
inherit git-r3
|
||||||
else
|
else
|
||||||
SRC_URI="https://www.kernel.org/pub/linux/utils/net/${PN}/${P}.tar.xz"
|
SRC_URI="https://www.kernel.org/pub/linux/utils/net/${PN}/${P}.tar.xz"
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
|
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DESCRIPTION="kernel routing and traffic control utilities"
|
DESCRIPTION="kernel routing and traffic control utilities"
|
||||||
@ -18,69 +18,80 @@ HOMEPAGE="https://wiki.linuxfoundation.org/networking/iproute2"
|
|||||||
|
|
||||||
LICENSE="GPL-2"
|
LICENSE="GPL-2"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
IUSE="atm berkdb +iptables ipv6 minimal selinux"
|
IUSE="atm berkdb bpf caps elf +iptables ipv6 libbsd minimal selinux"
|
||||||
|
|
||||||
# We could make libmnl optional, but it's tiny, so eh
|
# We could make libmnl optional, but it's tiny, so eh
|
||||||
RDEPEND="
|
RDEPEND="
|
||||||
!net-misc/arpd
|
!net-misc/arpd
|
||||||
!minimal? ( net-libs/libmnl )
|
!minimal? ( net-libs/libmnl:= )
|
||||||
iptables? ( >=net-firewall/iptables-1.4.20:= )
|
|
||||||
berkdb? ( sys-libs/db:= )
|
|
||||||
atm? ( net-dialup/linux-atm )
|
atm? ( net-dialup/linux-atm )
|
||||||
|
berkdb? ( sys-libs/db:= )
|
||||||
|
bpf? ( dev-libs/libbpf:= )
|
||||||
|
caps? ( sys-libs/libcap )
|
||||||
|
elf? ( virtual/libelf:= )
|
||||||
|
iptables? ( >=net-firewall/iptables-1.4.20:= )
|
||||||
|
libbsd? ( dev-libs/libbsd )
|
||||||
selinux? ( sys-libs/libselinux )
|
selinux? ( sys-libs/libselinux )
|
||||||
"
|
"
|
||||||
# We require newer linux-headers for ipset support #549948 and some defines #553876
|
# We require newer linux-headers for ipset support #549948 and some defines #553876
|
||||||
DEPEND="
|
DEPEND="
|
||||||
${RDEPEND}
|
${RDEPEND}
|
||||||
app-arch/xz-utils
|
|
||||||
iptables? ( virtual/pkgconfig )
|
|
||||||
sys-devel/bison
|
|
||||||
sys-devel/flex
|
|
||||||
>=sys-kernel/linux-headers-3.16
|
>=sys-kernel/linux-headers-3.16
|
||||||
elibc_glibc? ( >=sys-libs/glibc-2.7 )
|
"
|
||||||
|
BDEPEND="
|
||||||
|
app-arch/xz-utils
|
||||||
|
>=sys-devel/bison-2.4
|
||||||
|
sys-devel/flex
|
||||||
|
virtual/pkgconfig
|
||||||
"
|
"
|
||||||
|
|
||||||
PATCHES=(
|
PATCHES=(
|
||||||
"${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
|
"${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
|
||||||
|
"${FILESDIR}"/${PN}-5.12.0-configure-nomagic.patch # bug 643722
|
||||||
|
#"${FILESDIR}"/${PN}-5.1.0-portability.patch
|
||||||
|
"${FILESDIR}"/${PN}-5.7.0-mix-signal.h-include.patch
|
||||||
)
|
)
|
||||||
|
|
||||||
|
doecho() {
|
||||||
|
echo "${@}"
|
||||||
|
"${@}" || die
|
||||||
|
}
|
||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
if ! use ipv6 ; then
|
if ! use ipv6 ; then
|
||||||
PATCHES+=(
|
PATCHES+=(
|
||||||
"${FILESDIR}"/${PN}-4.11.0-no-ipv6.patch #326849
|
"${FILESDIR}"/${PN}-4.20.0-no-ipv6.patch #326849
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Local uclibc-ng compat fix until uclibc-ng upstream can sync
|
default
|
||||||
# netinet/in.h with glibc. Resolves #626546.
|
|
||||||
if use elibc_uclibc ; then
|
# Fix version if necessary
|
||||||
PATCHES+=(
|
local versionfile="include/version.h"
|
||||||
"${FILESDIR}"/${PN}-4.12.0-uclibc-ng-add-ipproto_mh.patch
|
if [[ "${PV}" != 9999 ]] && ! grep -Fq "${PV}" ${versionfile} ; then
|
||||||
)
|
einfo "Fixing version string"
|
||||||
|
sed "s@\"[[:digit:]\.]\+\"@\"${PV}\"@" \
|
||||||
|
-i ${versionfile} || die
|
||||||
fi
|
fi
|
||||||
|
|
||||||
epatch "${PATCHES[@]}"
|
# echo -n is not POSIX compliant
|
||||||
|
sed 's@echo -n@printf@' -i configure || die
|
||||||
|
|
||||||
sed -i \
|
sed -i \
|
||||||
-e '/^CC :=/d' \
|
-e '/^CC :\?=/d' \
|
||||||
-e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
|
-e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
|
||||||
-e "s:-O2:${CFLAGS} ${CPPFLAGS}:" \
|
-e "s|-O2|${CFLAGS} ${CPPFLAGS}|" \
|
||||||
-e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
|
-e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
|
||||||
-e "/^WFLAGS/s:-Werror::" \
|
|
||||||
-e "/^DBM_INCLUDE/s:=.*:=${T}:" \
|
-e "/^DBM_INCLUDE/s:=.*:=${T}:" \
|
||||||
Makefile || die
|
Makefile || die
|
||||||
|
|
||||||
# Use /run instead of /var/run.
|
|
||||||
sed -i \
|
|
||||||
-e 's:/var/run:/run:g' \
|
|
||||||
include/namespace.h \
|
|
||||||
man/man8/ip-netns.8 || die
|
|
||||||
|
|
||||||
# build against system headers
|
# build against system headers
|
||||||
rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
|
rm -r include/netinet || die #include/linux include/ip{,6}tables{,_common}.h include/libiptc
|
||||||
sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
|
sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
|
||||||
|
|
||||||
use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc ip:' Makefile
|
if use minimal ; then
|
||||||
|
sed -i -e '/^SUBDIRS=/s:=.*:=lib tc ip:' Makefile || die
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
src_configure() {
|
src_configure() {
|
||||||
@ -95,21 +106,34 @@ src_configure() {
|
|||||||
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
|
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
|
|
||||||
cat <<-EOF > Config
|
# run "configure" script first which will create "config.mk"...
|
||||||
|
# Using econf breaks since 5.14.0 (a9c3d70d902a0473ee5c13336317006a52ce8242)
|
||||||
|
doecho ./configure --libbpf_force $(usex bpf on off)
|
||||||
|
|
||||||
|
# ...now switch on/off requested features via USE flags
|
||||||
|
# this is only useful if the test did not set other things, per bug #643722
|
||||||
|
cat <<-EOF >> config.mk
|
||||||
TC_CONFIG_ATM := $(usex atm y n)
|
TC_CONFIG_ATM := $(usex atm y n)
|
||||||
TC_CONFIG_XT := $(usex iptables y n)
|
TC_CONFIG_XT := $(usex iptables y n)
|
||||||
TC_CONFIG_NO_XT := $(usex iptables n y)
|
TC_CONFIG_NO_XT := $(usex iptables n y)
|
||||||
# We've locked in recent enough kernel headers #549948
|
# We've locked in recent enough kernel headers #549948
|
||||||
TC_CONFIG_IPSET := y
|
TC_CONFIG_IPSET := y
|
||||||
HAVE_BERKELEY_DB := $(usex berkdb y n)
|
HAVE_BERKELEY_DB := $(usex berkdb y n)
|
||||||
|
HAVE_CAP := $(usex caps y n)
|
||||||
HAVE_MNL := $(usex minimal n y)
|
HAVE_MNL := $(usex minimal n y)
|
||||||
|
HAVE_ELF := $(usex elf y n)
|
||||||
HAVE_SELINUX := $(usex selinux y n)
|
HAVE_SELINUX := $(usex selinux y n)
|
||||||
IP_CONFIG_SETNS := ${setns}
|
IP_CONFIG_SETNS := ${setns}
|
||||||
# Use correct iptables dir, #144265 #293709
|
# Use correct iptables dir, #144265 #293709
|
||||||
IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
|
IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
|
||||||
|
HAVE_LIBBSD := $(usex libbsd y n)
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
src_compile() {
|
||||||
|
emake V=1 NETNS_RUN_DIR=/run/netns
|
||||||
|
}
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
if use minimal ; then
|
if use minimal ; then
|
||||||
into /
|
into /
|
||||||
@ -120,6 +144,7 @@ src_install() {
|
|||||||
|
|
||||||
emake \
|
emake \
|
||||||
DESTDIR="${D}" \
|
DESTDIR="${D}" \
|
||||||
|
PREFIX="${EPREFIX}/usr" \
|
||||||
LIBDIR="${EPREFIX}"/$(get_libdir) \
|
LIBDIR="${EPREFIX}"/$(get_libdir) \
|
||||||
SBINDIR="${EPREFIX}"/sbin \
|
SBINDIR="${EPREFIX}"/sbin \
|
||||||
CONFDIR="${EPREFIX}"/etc/iproute2 \
|
CONFDIR="${EPREFIX}"/etc/iproute2 \
|
||||||
@ -128,8 +153,6 @@ src_install() {
|
|||||||
ARPDDIR="${EPREFIX}"/var/lib/arpd \
|
ARPDDIR="${EPREFIX}"/var/lib/arpd \
|
||||||
install
|
install
|
||||||
|
|
||||||
rm "${ED}"/usr/share/doc/${PF}/*.{sgml,tex} || die #455988
|
|
||||||
|
|
||||||
dodir /bin
|
dodir /bin
|
||||||
mv "${ED}"/{s,}bin/ip || die #330115
|
mv "${ED}"/{s,}bin/ip || die #330115
|
||||||
|
|
||||||
@ -142,9 +165,11 @@ src_install() {
|
|||||||
sed -i '/linux\/netconf.h/d' "${ED}"/usr/include/libnetlink.h || die
|
sed -i '/linux\/netconf.h/d' "${ED}"/usr/include/libnetlink.h || die
|
||||||
|
|
||||||
if use berkdb ; then
|
if use berkdb ; then
|
||||||
dodir /var/lib/arpd
|
keepdir /var/lib/arpd
|
||||||
# bug 47482, arpd doesn't need to be in /sbin
|
# bug 47482, arpd doesn't need to be in /sbin
|
||||||
dodir /usr/bin
|
dodir /usr/bin
|
||||||
mv "${ED}"/sbin/arpd "${ED}"/usr/bin/ || die
|
mv "${ED}"/sbin/arpd "${ED}"/usr/bin/ || die
|
||||||
|
elif [[ -d "${ED}"/var/lib/arpd ]]; then
|
||||||
|
rmdir --ignore-fail-on-non-empty -p "${ED}"/var/lib/arpd || die
|
||||||
fi
|
fi
|
||||||
}
|
}
|
@ -1,16 +1,16 @@
|
|||||||
# Copyright 1999-2017 Gentoo Foundation
|
# Copyright 1999-2021 Gentoo Authors
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
EAPI="5"
|
EAPI=7
|
||||||
|
|
||||||
inherit eutils toolchain-funcs flag-o-matic multilib
|
inherit toolchain-funcs flag-o-matic multilib
|
||||||
|
|
||||||
if [[ ${PV} == "9999" ]] ; then
|
if [[ ${PV} == "9999" ]] ; then
|
||||||
EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
|
EGIT_REPO_URI="https://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
|
||||||
inherit git-2
|
inherit git-r3
|
||||||
else
|
else
|
||||||
SRC_URI="https://www.kernel.org/pub/linux/utils/net/${PN}/${P}.tar.xz"
|
SRC_URI="https://www.kernel.org/pub/linux/utils/net/${PN}/${P}.tar.xz"
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
|
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DESCRIPTION="kernel routing and traffic control utilities"
|
DESCRIPTION="kernel routing and traffic control utilities"
|
||||||
@ -18,57 +18,80 @@ HOMEPAGE="https://wiki.linuxfoundation.org/networking/iproute2"
|
|||||||
|
|
||||||
LICENSE="GPL-2"
|
LICENSE="GPL-2"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
IUSE="atm berkdb +iptables ipv6 minimal selinux"
|
IUSE="atm berkdb bpf caps elf +iptables ipv6 libbsd minimal selinux"
|
||||||
|
|
||||||
# We could make libmnl optional, but it's tiny, so eh
|
# We could make libmnl optional, but it's tiny, so eh
|
||||||
RDEPEND="!net-misc/arpd
|
RDEPEND="
|
||||||
!minimal? ( net-libs/libmnl )
|
!net-misc/arpd
|
||||||
iptables? ( >=net-firewall/iptables-1.4.20:= )
|
!minimal? ( net-libs/libmnl:= )
|
||||||
berkdb? ( sys-libs/db:= )
|
|
||||||
atm? ( net-dialup/linux-atm )
|
atm? ( net-dialup/linux-atm )
|
||||||
selinux? ( sys-libs/libselinux )"
|
berkdb? ( sys-libs/db:= )
|
||||||
|
bpf? ( dev-libs/libbpf:= )
|
||||||
|
caps? ( sys-libs/libcap )
|
||||||
|
elf? ( virtual/libelf:= )
|
||||||
|
iptables? ( >=net-firewall/iptables-1.4.20:= )
|
||||||
|
libbsd? ( dev-libs/libbsd )
|
||||||
|
selinux? ( sys-libs/libselinux )
|
||||||
|
"
|
||||||
# We require newer linux-headers for ipset support #549948 and some defines #553876
|
# We require newer linux-headers for ipset support #549948 and some defines #553876
|
||||||
DEPEND="${RDEPEND}
|
DEPEND="
|
||||||
app-arch/xz-utils
|
${RDEPEND}
|
||||||
iptables? ( virtual/pkgconfig )
|
|
||||||
sys-devel/bison
|
|
||||||
sys-devel/flex
|
|
||||||
>=sys-kernel/linux-headers-3.16
|
>=sys-kernel/linux-headers-3.16
|
||||||
elibc_glibc? ( >=sys-libs/glibc-2.7 )"
|
"
|
||||||
|
BDEPEND="
|
||||||
|
app-arch/xz-utils
|
||||||
|
>=sys-devel/bison-2.4
|
||||||
|
sys-devel/flex
|
||||||
|
virtual/pkgconfig
|
||||||
|
"
|
||||||
|
|
||||||
PATCHES=(
|
PATCHES=(
|
||||||
"${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
|
"${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
|
||||||
|
"${FILESDIR}"/${PN}-5.12.0-configure-nomagic.patch # bug 643722
|
||||||
|
#"${FILESDIR}"/${PN}-5.1.0-portability.patch
|
||||||
|
"${FILESDIR}"/${PN}-5.7.0-mix-signal.h-include.patch
|
||||||
)
|
)
|
||||||
|
|
||||||
|
doecho() {
|
||||||
|
echo "${@}"
|
||||||
|
"${@}" || die
|
||||||
|
}
|
||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
if ! use ipv6 ; then
|
if ! use ipv6 ; then
|
||||||
PATCHES+=(
|
PATCHES+=(
|
||||||
"${FILESDIR}"/${PN}-4.11.0-no-ipv6.patch #326849
|
"${FILESDIR}"/${PN}-4.20.0-no-ipv6.patch #326849
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
epatch "${PATCHES[@]}"
|
default
|
||||||
|
|
||||||
|
# Fix version if necessary
|
||||||
|
local versionfile="include/version.h"
|
||||||
|
if [[ "${PV}" != 9999 ]] && ! grep -Fq "${PV}" ${versionfile} ; then
|
||||||
|
einfo "Fixing version string"
|
||||||
|
sed "s@\"[[:digit:]\.]\+\"@\"${PV}\"@" \
|
||||||
|
-i ${versionfile} || die
|
||||||
|
fi
|
||||||
|
|
||||||
|
# echo -n is not POSIX compliant
|
||||||
|
sed 's@echo -n@printf@' -i configure || die
|
||||||
|
|
||||||
sed -i \
|
sed -i \
|
||||||
-e '/^CC :=/d' \
|
-e '/^CC :\?=/d' \
|
||||||
-e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
|
-e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
|
||||||
-e "s:-O2:${CFLAGS} ${CPPFLAGS}:" \
|
-e "s|-O2|${CFLAGS} ${CPPFLAGS}|" \
|
||||||
-e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
|
-e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
|
||||||
-e "/^WFLAGS/s:-Werror::" \
|
|
||||||
-e "/^DBM_INCLUDE/s:=.*:=${T}:" \
|
-e "/^DBM_INCLUDE/s:=.*:=${T}:" \
|
||||||
Makefile || die
|
Makefile || die
|
||||||
|
|
||||||
# Use /run instead of /var/run.
|
|
||||||
sed -i \
|
|
||||||
-e 's:/var/run:/run:g' \
|
|
||||||
include/namespace.h \
|
|
||||||
man/man8/ip-netns.8 || die
|
|
||||||
|
|
||||||
# build against system headers
|
# build against system headers
|
||||||
rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
|
rm -r include/netinet || die #include/linux include/ip{,6}tables{,_common}.h include/libiptc
|
||||||
sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
|
sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
|
||||||
|
|
||||||
use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc ip:' Makefile
|
if use minimal ; then
|
||||||
|
sed -i -e '/^SUBDIRS=/s:=.*:=lib tc ip:' Makefile || die
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
src_configure() {
|
src_configure() {
|
||||||
@ -83,21 +106,34 @@ src_configure() {
|
|||||||
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
|
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
|
|
||||||
cat <<-EOF > Config
|
# run "configure" script first which will create "config.mk"...
|
||||||
|
# Using econf breaks since 5.14.0 (a9c3d70d902a0473ee5c13336317006a52ce8242)
|
||||||
|
doecho ./configure --libbpf_force $(usex bpf on off)
|
||||||
|
|
||||||
|
# ...now switch on/off requested features via USE flags
|
||||||
|
# this is only useful if the test did not set other things, per bug #643722
|
||||||
|
cat <<-EOF >> config.mk
|
||||||
TC_CONFIG_ATM := $(usex atm y n)
|
TC_CONFIG_ATM := $(usex atm y n)
|
||||||
TC_CONFIG_XT := $(usex iptables y n)
|
TC_CONFIG_XT := $(usex iptables y n)
|
||||||
TC_CONFIG_NO_XT := $(usex iptables n y)
|
TC_CONFIG_NO_XT := $(usex iptables n y)
|
||||||
# We've locked in recent enough kernel headers #549948
|
# We've locked in recent enough kernel headers #549948
|
||||||
TC_CONFIG_IPSET := y
|
TC_CONFIG_IPSET := y
|
||||||
HAVE_BERKELEY_DB := $(usex berkdb y n)
|
HAVE_BERKELEY_DB := $(usex berkdb y n)
|
||||||
|
HAVE_CAP := $(usex caps y n)
|
||||||
HAVE_MNL := $(usex minimal n y)
|
HAVE_MNL := $(usex minimal n y)
|
||||||
|
HAVE_ELF := $(usex elf y n)
|
||||||
HAVE_SELINUX := $(usex selinux y n)
|
HAVE_SELINUX := $(usex selinux y n)
|
||||||
IP_CONFIG_SETNS := ${setns}
|
IP_CONFIG_SETNS := ${setns}
|
||||||
# Use correct iptables dir, #144265 #293709
|
# Use correct iptables dir, #144265 #293709
|
||||||
IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
|
IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
|
||||||
|
HAVE_LIBBSD := $(usex libbsd y n)
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
src_compile() {
|
||||||
|
emake V=1 NETNS_RUN_DIR=/run/netns
|
||||||
|
}
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
if use minimal ; then
|
if use minimal ; then
|
||||||
into /
|
into /
|
||||||
@ -108,6 +144,7 @@ src_install() {
|
|||||||
|
|
||||||
emake \
|
emake \
|
||||||
DESTDIR="${D}" \
|
DESTDIR="${D}" \
|
||||||
|
PREFIX="${EPREFIX}/usr" \
|
||||||
LIBDIR="${EPREFIX}"/$(get_libdir) \
|
LIBDIR="${EPREFIX}"/$(get_libdir) \
|
||||||
SBINDIR="${EPREFIX}"/sbin \
|
SBINDIR="${EPREFIX}"/sbin \
|
||||||
CONFDIR="${EPREFIX}"/etc/iproute2 \
|
CONFDIR="${EPREFIX}"/etc/iproute2 \
|
||||||
@ -116,8 +153,6 @@ src_install() {
|
|||||||
ARPDDIR="${EPREFIX}"/var/lib/arpd \
|
ARPDDIR="${EPREFIX}"/var/lib/arpd \
|
||||||
install
|
install
|
||||||
|
|
||||||
rm "${ED}"/usr/share/doc/${PF}/*.{sgml,tex} || die #455988
|
|
||||||
|
|
||||||
dodir /bin
|
dodir /bin
|
||||||
mv "${ED}"/{s,}bin/ip || die #330115
|
mv "${ED}"/{s,}bin/ip || die #330115
|
||||||
|
|
||||||
@ -130,9 +165,11 @@ src_install() {
|
|||||||
sed -i '/linux\/netconf.h/d' "${ED}"/usr/include/libnetlink.h || die
|
sed -i '/linux\/netconf.h/d' "${ED}"/usr/include/libnetlink.h || die
|
||||||
|
|
||||||
if use berkdb ; then
|
if use berkdb ; then
|
||||||
dodir /var/lib/arpd
|
keepdir /var/lib/arpd
|
||||||
# bug 47482, arpd doesn't need to be in /sbin
|
# bug 47482, arpd doesn't need to be in /sbin
|
||||||
dodir /usr/bin
|
dodir /usr/bin
|
||||||
mv "${ED}"/sbin/arpd "${ED}"/usr/bin/ || die
|
mv "${ED}"/sbin/arpd "${ED}"/usr/bin/ || die
|
||||||
|
elif [[ -d "${ED}"/var/lib/arpd ]]; then
|
||||||
|
rmdir --ignore-fail-on-non-empty -p "${ED}"/var/lib/arpd || die
|
||||||
fi
|
fi
|
||||||
}
|
}
|
@ -1,16 +1,16 @@
|
|||||||
# Copyright 1999-2017 Gentoo Foundation
|
# Copyright 1999-2021 Gentoo Authors
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
EAPI=6
|
EAPI=7
|
||||||
|
|
||||||
inherit toolchain-funcs flag-o-matic multilib
|
inherit toolchain-funcs flag-o-matic multilib
|
||||||
|
|
||||||
if [[ ${PV} == "9999" ]] ; then
|
if [[ ${PV} == "9999" ]] ; then
|
||||||
EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
|
EGIT_REPO_URI="https://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
|
||||||
inherit git-r3
|
inherit git-r3
|
||||||
else
|
else
|
||||||
SRC_URI="https://www.kernel.org/pub/linux/utils/net/${PN}/${P}.tar.xz"
|
SRC_URI="https://www.kernel.org/pub/linux/utils/net/${PN}/${P}.tar.xz"
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
|
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DESCRIPTION="kernel routing and traffic control utilities"
|
DESCRIPTION="kernel routing and traffic control utilities"
|
||||||
@ -18,58 +18,80 @@ HOMEPAGE="https://wiki.linuxfoundation.org/networking/iproute2"
|
|||||||
|
|
||||||
LICENSE="GPL-2"
|
LICENSE="GPL-2"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
IUSE="atm berkdb +iptables ipv6 minimal selinux"
|
IUSE="atm berkdb bpf caps elf +iptables ipv6 libbsd minimal selinux"
|
||||||
|
|
||||||
RDEPEND="!net-misc/arpd
|
# We could make libmnl optional, but it's tiny, so eh
|
||||||
iptables? ( >=net-firewall/iptables-1.4.20:= )
|
RDEPEND="
|
||||||
berkdb? ( sys-libs/db:= )
|
!net-misc/arpd
|
||||||
|
!minimal? ( net-libs/libmnl:= )
|
||||||
atm? ( net-dialup/linux-atm )
|
atm? ( net-dialup/linux-atm )
|
||||||
selinux? ( sys-libs/libselinux )"
|
berkdb? ( sys-libs/db:= )
|
||||||
# We require newer linux-headers for ipset support #549948
|
bpf? ( dev-libs/libbpf:= )
|
||||||
DEPEND="${RDEPEND}
|
caps? ( sys-libs/libcap )
|
||||||
|
elf? ( virtual/libelf:= )
|
||||||
|
iptables? ( >=net-firewall/iptables-1.4.20:= )
|
||||||
|
libbsd? ( dev-libs/libbsd )
|
||||||
|
selinux? ( sys-libs/libselinux )
|
||||||
|
"
|
||||||
|
# We require newer linux-headers for ipset support #549948 and some defines #553876
|
||||||
|
DEPEND="
|
||||||
|
${RDEPEND}
|
||||||
|
>=sys-kernel/linux-headers-3.16
|
||||||
|
"
|
||||||
|
BDEPEND="
|
||||||
app-arch/xz-utils
|
app-arch/xz-utils
|
||||||
iptables? ( virtual/pkgconfig )
|
>=sys-devel/bison-2.4
|
||||||
sys-devel/bison
|
|
||||||
sys-devel/flex
|
sys-devel/flex
|
||||||
>=sys-kernel/linux-headers-3.7
|
virtual/pkgconfig
|
||||||
elibc_glibc? ( >=sys-libs/glibc-2.7 )"
|
"
|
||||||
|
|
||||||
PATCHES=(
|
PATCHES=(
|
||||||
"${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
|
"${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
|
||||||
|
"${FILESDIR}"/${PN}-5.12.0-configure-nomagic.patch # bug 643722
|
||||||
|
#"${FILESDIR}"/${PN}-5.1.0-portability.patch
|
||||||
|
"${FILESDIR}"/${PN}-5.7.0-mix-signal.h-include.patch
|
||||||
)
|
)
|
||||||
|
|
||||||
|
doecho() {
|
||||||
|
echo "${@}"
|
||||||
|
"${@}" || die
|
||||||
|
}
|
||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
if ! use ipv6 ; then
|
if ! use ipv6 ; then
|
||||||
PATCHES+=(
|
PATCHES+=(
|
||||||
"${FILESDIR}"/${PN}-4.11.0-no-ipv6.patch #326849
|
"${FILESDIR}"/${PN}-4.20.0-no-ipv6.patch #326849
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
default
|
default
|
||||||
|
|
||||||
|
# Fix version if necessary
|
||||||
|
local versionfile="include/version.h"
|
||||||
|
if [[ "${PV}" != 9999 ]] && ! grep -Fq "${PV}" ${versionfile} ; then
|
||||||
|
einfo "Fixing version string"
|
||||||
|
sed "s@\"[[:digit:]\.]\+\"@\"${PV}\"@" \
|
||||||
|
-i ${versionfile} || die
|
||||||
|
fi
|
||||||
|
|
||||||
|
# echo -n is not POSIX compliant
|
||||||
|
sed 's@echo -n@printf@' -i configure || die
|
||||||
|
|
||||||
sed -i \
|
sed -i \
|
||||||
-e '/^CC :=/d' \
|
-e '/^CC :\?=/d' \
|
||||||
-e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
|
-e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
|
||||||
-e "s:-O2:${CFLAGS} ${CPPFLAGS}:" \
|
-e "s|-O2|${CFLAGS} ${CPPFLAGS}|" \
|
||||||
-e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
|
-e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
|
||||||
-e "/^WFLAGS/s:-Werror::" \
|
|
||||||
-e "/^DBM_INCLUDE/s:=.*:=${T}:" \
|
-e "/^DBM_INCLUDE/s:=.*:=${T}:" \
|
||||||
Makefile || die
|
Makefile || die
|
||||||
|
|
||||||
# Use /run instead of /var/run.
|
|
||||||
sed -i \
|
|
||||||
-e 's:/var/run:/run:g' \
|
|
||||||
include/namespace.h \
|
|
||||||
man/man8/ip-netns.8 || die
|
|
||||||
|
|
||||||
# build against system headers
|
# build against system headers
|
||||||
rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
|
rm -r include/netinet || die #include/linux include/ip{,6}tables{,_common}.h include/libiptc
|
||||||
sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
|
sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
|
||||||
|
|
||||||
# don't build arpd if USE=-berkdb #81660
|
if use minimal ; then
|
||||||
use berkdb || sed -i '/^TARGETS=/s: arpd : :' misc/Makefile
|
sed -i -e '/^SUBDIRS=/s:=.*:=lib tc ip:' Makefile || die
|
||||||
|
fi
|
||||||
use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc ip:' Makefile
|
|
||||||
}
|
}
|
||||||
|
|
||||||
src_configure() {
|
src_configure() {
|
||||||
@ -84,39 +106,55 @@ src_configure() {
|
|||||||
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
|
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
|
|
||||||
cat <<-EOF > Config
|
# run "configure" script first which will create "config.mk"...
|
||||||
|
# Using econf breaks since 5.14.0 (a9c3d70d902a0473ee5c13336317006a52ce8242)
|
||||||
|
doecho ./configure --libbpf_force $(usex bpf on off)
|
||||||
|
|
||||||
|
# ...now switch on/off requested features via USE flags
|
||||||
|
# this is only useful if the test did not set other things, per bug #643722
|
||||||
|
cat <<-EOF >> config.mk
|
||||||
TC_CONFIG_ATM := $(usex atm y n)
|
TC_CONFIG_ATM := $(usex atm y n)
|
||||||
TC_CONFIG_XT := $(usex iptables y n)
|
TC_CONFIG_XT := $(usex iptables y n)
|
||||||
|
TC_CONFIG_NO_XT := $(usex iptables n y)
|
||||||
# We've locked in recent enough kernel headers #549948
|
# We've locked in recent enough kernel headers #549948
|
||||||
TC_CONFIG_IPSET := y
|
TC_CONFIG_IPSET := y
|
||||||
|
HAVE_BERKELEY_DB := $(usex berkdb y n)
|
||||||
|
HAVE_CAP := $(usex caps y n)
|
||||||
|
HAVE_MNL := $(usex minimal n y)
|
||||||
|
HAVE_ELF := $(usex elf y n)
|
||||||
HAVE_SELINUX := $(usex selinux y n)
|
HAVE_SELINUX := $(usex selinux y n)
|
||||||
IP_CONFIG_SETNS := ${setns}
|
IP_CONFIG_SETNS := ${setns}
|
||||||
# Use correct iptables dir, #144265 #293709
|
# Use correct iptables dir, #144265 #293709
|
||||||
IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
|
IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
|
||||||
|
HAVE_LIBBSD := $(usex libbsd y n)
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
src_compile() {
|
||||||
|
emake V=1 NETNS_RUN_DIR=/run/netns
|
||||||
|
}
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
if use minimal ; then
|
if use minimal ; then
|
||||||
into /
|
into /
|
||||||
dosbin tc/tc ip/ip
|
dosbin tc/tc
|
||||||
|
dobin ip/ip
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
emake \
|
emake \
|
||||||
DESTDIR="${D}" \
|
DESTDIR="${D}" \
|
||||||
LIBDIR="${EPREFIX%/}"/$(get_libdir) \
|
PREFIX="${EPREFIX}/usr" \
|
||||||
SBINDIR="${EPREFIX%/}"/sbin \
|
LIBDIR="${EPREFIX}"/$(get_libdir) \
|
||||||
CONFDIR="${EPREFIX%/}"/etc/iproute2 \
|
SBINDIR="${EPREFIX}"/sbin \
|
||||||
DOCDIR="${EPREFIX%/}"/usr/share/doc/${PF} \
|
CONFDIR="${EPREFIX}"/etc/iproute2 \
|
||||||
MANDIR="${EPREFIX%/}"/usr/share/man \
|
DOCDIR="${EPREFIX}"/usr/share/doc/${PF} \
|
||||||
ARPDDIR="${EPREFIX%/}"/var/lib/arpd \
|
MANDIR="${EPREFIX}"/usr/share/man \
|
||||||
|
ARPDDIR="${EPREFIX}"/var/lib/arpd \
|
||||||
install
|
install
|
||||||
|
|
||||||
rm "${ED%/}"/usr/share/doc/${PF}/*.{sgml,tex} || die #455988
|
|
||||||
|
|
||||||
dodir /bin
|
dodir /bin
|
||||||
mv "${ED%/}"/{s,}bin/ip || die #330115
|
mv "${ED}"/{s,}bin/ip || die #330115
|
||||||
|
|
||||||
dolib.a lib/libnetlink.a
|
dolib.a lib/libnetlink.a
|
||||||
insinto /usr/include
|
insinto /usr/include
|
||||||
@ -124,12 +162,14 @@ src_install() {
|
|||||||
# This local header pulls in a lot of linux headers it
|
# This local header pulls in a lot of linux headers it
|
||||||
# doesn't directly need. Delete this header that requires
|
# doesn't directly need. Delete this header that requires
|
||||||
# linux-headers-3.8 until that goes stable. #467716
|
# linux-headers-3.8 until that goes stable. #467716
|
||||||
sed -i '/linux\/netconf.h/d' "${ED%/}"/usr/include/libnetlink.h || die
|
sed -i '/linux\/netconf.h/d' "${ED}"/usr/include/libnetlink.h || die
|
||||||
|
|
||||||
if use berkdb ; then
|
if use berkdb ; then
|
||||||
dodir /var/lib/arpd
|
keepdir /var/lib/arpd
|
||||||
# bug 47482, arpd doesn't need to be in /sbin
|
# bug 47482, arpd doesn't need to be in /sbin
|
||||||
dodir /usr/bin
|
dodir /usr/bin
|
||||||
mv "${ED%/}"/sbin/arpd "${ED%/}"/usr/bin/ || die
|
mv "${ED}"/sbin/arpd "${ED}"/usr/bin/ || die
|
||||||
|
elif [[ -d "${ED}"/var/lib/arpd ]]; then
|
||||||
|
rmdir --ignore-fail-on-non-empty -p "${ED}"/var/lib/arpd || die
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
|
||||||
<pkgmetadata>
|
<pkgmetadata>
|
||||||
<maintainer type="project">
|
<maintainer type="project">
|
||||||
<email>base-system@gentoo.org</email>
|
<email>base-system@gentoo.org</email>
|
||||||
@ -7,7 +7,13 @@
|
|||||||
</maintainer>
|
</maintainer>
|
||||||
<use>
|
<use>
|
||||||
<flag name="berkdb">build programs that use berkdb (just arpd)</flag>
|
<flag name="berkdb">build programs that use berkdb (just arpd)</flag>
|
||||||
|
<flag name="bpf">Use <pkg>dev-libs/libbpf</pkg></flag>
|
||||||
|
<flag name="elf">support loading eBPF programs from ELFs (e.g. LLVM's eBPF backend)</flag>
|
||||||
<flag name="iptables">include support for iptables filtering</flag>
|
<flag name="iptables">include support for iptables filtering</flag>
|
||||||
<flag name="minimal">only install ip and tc programs</flag>
|
<flag name="libbsd">Use <pkg>dev-libs/libbsd</pkg> instead of internal funcs</flag>
|
||||||
|
<flag name="minimal">only install ip and tc programs, without eBPF support</flag>
|
||||||
</use>
|
</use>
|
||||||
|
<upstream>
|
||||||
|
<remote-id type="cpe">cpe:/a:iproute2_project:iproute2</remote-id>
|
||||||
|
</upstream>
|
||||||
</pkgmetadata>
|
</pkgmetadata>
|
||||||
|
Loading…
Reference in New Issue
Block a user