[package] update xtables-addons to 1.24, add rawpost and rawnat modules, patch from...
[openwrt/svn-archive/archive.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.24
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_MD5SUM:=1b538a25ef82edb7a7ea7411d599d6b9
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 # uses GNU configure
30
31 CONFIGURE_ARGS+= \
32 --with-kbuild="$(LINUX_DIR)" \
33 --with-xtables="$(STAGING_DIR)/usr" \
34 --with-xtlibdir="/usr/lib/iptables" \
35
36 define Build/Compile
37 $(MAKE) -C $(PKG_BUILD_DIR) \
38 ARCH="$(LINUX_KARCH)" \
39 CROSS_COMPILE="$(TARGET_CROSS)" \
40 DESTDIR="$(PKG_INSTALL_DIR)" \
41 DEPMOD="/bin/true" \
42 LDFLAGS="$(TARGET_LDFLAGS)" \
43 all install
44 endef
45
46 # 1: extension/module suffix used in package name
47 # 2: extension/module display name used in package title/description
48 # 3: list of extensions to package
49 # 4: list of modules to package
50 # 5: module load priority
51 # 6: module depends
52 define BuildTemplate
53
54 ifneq ($(3),)
55 define Package/iptables-mod-$(1)
56 $$(call Package/xtables-addons)
57 CATEGORY:=Network
58 TITLE:=$(2) iptables extension
59 DEPENDS:= @LINUX_2_6 iptables $(if $(4),+kmod-ipt-$(1))
60 endef
61
62 define Package/iptables-mod-$(1)/install
63 $(INSTALL_DIR) $$(1)/usr/lib/iptables
64 for m in $(3); do \
65 $(CP) \
66 $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$$$$$${m}.so \
67 $$(1)/usr/lib/iptables/ ; \
68 done
69 endef
70
71 $$(eval $$(call BuildPackage,iptables-mod-$(1)))
72 endif
73
74 ifneq ($(4),)
75 define KernelPackage/ipt-$(1)
76 SUBMENU:=Netfilter Extensions
77 TITLE:=$(2) netfilter module
78 DEPENDS:= @LINUX_2_6 kmod-ipt-core $(6)
79 FILES:=$(foreach mod,$(4),$(PKG_BUILD_DIR)/extensions/$(mod).$(LINUX_KMOD_SUFFIX))
80 AUTOLOAD:=$(call AutoLoad,$(5),$(notdir $(4)))
81 endef
82
83 $$(eval $$(call KernelPackage,ipt-$(1)))
84 endif
85
86 endef
87
88 #$(eval $(call BuildTemplate,SUFFIX,DESCRIPTION,EXTENSION,MODULE,PRIORITY,DEPENDS))
89 $(eval $(call BuildTemplate,compat-xtables,API compatibilty layer,,compat_xtables,45,))
90 $(eval $(call BuildTemplate,chaos,CHAOS,xt_CHAOS,xt_CHAOS,47,+kmod-ipt-compat-xtables +kmod-ipt-delude +kmod-ipt-tarpit))
91 $(eval $(call BuildTemplate,condition,Condition,xt_condition,xt_condition,46,))
92 $(eval $(call BuildTemplate,delude,DELUDE,xt_DELUDE,xt_DELUDE,46,+kmod-ipt-compat-xtables))
93 $(eval $(call BuildTemplate,tarpit,TARPIT,xt_TARPIT,xt_TARPIT,46,+kmod-ipt-compat-xtables))
94 $(eval $(call BuildTemplate,tee,TEE,xt_TEE,xt_TEE,46,+kmod-ipt-compat-xtables))
95 $(eval $(call BuildTemplate,ipp2p,IPP2P,xt_ipp2p,xt_ipp2p,46,))
96 $(eval $(call BuildTemplate,rawpost,RAWPOST,,iptable_rawpost,46,+kmod-ipt-compat-xtables))
97 $(eval $(call BuildTemplate,rawnat,RAWNAT,xt_RAWDNAT xt_RAWSNAT,xt_RAWNAT,46,+kmod-ipt-compat-xtables))