2 # Copyright (C) 2006-2015 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.xz
15 PKG_SOURCE_URL
:=@KERNEL
/linux
/utils
/net
/iproute2
16 PKG_HASH
:=d9ec5ca1f47d8a85416fa26e7dc1cbf5d067640eb60e90bdc1c7e5bdc6a29984
18 PKG_BUILD_DEPENDS
:=iptables
20 PKG_CPE_ID
:=cpe
:/a
:iproute2_project
:iproute2
22 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(BUILD_VARIANT
)/$(PKG_NAME
)-$(PKG_VERSION
)
24 include $(INCLUDE_DIR
)/kernel.mk
25 include $(INCLUDE_DIR
)/package.mk
26 include $(INCLUDE_DIR
)/nls.mk
28 define Package
/iproute2
/Default
31 URL
:=http
://www.linuxfoundation.org
/collaborate
/workgroups
/networking
/iproute2
32 SUBMENU
:=Routing and Redirection
33 MAINTAINER
:=Russell Senior
<russell@personaltelco.net
>
36 define Package
/ip-tiny
37 $(call Package
/iproute2
/Default
)
38 TITLE
:=Routing control utility
(Minimal
)
41 ALTERNATIVES
:=200:/sbin
/ip
:/usr
/libexec
/ip-tiny
42 DEPENDS
:=+libnl-tiny
+(PACKAGE_devlink||PACKAGE_rdma
):libmnl
45 define Package
/ip-full
46 $(call Package
/iproute2
/Default
)
47 TITLE
:=Routing control utility
(Full
)
50 ALTERNATIVES
:=300:/sbin
/ip
:/usr
/libexec
/ip-full
51 DEPENDS
:=+libnl-tiny
+(PACKAGE_devlink||PACKAGE_rdma
):libmnl
55 $(call Package
/iproute2
/Default
)
56 TITLE
:=Traffic control utility
57 DEPENDS
:=+kmod-sched-core
+(PACKAGE_devlink||PACKAGE_rdma
):libmnl
+libelf1
61 $(call Package
/iproute2
/Default
)
62 TITLE
:=General netlink utility frontend
63 DEPENDS
:=+libnl-tiny
+(PACKAGE_devlink||PACKAGE_rdma
):libmnl
66 define Package
/ip-bridge
67 $(call Package
/iproute2
/Default
)
68 TITLE
:=Bridge configuration utility from iproute2
69 DEPENDS
:=+libnl-tiny
+(PACKAGE_devlink||PACKAGE_rdma
):libmnl
73 $(call Package
/iproute2
/Default
)
74 TITLE
:=Socket statistics utility
75 DEPENDS
:=+libnl-tiny
+(PACKAGE_devlink||PACKAGE_rdma
):libmnl
79 $(call Package
/iproute2
/Default
)
80 TITLE
:=Network statistics utility
81 DEPENDS
:=+libnl-tiny
+(PACKAGE_devlink||PACKAGE_rdma
):libmnl
84 define Package
/devlink
85 $(call Package
/iproute2
/Default
)
86 TITLE
:=Network devlink utility
91 $(call Package
/iproute2
/Default
)
92 TITLE
:=Network rdma utility
96 ifeq ($(BUILD_VARIANT
),tiny
)
100 ifdef CONFIG_PACKAGE_devlink
104 ifdef CONFIG_PACKAGE_rdma
108 define Build
/Configure
109 $(SED
) "s,-I/usr/include/db3,," $(PKG_BUILD_DIR
)/Makefile
110 $(SED
) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \
111 $(PKG_BUILD_DIR
)/Makefile
112 $(SED
) "s,^LIBC_INCLUDE.*,LIBC_INCLUDE=$(STAGING_DIR)/include," \
113 $(PKG_BUILD_DIR
)/Makefile
114 echo
"static const char SNAPSHOT[] = \"$(PKG_VERSION)-$(PKG_RELEASE)-openwrt\";" \
115 > $(PKG_BUILD_DIR
)/include/SNAPSHOT.h
118 TARGET_CFLAGS
+= -ffunction-sections
-fdata-sections
121 EXTRA_CCOPTS
="-I$(STAGING_DIR)/usr/include/libnl-tiny" \
122 KERNEL_INCLUDE
="$(LINUX_DIR)/include" \
124 LDFLAGS
="$(TARGET_LDFLAGS) -Wl,--gc-sections" \
125 IP_CONFIG_TINY
=$(IP_CONFIG_TINY
) \
126 HAVE_MNL
=$(HAVE_MNL
) \
127 IPT_LIB_DIR
=/usr
/lib
/iptables \
131 +$(MAKE_VARS
) $(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) $(MAKE_FLAGS
)
134 define Build
/InstallDev
135 $(INSTALL_DIR
) $(1)/usr
/include
136 $(CP
) $(PKG_BUILD_DIR
)/include/{libgenl
,libnetlink
}.h
$(1)/usr
/include/
137 $(INSTALL_DIR
) $(1)/usr
/lib
138 $(CP
) $(PKG_BUILD_DIR
)/lib
/libnetlink.a
$(1)/usr
/lib
/
141 define Package
/ip-tiny
/install
142 $(INSTALL_DIR
) $(1)/usr
/libexec
143 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/ip
/ip
$(1)/usr
/libexec
/ip-tiny
146 define Package
/ip-full
/install
147 $(INSTALL_DIR
) $(1)/usr
/libexec
148 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/ip
/ip
$(1)/usr
/libexec
/ip-full
151 define Package
/tc
/install
152 $(INSTALL_DIR
) $(1)/usr
/sbin
153 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/tc
/tc
$(1)/usr
/sbin
/
154 $(INSTALL_DIR
) $(1)/etc
/hotplug.d
/iface
155 $(INSTALL_BIN
) .
/files
/15-teql
$(1)/etc
/hotplug.d
/iface
/
158 define Package
/genl
/install
159 $(INSTALL_DIR
) $(1)/usr
/sbin
160 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/genl
/genl
$(1)/usr
/sbin
/
163 define Package
/ip-bridge
/install
164 $(INSTALL_DIR
) $(1)/usr
/sbin
165 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/bridge
/bridge
$(1)/usr
/sbin
/
168 define Package
/ss
/install
169 $(INSTALL_DIR
) $(1)/usr
/sbin
170 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/misc
/ss
$(1)/usr
/sbin
/
173 define Package
/nstat
/install
174 $(INSTALL_DIR
) $(1)/usr
/sbin
175 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/misc
/nstat
$(1)/usr
/sbin
/
178 define Package
/devlink
/install
179 $(INSTALL_DIR
) $(1)/usr
/sbin
180 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/devlink
/devlink
$(1)/usr
/sbin
/
183 define Package
/rdma
/install
184 $(INSTALL_DIR
) $(1)/usr
/sbin
185 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/rdma
/rdma
$(1)/usr
/sbin
/
188 $(eval
$(call BuildPackage
,ip-tiny
))
189 $(eval
$(call BuildPackage
,ip-full
))
190 $(eval
$(call BuildPackage
,tc
))
191 $(eval
$(call BuildPackage
,genl
))
192 $(eval
$(call BuildPackage
,ip-bridge
))
193 $(eval
$(call BuildPackage
,ss
))
194 $(eval
$(call BuildPackage
,nstat
))
195 $(eval
$(call BuildPackage
,devlink
))
196 $(eval
$(call BuildPackage
,rdma
))