[package] xtables-addons: fix build for 64-bits targets
[openwrt/svn-archive/archive.git] / net / xtables-addons / Makefile
1 #
2 # Copyright (C) 2009-2012 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.42
13 PKG_RELEASE:=2
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
16 PKG_MD5SUM:=7c996a0400667b57ab4fb53a013ae742
17 PKG_SOURCE_URL:=@SF/xtables-addons
18 PKG_BUILD_DEPENDS:=iptables
19 PKG_INSTALL:=1
20 PKG_BUILD_PARALLEL:=1
21
22 PKG_FIXUP:=autoreconf
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/xtables-addons
27 SECTION:=net
28 CATEGORY:=Network
29 SUBMENU:=Firewall
30 TITLE:=Extensions not distributed in the main Xtables
31 URL:=http://xtables-addons.sourceforge.net/
32 endef
33
34 # uses GNU configure
35
36 CONFIGURE_ARGS+= \
37 --with-kbuild="$(LINUX_DIR)" \
38 --with-xtables="$(STAGING_DIR)/usr" \
39 --with-xtlibdir="/usr/lib/iptables" \
40
41 define Build/Compile
42 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
43 ARCH="$(LINUX_KARCH)" \
44 CROSS_COMPILE="$(TARGET_CROSS)" \
45 DESTDIR="$(PKG_INSTALL_DIR)" \
46 DEPMOD="/bin/true" \
47 all
48 endef
49
50 define Build/Install
51 $(MAKE) -C $(PKG_BUILD_DIR) \
52 ARCH="$(LINUX_KARCH)" \
53 CROSS_COMPILE="$(TARGET_CROSS)" \
54 DESTDIR="$(PKG_INSTALL_DIR)" \
55 DEPMOD="/bin/true" \
56 install
57 endef
58
59 # 1: extension/module suffix used in package name
60 # 2: extension/module display name used in package title/description
61 # 3: list of extensions to package
62 # 4: list of modules to package
63 # 5: module load priority
64 # 6: module depends
65 define BuildTemplate
66
67 ifneq ($(3),)
68 define Package/iptables-mod-$(1)
69 $$(call Package/xtables-addons)
70 CATEGORY:=Network
71 TITLE:=$(2) iptables extension
72 DEPENDS:=iptables $(if $(4),+kmod-ipt-$(1))
73 endef
74
75 define Package/iptables-mod-$(1)/install
76 $(INSTALL_DIR) $$(1)/usr/lib/iptables
77 for m in $(3); do \
78 $(CP) \
79 $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$$$$$${m}.so \
80 $$(1)/usr/lib/iptables/ ; \
81 done
82 endef
83
84 $$(eval $$(call BuildPackage,iptables-mod-$(1)))
85 endif
86
87 ifneq ($(4),)
88 define KernelPackage/ipt-$(1)
89 SUBMENU:=Netfilter Extensions
90 TITLE:=$(2) netfilter module
91 DEPENDS:=kmod-ipt-core $(6)
92 KCONFIG:=$(7)
93 FILES:=$(foreach mod,$(4),$(PKG_BUILD_DIR)/extensions/$(mod).$(LINUX_KMOD_SUFFIX))
94 AUTOLOAD:=$(call AutoLoad,$(5),$(notdir $(4)))
95 endef
96
97 $$(eval $$(call KernelPackage,ipt-$(1)))
98 endif
99
100 endef
101
102 #$(eval $(call BuildTemplate,SUFFIX,DESCRIPTION,EXTENSION,MODULE,PRIORITY,DEPENDS))
103
104 $(eval $(call BuildTemplate,compat-xtables,API compatibilty layer,,compat_xtables,45,,CONFIG_NF_CONNTRACK_MARK=y))
105 $(eval $(call BuildTemplate,rawpost,RAWPOST,,iptable_rawpost $(if $(CONFIG_IPV6),ip6table_rawpost),50,+kmod-ipt-compat-xtables))
106 $(eval $(call BuildTemplate,nathelper-rtsp,RTSP Conntrack and NAT,,rtsp/nf_conntrack_rtsp rtsp/nf_nat_rtsp,46,+kmod-ipt-conntrack-extra))
107
108 $(eval $(call BuildTemplate,chaos,CHAOS,xt_CHAOS,xt_CHAOS,47,+kmod-ipt-compat-xtables +kmod-ipt-delude +kmod-ipt-tarpit))
109 $(eval $(call BuildTemplate,condition,Condition,xt_condition,xt_condition,46,))
110 $(eval $(call BuildTemplate,delude,DELUDE,xt_DELUDE,xt_DELUDE,46,+kmod-ipt-compat-xtables))
111 $(eval $(call BuildTemplate,dhcpmac,DHCPMAC,xt_DHCPMAC,xt_DHCPMAC,46,+kmod-ipt-compat-xtables))
112 $(eval $(call BuildTemplate,dnetmap,DNETMAP,xt_DNETMAP,xt_DNETMAP,46,+kmod-ipt-compat-xtables))
113 $(eval $(call BuildTemplate,fuzzy,fuzzy,xt_fuzzy,xt_fuzzy,46,))
114 $(eval $(call BuildTemplate,geoip,geoip,xt_geoip,xt_geoip,46,))
115 $(eval $(call BuildTemplate,iface,iface,xt_iface,xt_iface,46,))
116 $(eval $(call BuildTemplate,ipmark,IPMARK,xt_IPMARK,xt_IPMARK,46,+kmod-ipt-compat-xtables))
117 $(eval $(call BuildTemplate,ipp2p,IPP2P,xt_ipp2p,xt_ipp2p,46,+kmod-ipt-compat-xtables))
118 $(eval $(call BuildTemplate,ipv4options,ipv4options,xt_ipv4options,xt_ipv4options,46,))
119 $(eval $(call BuildTemplate,length2,length2,xt_length2,xt_length2,46,))
120 $(eval $(call BuildTemplate,logmark,LOGMARK,xt_LOGMARK,xt_LOGMARK,46,+kmod-ipt-compat-xtables))
121 $(eval $(call BuildTemplate,lscan,lscan,xt_lscan,xt_lscan,46,))
122 $(eval $(call BuildTemplate,lua,Lua PacketScript,xt_LUA,LUA/xt_LUA,46,+kmod-ipt-conntrack-extra))
123 $(eval $(call BuildTemplate,psd,psd,xt_psd,xt_psd,46,))
124 $(eval $(call BuildTemplate,quota2,quota2,xt_quota2,xt_quota2,46,))
125 $(eval $(call BuildTemplate,rawnat,RAWNAT,xt_RAWDNAT xt_RAWSNAT,xt_RAWNAT,46,+kmod-ipt-compat-xtables))
126 $(eval $(call BuildTemplate,steal,STEAL,xt_STEAL,xt_STEAL,46,+kmod-ipt-compat-xtables))
127 $(eval $(call BuildTemplate,sysrq,SYSRQ,xt_SYSRQ,xt_SYSRQ,46,+kmod-ipt-compat-xtables))
128 $(eval $(call BuildTemplate,tarpit,TARPIT,xt_TARPIT,xt_TARPIT,46,+kmod-ipt-compat-xtables))