[packages] bind: fix autoreconf
[openwrt/svn-archive/archive.git] / net / xtables-addons / Makefile
1 #
2 # Copyright (C) 2009-2010 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.31
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
16 PKG_MD5SUM:=97ac895a67df67c28def98763023d51b
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:=libtool
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/xtables-addons
27 SECTION:=net
28 CATEGORY:=Network
29 TITLE:=Extensions not distributed in the main Xtables
30 URL:=http://xtables-addons.sourceforge.net/
31 endef
32
33 # uses GNU configure
34
35 CONFIGURE_ARGS+= \
36 --with-kbuild="$(LINUX_DIR)" \
37 --with-xtables="$(STAGING_DIR)/usr" \
38 --with-xtlibdir="/usr/lib/iptables" \
39
40 define Build/Compile
41 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
42 ARCH="$(LINUX_KARCH)" \
43 CROSS_COMPILE="$(TARGET_CROSS)" \
44 DESTDIR="$(PKG_INSTALL_DIR)" \
45 DEPMOD="/bin/true" \
46 LDFLAGS="$(TARGET_LDFLAGS)" \
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 LDFLAGS="$(TARGET_LDFLAGS)" \
57 install
58 endef
59
60 # 1: extension/module suffix used in package name
61 # 2: extension/module display name used in package title/description
62 # 3: list of extensions to package
63 # 4: list of modules to package
64 # 5: module load priority
65 # 6: module depends
66 define BuildTemplate
67
68 ifneq ($(3),)
69 define Package/iptables-mod-$(1)
70 $$(call Package/xtables-addons)
71 CATEGORY:=Network
72 TITLE:=$(2) iptables extension
73 DEPENDS:= @!LINUX_2_4 iptables $(if $(4),+kmod-ipt-$(1))
74 endef
75
76 define Package/iptables-mod-$(1)/install
77 $(INSTALL_DIR) $$(1)/usr/lib/iptables
78 for m in $(3); do \
79 $(CP) \
80 $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$$$$$${m}.so \
81 $$(1)/usr/lib/iptables/ ; \
82 done
83 endef
84
85 $$(eval $$(call BuildPackage,iptables-mod-$(1)))
86 endif
87
88 ifneq ($(4),)
89 define KernelPackage/ipt-$(1)
90 SUBMENU:=Netfilter Extensions
91 TITLE:=$(2) netfilter module
92 DEPENDS:= @!LINUX_2_4 kmod-ipt-core $(6)
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 $(eval $(call BuildTemplate,compat-xtables,API compatibilty layer,,compat_xtables,45,))
104 $(eval $(call BuildTemplate,chaos,CHAOS,xt_CHAOS,xt_CHAOS,47,+kmod-ipt-compat-xtables +kmod-ipt-delude +kmod-ipt-tarpit))
105 $(eval $(call BuildTemplate,condition,Condition,xt_condition,xt_condition,46,))
106 $(eval $(call BuildTemplate,delude,DELUDE,xt_DELUDE,xt_DELUDE,46,+kmod-ipt-compat-xtables))
107 $(eval $(call BuildTemplate,tarpit,TARPIT,xt_TARPIT,xt_TARPIT,46,+kmod-ipt-compat-xtables))
108 #$(eval $(call BuildTemplate,tee,TEE,xt_TEE,xt_TEE,46,+kmod-ipt-compat-xtables))
109 $(eval $(call BuildTemplate,ipp2p,IPP2P,xt_ipp2p,xt_ipp2p,46,))
110 $(eval $(call BuildTemplate,rawpost,RAWPOST,,iptable_rawpost,46,+kmod-ipt-compat-xtables))
111 $(eval $(call BuildTemplate,rawnat,RAWNAT,xt_RAWDNAT xt_RAWSNAT,xt_RAWNAT,46,+kmod-ipt-compat-xtables))