blob: 8c460adf731db2d699c523d0017644cc7162efe9 [file] [log] [blame]
Patrick Williamsac13d5f2023-11-24 18:59:46 -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 "
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
Patrick Williams56b44a92024-01-19 08:49:29 -060018SRC_URI[sha256sum] = "ff942dd9828d7d1f867f61fe72ce433078c31e5d8e4a78e20f02cb5892e8841d"
Patrick Williamsac13d5f2023-11-24 18:59:46 -060019
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 CONF_USR_DIR='${libdir}/iproute2' \
40 LIBDIR='${libdir}' \
41 CCOPTS='${CFLAGS}' \
42"
43
44do_configure:append () {
45 sh configure ${STAGING_INCDIR}
46 # Explicitly disable ATM support
47 sed -i -e '/TC_CONFIG_ATM/d' config.mk
48}
49
50do_install () {
51 oe_runmake DESTDIR=${D} install
52 mv ${D}${base_sbindir}/ip ${D}${base_sbindir}/ip.iproute2
53 install -d ${D}${datadir}
54 mv ${D}/share/* ${D}${datadir}/ || true
55 rm ${D}/share -rf || true
56}
57
58# The .so files in iproute2-tc are modules, not traditional libraries
59INSANE_SKIP:${PN}-tc = "dev-so"
60
61IPROUTE2_PACKAGES =+ "\
Patrick Williams44b3caf2024-04-12 16:51:14 -050062 ${PN}-bridge \
Patrick Williamsac13d5f2023-11-24 18:59:46 -060063 ${PN}-devlink \
64 ${PN}-genl \
65 ${PN}-ifstat \
66 ${PN}-ip \
67 ${PN}-lnstat \
68 ${PN}-nstat \
69 ${PN}-routel \
70 ${PN}-rtacct \
71 ${PN}-ss \
72 ${PN}-tc \
73 ${PN}-tipc \
74 ${PN}-rdma \
75"
76
77PACKAGE_BEFORE_PN = "${IPROUTE2_PACKAGES}"
78RDEPENDS:${PN} += "${PN}-ip"
79
80FILES:${PN}-tc = "${base_sbindir}/tc* \
81 ${libdir}/tc/*.so"
82FILES:${PN}-lnstat = "${base_sbindir}/lnstat \
83 ${base_sbindir}/ctstat \
84 ${base_sbindir}/rtstat"
85FILES:${PN}-ifstat = "${base_sbindir}/ifstat"
86FILES:${PN}-ip = "${base_sbindir}/ip.* ${libdir}/iproute2"
87FILES:${PN}-genl = "${base_sbindir}/genl"
88FILES:${PN}-rtacct = "${base_sbindir}/rtacct"
89FILES:${PN}-nstat = "${base_sbindir}/nstat"
90FILES:${PN}-ss = "${base_sbindir}/ss"
91FILES:${PN}-tipc = "${base_sbindir}/tipc"
92FILES:${PN}-devlink = "${base_sbindir}/devlink"
93FILES:${PN}-rdma = "${base_sbindir}/rdma"
94FILES:${PN}-routel = "${base_sbindir}/routel"
Patrick Williams44b3caf2024-04-12 16:51:14 -050095FILES:${PN}-bridge = "${base_sbindir}/bridge"
Patrick Williamsac13d5f2023-11-24 18:59:46 -060096
97RDEPENDS:${PN}-routel = "python3-core"
98
99ALTERNATIVE:${PN}-ip = "ip"
100ALTERNATIVE_TARGET[ip] = "${base_sbindir}/ip.${BPN}"
101ALTERNATIVE_LINK_NAME[ip] = "${base_sbindir}/ip"
102ALTERNATIVE_PRIORITY = "100"
103
104ALTERNATIVE:${PN}-tc = "tc"
105ALTERNATIVE_LINK_NAME[tc] = "${base_sbindir}/tc"
106ALTERNATIVE_PRIORITY_${PN}-tc = "100"