source: packages/net/xtables-addons/Makefile @ 30901

Last change on this file since 30901 was 30901, checked in by jow, 4 years ago

[packages] xtables-addons: integrate Lua PacketScript
PacketScript adds a -j LUA target to iptables which allows to manipulate
and filter packets in kernel space using Lua scripts uploaded through iptables.
This enables rapid netfilter prototyping and allows to easily implement complex filters.
See also http://cn.cs.unibas.ch/pub/doc/2010-msthGraf.pdf

File size: 3.4 KB
Line 
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
8include $(TOPDIR)/rules.mk
9include $(INCLUDE_DIR)/kernel.mk
10
11PKG_NAME:=xtables-addons
12PKG_VERSION:=1.41
13PKG_RELEASE:=2
14
15PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
16PKG_MD5SUM:=a8de5e5e5823aefcbab210159f122564
17PKG_SOURCE_URL:=@SF/xtables-addons
18PKG_BUILD_DEPENDS:=iptables
19PKG_INSTALL:=1
20PKG_BUILD_PARALLEL:=1
21
22PKG_FIXUP:=autoreconf
23
24include $(INCLUDE_DIR)/package.mk
25
26define 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/
32endef
33
34# uses GNU configure
35
36CONFIGURE_ARGS+= \
37        --with-kbuild="$(LINUX_DIR)" \
38        --with-xtables="$(STAGING_DIR)/usr" \
39        --with-xtlibdir="/usr/lib/iptables" \
40
41define 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                LDFLAGS="$(TARGET_LDFLAGS)" \
48                all
49endef
50
51define Build/Install
52        $(MAKE) -C $(PKG_BUILD_DIR) \
53                ARCH="$(LINUX_KARCH)" \
54                CROSS_COMPILE="$(TARGET_CROSS)" \
55                DESTDIR="$(PKG_INSTALL_DIR)" \
56                DEPMOD="/bin/true" \
57                LDFLAGS="$(TARGET_LDFLAGS)" \
58                install
59endef
60
61# 1: extension/module suffix used in package name
62# 2: extension/module display name used in package title/description
63# 3: list of extensions to package
64# 4: list of modules to package
65# 5: module load priority
66# 6: module depends
67define BuildTemplate
68
69 ifneq ($(3),)
70  define Package/iptables-mod-$(1)
71    $$(call Package/xtables-addons)
72    CATEGORY:=Network
73    TITLE:=$(2) iptables extension
74    DEPENDS:=iptables $(if $(4),+kmod-ipt-$(1))
75  endef
76
77  define Package/iptables-mod-$(1)/install
78        $(INSTALL_DIR) $$(1)/usr/lib/iptables
79        for m in $(3); do \
80                $(CP) \
81                        $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$$$$$${m}.so \
82                        $$(1)/usr/lib/iptables/ ; \
83        done
84  endef
85
86  $$(eval $$(call BuildPackage,iptables-mod-$(1)))
87 endif
88
89 ifneq ($(4),)
90  define KernelPackage/ipt-$(1)
91    SUBMENU:=Netfilter Extensions
92    TITLE:=$(2) netfilter module
93    DEPENDS:=kmod-ipt-core $(6)
94    FILES:=$(foreach mod,$(4),$(PKG_BUILD_DIR)/extensions/$(mod).$(LINUX_KMOD_SUFFIX))
95    AUTOLOAD:=$(call AutoLoad,$(5),$(notdir $(4)))
96  endef
97
98  $$(eval $$(call KernelPackage,ipt-$(1)))
99 endif
100
101endef
102
103#$(eval $(call BuildTemplate,SUFFIX,DESCRIPTION,EXTENSION,MODULE,PRIORITY,DEPENDS))
104$(eval $(call BuildTemplate,compat-xtables,API compatibilty layer,,compat_xtables,45,))
105$(eval $(call BuildTemplate,chaos,CHAOS,xt_CHAOS,xt_CHAOS,47,+kmod-ipt-compat-xtables +kmod-ipt-delude +kmod-ipt-tarpit))
106$(eval $(call BuildTemplate,condition,Condition,xt_condition,xt_condition,46,))
107$(eval $(call BuildTemplate,delude,DELUDE,xt_DELUDE,xt_DELUDE,46,+kmod-ipt-compat-xtables))
108$(eval $(call BuildTemplate,tarpit,TARPIT,xt_TARPIT,xt_TARPIT,46,+kmod-ipt-compat-xtables))
109$(eval $(call BuildTemplate,ipp2p,IPP2P,xt_ipp2p,xt_ipp2p,46,))
110$(eval $(call BuildTemplate,rawpost,RAWPOST,,iptable_rawpost $(if $(CONFIG_IPV6),ip6table_rawpost),50,+kmod-ipt-compat-xtables))
111$(eval $(call BuildTemplate,rawnat,RAWNAT,xt_RAWDNAT xt_RAWSNAT,xt_RAWNAT,46,+kmod-ipt-compat-xtables))
112$(eval $(call BuildTemplate,nathelper-rtsp,RTSP Conntrack and NAT,,rtsp/nf_conntrack_rtsp rtsp/nf_nat_rtsp,46,+kmod-ipt-conntrack-extra))
113$(eval $(call BuildTemplate,lua,Lua PacketScript,xt_LUA,LUA/xt_LUA,46,+kmod-ipt-conntrack-extra))
Note: See TracBrowser for help on using the repository browser.