blob: 7272e8f1472d0394904c50d75820a87d9cb97024 [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001SUMMARY = "TCP / IP networking and traffic control utilities"
2DESCRIPTION = "Iproute2 is a collection of utilities for controlling \
3TCP / IP networking and traffic control in Linux. Of the utilities ip \
4and tc are the most important. ip controls IPv4 and IPv6 \
5configuration and tc stands for traffic control."
6HOMEPAGE = "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2"
7SECTION = "base"
8LICENSE = "GPL-2.0-or-later"
9LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \
10 file://ip/ip.c;beginline=3;endline=8;md5=689d691d0410a4b64d3899f8d6e31817"
11
12DEPENDS = "flex-native bison-native iptables libcap"
13
14SRC_URI = "${KERNELORG_MIRROR}/linux/utils/net/${BPN}/${BP}.tar.xz \
15 file://0001-libc-compat.h-add-musl-workaround.patch \
16 "
17
18SRC_URI[sha256sum] = "5ce12a0fec6b212725ef218735941b2dab76244db7e72646a76021b0537b43ab"
19
20inherit update-alternatives bash-completion pkgconfig
21
22PACKAGECONFIG ??= "tipc elf devlink"
23PACKAGECONFIG[tipc] = ",,libmnl,"
24PACKAGECONFIG[elf] = ",,elfutils,"
25PACKAGECONFIG[devlink] = ",,libmnl,"
26PACKAGECONFIG[rdma] = ",,libmnl,"
27PACKAGECONFIG[selinux] = ",,libselinux"
28
29IPROUTE2_MAKE_SUBDIRS = "lib tc ip bridge misc genl ${@bb.utils.filter('PACKAGECONFIG', 'devlink tipc rdma', d)}"
30
31# CFLAGS are computed in Makefile and reference CCOPTS
32#
33EXTRA_OEMAKE = "\
34 CC='${CC}' \
35 KERNEL_INCLUDE=${STAGING_INCDIR} \
36 DOCDIR=${docdir}/iproute2 \
37 SUBDIRS='${IPROUTE2_MAKE_SUBDIRS}' \
38 SBINDIR='${base_sbindir}' \
39 LIBDIR='${libdir}' \
40 CCOPTS='${CFLAGS}' \
41"
42
43do_configure:append () {
44 sh configure ${STAGING_INCDIR}
45 # Explicitly disable ATM support
46 sed -i -e '/TC_CONFIG_ATM/d' config.mk
47}
48
49do_install () {
50 oe_runmake DESTDIR=${D} install
51 mv ${D}${base_sbindir}/ip ${D}${base_sbindir}/ip.iproute2
52 install -d ${D}${datadir}
53 mv ${D}/share/* ${D}${datadir}/ || true
54 rm ${D}/share -rf || true
55}
56
57# The .so files in iproute2-tc are modules, not traditional libraries
58INSANE_SKIP:${PN}-tc = "dev-so"
59
60IPROUTE2_PACKAGES =+ "\
61 ${PN}-devlink \
62 ${PN}-genl \
63 ${PN}-ifstat \
64 ${PN}-ip \
65 ${PN}-lnstat \
66 ${PN}-nstat \
Andrew Geisslerc5535c92023-01-27 16:10:19 -060067 ${PN}-routel \
Andrew Geissler517393d2023-01-13 08:55:19 -060068 ${PN}-rtacct \
69 ${PN}-ss \
70 ${PN}-tc \
71 ${PN}-tipc \
72 ${PN}-rdma \
73"
74
75PACKAGE_BEFORE_PN = "${IPROUTE2_PACKAGES}"
76RDEPENDS:${PN} += "${PN}-ip"
77
78FILES:${PN}-tc = "${base_sbindir}/tc* \
79 ${libdir}/tc/*.so"
80FILES:${PN}-lnstat = "${base_sbindir}/lnstat \
81 ${base_sbindir}/ctstat \
82 ${base_sbindir}/rtstat"
83FILES:${PN}-ifstat = "${base_sbindir}/ifstat"
84FILES:${PN}-ip = "${base_sbindir}/ip.${PN} ${sysconfdir}/iproute2"
85FILES:${PN}-genl = "${base_sbindir}/genl"
86FILES:${PN}-rtacct = "${base_sbindir}/rtacct"
87FILES:${PN}-nstat = "${base_sbindir}/nstat"
88FILES:${PN}-ss = "${base_sbindir}/ss"
89FILES:${PN}-tipc = "${base_sbindir}/tipc"
90FILES:${PN}-devlink = "${base_sbindir}/devlink"
91FILES:${PN}-rdma = "${base_sbindir}/rdma"
Andrew Geisslerc5535c92023-01-27 16:10:19 -060092FILES:${PN}-routel = "${base_sbindir}/routel"
93
94RDEPENDS:${PN}-routel = "python3-core"
Andrew Geissler517393d2023-01-13 08:55:19 -060095
96ALTERNATIVE:${PN}-ip = "ip"
97ALTERNATIVE_TARGET[ip] = "${base_sbindir}/ip.${BPN}"
98ALTERNATIVE_LINK_NAME[ip] = "${base_sbindir}/ip"
99ALTERNATIVE_PRIORITY = "100"
100
101ALTERNATIVE:${PN}-tc = "tc"
102ALTERNATIVE_LINK_NAME[tc] = "${base_sbindir}/tc"
103ALTERNATIVE_PRIORITY_${PN}-tc = "100"