Advertisement
Guest User

iptables_kn

a guest
Jul 18th, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.95 KB | None | 0 0
  1. ➜ cat ../feeds/keendev/iptables_kn/Makefile
  2. #
  3. # Copyright (C) 2006-2016 OpenWrt.org
  4. #
  5. # This is free software, licensed under the GNU General Public License v2.
  6. # See /LICENSE for more information.
  7. #
  8. # Entware specific: keep 1.4.21 version
  9. # Do not split extensions into separate packages, do not install dev headers
  10.  
  11. include $(TOPDIR)/rules.mk
  12. include $(INCLUDE_DIR)/kernel.mk
  13.  
  14. PKG_NAME:=iptables
  15. PKG_VERSION:=1.4.21
  16. PKG_RELEASE:=2a
  17.  
  18. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  19. PKG_SOURCE_URL:=http://www.netfilter.org/projects/iptables/files \
  20. ftp://ftp.be.netfilter.org/pub/netfilter/iptables/ \
  21. ftp://ftp.de.netfilter.org/pub/netfilter/iptables/ \
  22. ftp://ftp.no.netfilter.org/pub/netfilter/iptables/
  23. PKG_HASH:=52004c68021da9a599feed27f65defcfb22128f7da2c0531c0f75de0f479d3e0
  24. PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/iptables_kn-$(PKG_VERSION)
  25.  
  26. PKG_FIXUP:=autoreconf
  27.  
  28. PKG_INSTALL:=1
  29. PKG_BUILD_PARALLEL:=1
  30. PKG_LICENSE:=GPL-2.0
  31. PKG_CPE_ID:=cpe:/a:netfilter_core_team:iptables
  32.  
  33. include $(INCLUDE_DIR)/package.mk
  34.  
  35. PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xjf $(DL_DIR)/$(PKG_SOURCE)
  36.  
  37. define Package/iptables_kn
  38. TITLE:=IP firewall administration tool (Keenetic version)
  39. SECTION:=net
  40. CATEGORY:=Network
  41. SUBMENU:=Firewall
  42. URL:=http://netfilter.org/
  43. PROVIDES:=iptables
  44. endef
  45.  
  46. define Package/iptables_kn/description
  47. IP firewall administration tool.
  48.  
  49. Matches:
  50. - icmp
  51. - tcp
  52. - udp
  53. - comment
  54. - conntrack
  55. - limit
  56. - mac
  57. - mark
  58. - multiport
  59. - set
  60. - state
  61. - time
  62.  
  63. Targets:
  64. - ACCEPT
  65. - CT
  66. - DNAT
  67. - DROP
  68. - REJECT
  69. - LOG
  70. - MARK
  71. - MASQUERADE
  72. - REDIRECT
  73. - SET
  74. - SNAT
  75. - TCPMSS
  76.  
  77. Tables:
  78. - filter
  79. - mangle
  80. - nat
  81. - raw
  82.  
  83. endef
  84.  
  85. TARGET_CPPFLAGS := \
  86. -I$(PKG_BUILD_DIR)/include \
  87. -I$(LINUX_DIR)/user_headers/include \
  88. $(TARGET_CPPFLAGS)
  89.  
  90. TARGET_CFLAGS += \
  91. -I$(PKG_BUILD_DIR)/include \
  92. -I$(LINUX_DIR)/user_headers/include \
  93. -ffunction-sections -fdata-sections \
  94. -DNO_LEGACY
  95.  
  96. TARGET_LDFLAGS += \
  97. -lm -Wl,--gc-sections
  98.  
  99. CONFIGURE_ARGS += \
  100. --enable-shared \
  101. --enable-devel \
  102. --with-kernel="$(LINUX_DIR)/user_headers" \
  103. --with-xtlibdir=/opt/lib/iptables \
  104. --enable-static \
  105. $(if $(CONFIG_IPV6),,--disable-ipv6)
  106.  
  107. MAKE_FLAGS := \
  108. $(TARGET_CONFIGURE_OPTS) \
  109. COPT_FLAGS="$(TARGET_CFLAGS)" \
  110. KERNEL_DIR="$(LINUX_DIR)/user_headers/" PREFIX=/opt \
  111. KBUILD_OUTPUT="$(LINUX_DIR)"
  112.  
  113. #define Build/InstallDev
  114. # $(INSTALL_DIR) $(1)/opt/include
  115. # $(INSTALL_DIR) $(1)/opt/include/iptables
  116. # $(INSTALL_DIR) $(1)/opt/include/net/netfilter
  117.  
  118. # # XXX: iptables header fixup, some headers are not installed by iptables anymore
  119. # $(CP) $(PKG_BUILD_DIR)/include/iptables/*.h $(1)/opt/include/iptables/
  120. # $(CP) $(PKG_BUILD_DIR)/include/iptables.h $(1)/opt/include/
  121. # $(CP) $(PKG_BUILD_DIR)/include/ip6tables.h $(1)/opt/include/
  122. # $(CP) $(PKG_BUILD_DIR)/include/libipulog $(1)/opt/include/
  123. # $(CP) $(PKG_BUILD_DIR)/include/libiptc $(1)/opt/include/
  124.  
  125. # $(CP) $(PKG_INSTALL_DIR)/opt/include/* $(1)/opt/include/
  126. # $(INSTALL_DIR) $(1)/opt/lib
  127. # $(CP) $(PKG_INSTALL_DIR)/opt/lib/libxtables.so* $(1)/opt/lib/
  128. # $(CP) $(PKG_INSTALL_DIR)/opt/lib/libip*tc.so* $(1)/opt/lib/
  129. # $(INSTALL_DIR) $(1)/opt/lib/pkgconfig
  130. # $(CP) $(PKG_INSTALL_DIR)/opt/lib/pkgconfig/xtables.pc $(1)/opt/lib/pkgconfig/
  131. # $(CP) $(PKG_INSTALL_DIR)/opt/lib/pkgconfig/libip*tc.pc $(1)/opt/lib/pkgconfig/
  132.  
  133. # # XXX: needed by firewall3
  134. # $(CP) $(PKG_BUILD_DIR)/extensions/libiptext*.so $(1)/opt/lib/
  135. #endef
  136.  
  137. define Package/iptables_kn/install
  138. $(INSTALL_DIR) $(1)/opt/bin
  139. $(CP) $(PKG_INSTALL_DIR)/opt/bin/iptables-xml $(1)/opt/bin/
  140. $(INSTALL_DIR) $(1)/opt/sbin
  141. $(CP) $(PKG_INSTALL_DIR)/opt/sbin/* $(1)/opt/sbin/
  142. $(INSTALL_DIR) $(1)/opt/lib/iptables
  143. $(CP) $(PKG_INSTALL_DIR)/opt/lib/*.so* $(1)/opt/lib/
  144. $(CP) $(PKG_BUILD_DIR)/extensions/*.so $(1)/opt/lib/
  145. $(CP) $(PKG_INSTALL_DIR)/opt/lib/iptables/*.so* $(1)/opt/lib/iptables/
  146. endef
  147.  
  148. $(eval $(call BuildPackage,iptables_kn))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement