You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

159 lines
5.2 KiB

  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.14
  11. PKG_RELEASE:=7
  12. PKG_HASH:=d215a9a8b8e66aae04b982fa2e1228e8a71e7dfe42320df99e34e5000cbdf152
  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. MAKE_FLAGS += \
  35. DEPMOD="/bin/true"
  36. MAKE_INSTALL_FLAGS += \
  37. DEPMOD="/bin/true"
  38. # 1: extension/module suffix used in package name
  39. # 2: extension/module display name used in package title/description
  40. # 3: list of extensions to package
  41. # 4: list of modules to package
  42. # 5: module load priority
  43. # 6: module depends
  44. define BuildTemplate
  45. ifneq ($(3),)
  46. define Package/iptables-mod-$(1)
  47. $$(call Package/xtables-addons)
  48. CATEGORY:=Network
  49. TITLE:=$(2) iptables extension
  50. DEPENDS:=iptables $(if $(4),+kmod-ipt-$(1))
  51. endef
  52. define Package/iptables-mod-$(1)/install
  53. $(INSTALL_DIR) $$(1)/usr/lib/iptables
  54. for m in $(3); do \
  55. $(CP) \
  56. $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$$$$$${m}.so \
  57. $$(1)/usr/lib/iptables/ ; \
  58. done
  59. endef
  60. $$(eval $$(call BuildPackage,iptables-mod-$(1)))
  61. endif
  62. ifneq ($(4),)
  63. define KernelPackage/ipt-$(1)
  64. SUBMENU:=Netfilter Extensions
  65. TITLE:=$(2) netfilter module
  66. DEPENDS:=+kmod-ipt-core $(5)
  67. FILES:=$(foreach mod,$(4),$(PKG_BUILD_DIR)/extensions/$(mod).$(LINUX_KMOD_SUFFIX))
  68. AUTOLOAD:=$(call AutoProbe,$(notdir $(4)))
  69. endef
  70. $$(eval $$(call KernelPackage,ipt-$(1)))
  71. endif
  72. endef
  73. define Package/iptaccount
  74. $(call Package/xtables-addons)
  75. CATEGORY:=Network
  76. TITLE:=iptables-mod-account control utility
  77. DEPENDS:=iptables +iptables-mod-account
  78. endef
  79. define Package/iptaccount/install
  80. $(INSTALL_DIR) $(1)/usr/lib
  81. $(INSTALL_DIR) $(1)/usr/sbin
  82. $(CP) \
  83. $(PKG_INSTALL_DIR)/usr/lib/libxt_ACCOUNT_cl.so* \
  84. $(1)/usr/lib/
  85. $(CP) \
  86. $(PKG_INSTALL_DIR)/usr/sbin/iptaccount \
  87. $(1)/usr/sbin/
  88. endef
  89. define Package/iptgeoip
  90. $(call Package/xtables-addons)
  91. CATEGORY:=Network
  92. TITLE:=iptables-mod-geoip support scripts for MaxMind GeoIP databases
  93. # we could also use wget-nossl but that's more complicated than our
  94. # syntax of dependencies permits...
  95. DEPENDS:=iptables +iptables-mod-geoip \
  96. +perl +perlbase-getopt +perlbase-io +perl-text-csv_xs \
  97. +!BUSYBOX_CONFIG_WGET:wget +!BUSYBOX_CONFIG_GZIP:gzip +!BUSYBOX_CONFIG_UNZIP:unzip
  98. endef
  99. define Package/iptgeoip/install
  100. $(INSTALL_DIR) $(1)/usr/lib/xtables-addons
  101. $(CP) \
  102. $(PKG_INSTALL_DIR)/usr/lib/xtables-addons/xt_geoip_{build,dl} \
  103. $(1)/usr/lib/xtables-addons/
  104. $(INSTALL_DIR) $(1)/usr/share/xt_geoip
  105. endef
  106. #$(eval $(call BuildTemplate,SUFFIX,DESCRIPTION,EXTENSION,MODULE,PRIORITY,DEPENDS))
  107. $(eval $(call BuildTemplate,compat-xtables,API compatibilty layer,,compat_xtables,+IPV6:kmod-ip6tables))
  108. $(eval $(call BuildTemplate,nathelper-rtsp,RTSP Conntrack and NAT,,rtsp/nf_conntrack_rtsp rtsp/nf_nat_rtsp,+kmod-ipt-conntrack-extra +kmod-ipt-nat))
  109. $(eval $(call BuildTemplate,account,ACCOUNT,xt_ACCOUNT,ACCOUNT/xt_ACCOUNT,+kmod-ipt-compat-xtables))
  110. $(eval $(call BuildTemplate,chaos,CHAOS,xt_CHAOS,xt_CHAOS,+kmod-ipt-compat-xtables +kmod-ipt-delude +kmod-ipt-tarpit))
  111. $(eval $(call BuildTemplate,condition,Condition,xt_condition,xt_condition,))
  112. $(eval $(call BuildTemplate,delude,DELUDE,xt_DELUDE,xt_DELUDE,+kmod-ipt-compat-xtables))
  113. $(eval $(call BuildTemplate,dhcpmac,DHCPMAC,xt_DHCPMAC,xt_DHCPMAC,+kmod-ipt-compat-xtables))
  114. $(eval $(call BuildTemplate,dnetmap,DNETMAP,xt_DNETMAP,xt_DNETMAP,+kmod-ipt-compat-xtables +kmod-ipt-nat))
  115. $(eval $(call BuildTemplate,fuzzy,fuzzy,xt_fuzzy,xt_fuzzy,))
  116. $(eval $(call BuildTemplate,geoip,geoip,xt_geoip,xt_geoip,))
  117. $(eval $(call BuildTemplate,iface,iface,xt_iface,xt_iface,))
  118. $(eval $(call BuildTemplate,ipmark,IPMARK,xt_IPMARK,xt_IPMARK,+kmod-ipt-compat-xtables))
  119. $(eval $(call BuildTemplate,ipp2p,IPP2P,xt_ipp2p,xt_ipp2p,+kmod-ipt-compat-xtables))
  120. $(eval $(call BuildTemplate,ipv4options,ipv4options,xt_ipv4options,xt_ipv4options,))
  121. $(eval $(call BuildTemplate,length2,length2,xt_length2,xt_length2,+kmod-ipt-compat-xtables))
  122. $(eval $(call BuildTemplate,logmark,LOGMARK,xt_LOGMARK,xt_LOGMARK,+kmod-ipt-compat-xtables))
  123. $(eval $(call BuildTemplate,lscan,lscan,xt_lscan,xt_lscan,))
  124. $(eval $(call BuildTemplate,lua,Lua PacketScript,xt_LUA,LUA/xt_LUA,+kmod-ipt-conntrack-extra))
  125. $(eval $(call BuildTemplate,psd,psd,xt_psd,xt_psd,))
  126. $(eval $(call BuildTemplate,quota2,quota2,xt_quota2,xt_quota2,))
  127. $(eval $(call BuildTemplate,sysrq,SYSRQ,xt_SYSRQ,xt_SYSRQ,+kmod-ipt-compat-xtables +kmod-crypto-hash))
  128. $(eval $(call BuildTemplate,tarpit,TARPIT,xt_TARPIT,xt_TARPIT,+kmod-ipt-compat-xtables))
  129. $(eval $(call BuildPackage,iptaccount))
  130. $(eval $(call BuildPackage,iptgeoip))