1 # SPDX-License-Identifier: GPL-3.0-only
3 # Copyright (C) 2021-2022 ImmortalWrt.org
5 include $(TOPDIR
)/rules.mk
7 PKG_NAME
:=v2ray-geodata
10 PKG_LICENSE_FILES
:=LICENSE
11 PKG_MAINTAINER
:=Tianling Shen
<cnsztl@immortalwrt.org
>
13 include $(INCLUDE_DIR
)/package.mk
15 GEOIP_VER
:=202310120354
16 GEOIP_FILE
:=geoip.dat.
$(GEOIP_VER
)
18 URL
:=https
://github.com
/v2fly
/geoip
/releases
/download
/$(GEOIP_VER
)/
21 HASH
:=7107cfe4e211d4df5234d0d2b1c47bdcd19f6602c2b7969f3a5e12f7cf48692e
24 GEOSITE_VER
:=20231015073627
25 GEOSITE_FILE
:=dlc.dat.
$(GEOSITE_VER
)
26 define Download
/geosite
27 URL
:=https
://github.com
/v2fly
/domain-list-community
/releases
/download
/$(GEOSITE_VER
)/
30 HASH
:=2042c47d520634236fbf238a4168196bea64a2d61ca5e6cbab9fd0ac37c7e659
33 GEOSITE_IRAN_VER
:=202310160024
34 GEOSITE_IRAN_FILE
:=iran.dat.
$(GEOSITE_IRAN_VER
)
35 define Download
/geosite-ir
36 URL
:=https
://github.com
/bootmortis
/iran-hosted-domains
/releases
/download
/$(GEOSITE_IRAN_VER
)/
38 FILE
:=$(GEOSITE_IRAN_FILE
)
39 HASH
:=70db057c5c1d07de251c4543e6c20ff0a352c95977e120d1522a7f826ff08cf2
42 define Package
/v2ray-geodata
/template
45 SUBMENU
:=IP Addresses and Names
46 URL
:=https
://www.v2fly.org
50 define Package
/v2ray-geoip
51 $(call Package
/v2ray-geodata
/template
)
52 TITLE
:=GeoIP List for V2Ray
53 PROVIDES
:=v2ray-geodata xray-geodata xray-geoip
54 VERSION
:=$(GEOIP_VER
)-$(PKG_RELEASE
)
58 define Package
/v2ray-geosite
59 $(call Package
/v2ray-geodata
/template
)
60 TITLE
:=Geosite List for V2Ray
61 PROVIDES
:=v2ray-geodata xray-geodata xray-geosite
62 VERSION
:=$(GEOSITE_VER
)-$(PKG_RELEASE
)
66 define Package
/v2ray-geosite-ir
67 $(call Package
/v2ray-geodata
/template
)
68 TITLE
:=Iran Geosite List for V2Ray
69 PROVIDES
:=xray-geosite-ir
70 VERSION
:=$(GEOSITE_IRAN_VER
)-$(PKG_RELEASE
)
75 $(call Build
/Prepare
/Default
)
76 ifneq ($(CONFIG_PACKAGE_v2ray-geoip
),)
77 $(call Download
,geoip
)
79 ifneq ($(CONFIG_PACKAGE_v2ray-geosite
),)
80 $(call Download
,geosite
)
82 ifneq ($(CONFIG_PACKAGE_v2ray-geosite-ir
),)
83 $(call Download
,geosite-ir
)
90 define Package
/v2ray-geoip
/install
91 $(INSTALL_DIR
) $(1)/usr
/share
/v2ray
$(1)/usr
/share
/xray
92 $(INSTALL_DATA
) $(DL_DIR
)/$(GEOIP_FILE
) $(1)/usr
/share
/v2ray
/geoip.dat
93 $(LN
) ..
/v2ray
/geoip.dat
$(1)/usr
/share
/xray
/geoip.dat
96 define Package
/v2ray-geosite
/install
97 $(INSTALL_DIR
) $(1)/usr
/share
/v2ray
$(1)/usr
/share
/xray
98 $(INSTALL_DATA
) $(DL_DIR
)/$(GEOSITE_FILE
) $(1)/usr
/share
/v2ray
/geosite.dat
99 $(LN
) ..
/v2ray
/geosite.dat
$(1)/usr
/share
/xray
/geosite.dat
102 define Package
/v2ray-geosite-ir
/install
103 $(INSTALL_DIR
) $(1)/usr
/share
/v2ray
$(1)/usr
/share
/xray
104 $(INSTALL_DATA
) $(DL_DIR
)/$(GEOSITE_IRAN_FILE
) $(1)/usr
/share
/v2ray
/iran.dat
105 $(LN
) ..
/v2ray
/iran.dat
$(1)/usr
/share
/xray
/iran.dat
108 $(eval
$(call BuildPackage
,v2ray-geoip
))
109 $(eval
$(call BuildPackage
,v2ray-geosite
))
110 $(eval
$(call BuildPackage
,v2ray-geosite-ir
))