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.

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