small-package/v2ray-geodata/Makefile

80 lines
2.0 KiB
Makefile
Raw Normal View History

2023-02-01 19:53:32 +08:00
# SPDX-License-Identifier: GPL-3.0-only
#
# Copyright (C) 2021-2022 ImmortalWrt.org
include $(TOPDIR)/rules.mk
PKG_NAME:=v2ray-geodata
PKG_RELEASE:=$(AUTORELEASE)
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
include $(INCLUDE_DIR)/package.mk
2023-07-20 16:21:52 +08:00
GEOIP_VER:=202307200047
2023-02-01 19:53:32 +08:00
GEOIP_FILE:=geoip.dat.$(GEOIP_VER)
define Download/geoip
URL:=https://github.com/v2fly/geoip/releases/download/$(GEOIP_VER)/
URL_FILE:=geoip.dat
FILE:=$(GEOIP_FILE)
2023-07-20 16:21:52 +08:00
HASH:=80aa5f200b91b22a75cb2ca01f8d868d54c74fcc5f8c8802c41d70f050ebb65d
2023-02-01 19:53:32 +08:00
endef
2023-07-26 09:29:29 +08:00
GEOSITE_VER:=20230725085751
2023-02-01 19:53:32 +08:00
GEOSITE_FILE:=dlc.dat.$(GEOSITE_VER)
define Download/geosite
URL:=https://github.com/v2fly/domain-list-community/releases/download/$(GEOSITE_VER)/
URL_FILE:=dlc.dat
FILE:=$(GEOSITE_FILE)
2023-07-26 09:29:29 +08:00
HASH:=862208b4ae425cb8ff6b9c1b3abefbc5a14f531a31aeb15a5a93a035c180be45
2023-02-01 19:53:32 +08:00
endef
define Package/v2ray-geodata/template
SECTION:=net
CATEGORY:=Network
SUBMENU:=IP Addresses and Names
URL:=https://www.v2fly.org
PKGARCH:=all
endef
define Package/v2ray-geoip
$(call Package/v2ray-geodata/template)
TITLE:=GeoIP List for V2Ray
VERSION:=$(GEOIP_VER)-$(PKG_RELEASE)
LICENSE:=CC-BY-SA-4.0
endef
define Package/v2ray-geosite
$(call Package/v2ray-geodata/template)
TITLE:=Geosite List for V2Ray
VERSION:=$(GEOSITE_VER)-$(PKG_RELEASE)
LICENSE:=MIT
endef
define Build/Prepare
$(call Build/Prepare/Default)
ifneq ($(CONFIG_PACKAGE_v2ray-geoip),)
$(call Download,geoip)
endif
ifneq ($(CONFIG_PACKAGE_v2ray-geosite),)
$(call Download,geosite)
endif
endef
define Build/Compile
endef
define Package/v2ray-geoip/install
$(INSTALL_DIR) $(1)/usr/share/v2ray
$(INSTALL_DATA) $(DL_DIR)/$(GEOIP_FILE) $(1)/usr/share/v2ray/geoip.dat
endef
define Package/v2ray-geosite/install
$(INSTALL_DIR) $(1)/usr/share/v2ray
$(INSTALL_DATA) $(DL_DIR)/$(GEOSITE_FILE) $(1)/usr/share/v2ray/geosite.dat
endef
$(eval $(call BuildPackage,v2ray-geoip))
$(eval $(call BuildPackage,v2ray-geosite))