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