v2ray-core: Update to 5.15.1
[feed/packages.git] / net / v2ray-core / Makefile
1 # SPDX-License-Identifier: GPL-3.0-only
2 #
3 # Copyright (C) 2021-2022 ImmortalWrt.org
4
5 include $(TOPDIR)/rules.mk
6
7 PKG_NAME:=v2ray-core
8 PKG_VERSION:=5.15.1
9 PKG_RELEASE:=1
10
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
12 PKG_SOURCE_URL:=https://codeload.github.com/v2fly/v2ray-core/tar.gz/v$(PKG_VERSION)?
13 PKG_HASH:=461a65a1675f17ad95a2a5ddf0b016247a34aa376ed1738c143e7c6603ab4abd
14
15 PKG_LICENSE:=MIT
16 PKG_LICENSE_FILES:=LICENSE
17 PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
18
19 PKG_BUILD_DEPENDS:=golang/host
20 PKG_BUILD_PARALLEL:=1
21 PKG_BUILD_FLAGS:=no-mips16
22
23 GO_PKG:=github.com/v2fly/v2ray-core/v5
24 GO_PKG_BUILD_PKG:=$(GO_PKG)/main
25 GO_PKG_LDFLAGS_X:= \
26 $(GO_PKG).build=OpenWrt \
27 $(GO_PKG).version=$(PKG_VERSION)
28
29 include $(INCLUDE_DIR)/package.mk
30 include ../../lang/golang/golang-package.mk
31
32 define Package/v2ray/template
33 TITLE:=A platform for building proxies to bypass network restrictions
34 SECTION:=net
35 CATEGORY:=Network
36 URL:=https://www.v2fly.org
37 endef
38
39 define Package/v2ray-core
40 $(call Package/v2ray/template)
41 DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
42 endef
43
44 define Package/v2ray-example
45 $(call Package/v2ray/template)
46 TITLE+= (example configs)
47 DEPENDS:=v2ray-core
48 PKGARCH:=all
49 endef
50
51 define Package/v2ray-extra
52 $(call Package/v2ray/template)
53 TITLE+= (extra resources)
54 DEPENDS:=v2ray-core
55 PKGARCH:=all
56 endef
57
58 define Package/v2ray/description
59 Project V is a set of network tools that help you to build your own computer network.
60 It secures your network connections and thus protects your privacy.
61 endef
62
63 define Package/v2ray-core/description
64 $(call Package/v2ray/description)
65 endef
66
67 define Package/v2ray-example/description
68 $(call Package/v2ray/description)
69
70 This includes example configuration files for v2ray-core.
71 endef
72
73 define Package/v2ray-extra/description
74 $(call Package/v2ray/description)
75
76 This includes extra resources for v2ray-core.
77 endef
78
79 define Package/v2ray-core/conffiles
80 /etc/config/v2ray
81 /etc/v2ray/
82 endef
83
84 define Package/v2ray-core/install
85 $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
86 $(INSTALL_DIR) $(1)/usr/bin/
87 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/main $(1)/usr/bin/v2ray
88
89 $(INSTALL_DIR) $(1)/etc/v2ray/
90 $(INSTALL_DATA) $(PKG_BUILD_DIR)/release/config/config.json $(1)/etc/v2ray/
91
92 $(INSTALL_DIR) $(1)/etc/config/
93 $(INSTALL_CONF) $(CURDIR)/files/v2ray.conf $(1)/etc/config/v2ray
94 $(INSTALL_DIR) $(1)/etc/init.d/
95 $(INSTALL_BIN) $(CURDIR)/files/v2ray.init $(1)/etc/init.d/v2ray
96 endef
97
98 define Package/v2ray-example/install
99 $(INSTALL_DIR) $(1)/etc/v2ray/
100 $(INSTALL_DATA) $(PKG_BUILD_DIR)/release/config/vpoint_socks_vmess.json $(1)/etc/v2ray/
101 $(INSTALL_DATA) $(PKG_BUILD_DIR)/release/config/vpoint_vmess_freedom.json $(1)/etc/v2ray/
102 endef
103
104 define Package/v2ray-extra/install
105 $(INSTALL_DIR) $(1)/usr/share/v2ray/
106 $(CP) $(PKG_BUILD_DIR)/release/extra/* $(1)/usr/share/v2ray/
107 endef
108
109 $(eval $(call BuildPackage,v2ray-core))
110 $(eval $(call BuildPackage,v2ray-example))
111 $(eval $(call BuildPackage,v2ray-extra))