Makefile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #
  2. # Copyright (C) 2009 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. include $(INCLUDE_DIR)/kernel.mk
  10. PKG_NAME:=ipset
  11. PKG_VERSION:=4.1
  12. PKG_RELEASE:=1
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  14. PKG_SOURCE_URL:=http://ipset.netfilter.org
  15. PKG_MD5SUM:=d104007fdf5ea64fef774c22b1c0a97b
  16. include $(INCLUDE_DIR)/package.mk
  17. define Package/ipset/Default
  18. DEPENDS:= @LINUX_2_6 @(!(TARGET_ps3||TARGET_pxcab)||BROKEN)
  19. endef
  20. define Package/ipset
  21. $(call Package/ipset/Default)
  22. SECTION:=net
  23. CATEGORY:=Network
  24. DEPENDS+= +iptables-mod-ipset +kmod-ipt-ipset
  25. TITLE:=IPset administration utility
  26. URL:=http://ipset.netfilter.org/
  27. endef
  28. include $(INCLUDE_DIR)/kernel-defaults.mk
  29. IPSET_MAKEOPTS:= -C $(PKG_BUILD_DIR) \
  30. $(TARGET_CONFIGURE_OPTS) \
  31. COPT_FLAGS="$(TARGET_CFLAGS)" \
  32. LDFLAGS="-rdynamic -static-libgcc" \
  33. NO_EXTRA_WARN_FLAGS=yes \
  34. KERNEL_DIR="$(LINUX_DIR)" \
  35. PREFIX=/usr \
  36. IPSET_MODULES:= \
  37. ip_set \
  38. ip_set_iphash \
  39. ip_set_ipmap \
  40. ip_set_ipporthash \
  41. ip_set_ipportiphash \
  42. ip_set_ipportnethash \
  43. ip_set_iptree \
  44. ip_set_iptreemap \
  45. ip_set_macipmap \
  46. ip_set_nethash \
  47. ip_set_portmap \
  48. ip_set_setlist \
  49. ipt_set \
  50. ipt_SET \
  51. define Build/Compile
  52. mkdir -p $(PKG_INSTALL_DIR)
  53. $(MAKE) $(IPSET_MAKEOPTS) binaries
  54. $(MAKE) $(KERNEL_MAKEOPTS) M="$(PKG_BUILD_DIR)/kernel" IP_NF_SET_MAX="256" IP_NF_SET_HASHSIZE="1024" modules
  55. $(MAKE) $(IPSET_MAKEOPTS) DESTDIR="$(PKG_INSTALL_DIR)" binaries_install
  56. endef
  57. define Package/ipset/install
  58. $(INSTALL_DIR) $(1)/usr/sbin
  59. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ipset $(1)/usr/sbin/
  60. $(INSTALL_DIR) $(1)/usr/lib/ipset
  61. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipset/libipset*.so $(1)/usr/lib/ipset/
  62. endef
  63. define KernelPackage/ipt-ipset
  64. $(call Package/ipset/Default)
  65. SUBMENU:=Netfilter Extensions
  66. TITLE:=IPset netfilter modules
  67. DEPENDS+= kmod-ipt-core
  68. FILES:=$(foreach mod,$(IPSET_MODULES),$(PKG_BUILD_DIR)/kernel/$(mod).ko)
  69. AUTOLOAD:=$(call AutoLoad,46,$(IPSET_MODULES))
  70. endef
  71. $(eval $(call BuildPackage,ipset))
  72. $(eval $(call KernelPackage,ipt-ipset))