xtables-addons: add packaging for xt_asn, et al
authorPhilip Prindeville <philipp@redfish-solutions.com>
Mon, 10 Jul 2023 03:21:58 +0000 (21:21 -0600)
committerRosen Penev <rosenp@gmail.com>
Tue, 8 Aug 2023 22:23:46 +0000 (15:23 -0700)
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
net/xtables-addons/Makefile

index f96c12da818c2ddd621769b1516e04b94e758b98..272e95917c96578090232d7422295214c9881c86 100644 (file)
@@ -129,6 +129,42 @@ define Package/iptaccount/install
 endef
 
 
+define Package/iptasn
+  $(call Package/xtables-addons)
+  CATEGORY:=Network
+  TITLE:=iptables-mod-asn support scripts for MaxMind ASN databases
+  DEPENDS:=iptables +iptables-mod-asn \
+               +perl +perlbase-getopt +perlbase-io +perl-text-csv_xs \
+               +perl-net-cidr-lite \
+               +wget-ssl +!BUSYBOX_CONFIG_ZCAT:gzip
+endef
+
+define Package/iptasn/config
+       menu "Select iptasn options"
+               config IPTASN_PRESERVE
+                       bool "Preserve across sysupgrades"
+                       default n
+                       help
+                         Backup and restore during sysupgrade (requires >7MB)
+       endmenu
+endef
+
+ifeq ($(CONFIG_IPTASN_PRESERVE),y)
+define Package/iptasn/conffiles
+/usr/share/xt_asn/
+endef
+endif
+
+define Package/iptasn/install
+       $(INSTALL_DIR) $(1)/usr/lib/xtables-addons
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/xtables-addons/xt_asn_{build,dl} \
+               $(1)/usr/lib/xtables-addons/
+       $(INSTALL_DIR) $(1)/usr/share/xt_asn
+       touch $(1)/usr/share/xt_asn/.keep
+endef
+
+
 define Package/iptgeoip
   $(call Package/xtables-addons)
   CATEGORY:=Network
@@ -175,6 +211,7 @@ $(eval $(call BuildTemplate,compat-xtables,API compatibilty layer,,compat_xtable
 $(eval $(call BuildTemplate,nathelper-rtsp,RTSP Conntrack and NAT,,rtsp/nf_conntrack_rtsp rtsp/nf_nat_rtsp,+kmod-ipt-conntrack-extra +kmod-ipt-nat))
 
 $(eval $(call BuildTemplate,account,ACCOUNT,xt_ACCOUNT,ACCOUNT/xt_ACCOUNT,+kmod-ipt-compat-xtables))
+$(eval $(call BuildTemplate,asn,asn,xt_asn,xt_asn,))
 $(eval $(call BuildTemplate,chaos,CHAOS,xt_CHAOS,xt_CHAOS,+kmod-ipt-compat-xtables +kmod-ipt-delude +kmod-ipt-tarpit))
 $(eval $(call BuildTemplate,condition,Condition,xt_condition,xt_condition,))
 $(eval $(call BuildTemplate,delude,DELUDE,xt_DELUDE,xt_DELUDE,+kmod-ipt-compat-xtables))
@@ -197,4 +234,5 @@ $(eval $(call BuildTemplate,sysrq,SYSRQ,xt_SYSRQ,xt_SYSRQ,+kmod-ipt-compat-xtabl
 $(eval $(call BuildTemplate,tarpit,TARPIT,xt_TARPIT,xt_TARPIT,+kmod-ipt-compat-xtables))
 
 $(eval $(call BuildPackage,iptaccount))
+$(eval $(call BuildPackage,iptasn))
 $(eval $(call BuildPackage,iptgeoip))