OSDN Git Service

v2ray-geodata: update to latest version
[immortalwrt/packages.git] / net / v2ray-geodata / Makefile
1 # SPDX-License-Identifier: GPL-3.0-only
2 #
3 # Copyright (C) 2021 ImmortalWrt.org
4
5 include $(TOPDIR)/rules.mk
6
7 PKG_NAME:=v2ray-geodata
8 PKG_RELEASE:=$(AUTORELEASE)
9
10 PKG_LICENSE_FILES:=LICENSE
11 PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
12
13 include $(INCLUDE_DIR)/package.mk
14
15 GEOIP_VER:=202204210050
16 GEOIP_FILE:=geoip.dat.$(GEOIP_VER)
17 define Download/geoip
18   URL:=https://github.com/v2fly/geoip/releases/download/$(GEOIP_VER)/
19   URL_FILE:=geoip.dat
20   FILE:=$(GEOIP_FILE)
21   HASH:=9414426b105894bbacd6e913d180e4d86c32bd08d468f08b8ea8d4f9ecd6674c
22 endef
23
24 GEOSITE_VER:=20220425025949
25 GEOSITE_FILE:=dlc.dat.$(GEOSITE_VER)
26 define Download/geosite
27   URL:=https://github.com/v2fly/domain-list-community/releases/download/$(GEOSITE_VER)/
28   URL_FILE:=dlc.dat
29   FILE:=$(GEOSITE_FILE)
30   HASH:=9065ea5d6fa20acf3e1a687b1c33f8669c48bf61b4979768ce2f50fe507053ee
31 endef
32
33 define Package/v2ray-geodata/template
34   SECTION:=net
35   CATEGORY:=Network
36   SUBMENU:=IP Addresses and Names
37   URL:=https://www.v2fly.org
38   PKGARCH:=all
39 endef
40
41 define Package/v2ray-geoip
42   $(call Package/v2ray-geodata/template)
43   TITLE:=GeoIP List for V2Ray
44   VERSION:=$(GEOIP_VER)-$(PKG_RELEASE)
45   LICENSE:=CC-BY-SA-4.0
46 endef
47
48 define Package/v2ray-geosite
49   $(call Package/v2ray-geodata/template)
50   TITLE:=Geosite List for V2Ray
51   VERSION:=$(GEOSITE_VER)-$(PKG_RELEASE)
52   LICENSE:=MIT
53 endef
54
55 define Build/Prepare
56         $(call Build/Prepare/Default)
57 ifneq ($(CONFIG_PACKAGE_v2ray-geoip),)
58         $(call Download,geoip)
59 endif
60 ifneq ($(CONFIG_PACKAGE_v2ray-geosite),)
61         $(call Download,geosite)
62 endif
63 endef
64
65 define Build/Compile
66 endef
67
68 define Package/v2ray-geoip/install
69         $(INSTALL_DIR) $(1)/usr/share/v2ray
70         $(INSTALL_DATA) $(DL_DIR)/$(GEOIP_FILE) $(1)/usr/share/v2ray/geoip.dat
71 endef
72
73 define Package/v2ray-geosite/install
74         $(INSTALL_DIR) $(1)/usr/share/v2ray
75         $(INSTALL_DATA) $(DL_DIR)/$(GEOSITE_FILE) $(1)/usr/share/v2ray/geosite.dat
76 endef
77
78 $(eval $(call BuildPackage,v2ray-geoip))
79 $(eval $(call BuildPackage,v2ray-geosite))