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