[packages] xtables-addons: Move iptable modules to Network category
[packages.git] / net / xtables-addons / Makefile
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:=xtables-addons
12 PKG_VERSION:=1.18
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_MD5SUM:=5a8d2edbf5a3470bba58d6a60c350805
17 PKG_SOURCE_URL:=@SF/xtables-addons
18 PKG_BUILD_DEPENDS:=iptables
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/xtables-addons
23   SECTION:=net
24   CATEGORY:=Network
25   TITLE:=Extensions not distributed in the main Xtables
26   URL:=http://xtables-addons.sourceforge.net/
27 endef
28
29 define Package/ipset
30 $(call Package/xtables-addons)
31   TITLE:=IPset administration utility
32   DEPENDS:= @LINUX_2_6 +iptables-mod-ipset
33 endef
34
35 # uses GNU configure
36
37 CONFIGURE_ARGS+= \
38         --with-kbuild="$(LINUX_DIR)" \
39         --with-xtables="$(STAGING_DIR)/usr" \
40         --with-xtlibdir="/usr/lib/iptables" \
41
42 IPSET_EXT:= \
43         ipset_iphash \
44         ipset_ipmap \
45         ipset_ipporthash \
46         ipset_ipportnethash \
47         ipset_iptree \
48         ipset_iptreemap \
49         ipset_macipmap \
50         ipset_nethash \
51         ipset_portmap \
52         ipset_setlist \
53
54 IPSET_MOD:= \
55         ipset/ip_set \
56         ipset/ip_set_iphash \
57         ipset/ip_set_ipmap \
58         ipset/ip_set_ipporthash \
59         ipset/ip_set_iptree \
60         ipset/ip_set_iptreemap \
61         ipset/ip_set_macipmap \
62         ipset/ip_set_nethash \
63         ipset/ip_set_portmap \
64         ipset/ipt_set \
65         ipset/ipt_SET \
66
67 define Build/Compile
68         $(MAKE) -C $(PKG_BUILD_DIR) \
69                 ARCH="$(LINUX_KARCH)" \
70                 CROSS_COMPILE="$(TARGET_CROSS)" \
71                 DESTDIR="$(PKG_INSTALL_DIR)" \
72                 DEPMOD="/bin/true" \
73                 all install
74 endef
75
76 # 1: extension/module suffix used in package name
77 # 2: extension/module display name used in package title/description
78 # 3: list of extensions to package
79 # 4: list of modules to package
80 # 5: module load priority
81 # 6: module depends
82 define BuildTemplate
83
84  ifneq ($(3),)
85   define Package/iptables-mod-$(1)
86     $$(call Package/xtables-addons)
87     CATEGORY:=Network
88     TITLE:=$(2) iptables extension
89     DEPENDS:= @LINUX_2_6 iptables $(if $(4),+kmod-ipt-$(1))
90   endef
91
92   define Package/iptables-mod-$(1)/install
93         $(INSTALL_DIR) $$(1)/usr/lib/iptables
94         for m in $(3); do \
95                 $(CP) \
96                         $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$$$$$${m}.so \
97                         $$(1)/usr/lib/iptables/ ; \
98         done
99   endef
100
101   $$(eval $$(call BuildPackage,iptables-mod-$(1)))
102  endif
103
104  ifneq ($(4),)
105   define KernelPackage/ipt-$(1)
106     SUBMENU:=Netfilter Extensions
107     TITLE:=$(2) netfilter module
108     DEPENDS:= @LINUX_2_6 kmod-ipt-core $(6)
109     FILES:=$(foreach mod,$(4),$(PKG_BUILD_DIR)/extensions/$(mod).$(LINUX_KMOD_SUFFIX))
110     AUTOLOAD:=$(call AutoLoad,$(5),$(notdir $(4)))
111   endef
112
113   $$(eval $$(call KernelPackage,ipt-$(1)))
114  endif
115
116 endef
117
118 define Package/ipset/install
119         $(INSTALL_DIR) $(1)/usr/sbin
120         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ipset $(1)/usr/sbin/
121 endef
122
123 $(eval $(call BuildPackage,ipset))
124
125 #$(eval $(call BuildTemplate,SUFFIX,DESCRIPTION,EXTENSION,MODULE,PRIORITY,DEPENDS))
126 $(eval $(call BuildTemplate,compat-xtables,API compatibilty layer,,compat_xtables,45,))
127 $(eval $(call BuildTemplate,chaos,CHAOS,xt_CHAOS,xt_CHAOS,47,+kmod-ipt-compat-xtables +kmod-ipt-delude +kmod-ipt-tarpit))
128 $(eval $(call BuildTemplate,condition,Condition,xt_condition,xt_condition,46,))
129 $(eval $(call BuildTemplate,delude,DELUDE,xt_DELUDE,xt_DELUDE,46,+kmod-ipt-compat-xtables))
130 $(eval $(call BuildTemplate,tarpit,TARPIT,xt_TARPIT,xt_TARPIT,46,+kmod-ipt-compat-xtables))
131 $(eval $(call BuildTemplate,ipp2p,IPP2P,xt_ipp2p,xt_ipp2p,46,))
132 $(eval $(call BuildTemplate,ipset,IPset,$(IPSET_EXT),$(IPSET_MOD),46,))