2 # Copyright (C) 2006-2010 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.gz
15 PKG_SOURCE_URL
:=http
://kernel.org
/pub
/linux
/utils
/net
/iproute2
/
16 PKG_MD5SUM
:=d58f388b670e0c1b2cd81eb65d5ac626
19 PKG_BUILD_DIR
:=$(BUILD_DIR
)/iproute2-
$(PKG_VERSION
)
21 include $(INCLUDE_DIR
)/package.mk
23 define Package
/iproute2
/Default
26 URL
:=http
://linux-net.osdl.org
/index.php
/Iproute2
30 $(call Package
/iproute2
/Default
)
31 SUBMENU
:=Routing and Redirection
33 TITLE
:=Routing control utility
36 define Package
/ip
/conffiles
37 /etc
/iproute2
/rt_tables
41 $(call Package
/iproute2
/Default
)
42 TITLE
:=Traffic control utility
47 $(call Package
/iproute2
/Default
)
48 TITLE
:=General netlink utility frontend
52 $(call Package
/iproute2
/Default
)
53 TITLE
:=Socket statistics utility
56 define Build
/Configure
57 $(SED
) "s,-I/usr/include/db3,," $(PKG_BUILD_DIR
)/Makefile
58 $(SED
) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \
59 $(PKG_BUILD_DIR
)/Makefile
60 $(SED
) "s,^LIBC_INCLUDE.*,LIBC_INCLUDE=$(STAGING_DIR)/include," \
61 $(PKG_BUILD_DIR
)/Makefile
62 echo
"static const char SNAPSHOT[] = \"$(PKG_VERSION)-$(PKG_RELEASE)-openwrt\";" \
63 > $(PKG_BUILD_DIR
)/include/SNAPSHOT.h
67 EXTRA_CCOPTS
="$(TARGET_CFLAGS) -I../include -I$(STAGING_DIR)/usr/include/libnl-tiny" \
68 KERNEL_INCLUDE
="$(LINUX_DIR)/include" \
72 $(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
)/netem \
73 HOSTCC
="$(HOSTCC)" EXTRA_CCOPTS
="$(TARGET_CFLAGS)" \
74 CFLAGS
="-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall \
75 -I../include -DRESOLVE_HOSTNAMES"
76 $(MAKE_VARS
) $(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) $(MAKE_FLAGS
) all
77 $(MAKE_VARS
) $(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
)/tc
$(MAKE_FLAGS
) tc
78 $(MAKE_VARS
) $(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
)/ip
$(MAKE_FLAGS
) ip
79 $(MAKE_VARS
) $(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
)/misc
$(MAKE_FLAGS
) ss
82 define Build
/InstallDev
83 $(INSTALL_DIR
) $(1)/usr
/include
84 $(CP
) $(PKG_BUILD_DIR
)/include/libnetlink.h
$(1)/usr
/include/
85 $(INSTALL_DIR
) $(1)/usr
/lib
86 $(CP
) $(PKG_BUILD_DIR
)/lib
/libnetlink.a
$(1)/usr
/lib
/
89 define Package
/ip
/install
90 $(INSTALL_DIR
) $(1)/usr
/sbin
91 $(INSTALL_DIR
) $(1)/etc
/iproute2
92 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/etc
/iproute2
/rt_tables
$(1)/etc
/iproute2
93 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/ip
/ip
$(1)/usr
/sbin
/
96 define Package
/tc
/install
97 $(INSTALL_DIR
) $(1)/usr
/sbin
98 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/tc
/tc
$(1)/usr
/sbin
/
101 define Package
/genl
/install
102 $(INSTALL_DIR
) $(1)/usr
/sbin
103 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/genl
/genl
$(1)/usr
/sbin
/
106 define Package
/ss
/install
107 $(INSTALL_DIR
) $(1)/usr
/sbin
108 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/misc
/ss
$(1)/usr
/sbin
/
111 $(eval
$(call BuildPackage
,ip
))
112 $(eval
$(call BuildPackage
,tc
))
113 $(eval
$(call BuildPackage
,genl
))
114 $(eval
$(call BuildPackage
,ss
))