Root/package/network/utils/iproute2/Makefile

1#
2# Copyright (C) 2006-2010 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=iproute2
11PKG_VERSION:=3.3.0
12PKG_RELEASE:=1
13
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15PKG_SOURCE_URL:=http://kernel.org/pub/linux/utils/net/iproute2/
16PKG_MD5SUM:=308e7145218dd552c2766fe527e239e1
17PKG_BUILD_PARALLEL:=1
18
19PKG_BUILD_DIR:=$(BUILD_DIR)/iproute2-$(PKG_VERSION)
20
21include $(INCLUDE_DIR)/package.mk
22
23define Package/iproute2/Default
24  SECTION:=net
25  CATEGORY:=Network
26  URL:=http://linux-net.osdl.org/index.php/Iproute2
27endef
28
29define Package/ip
30$(call Package/iproute2/Default)
31  SUBMENU:=Routing and Redirection
32  DEPENDS:= +libnl-tiny
33  TITLE:=Routing control utility
34endef
35
36define Package/ip/conffiles
37/etc/iproute2/rt_tables
38endef
39
40define Package/tc
41$(call Package/iproute2/Default)
42  TITLE:=Traffic control utility
43  DEPENDS:=+kmod-sched-core
44endef
45
46define Package/genl
47$(call Package/iproute2/Default)
48  TITLE:=General netlink utility frontend
49endef
50
51define Package/ss
52$(call Package/iproute2/Default)
53  TITLE:=Socket statistics utility
54endef
55
56define 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
64endef
65
66ifdef CONFIG_USE_EGLIBC
67  ifndef CONFIG_EGLIBC_VERSION_2_13
68    TARGET_CFLAGS += -DHAVE_SETNS
69  endif
70endif
71
72MAKE_FLAGS += \
73    EXTRA_CCOPTS="$(TARGET_CFLAGS) -I../include -I$(STAGING_DIR)/usr/include/libnl-tiny" \
74    KERNEL_INCLUDE="$(LINUX_DIR)/include" \
75    FPIC="$(FPIC)"
76
77define Build/Compile
78    +$(MAKE_VARS) $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS)
79endef
80
81define Build/InstallDev
82    $(INSTALL_DIR) $(1)/usr/include
83    $(CP) $(PKG_BUILD_DIR)/include/libnetlink.h $(1)/usr/include/
84    $(INSTALL_DIR) $(1)/usr/lib
85    $(CP) $(PKG_BUILD_DIR)/lib/libnetlink.a $(1)/usr/lib/
86endef
87
88define Package/ip/install
89    $(INSTALL_DIR) $(1)/usr/sbin
90    $(INSTALL_DIR) $(1)/etc/iproute2
91    $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/iproute2/rt_tables $(1)/etc/iproute2
92    $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/sbin/
93endef
94
95define Package/tc/install
96    $(INSTALL_DIR) $(1)/usr/sbin
97    $(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/sbin/
98    $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
99    $(INSTALL_BIN) ./files/15-teql $(1)/etc/hotplug.d/iface/
100endef
101
102define Package/genl/install
103    $(INSTALL_DIR) $(1)/usr/sbin
104    $(INSTALL_BIN) $(PKG_BUILD_DIR)/genl/genl $(1)/usr/sbin/
105endef
106
107define Package/ss/install
108    $(INSTALL_DIR) $(1)/usr/sbin
109    $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc/ss $(1)/usr/sbin/
110endef
111
112$(eval $(call BuildPackage,ip))
113$(eval $(call BuildPackage,tc))
114$(eval $(call BuildPackage,genl))
115$(eval $(call BuildPackage,ss))
116

Archive Download this file



interactive