ce6afdcd21f5c7eafa0a9de294f9f32022eea2c1
[openwrt/svn-archive/archive.git] / package / 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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=iproute2
11 #PKG_VERSION:=2.6.29-1
12 PKG_VERSION:=2.6.31
13 PKG_RELEASE:=2
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=http://devresources.linux-foundation.org/dev/iproute2/download/
17 #PKG_MD5SUM:=c1bc258a6c345905e79935ac7a3cc582
18 PKG_MD5SUM:=230f35282a95451622f3e8394f9cd80a
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/iproute2-$(PKG_VERSION)
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/iproute2/Default
25 SECTION:=net
26 CATEGORY:=Network
27 URL:=http://linux-net.osdl.org/index.php/Iproute2
28 endef
29
30 define Package/ip
31 $(call Package/iproute2/Default)
32 TITLE:=Routing control utility
33 endef
34
35 define Package/tc
36 $(call Package/iproute2/Default)
37 TITLE:=Traffic control utility
38 DEPENDS:=+kmod-sched
39 endef
40
41 define Package/genl
42 $(call Package/iproute2/Default)
43 TITLE:=General netlink utility frontend
44 endef
45
46 define Build/Configure
47 $(SED) "s,-I/usr/include/db3,," $(PKG_BUILD_DIR)/Makefile
48 $(SED) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \
49 $(PKG_BUILD_DIR)/Makefile
50 $(SED) "s,^LIBC_INCLUDE.*,LIBC_INCLUDE=$(STAGING_DIR)/include," \
51 $(PKG_BUILD_DIR)/Makefile
52 # For now disable compiling of the misc directory because it seems to fail
53 rm -rf $(PKG_BUILD_DIR)/misc
54 $(SED) "s, misc,," $(PKG_BUILD_DIR)/Makefile
55 endef
56
57 MAKE_FLAGS += \
58 EXTRA_CCOPTS="$(TARGET_CFLAGS)" \
59 KERNEL_INCLUDE="$(LINUX_DIR)/include" \
60 FPIC="$(FPIC)" \
61 all tc/tc ip/ip
62
63 define Build/Compile
64 $(_SINGLE)$(MAKE) -C $(PKG_BUILD_DIR)/netem HOSTCC="$(HOSTCC)" EXTRA_CCOPTS="$(TARGET_CFLAGS)" CFLAGS="-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -I ../include -DRESOLVE_HOSTNAMES"
65 $(_SINGLE)$(Build/Compile/Default)
66 endef
67
68 define Build/InstallDev
69 $(INSTALL_DIR) $(1)/usr/include
70 $(CP) $(PKG_BUILD_DIR)/include/libnetlink.h $(1)/usr/include/
71 $(INSTALL_DIR) $(1)/usr/lib
72 $(CP) $(PKG_BUILD_DIR)/lib/libnetlink.a $(1)/usr/lib/
73 endef
74
75 define Package/ip/install
76 $(INSTALL_DIR) $(1)/usr/sbin
77 $(INSTALL_DIR) $(1)/etc/iproute2
78 $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/iproute2/rt_tables $(1)/etc/iproute2
79 $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/sbin/
80 endef
81
82 define Package/tc/install
83 $(INSTALL_DIR) $(1)/usr/sbin
84 $(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/sbin/
85 endef
86
87 define Package/genl/install
88 $(INSTALL_DIR) $(1)/usr/sbin
89 $(INSTALL_BIN) $(PKG_BUILD_DIR)/genl/genl $(1)/usr/sbin/
90 endef
91
92 $(eval $(call BuildPackage,ip))
93 $(eval $(call BuildPackage,tc))
94 $(eval $(call BuildPackage,genl))