[packages] add xtables-addons, providing netfilter/xtables modules & extensions that...
[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 # $Id$
8
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/kernel.mk
11
12 PKG_NAME:=xtables-addons
13 PKG_VERSION:=1.9
14 PKG_RELEASE:=1
15
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
17 PKG_SOURCE_URL:=http://dev.medozas.de/files/xtables/
18 PKG_MD5SUM:=578176c969a70858bfc06d9ee3b5dbda
19
20 PKG_BUILD_DEPENDS:=iptables
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/xtables-addons
25 SECTION:=net
26 CATEGORY:=Base system
27 TITLE:=Extensions not distributed in the main Xtables
28 URL:=http://jengelh.medozas.de/projects/xtables/
29 endef
30
31
32 # uses GNU configure
33
34 CONFIGURE_ARGS+= \
35 --with-kbuild="$(LINUX_DIR)" \
36 --with-xtables="$(STAGING_DIR)/usr" \
37 --with-xtlibdir="/usr/lib/iptables" \
38
39 define Build/Compile
40 $(MAKE) -C $(PKG_BUILD_DIR) \
41 ARCH="$(LINUX_KARCH)" \
42 CROSS_COMPILE="$(TARGET_CROSS)" \
43 DESTDIR="$(PKG_INSTALL_DIR)" \
44 all install
45 endef
46
47 # 1: extension/module suffix used in package name
48 # 2: extension/module display name used in package title/description
49 # 3: list of extensions/modules to package
50 # 4: module load priority
51 # 5: module depends
52 define BuildTemplate
53
54 define Package/iptables-mod-$(1)
55 $$(call Package/xtables-addons)
56 TITLE:=$(2) iptables extension
57 DEPENDS:=iptables +kmod-ipt-$(1)
58 endef
59
60 define Package/iptables-mod-$(1)/install
61 $(INSTALL_DIR) $$(1)/usr/lib/iptables
62 for m in $(3); do \
63 $(CP) \
64 $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$$$$$${m}.so \
65 $$(1)/usr/lib/iptables/ ; \
66 done
67 endef
68
69 $$(eval $$(call BuildPackage,iptables-mod-$(1)))
70
71 define KernelPackage/ipt-$(1)
72 SUBMENU:=Netfilter Extensions
73 TITLE:=$(2) netfilter module
74 DEPENDS:=@LINUX_2_6 kmod-ipt-core $(5)
75 FILES:=$(PKG_BUILD_DIR)/extensions/$(3).$(LINUX_KMOD_SUFFIX)
76 AUTOLOAD:=$(call AutoLoad,$(4),$(3))
77 endef
78
79 $$(eval $$(call KernelPackage,ipt-$(1)))
80
81 endef
82
83 define KernelPackage/compat-xtables
84 SUBMENU:=Netfilter Extensions
85 TITLE:=API compatibilty layer module
86 DEPENDS:=@LINUX_2_6
87 FILES:=$(PKG_BUILD_DIR)/extensions/compat_xtables.$(LINUX_KMOD_SUFFIX)
88 AUTOLOAD:=$(call AutoLoad,45,compat_xtables)
89 endef
90
91 $(eval $(call KernelPackage,compat-xtables))
92
93 $(eval $(call BuildTemplate,chaos,CHAOS,xt_CHAOS,47,+kmod-compat-xtables +kmod-ipt-delude +kmod-ipt-tarpit))
94 $(eval $(call BuildTemplate,condition,condition,xt_condition,46))
95 $(eval $(call BuildTemplate,delude,DELUDE,xt_DELUDE,46,+kmod-compat-xtables))
96 $(eval $(call BuildTemplate,portscan,portscan,xt_portscan,46))
97 $(eval $(call BuildTemplate,tarpit,TARPIT,xt_TARPIT,46,+kmod-compat-xtables))