1
0

Makefile 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. #
  2. # Copyright (C) 2009-2013 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. include $(INCLUDE_DIR)/kernel.mk
  9. PKG_NAME:=xtables-addons
  10. PKG_VERSION:=2.11
  11. PKG_RELEASE:=1
  12. PKG_HASH:=f14f8953a9d3a70157a82883886ff6ec866c61dbea1585edb421478107279921
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  14. PKG_SOURCE_URL:=@SF/xtables-addons
  15. PKG_BUILD_DEPENDS:=iptables
  16. PKG_INSTALL:=1
  17. PKG_BUILD_PARALLEL:=1
  18. PKG_CHECK_FORMAT_SECURITY:=0
  19. PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
  20. PKG_LICENSE:=GPL-2.0
  21. PKG_FIXUP:=autoreconf
  22. include $(INCLUDE_DIR)/package.mk
  23. define Package/xtables-addons
  24. SECTION:=net
  25. CATEGORY:=Network
  26. SUBMENU:=Firewall
  27. TITLE:=Extensions not distributed in the main Xtables
  28. URL:=http://xtables-addons.sourceforge.net/
  29. endef
  30. # uses GNU configure
  31. CONFIGURE_ARGS+= \
  32. --with-kbuild="$(LINUX_DIR)" \
  33. --with-xtlibdir="/usr/lib/iptables" \
  34. define Build/Compile
  35. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  36. ARCH="$(LINUX_KARCH)" \
  37. CROSS_COMPILE="$(TARGET_CROSS)" \
  38. DESTDIR="$(PKG_INSTALL_DIR)" \
  39. DEPMOD="/bin/true" \
  40. all
  41. endef
  42. define Build/Install
  43. $(MAKE) -C $(PKG_BUILD_DIR) \
  44. ARCH="$(LINUX_KARCH)" \
  45. CROSS_COMPILE="$(TARGET_CROSS)" \
  46. DESTDIR="$(PKG_INSTALL_DIR)" \
  47. DEPMOD="/bin/true" \
  48. install
  49. endef
  50. # 1: extension/module suffix used in package name
  51. # 2: extension/module display name used in package title/description
  52. # 3: list of extensions to package
  53. # 4: list of modules to package
  54. # 5: module load priority
  55. # 6: module depends
  56. define BuildTemplate
  57. ifneq ($(3),)
  58. define Package/iptables-mod-$(1)
  59. $$(call Package/xtables-addons)
  60. CATEGORY:=Network
  61. TITLE:=$(2) iptables extension
  62. DEPENDS:=iptables $(if $(4),+kmod-ipt-$(1))
  63. endef
  64. define Package/iptables-mod-$(1)/install
  65. $(INSTALL_DIR) $$(1)/usr/lib/iptables
  66. for m in $(3); do \
  67. $(CP) \
  68. $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$$$$$${m}.so \
  69. $$(1)/usr/lib/iptables/ ; \
  70. done
  71. endef
  72. $$(eval $$(call BuildPackage,iptables-mod-$(1)))
  73. endif
  74. ifneq ($(4),)
  75. define KernelPackage/ipt-$(1)
  76. SUBMENU:=Netfilter Extensions
  77. TITLE:=$(2) netfilter module
  78. DEPENDS:=+kmod-ipt-core $(5)
  79. KCONFIG:=CONFIG_NF_CONNTRACK_MARK=y
  80. FILES:=$(foreach mod,$(4),$(PKG_BUILD_DIR)/extensions/$(mod).$(LINUX_KMOD_SUFFIX))
  81. AUTOLOAD:=$(call AutoProbe,$(notdir $(4)))
  82. endef
  83. $$(eval $$(call KernelPackage,ipt-$(1)))
  84. endif
  85. endef
  86. define Package/iptaccount
  87. $(call Package/xtables-addons)
  88. CATEGORY:=Network
  89. TITLE:=iptables-mod-account control utility
  90. DEPENDS:=iptables +iptables-mod-account
  91. endef
  92. define Package/iptaccount/install
  93. $(INSTALL_DIR) $(1)/usr/lib
  94. $(INSTALL_DIR) $(1)/usr/sbin
  95. $(CP) \
  96. $(PKG_INSTALL_DIR)/usr/lib/libxt_ACCOUNT_cl.so* \
  97. $(1)/usr/lib/
  98. $(CP) \
  99. $(PKG_INSTALL_DIR)/usr/sbin/iptaccount \
  100. $(1)/usr/sbin/
  101. endef
  102. #$(eval $(call BuildTemplate,SUFFIX,DESCRIPTION,EXTENSION,MODULE,PRIORITY,DEPENDS))
  103. $(eval $(call BuildTemplate,compat-xtables,API compatibilty layer,,compat_xtables,+IPV6:kmod-ip6tables))
  104. $(eval $(call BuildTemplate,nathelper-rtsp,RTSP Conntrack and NAT,,rtsp/nf_conntrack_rtsp rtsp/nf_nat_rtsp,+kmod-ipt-conntrack-extra +kmod-ipt-nat))
  105. $(eval $(call BuildTemplate,account,ACCOUNT,xt_ACCOUNT,ACCOUNT/xt_ACCOUNT,+kmod-ipt-compat-xtables))
  106. $(eval $(call BuildTemplate,chaos,CHAOS,xt_CHAOS,xt_CHAOS,+kmod-ipt-compat-xtables +kmod-ipt-delude +kmod-ipt-tarpit))
  107. $(eval $(call BuildTemplate,condition,Condition,xt_condition,xt_condition,))
  108. $(eval $(call BuildTemplate,delude,DELUDE,xt_DELUDE,xt_DELUDE,+kmod-ipt-compat-xtables))
  109. $(eval $(call BuildTemplate,dhcpmac,DHCPMAC,xt_DHCPMAC,xt_DHCPMAC,+kmod-ipt-compat-xtables))
  110. $(eval $(call BuildTemplate,dnetmap,DNETMAP,xt_DNETMAP,xt_DNETMAP,+kmod-ipt-compat-xtables +kmod-ipt-nat))
  111. $(eval $(call BuildTemplate,fuzzy,fuzzy,xt_fuzzy,xt_fuzzy,))
  112. $(eval $(call BuildTemplate,geoip,geoip,xt_geoip,xt_geoip,))
  113. $(eval $(call BuildTemplate,iface,iface,xt_iface,xt_iface,))
  114. $(eval $(call BuildTemplate,ipmark,IPMARK,xt_IPMARK,xt_IPMARK,+kmod-ipt-compat-xtables))
  115. $(eval $(call BuildTemplate,ipp2p,IPP2P,xt_ipp2p,xt_ipp2p,+kmod-ipt-compat-xtables))
  116. $(eval $(call BuildTemplate,ipv4options,ipv4options,xt_ipv4options,xt_ipv4options,))
  117. $(eval $(call BuildTemplate,length2,length2,xt_length2,xt_length2,+kmod-ipt-compat-xtables))
  118. $(eval $(call BuildTemplate,logmark,LOGMARK,xt_LOGMARK,xt_LOGMARK,+kmod-ipt-compat-xtables))
  119. $(eval $(call BuildTemplate,lscan,lscan,xt_lscan,xt_lscan,))
  120. $(eval $(call BuildTemplate,lua,Lua PacketScript,xt_LUA,LUA/xt_LUA,+kmod-ipt-conntrack-extra))
  121. $(eval $(call BuildTemplate,psd,psd,xt_psd,xt_psd,))
  122. $(eval $(call BuildTemplate,quota2,quota2,xt_quota2,xt_quota2,))
  123. $(eval $(call BuildTemplate,sysrq,SYSRQ,xt_SYSRQ,xt_SYSRQ,+kmod-ipt-compat-xtables +kmod-crypto-hash))
  124. $(eval $(call BuildTemplate,tarpit,TARPIT,xt_TARPIT,xt_TARPIT,+kmod-ipt-compat-xtables))
  125. $(eval $(call BuildPackage,iptaccount))