-SECTION:=base
-CATEGORY:=Network
-TITLE:=Netfilter ip sets administration utility
-DESCRIPTION:=Netfilter ip sets administration utility
-URL:=http://ipset.netfilter.org/
+$(call Package/ipset/Default)
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS+= +iptables-mod-ipset +kmod-ipt-ipset
+ TITLE:=IPset administration utility
+ URL:=http://ipset.netfilter.org/
+endef
+
+include $(INCLUDE_DIR)/kernel-defaults.mk
+
+IPSET_MAKEOPTS:= -C $(PKG_BUILD_DIR) \
+ $(TARGET_CONFIGURE_OPTS) \
+ COPT_FLAGS="$(TARGET_CFLAGS)" \
+ LDFLAGS="-rdynamic -static-libgcc" \
+ NO_EXTRA_WARN_FLAGS=yes \
+ KERNEL_DIR="$(LINUX_DIR)" \
+ PREFIX=/usr \
+
+IPSET_MODULES:= \
+ ip_set \
+ ip_set_iphash \
+ ip_set_ipmap \
+ ip_set_ipporthash \
+ ip_set_ipportiphash \
+ ip_set_ipportnethash \
+ ip_set_iptree \
+ ip_set_iptreemap \
+ ip_set_macipmap \
+ ip_set_nethash \
+ ip_set_portmap \
+ ip_set_setlist \
+ ipt_set \
+ ipt_SET \
+
+define Build/Compile
+ mkdir -p $(PKG_INSTALL_DIR)
+ $(MAKE) $(IPSET_MAKEOPTS) binaries
+ $(MAKE) $(KERNEL_MAKEOPTS) M="$(PKG_BUILD_DIR)/kernel" IP_NF_SET_MAX="256" IP_NF_SET_HASHSIZE="1024" modules
+ $(MAKE) $(IPSET_MAKEOPTS) DESTDIR="$(PKG_INSTALL_DIR)" binaries_install