-
Notifications
You must be signed in to change notification settings - Fork 3.5k
/
Makefile
110 lines (93 loc) · 3.05 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# SPDX-License-Identifier: GPL-3.0-only
#
# Copyright (C) 2021-2022 ImmortalWrt.org
include $(TOPDIR)/rules.mk
PKG_NAME:=v2ray-geodata
PKG_RELEASE:=1
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
include $(INCLUDE_DIR)/package.mk
GEOIP_VER:=202410310053
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)
HASH:=2762fa0a7d1728089b7723b7796cb5ca955330a3fa2e4407fa40e480fbf9cea7
endef
GEOSITE_VER:=20241013063848
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)
HASH:=f820556ed3aa02eb7eadba7a3743d7e6df8e9234785d0d82d2d1edce20fe4b3c
endef
GEOSITE_IRAN_VER:=202410280036
GEOSITE_IRAN_FILE:=iran.dat.$(GEOSITE_IRAN_VER)
define Download/geosite-ir
URL:=https://github.com/bootmortis/iran-hosted-domains/releases/download/$(GEOSITE_IRAN_VER)/
URL_FILE:=iran.dat
FILE:=$(GEOSITE_IRAN_FILE)
HASH:=5059e9d5ffcc80a8e2d7824dde704e8f086e41ccfc90ae36c355b49564a7ce68
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
PROVIDES:=v2ray-geodata xray-geodata xray-geoip
VERSION:=$(GEOIP_VER)-r$(PKG_RELEASE)
LICENSE:=CC-BY-SA-4.0
endef
define Package/v2ray-geosite
$(call Package/v2ray-geodata/template)
TITLE:=Geosite List for V2Ray
PROVIDES:=v2ray-geodata xray-geodata xray-geosite
VERSION:=$(GEOSITE_VER)-r$(PKG_RELEASE)
LICENSE:=MIT
endef
define Package/v2ray-geosite-ir
$(call Package/v2ray-geodata/template)
TITLE:=Iran Geosite List for V2Ray
PROVIDES:=xray-geosite-ir
VERSION:=$(GEOSITE_IRAN_VER)-r$(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
ifneq ($(CONFIG_PACKAGE_v2ray-geosite-ir),)
$(call Download,geosite-ir)
endif
endef
define Build/Compile
endef
define Package/v2ray-geoip/install
$(INSTALL_DIR) $(1)/usr/share/v2ray $(1)/usr/share/xray
$(INSTALL_DATA) $(DL_DIR)/$(GEOIP_FILE) $(1)/usr/share/v2ray/geoip.dat
$(LN) ../v2ray/geoip.dat $(1)/usr/share/xray/geoip.dat
endef
define Package/v2ray-geosite/install
$(INSTALL_DIR) $(1)/usr/share/v2ray $(1)/usr/share/xray
$(INSTALL_DATA) $(DL_DIR)/$(GEOSITE_FILE) $(1)/usr/share/v2ray/geosite.dat
$(LN) ../v2ray/geosite.dat $(1)/usr/share/xray/geosite.dat
endef
define Package/v2ray-geosite-ir/install
$(INSTALL_DIR) $(1)/usr/share/v2ray $(1)/usr/share/xray
$(INSTALL_DATA) $(DL_DIR)/$(GEOSITE_IRAN_FILE) $(1)/usr/share/v2ray/iran.dat
$(LN) ../v2ray/iran.dat $(1)/usr/share/xray/iran.dat
endef
$(eval $(call BuildPackage,v2ray-geoip))
$(eval $(call BuildPackage,v2ray-geosite))
$(eval $(call BuildPackage,v2ray-geosite-ir))