summaryrefslogtreecommitdiff
path: root/package/ipset/Makefile
blob: 012505fe8c4027856c2cc7e04da549ddc2e24777 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# 
# Copyright (C) 2009 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk

PKG_NAME:=ipset
PKG_VERSION:=4.2
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://ipset.netfilter.org
PKG_MD5SUM:=9060d549a18c1c0794fa47a71343d627

include $(INCLUDE_DIR)/package.mk

define Package/ipset/Default
  DEPENDS:= @LINUX_2_6 @(!(TARGET_ps3||TARGET_pxcab)||BROKEN)
endef

define Package/ipset
$(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
endef

define Package/ipset/install
	$(INSTALL_DIR) $(1)/usr/sbin
	$(CP) $(PKG_INSTALL_DIR)/usr/sbin/ipset $(1)/usr/sbin/
	$(INSTALL_DIR) $(1)/usr/lib/ipset
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ipset/libipset*.so $(1)/usr/lib/ipset/
endef

define KernelPackage/ipt-ipset
$(call Package/ipset/Default)
  SUBMENU:=Netfilter Extensions
  TITLE:=IPset netfilter modules
  DEPENDS+= kmod-ipt-core
  FILES:=$(foreach mod,$(IPSET_MODULES),$(PKG_BUILD_DIR)/kernel/$(mod).ko)
  AUTOLOAD:=$(call AutoLoad,46,$(IPSET_MODULES))
endef

$(eval $(call BuildPackage,ipset))
$(eval $(call KernelPackage,ipt-ipset))