Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=iproute2
  9. PKG_VERSION:=3.3.0
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  12. PKG_SOURCE_URL:=http://kernel.org/pub/linux/utils/net/iproute2/
  13. PKG_MD5SUM:=308e7145218dd552c2766fe527e239e1
  14. PKG_BUILD_PARALLEL:=1
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/iproute2-$(PKG_VERSION)
  16. include $(INCLUDE_DIR)/package.mk
  17. define Package/iproute2/Default
  18. SECTION:=net
  19. CATEGORY:=Network
  20. URL:=http://linux-net.osdl.org/index.php/Iproute2
  21. endef
  22. define Package/ip
  23. $(call Package/iproute2/Default)
  24. SUBMENU:=Routing and Redirection
  25. DEPENDS:= +libnl-tiny
  26. TITLE:=Routing control utility
  27. endef
  28. define Package/ip/conffiles
  29. /etc/iproute2/rt_tables
  30. endef
  31. define Package/tc
  32. $(call Package/iproute2/Default)
  33. TITLE:=Traffic control utility
  34. DEPENDS:=+kmod-sched-core
  35. endef
  36. define Package/genl
  37. $(call Package/iproute2/Default)
  38. TITLE:=General netlink utility frontend
  39. endef
  40. define Package/ss
  41. $(call Package/iproute2/Default)
  42. TITLE:=Socket statistics utility
  43. endef
  44. define Build/Configure
  45. $(SED) "s,-I/usr/include/db3,," $(PKG_BUILD_DIR)/Makefile
  46. $(SED) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \
  47. $(PKG_BUILD_DIR)/Makefile
  48. $(SED) "s,^LIBC_INCLUDE.*,LIBC_INCLUDE=$(STAGING_DIR)/include," \
  49. $(PKG_BUILD_DIR)/Makefile
  50. echo "static const char SNAPSHOT[] = \"$(PKG_VERSION)-$(PKG_RELEASE)-openwrt\";" \
  51. > $(PKG_BUILD_DIR)/include/SNAPSHOT.h
  52. endef
  53. ifdef CONFIG_USE_EGLIBC
  54. ifndef CONFIG_EGLIBC_VERSION_2_13
  55. TARGET_CFLAGS += -DHAVE_SETNS
  56. endif
  57. endif
  58. MAKE_FLAGS += \
  59. EXTRA_CCOPTS="$(TARGET_CFLAGS) -I../include -I$(STAGING_DIR)/usr/include/libnl-tiny" \
  60. KERNEL_INCLUDE="$(LINUX_DIR)/include" \
  61. FPIC="$(FPIC)"
  62. define Build/Compile
  63. +$(MAKE_VARS) $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS)
  64. endef
  65. define Build/InstallDev
  66. $(INSTALL_DIR) $(1)/usr/include
  67. $(CP) $(PKG_BUILD_DIR)/include/libnetlink.h $(1)/usr/include/
  68. $(INSTALL_DIR) $(1)/usr/lib
  69. $(CP) $(PKG_BUILD_DIR)/lib/libnetlink.a $(1)/usr/lib/
  70. endef
  71. define Package/ip/install
  72. $(INSTALL_DIR) $(1)/usr/sbin
  73. $(INSTALL_DIR) $(1)/etc/iproute2
  74. $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/iproute2/rt_tables $(1)/etc/iproute2
  75. $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/sbin/
  76. endef
  77. define Package/tc/install
  78. $(INSTALL_DIR) $(1)/usr/sbin
  79. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/sbin/
  80. $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
  81. $(INSTALL_BIN) ./files/15-teql $(1)/etc/hotplug.d/iface/
  82. endef
  83. define Package/genl/install
  84. $(INSTALL_DIR) $(1)/usr/sbin
  85. $(INSTALL_BIN) $(PKG_BUILD_DIR)/genl/genl $(1)/usr/sbin/
  86. endef
  87. define Package/ss/install
  88. $(INSTALL_DIR) $(1)/usr/sbin
  89. $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc/ss $(1)/usr/sbin/
  90. endef
  91. $(eval $(call BuildPackage,ip))
  92. $(eval $(call BuildPackage,tc))
  93. $(eval $(call BuildPackage,genl))
  94. $(eval $(call BuildPackage,ss))