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
:=df047302a39650ef832c07e8dab5df7a23218cd398bd310c8628e386161d20ba
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
)
42 ALTERNATIVES
:=200:/sbin
/ip
:/usr
/libexec
/ip-tiny
43 DEPENDS
:=+libnl-tiny
+(PACKAGE_devlink||PACKAGE_rdma
):libmnl
46 define Package
/ip-full
47 $(call Package
/iproute2
/Default
)
48 TITLE
:=Routing control utility
(Full
)
51 ALTERNATIVES
:=300:/sbin
/ip
:/usr
/libexec
/ip-full
52 DEPENDS
:=+libnl-tiny
+libelf
+(PACKAGE_devlink||PACKAGE_rdma
):libmnl
56 $(call Package
/iproute2
/Default
)
57 TITLE
:=Traffic control utility
60 DEPENDS
:=+kmod-sched-core
+libxtables
+libelf
+(PACKAGE_devlink||PACKAGE_rdma
):libmnl
64 $(call Package
/iproute2
/Default
)
65 TITLE
:=General netlink utility frontend
66 DEPENDS
:=+libnl-tiny
+(PACKAGE_devlink||PACKAGE_rdma
):libmnl
+(PACKAGE_tc||PACKAGE_ip-full
):libelf
69 define Package
/ip-bridge
70 $(call Package
/iproute2
/Default
)
71 TITLE
:=Bridge configuration utility from iproute2
72 DEPENDS
:=+libnl-tiny
+(PACKAGE_devlink||PACKAGE_rdma
):libmnl
+(PACKAGE_tc||PACKAGE_ip-full
):libelf
76 $(call Package
/iproute2
/Default
)
77 TITLE
:=Socket statistics utility
78 DEPENDS
:=+libnl-tiny
+(PACKAGE_devlink||PACKAGE_rdma
):libmnl
+(PACKAGE_tc||PACKAGE_ip-full
):libelf
82 $(call Package
/iproute2
/Default
)
83 TITLE
:=Network statistics utility
84 DEPENDS
:=+libnl-tiny
+(PACKAGE_devlink||PACKAGE_rdma
):libmnl
+(PACKAGE_tc||PACKAGE_ip-full
):libelf
87 define Package
/devlink
88 $(call Package
/iproute2
/Default
)
89 TITLE
:=Network devlink utility
90 DEPENDS
:=+libmnl
+(PACKAGE_tc||PACKAGE_ip-full
):libelf
94 $(call Package
/iproute2
/Default
)
95 TITLE
:=Network rdma utility
96 DEPENDS
:=+libmnl
+(PACKAGE_tc||PACKAGE_ip-full
):libelf
99 ifeq ($(BUILD_VARIANT
),tiny
)
103 ifeq ($(BUILD_VARIANT
),full
)
107 ifeq ($(BUILD_VARIANT
),tc
)
112 ifdef CONFIG_PACKAGE_devlink
116 ifdef CONFIG_PACKAGE_rdma
120 define Build
/Configure
121 echo
"static const char SNAPSHOT[] = \"$(PKG_VERSION)-$(PKG_RELEASE)-openwrt\";" \
122 > $(PKG_BUILD_DIR
)/include/SNAPSHOT.h
125 TARGET_CFLAGS
+= -ffunction-sections
-fdata-sections
126 TARGET_LDFLAGS
+= -Wl
,--gc-sections
127 TARGET_CPPFLAGS
+= -I
$(STAGING_DIR
)/usr
/include/libnl-tiny
130 KERNEL_INCLUDE
="$(LINUX_DIR)/user_headers/include" \
131 SHARED_LIBS
=$(SHARED_LIBS
) \
132 IP_CONFIG_TINY
=$(IP_CONFIG_TINY
) \
133 HAVE_ELF
=$(HAVE_ELF
) \
134 HAVE_MNL
=$(HAVE_MNL
) \
135 IPT_LIB_DIR
=/usr
/lib
/iptables \
136 XT_LIB_DIR
=/usr
/lib
/iptables \
140 +$(MAKE_VARS
) $(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) $(MAKE_FLAGS
)
143 define Build
/InstallDev
144 $(INSTALL_DIR
) $(1)/usr
/include
145 $(CP
) $(PKG_BUILD_DIR
)/include/{libgenl
,libnetlink
}.h
$(1)/usr
/include/
146 $(INSTALL_DIR
) $(1)/usr
/lib
147 $(CP
) $(PKG_BUILD_DIR
)/lib
/libnetlink.a
$(1)/usr
/lib
/
150 define Package
/ip-tiny
/install
151 $(INSTALL_DIR
) $(1)/usr
/libexec
152 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/ip
/ip
$(1)/usr
/libexec
/ip-tiny
155 define Package
/ip-full
/install
156 $(INSTALL_DIR
) $(1)/usr
/libexec
157 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/ip
/ip
$(1)/usr
/libexec
/ip-full
160 define Package
/tc
/install
161 $(INSTALL_DIR
) $(1)/usr
/sbin
162 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/tc
/tc
$(1)/usr
/sbin
/
163 $(INSTALL_DIR
) $(1)/etc
/hotplug.d
/iface
164 $(INSTALL_BIN
) .
/files
/15-teql
$(1)/etc
/hotplug.d
/iface
/
165 ifeq ($(SHARED_LIBS
),y
)
166 $(INSTALL_DIR
) $(1)/usr
/lib
/tc
167 $(CP
) $(PKG_BUILD_DIR
)/tc
/*.so
$(1)/usr
/lib
/tc
171 define Package
/genl
/install
172 $(INSTALL_DIR
) $(1)/usr
/sbin
173 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/genl
/genl
$(1)/usr
/sbin
/
176 define Package
/ip-bridge
/install
177 $(INSTALL_DIR
) $(1)/usr
/sbin
178 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/bridge
/bridge
$(1)/usr
/sbin
/
181 define Package
/ss
/install
182 $(INSTALL_DIR
) $(1)/usr
/sbin
183 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/misc
/ss
$(1)/usr
/sbin
/
186 define Package
/nstat
/install
187 $(INSTALL_DIR
) $(1)/usr
/sbin
188 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/misc
/nstat
$(1)/usr
/sbin
/
191 define Package
/devlink
/install
192 $(INSTALL_DIR
) $(1)/usr
/sbin
193 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/devlink
/devlink
$(1)/usr
/sbin
/
196 define Package
/rdma
/install
197 $(INSTALL_DIR
) $(1)/usr
/sbin
198 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/rdma
/rdma
$(1)/usr
/sbin
/
201 $(eval
$(call BuildPackage
,ip-tiny
))
202 $(eval
$(call BuildPackage
,ip-full
))
203 $(eval
$(call BuildPackage
,tc
))
204 $(eval
$(call BuildPackage
,genl
))
205 $(eval
$(call BuildPackage
,ip-bridge
))
206 $(eval
$(call BuildPackage
,ss
))
207 $(eval
$(call BuildPackage
,nstat
))
208 $(eval
$(call BuildPackage
,devlink
))
209 $(eval
$(call BuildPackage
,rdma
))